Merge conflict of mlx5 resolved using instructions in merge commit 9566e650bf7fdf58384bb06df634f7531ca3a97e.
Showing the changes to kernel (8 of 549 files). Show all
Unified · Split
| @@ -1,3 +1,4 @@ | ||
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later | |
| 1 | 2 | /* |
| 2 | 3 | * kernel/configs.c |
| 3 | 4 | * Echo the kernel .config file used to build the kernel |
| @@ -6,21 +7,6 @@ · 2 unmodified lines | ||
| 6 | 7 | * Copyright (C) 2002 Randy Dunlap <rdunlap@xenotime.net> |
| 7 | 8 | * Copyright (C) 2002 Al Stone <ahs3@fc.hp.com> |
| 8 | 9 | * Copyright (C) 2002 Hewlett-Packard Company |
| 9 | − * | |
| 10 | − * This program is free software; you can redistribute it and/or modify | |
| 11 | − * it under the terms of the GNU General Public License as published by | |
| 12 | − * the Free Software Foundation; either version 2 of the License, or (at | |
| 13 | − * your option) any later version. | |
| 14 | − * | |
| 15 | − * This program is distributed in the hope that it will be useful, but | |
| 16 | − * WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | − * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | |
| 18 | − * NON INFRINGEMENT. See the GNU General Public License for more | |
| 19 | − * details. | |
| 20 | − * | |
| 21 | − * You should have received a copy of the GNU General Public License | |
| 22 | − * along with this program; if not, write to the Free Software | |
| 23 | − * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 24 | 10 | */ |
| 25 | 11 | |
| 26 | 12 | #include <linux/kernel.h> |
| @@ -47,9 +47,6 @@ u64 dma_direct_get_required_mask(struct device *dev) · 46 unmodified lines | ||
| 47 | 47 | { |
| 48 | 48 | u64 max_dma = phys_to_dma_direct(dev, (max_pfn - 1) << PAGE_SHIFT); |
| 49 | 49 | |
| 50 | − if (dev->bus_dma_mask && dev->bus_dma_mask < max_dma) | |
| 51 | − max_dma = dev->bus_dma_mask; | |
| 52 | − | |
| 53 | 50 | return (1ULL << (fls64(max_dma) - 1)) * 2 - 1; |
| 54 | 51 | } |
| 55 | 52 | |
| @@ -130,10 +127,12 @@ void *dma_direct_alloc_pages(struct device *dev, size_t size, · 74 unmodified lines | ||
| 130 | 127 | if (!page) |
| 131 | 128 | return NULL; |
| 132 | 129 | |
| 133 | − if (attrs & DMA_ATTR_NO_KERNEL_MAPPING) { | |
| 130 | + if ((attrs & DMA_ATTR_NO_KERNEL_MAPPING) && | |
| 131 | + !force_dma_unencrypted(dev)) { | |
| 134 | 132 | /* remove any dirty cache lines on the kernel alias */ |
| 135 | 133 | if (!PageHighMem(page)) |
| 136 | 134 | arch_dma_prep_coherent(page, size); |
| 135 | + *dma_handle = phys_to_dma(dev, page_to_phys(page)); | |
| 137 | 136 | /* return the page pointer as the opaque cookie */ |
| 138 | 137 | return page; |
| 139 | 138 | } |
| @@ -178,7 +177,8 @@ void dma_direct_free_pages(struct device *dev, size_t size, void *cpu_addr, · 38 unmodified lines | ||
| 178 | 177 | { |
| 179 | 178 | unsigned int page_order = get_order(size); |
| 180 | 179 | |
| 181 | − if (attrs & DMA_ATTR_NO_KERNEL_MAPPING) { | |
| 180 | + if ((attrs & DMA_ATTR_NO_KERNEL_MAPPING) && | |
| 181 | + !force_dma_unencrypted(dev)) { | |
| 182 | 182 | /* cpu_addr is a struct page cookie, not a kernel address */ |
| 183 | 183 | __dma_direct_free_pages(dev, size, cpu_addr); |
| 184 | 184 | return; |
| @@ -150,6 +150,23 @@ int dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt, · 149 unmodified lines | ||
| 150 | 150 | } |
| 151 | 151 | EXPORT_SYMBOL(dma_get_sgtable_attrs); |
| 152 | 152 | |
| 153 | +#ifdef CONFIG_MMU | |
| 154 | +/* | |
| 155 | + * Return the page attributes used for mapping dma_alloc_* memory, either in | |
| 156 | + * kernel space if remapping is needed, or to userspace through dma_mmap_*. | |
| 157 | + */ | |
| 158 | +pgprot_t dma_pgprot(struct device *dev, pgprot_t prot, unsigned long attrs) | |
| 159 | +{ | |
| 160 | + if (dev_is_dma_coherent(dev) || | |
| 161 | + (IS_ENABLED(CONFIG_DMA_NONCOHERENT_CACHE_SYNC) && | |
| 162 | + (attrs & DMA_ATTR_NON_CONSISTENT))) | |
| 163 | + return prot; | |
| 164 | + if (IS_ENABLED(CONFIG_ARCH_HAS_DMA_MMAP_PGPROT)) | |
| 165 | + return arch_dma_mmap_pgprot(dev, prot, attrs); | |
| 166 | + return pgprot_noncached(prot); | |
| 167 | +} | |
| 168 | +#endif /* CONFIG_MMU */ | |
| 169 | + | |
| 153 | 170 | /* |
| 154 | 171 | * Create userspace mapping for the DMA-coherent memory. |
| 155 | 172 | */ |
| @@ -164,7 +181,7 @@ int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, · 8 unmodified lines | ||
| 164 | 181 | unsigned long pfn; |
| 165 | 182 | int ret = -ENXIO; |
| 166 | 183 | |
| 167 | − vma->vm_page_prot = arch_dma_mmap_pgprot(dev, vma->vm_page_prot, attrs); | |
| 184 | + vma->vm_page_prot = dma_pgprot(dev, vma->vm_page_prot, attrs); | |
| 168 | 185 | |
| 169 | 186 | if (dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, &ret)) |
| 170 | 187 | return ret; |
| @@ -218,7 +218,7 @@ void *arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle, · 217 unmodified lines | ||
| 218 | 218 | |
| 219 | 219 | /* create a coherent mapping */ |
| 220 | 220 | ret = dma_common_contiguous_remap(page, size, VM_USERMAP, |
| 221 | − arch_dma_mmap_pgprot(dev, PAGE_KERNEL, attrs), | |
| 221 | + dma_pgprot(dev, PAGE_KERNEL, attrs), | |
| 222 | 222 | __builtin_return_address(0)); |
| 223 | 223 | if (!ret) { |
| 224 | 224 | __dma_direct_free_pages(dev, size, page); |
| @@ -251,11 +251,9 @@ irq_create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd) · 250 unmodified lines | ||
| 251 | 251 | * Determine the number of vectors which need interrupt affinities |
| 252 | 252 | * assigned. If the pre/post request exhausts the available vectors |
| 253 | 253 | * then nothing to do here except for invoking the calc_sets() |
| 254 | − * callback so the device driver can adjust to the situation. If there | |
| 255 | − * is only a single vector, then managing the queue is pointless as | |
| 256 | − * well. | |
| 254 | + * callback so the device driver can adjust to the situation. | |
| 257 | 255 | */ |
| 258 | − if (nvecs > 1 && nvecs > affd->pre_vectors + affd->post_vectors) | |
| 256 | + if (nvecs > affd->pre_vectors + affd->post_vectors) | |
| 259 | 257 | affvecs = nvecs - affd->pre_vectors - affd->post_vectors; |
| 260 | 258 | else |
| 261 | 259 | affvecs = 0; |
| @@ -40,6 +40,7 @@ struct sugov_policy { · 39 unmodified lines | ||
| 40 | 40 | struct task_struct *thread; |
| 41 | 41 | bool work_in_progress; |
| 42 | 42 | |
| 43 | + bool limits_changed; | |
| 43 | 44 | bool need_freq_update; |
| 44 | 45 | }; |
| 45 | 46 | |
| @@ -89,8 +90,11 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time) · 43 unmodified lines | ||
| 89 | 90 | !cpufreq_this_cpu_can_update(sg_policy->policy)) |
| 90 | 91 | return false; |
| 91 | 92 | |
| 92 | − if (unlikely(sg_policy->need_freq_update)) | |
| 93 | + if (unlikely(sg_policy->limits_changed)) { | |
| 94 | + sg_policy->limits_changed = false; | |
| 95 | + sg_policy->need_freq_update = true; | |
| 93 | 96 | return true; |
| 97 | + } | |
| 94 | 98 | |
| 95 | 99 | delta_ns = time - sg_policy->last_freq_update_time; |
| 96 | 100 | |
| @@ -437,7 +441,7 @@ static inline bool sugov_cpu_is_busy(struct sugov_cpu *sg_cpu) { return false; } · 340 unmodified lines | ||
| 437 | 441 | static inline void ignore_dl_rate_limit(struct sugov_cpu *sg_cpu, struct sugov_policy *sg_policy) |
| 438 | 442 | { |
| 439 | 443 | if (cpu_bw_dl(cpu_rq(sg_cpu->cpu)) > sg_cpu->bw_dl) |
| 440 | − sg_policy->need_freq_update = true; | |
| 444 | + sg_policy->limits_changed = true; | |
| 441 | 445 | } |
| 442 | 446 | |
| 443 | 447 | static void sugov_update_single(struct update_util_data *hook, u64 time, |
| @@ -457,7 +461,8 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, · 13 unmodified lines | ||
| 457 | 461 | if (!sugov_should_update_freq(sg_policy, time)) |
| 458 | 462 | return; |
| 459 | 463 | |
| 460 | − busy = sugov_cpu_is_busy(sg_cpu); | |
| 464 | + /* Limits may have changed, don't skip frequency update */ | |
| 465 | + busy = !sg_policy->need_freq_update && sugov_cpu_is_busy(sg_cpu); | |
| 461 | 466 | |
| 462 | 467 | util = sugov_get_util(sg_cpu); |
| 463 | 468 | max = sg_cpu->max; |
| @@ -831,6 +836,7 @@ static int sugov_start(struct cpufreq_policy *policy) · 367 unmodified lines | ||
| 831 | 836 | sg_policy->last_freq_update_time = 0; |
| 832 | 837 | sg_policy->next_freq = 0; |
| 833 | 838 | sg_policy->work_in_progress = false; |
| 839 | + sg_policy->limits_changed = false; | |
| 834 | 840 | sg_policy->need_freq_update = false; |
| 835 | 841 | sg_policy->cached_raw_freq = 0; |
| 836 | 842 | |
| @@ -879,7 +885,7 @@ static void sugov_limits(struct cpufreq_policy *policy) · 42 unmodified lines | ||
| 879 | 885 | mutex_unlock(&sg_policy->work_lock); |
| 880 | 886 | } |
| 881 | 887 | |
| 882 | − sg_policy->need_freq_update = true; | |
| 888 | + sg_policy->limits_changed = true; | |
| 883 | 889 | } |
| 884 | 890 | |
| 885 | 891 | struct cpufreq_governor schedutil_gov = { |
| @@ -2088,17 +2088,13 @@ retry: · 2087 unmodified lines | ||
| 2088 | 2088 | } |
| 2089 | 2089 | |
| 2090 | 2090 | deactivate_task(rq, next_task, 0); |
| 2091 | − sub_running_bw(&next_task->dl, &rq->dl); | |
| 2092 | − sub_rq_bw(&next_task->dl, &rq->dl); | |
| 2093 | 2091 | set_task_cpu(next_task, later_rq->cpu); |
| 2094 | − add_rq_bw(&next_task->dl, &later_rq->dl); | |
| 2095 | 2092 | |
| 2096 | 2093 | /* |
| 2097 | 2094 | * Update the later_rq clock here, because the clock is used |
| 2098 | 2095 | * by the cpufreq_update_util() inside __add_running_bw(). |
| 2099 | 2096 | */ |
| 2100 | 2097 | update_rq_clock(later_rq); |
| 2101 | − add_running_bw(&next_task->dl, &later_rq->dl); | |
| 2102 | 2098 | activate_task(later_rq, next_task, ENQUEUE_NOCLOCK); |
| 2103 | 2099 | ret = 1; |
| 2104 | 2100 | |
| @@ -2186,11 +2182,7 @@ static void pull_dl_task(struct rq *this_rq) · 81 unmodified lines | ||
| 2186 | 2182 | resched = true; |
| 2187 | 2183 | |
| 2188 | 2184 | deactivate_task(src_rq, p, 0); |
| 2189 | − sub_running_bw(&p->dl, &src_rq->dl); | |
| 2190 | − sub_rq_bw(&p->dl, &src_rq->dl); | |
| 2191 | 2185 | set_task_cpu(p, this_cpu); |
| 2192 | − add_rq_bw(&p->dl, &this_rq->dl); | |
| 2193 | − add_running_bw(&p->dl, &this_rq->dl); | |
| 2194 | 2186 | activate_task(this_rq, p, 0); |
| 2195 | 2187 | dmin = p->dl.deadline; |
| 2196 | 2188 | |
| @@ -1051,7 +1051,7 @@ struct psi_trigger *psi_trigger_create(struct psi_group *group, · 1050 unmodified lines | ||
| 1051 | 1051 | |
| 1052 | 1052 | if (!rcu_access_pointer(group->poll_kworker)) { |
| 1053 | 1053 | struct sched_param param = { |
| 1054 | − .sched_priority = MAX_RT_PRIO - 1, | |
| 1054 | + .sched_priority = 1, | |
| 1055 | 1055 | }; |
| 1056 | 1056 | struct kthread_worker *kworker; |
| 1057 | 1057 | |
| @@ -1061,7 +1061,7 @@ struct psi_trigger *psi_trigger_create(struct psi_group *group, · 3 unmodified lines | ||
| 1061 | 1061 | mutex_unlock(&group->trigger_lock); |
| 1062 | 1062 | return ERR_CAST(kworker); |
| 1063 | 1063 | } |
| 1064 | − sched_setscheduler(kworker->task, SCHED_FIFO, ¶m); | |
| 1064 | + sched_setscheduler_nocheck(kworker->task, SCHED_FIFO, ¶m); | |
| 1065 | 1065 | kthread_init_delayed_work(&group->poll_work, |
| 1066 | 1066 | psi_poll_work); |
| 1067 | 1067 | rcu_assign_pointer(group->poll_kworker, kworker); |