Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

+1837 -1129
+4
CREDITS
··· 2138 2138 D: Soundblaster driver fixes, ISAPnP quirk 2139 2139 S: California, USA 2140 2140 2141 + N: Jarkko Lavinen 2142 + E: jarkko.lavinen@nokia.com 2143 + D: OMAP MMC support 2144 + 2141 2145 N: Jonathan Layes 2142 2146 D: ARPD support 2143 2147
+1 -1
Documentation/admin-guide/pm/cpufreq.rst
··· 150 150 a governor ``sysfs`` interface to it. Next, the governor is started by 151 151 invoking its ``->start()`` callback. 152 152 153 - That callback it expected to register per-CPU utilization update callbacks for 153 + That callback is expected to register per-CPU utilization update callbacks for 154 154 all of the online CPUs belonging to the given policy with the CPU scheduler. 155 155 The utilization update callbacks will be invoked by the CPU scheduler on 156 156 important events, like task enqueue and dequeue, on every iteration of the
+5 -3
Documentation/cpu-freq/cpufreq-stats.txt
··· 86 86 This will give a fine grained information about all the CPU frequency 87 87 transitions. The cat output here is a two dimensional matrix, where an entry 88 88 <i,j> (row i, column j) represents the count of number of transitions from 89 - Freq_i to Freq_j. Freq_i is in descending order with increasing rows and 90 - Freq_j is in descending order with increasing columns. The output here also 91 - contains the actual freq values for each row and column for better readability. 89 + Freq_i to Freq_j. Freq_i rows and Freq_j columns follow the sorting order in 90 + which the driver has provided the frequency table initially to the cpufreq core 91 + and so can be sorted (ascending or descending) or unsorted. The output here 92 + also contains the actual freq values for each row and column for better 93 + readability. 92 94 93 95 If the transition table is bigger than PAGE_SIZE, reading this will 94 96 return an -EFBIG error.
-65
Documentation/devicetree/bindings/cpufreq/arm_big_little_dt.txt
··· 1 - Generic ARM big LITTLE cpufreq driver's DT glue 2 - ----------------------------------------------- 3 - 4 - This is DT specific glue layer for generic cpufreq driver for big LITTLE 5 - systems. 6 - 7 - Both required and optional properties listed below must be defined 8 - under node /cpus/cpu@x. Where x is the first cpu inside a cluster. 9 - 10 - FIXME: Cpus should boot in the order specified in DT and all cpus for a cluster 11 - must be present contiguously. Generic DT driver will check only node 'x' for 12 - cpu:x. 13 - 14 - Required properties: 15 - - operating-points: Refer to Documentation/devicetree/bindings/opp/opp.txt 16 - for details 17 - 18 - Optional properties: 19 - - clock-latency: Specify the possible maximum transition latency for clock, 20 - in unit of nanoseconds. 21 - 22 - Examples: 23 - 24 - cpus { 25 - #address-cells = <1>; 26 - #size-cells = <0>; 27 - 28 - cpu@0 { 29 - compatible = "arm,cortex-a15"; 30 - reg = <0>; 31 - next-level-cache = <&L2>; 32 - operating-points = < 33 - /* kHz uV */ 34 - 792000 1100000 35 - 396000 950000 36 - 198000 850000 37 - >; 38 - clock-latency = <61036>; /* two CLK32 periods */ 39 - }; 40 - 41 - cpu@1 { 42 - compatible = "arm,cortex-a15"; 43 - reg = <1>; 44 - next-level-cache = <&L2>; 45 - }; 46 - 47 - cpu@100 { 48 - compatible = "arm,cortex-a7"; 49 - reg = <100>; 50 - next-level-cache = <&L2>; 51 - operating-points = < 52 - /* kHz uV */ 53 - 792000 950000 54 - 396000 750000 55 - 198000 450000 56 - >; 57 - clock-latency = <61036>; /* two CLK32 periods */ 58 - }; 59 - 60 - cpu@101 { 61 - compatible = "arm,cortex-a7"; 62 - reg = <101>; 63 - next-level-cache = <&L2>; 64 - }; 65 - };
+1 -1
Documentation/devicetree/bindings/net/can/holt_hi311x.txt
··· 17 17 reg = <1>; 18 18 clocks = <&clk32m>; 19 19 interrupt-parent = <&gpio4>; 20 - interrupts = <13 IRQ_TYPE_EDGE_RISING>; 20 + interrupts = <13 IRQ_TYPE_LEVEL_HIGH>; 21 21 vdd-supply = <&reg5v0>; 22 22 xceiver-supply = <&reg5v0>; 23 23 };
+18 -10
Documentation/devicetree/bindings/net/can/rcar_can.txt
··· 5 5 - compatible: "renesas,can-r8a7743" if CAN controller is a part of R8A7743 SoC. 6 6 "renesas,can-r8a7744" if CAN controller is a part of R8A7744 SoC. 7 7 "renesas,can-r8a7745" if CAN controller is a part of R8A7745 SoC. 8 + "renesas,can-r8a774a1" if CAN controller is a part of R8A774A1 SoC. 8 9 "renesas,can-r8a7778" if CAN controller is a part of R8A7778 SoC. 9 10 "renesas,can-r8a7779" if CAN controller is a part of R8A7779 SoC. 10 11 "renesas,can-r8a7790" if CAN controller is a part of R8A7790 SoC. ··· 15 14 "renesas,can-r8a7794" if CAN controller is a part of R8A7794 SoC. 16 15 "renesas,can-r8a7795" if CAN controller is a part of R8A7795 SoC. 17 16 "renesas,can-r8a7796" if CAN controller is a part of R8A7796 SoC. 17 + "renesas,can-r8a77965" if CAN controller is a part of R8A77965 SoC. 18 18 "renesas,rcar-gen1-can" for a generic R-Car Gen1 compatible device. 19 19 "renesas,rcar-gen2-can" for a generic R-Car Gen2 or RZ/G1 20 20 compatible device. 21 - "renesas,rcar-gen3-can" for a generic R-Car Gen3 compatible device. 21 + "renesas,rcar-gen3-can" for a generic R-Car Gen3 or RZ/G2 22 + compatible device. 22 23 When compatible with the generic version, nodes must list the 23 24 SoC-specific version corresponding to the platform first 24 25 followed by the generic version. 25 26 26 27 - reg: physical base address and size of the R-Car CAN register map. 27 28 - interrupts: interrupt specifier for the sole interrupt. 28 - - clocks: phandles and clock specifiers for 3 CAN clock inputs. 29 - - clock-names: 3 clock input name strings: "clkp1", "clkp2", "can_clk". 29 + - clocks: phandles and clock specifiers for 2 CAN clock inputs for RZ/G2 30 + devices. 31 + phandles and clock specifiers for 3 CAN clock inputs for every other 32 + SoC. 33 + - clock-names: 2 clock input name strings for RZ/G2: "clkp1", "can_clk". 34 + 3 clock input name strings for every other SoC: "clkp1", "clkp2", 35 + "can_clk". 30 36 - pinctrl-0: pin control group to be used for this controller. 31 37 - pinctrl-names: must be "default". 32 38 33 - Required properties for "renesas,can-r8a7795" and "renesas,can-r8a7796" 34 - compatible: 35 - In R8A7795 and R8A7796 SoCs, "clkp2" can be CANFD clock. This is a div6 clock 36 - and can be used by both CAN and CAN FD controller at the same time. It needs to 37 - be scaled to maximum frequency if any of these controllers use it. This is done 39 + Required properties for R8A7795, R8A7796 and R8A77965: 40 + For the denoted SoCs, "clkp2" can be CANFD clock. This is a div6 clock and can 41 + be used by both CAN and CAN FD controller at the same time. It needs to be 42 + scaled to maximum frequency if any of these controllers use it. This is done 38 43 using the below properties: 39 44 40 45 - assigned-clocks: phandle of clkp2(CANFD) clock. ··· 49 42 Optional properties: 50 43 - renesas,can-clock-select: R-Car CAN Clock Source Select. Valid values are: 51 44 <0x0> (default) : Peripheral clock (clkp1) 52 - <0x1> : Peripheral clock (clkp2) 53 - <0x3> : Externally input clock 45 + <0x1> : Peripheral clock (clkp2) (not supported by 46 + RZ/G2 devices) 47 + <0x3> : External input clock 54 48 55 49 Example 56 50 -------
+11 -6
Documentation/networking/rxrpc.txt
··· 1056 1056 1057 1057 u32 rxrpc_kernel_check_life(struct socket *sock, 1058 1058 struct rxrpc_call *call); 1059 + void rxrpc_kernel_probe_life(struct socket *sock, 1060 + struct rxrpc_call *call); 1059 1061 1060 - This returns a number that is updated when ACKs are received from the peer 1061 - (notably including PING RESPONSE ACKs which we can elicit by sending PING 1062 - ACKs to see if the call still exists on the server). The caller should 1063 - compare the numbers of two calls to see if the call is still alive after 1064 - waiting for a suitable interval. 1062 + The first function returns a number that is updated when ACKs are received 1063 + from the peer (notably including PING RESPONSE ACKs which we can elicit by 1064 + sending PING ACKs to see if the call still exists on the server). The 1065 + caller should compare the numbers of two calls to see if the call is still 1066 + alive after waiting for a suitable interval. 1065 1067 1066 1068 This allows the caller to work out if the server is still contactable and 1067 1069 if the call is still alive on the server whilst waiting for the server to 1068 1070 process a client operation. 1069 1071 1070 - This function may transmit a PING ACK. 1072 + The second function causes a ping ACK to be transmitted to try to provoke 1073 + the peer into responding, which would then cause the value returned by the 1074 + first function to change. Note that this must be called in TASK_RUNNING 1075 + state. 1071 1076 1072 1077 (*) Get reply timestamp. 1073 1078
+10 -3
MAINTAINERS
··· 717 717 F: include/dt-bindings/reset/altr,rst-mgr-a10sr.h 718 718 719 719 ALTERA TRIPLE SPEED ETHERNET DRIVER 720 - M: Vince Bridgers <vbridger@opensource.altera.com> 720 + M: Thor Thayer <thor.thayer@linux.intel.com> 721 721 L: netdev@vger.kernel.org 722 722 L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers) 723 723 S: Maintained ··· 3275 3275 F: include/uapi/linux/caif/ 3276 3276 F: include/net/caif/ 3277 3277 F: net/caif/ 3278 + 3279 + CAKE QDISC 3280 + M: Toke Høiland-Jørgensen <toke@toke.dk> 3281 + L: cake@lists.bufferbloat.net (moderated for non-subscribers) 3282 + S: Maintained 3283 + F: net/sched/sch_cake.c 3278 3284 3279 3285 CALGARY x86-64 IOMMU 3280 3286 M: Muli Ben-Yehuda <mulix@mulix.org> ··· 10815 10809 F: drivers/staging/media/omap4iss/ 10816 10810 10817 10811 OMAP MMC SUPPORT 10818 - M: Jarkko Lavinen <jarkko.lavinen@nokia.com> 10812 + M: Aaro Koskinen <aaro.koskinen@iki.fi> 10819 10813 L: linux-omap@vger.kernel.org 10820 - S: Maintained 10814 + S: Odd Fixes 10821 10815 F: drivers/mmc/host/omap.c 10822 10816 10823 10817 OMAP POWER MANAGEMENT SUPPORT ··· 11752 11746 PIN CONTROLLER - INTEL 11753 11747 M: Mika Westerberg <mika.westerberg@linux.intel.com> 11754 11748 M: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 11749 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git 11755 11750 S: Maintained 11756 11751 F: drivers/pinctrl/intel/ 11757 11752
+1 -1
Makefile
··· 2 2 VERSION = 4 3 3 PATCHLEVEL = 20 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc2 5 + EXTRAVERSION = -rc3 6 6 NAME = "People's Front" 7 7 8 8 # *DOCUMENTATION*
+1
arch/arm/include/asm/cputype.h
··· 111 111 #include <linux/kernel.h> 112 112 113 113 extern unsigned int processor_id; 114 + struct proc_info_list *lookup_processor(u32 midr); 114 115 115 116 #ifdef CONFIG_CPU_CP15 116 117 #define read_cpuid(reg) \
+49 -12
arch/arm/include/asm/proc-fns.h
··· 23 23 /* 24 24 * Don't change this structure - ASM code relies on it. 25 25 */ 26 - extern struct processor { 26 + struct processor { 27 27 /* MISC 28 28 * get data abort address/flags 29 29 */ ··· 79 79 unsigned int suspend_size; 80 80 void (*do_suspend)(void *); 81 81 void (*do_resume)(void *); 82 - } processor; 82 + }; 83 83 84 84 #ifndef MULTI_CPU 85 + static inline void init_proc_vtable(const struct processor *p) 86 + { 87 + } 88 + 85 89 extern void cpu_proc_init(void); 86 90 extern void cpu_proc_fin(void); 87 91 extern int cpu_do_idle(void); ··· 102 98 extern void cpu_do_suspend(void *); 103 99 extern void cpu_do_resume(void *); 104 100 #else 105 - #define cpu_proc_init processor._proc_init 106 - #define cpu_proc_fin processor._proc_fin 107 - #define cpu_reset processor.reset 108 - #define cpu_do_idle processor._do_idle 109 - #define cpu_dcache_clean_area processor.dcache_clean_area 110 - #define cpu_set_pte_ext processor.set_pte_ext 111 - #define cpu_do_switch_mm processor.switch_mm 112 101 113 - /* These three are private to arch/arm/kernel/suspend.c */ 114 - #define cpu_do_suspend processor.do_suspend 115 - #define cpu_do_resume processor.do_resume 102 + extern struct processor processor; 103 + #if defined(CONFIG_BIG_LITTLE) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR) 104 + #include <linux/smp.h> 105 + /* 106 + * This can't be a per-cpu variable because we need to access it before 107 + * per-cpu has been initialised. We have a couple of functions that are 108 + * called in a pre-emptible context, and so can't use smp_processor_id() 109 + * there, hence PROC_TABLE(). We insist in init_proc_vtable() that the 110 + * function pointers for these are identical across all CPUs. 111 + */ 112 + extern struct processor *cpu_vtable[]; 113 + #define PROC_VTABLE(f) cpu_vtable[smp_processor_id()]->f 114 + #define PROC_TABLE(f) cpu_vtable[0]->f 115 + static inline void init_proc_vtable(const struct processor *p) 116 + { 117 + unsigned int cpu = smp_processor_id(); 118 + *cpu_vtable[cpu] = *p; 119 + WARN_ON_ONCE(cpu_vtable[cpu]->dcache_clean_area != 120 + cpu_vtable[0]->dcache_clean_area); 121 + WARN_ON_ONCE(cpu_vtable[cpu]->set_pte_ext != 122 + cpu_vtable[0]->set_pte_ext); 123 + } 124 + #else 125 + #define PROC_VTABLE(f) processor.f 126 + #define PROC_TABLE(f) processor.f 127 + static inline void init_proc_vtable(const struct processor *p) 128 + { 129 + processor = *p; 130 + } 131 + #endif 132 + 133 + #define cpu_proc_init PROC_VTABLE(_proc_init) 134 + #define cpu_check_bugs PROC_VTABLE(check_bugs) 135 + #define cpu_proc_fin PROC_VTABLE(_proc_fin) 136 + #define cpu_reset PROC_VTABLE(reset) 137 + #define cpu_do_idle PROC_VTABLE(_do_idle) 138 + #define cpu_dcache_clean_area PROC_TABLE(dcache_clean_area) 139 + #define cpu_set_pte_ext PROC_TABLE(set_pte_ext) 140 + #define cpu_do_switch_mm PROC_VTABLE(switch_mm) 141 + 142 + /* These two are private to arch/arm/kernel/suspend.c */ 143 + #define cpu_do_suspend PROC_VTABLE(do_suspend) 144 + #define cpu_do_resume PROC_VTABLE(do_resume) 116 145 #endif 117 146 118 147 extern void cpu_resume(void);
+2 -2
arch/arm/kernel/bugs.c
··· 6 6 void check_other_bugs(void) 7 7 { 8 8 #ifdef MULTI_CPU 9 - if (processor.check_bugs) 10 - processor.check_bugs(); 9 + if (cpu_check_bugs) 10 + cpu_check_bugs(); 11 11 #endif 12 12 } 13 13
+3 -3
arch/arm/kernel/head-common.S
··· 145 145 #endif 146 146 .size __mmap_switched_data, . - __mmap_switched_data 147 147 148 + __FINIT 149 + .text 150 + 148 151 /* 149 152 * This provides a C-API version of __lookup_processor_type 150 153 */ ··· 158 155 mov r0, r5 159 156 ldmfd sp!, {r4 - r6, r9, pc} 160 157 ENDPROC(lookup_processor_type) 161 - 162 - __FINIT 163 - .text 164 158 165 159 /* 166 160 * Read processor ID register (CP#15, CR0), and look up in the linker-built
+27 -17
arch/arm/kernel/setup.c
··· 114 114 115 115 #ifdef MULTI_CPU 116 116 struct processor processor __ro_after_init; 117 + #if defined(CONFIG_BIG_LITTLE) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR) 118 + struct processor *cpu_vtable[NR_CPUS] = { 119 + [0] = &processor, 120 + }; 121 + #endif 117 122 #endif 118 123 #ifdef MULTI_TLB 119 124 struct cpu_tlb_fns cpu_tlb __ro_after_init; ··· 671 666 } 672 667 #endif 673 668 669 + /* 670 + * locate processor in the list of supported processor types. The linker 671 + * builds this table for us from the entries in arch/arm/mm/proc-*.S 672 + */ 673 + struct proc_info_list *lookup_processor(u32 midr) 674 + { 675 + struct proc_info_list *list = lookup_processor_type(midr); 676 + 677 + if (!list) { 678 + pr_err("CPU%u: configuration botched (ID %08x), CPU halted\n", 679 + smp_processor_id(), midr); 680 + while (1) 681 + /* can't use cpu_relax() here as it may require MMU setup */; 682 + } 683 + 684 + return list; 685 + } 686 + 674 687 static void __init setup_processor(void) 675 688 { 676 - struct proc_info_list *list; 677 - 678 - /* 679 - * locate processor in the list of supported processor 680 - * types. The linker builds this table for us from the 681 - * entries in arch/arm/mm/proc-*.S 682 - */ 683 - list = lookup_processor_type(read_cpuid_id()); 684 - if (!list) { 685 - pr_err("CPU configuration botched (ID %08x), unable to continue.\n", 686 - read_cpuid_id()); 687 - while (1); 688 - } 689 + unsigned int midr = read_cpuid_id(); 690 + struct proc_info_list *list = lookup_processor(midr); 689 691 690 692 cpu_name = list->cpu_name; 691 693 __cpu_architecture = __get_cpu_architecture(); 692 694 693 - #ifdef MULTI_CPU 694 - processor = *list->proc; 695 - #endif 695 + init_proc_vtable(list->proc); 696 696 #ifdef MULTI_TLB 697 697 cpu_tlb = *list->tlb; 698 698 #endif ··· 709 699 #endif 710 700 711 701 pr_info("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n", 712 - cpu_name, read_cpuid_id(), read_cpuid_id() & 15, 702 + list->cpu_name, midr, midr & 15, 713 703 proc_arch[cpu_architecture()], get_cr()); 714 704 715 705 snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c",
+31
arch/arm/kernel/smp.c
··· 42 42 #include <asm/mmu_context.h> 43 43 #include <asm/pgtable.h> 44 44 #include <asm/pgalloc.h> 45 + #include <asm/procinfo.h> 45 46 #include <asm/processor.h> 46 47 #include <asm/sections.h> 47 48 #include <asm/tlbflush.h> ··· 103 102 #endif 104 103 } 105 104 105 + #if defined(CONFIG_BIG_LITTLE) && defined(CONFIG_HARDEN_BRANCH_PREDICTOR) 106 + static int secondary_biglittle_prepare(unsigned int cpu) 107 + { 108 + if (!cpu_vtable[cpu]) 109 + cpu_vtable[cpu] = kzalloc(sizeof(*cpu_vtable[cpu]), GFP_KERNEL); 110 + 111 + return cpu_vtable[cpu] ? 0 : -ENOMEM; 112 + } 113 + 114 + static void secondary_biglittle_init(void) 115 + { 116 + init_proc_vtable(lookup_processor(read_cpuid_id())->proc); 117 + } 118 + #else 119 + static int secondary_biglittle_prepare(unsigned int cpu) 120 + { 121 + return 0; 122 + } 123 + 124 + static void secondary_biglittle_init(void) 125 + { 126 + } 127 + #endif 128 + 106 129 int __cpu_up(unsigned int cpu, struct task_struct *idle) 107 130 { 108 131 int ret; 109 132 110 133 if (!smp_ops.smp_boot_secondary) 111 134 return -ENOSYS; 135 + 136 + ret = secondary_biglittle_prepare(cpu); 137 + if (ret) 138 + return ret; 112 139 113 140 /* 114 141 * We need to tell the secondary core where to find ··· 387 358 { 388 359 struct mm_struct *mm = &init_mm; 389 360 unsigned int cpu; 361 + 362 + secondary_biglittle_init(); 390 363 391 364 /* 392 365 * The identity mapping is uncached (strongly ordered), so
+53 -58
arch/arm/mach-omap2/display.c
··· 209 209 210 210 return 0; 211 211 } 212 - #else 213 - static inline int omapdss_init_fbdev(void) 212 + 213 + static const char * const omapdss_compat_names[] __initconst = { 214 + "ti,omap2-dss", 215 + "ti,omap3-dss", 216 + "ti,omap4-dss", 217 + "ti,omap5-dss", 218 + "ti,dra7-dss", 219 + }; 220 + 221 + static struct device_node * __init omapdss_find_dss_of_node(void) 214 222 { 215 - return 0; 223 + struct device_node *node; 224 + int i; 225 + 226 + for (i = 0; i < ARRAY_SIZE(omapdss_compat_names); ++i) { 227 + node = of_find_compatible_node(NULL, NULL, 228 + omapdss_compat_names[i]); 229 + if (node) 230 + return node; 231 + } 232 + 233 + return NULL; 216 234 } 235 + 236 + static int __init omapdss_init_of(void) 237 + { 238 + int r; 239 + struct device_node *node; 240 + struct platform_device *pdev; 241 + 242 + /* only create dss helper devices if dss is enabled in the .dts */ 243 + 244 + node = omapdss_find_dss_of_node(); 245 + if (!node) 246 + return 0; 247 + 248 + if (!of_device_is_available(node)) 249 + return 0; 250 + 251 + pdev = of_find_device_by_node(node); 252 + 253 + if (!pdev) { 254 + pr_err("Unable to find DSS platform device\n"); 255 + return -ENODEV; 256 + } 257 + 258 + r = of_platform_populate(node, NULL, NULL, &pdev->dev); 259 + if (r) { 260 + pr_err("Unable to populate DSS submodule devices\n"); 261 + return r; 262 + } 263 + 264 + return omapdss_init_fbdev(); 265 + } 266 + omap_device_initcall(omapdss_init_of); 217 267 #endif /* CONFIG_FB_OMAP2 */ 218 268 219 269 static void dispc_disable_outputs(void) ··· 411 361 412 362 return r; 413 363 } 414 - 415 - static const char * const omapdss_compat_names[] __initconst = { 416 - "ti,omap2-dss", 417 - "ti,omap3-dss", 418 - "ti,omap4-dss", 419 - "ti,omap5-dss", 420 - "ti,dra7-dss", 421 - }; 422 - 423 - static struct device_node * __init omapdss_find_dss_of_node(void) 424 - { 425 - struct device_node *node; 426 - int i; 427 - 428 - for (i = 0; i < ARRAY_SIZE(omapdss_compat_names); ++i) { 429 - node = of_find_compatible_node(NULL, NULL, 430 - omapdss_compat_names[i]); 431 - if (node) 432 - return node; 433 - } 434 - 435 - return NULL; 436 - } 437 - 438 - static int __init omapdss_init_of(void) 439 - { 440 - int r; 441 - struct device_node *node; 442 - struct platform_device *pdev; 443 - 444 - /* only create dss helper devices if dss is enabled in the .dts */ 445 - 446 - node = omapdss_find_dss_of_node(); 447 - if (!node) 448 - return 0; 449 - 450 - if (!of_device_is_available(node)) 451 - return 0; 452 - 453 - pdev = of_find_device_by_node(node); 454 - 455 - if (!pdev) { 456 - pr_err("Unable to find DSS platform device\n"); 457 - return -ENODEV; 458 - } 459 - 460 - r = of_platform_populate(node, NULL, NULL, &pdev->dev); 461 - if (r) { 462 - pr_err("Unable to populate DSS submodule devices\n"); 463 - return r; 464 - } 465 - 466 - return omapdss_init_fbdev(); 467 - } 468 - omap_device_initcall(omapdss_init_of);
+2 -15
arch/arm/mm/proc-v7-bugs.c
··· 52 52 case ARM_CPU_PART_CORTEX_A17: 53 53 case ARM_CPU_PART_CORTEX_A73: 54 54 case ARM_CPU_PART_CORTEX_A75: 55 - if (processor.switch_mm != cpu_v7_bpiall_switch_mm) 56 - goto bl_error; 57 55 per_cpu(harden_branch_predictor_fn, cpu) = 58 56 harden_branch_predictor_bpiall; 59 57 spectre_v2_method = "BPIALL"; ··· 59 61 60 62 case ARM_CPU_PART_CORTEX_A15: 61 63 case ARM_CPU_PART_BRAHMA_B15: 62 - if (processor.switch_mm != cpu_v7_iciallu_switch_mm) 63 - goto bl_error; 64 64 per_cpu(harden_branch_predictor_fn, cpu) = 65 65 harden_branch_predictor_iciallu; 66 66 spectre_v2_method = "ICIALLU"; ··· 84 88 ARM_SMCCC_ARCH_WORKAROUND_1, &res); 85 89 if ((int)res.a0 != 0) 86 90 break; 87 - if (processor.switch_mm != cpu_v7_hvc_switch_mm && cpu) 88 - goto bl_error; 89 91 per_cpu(harden_branch_predictor_fn, cpu) = 90 92 call_hvc_arch_workaround_1; 91 - processor.switch_mm = cpu_v7_hvc_switch_mm; 93 + cpu_do_switch_mm = cpu_v7_hvc_switch_mm; 92 94 spectre_v2_method = "hypervisor"; 93 95 break; 94 96 ··· 95 101 ARM_SMCCC_ARCH_WORKAROUND_1, &res); 96 102 if ((int)res.a0 != 0) 97 103 break; 98 - if (processor.switch_mm != cpu_v7_smc_switch_mm && cpu) 99 - goto bl_error; 100 104 per_cpu(harden_branch_predictor_fn, cpu) = 101 105 call_smc_arch_workaround_1; 102 - processor.switch_mm = cpu_v7_smc_switch_mm; 106 + cpu_do_switch_mm = cpu_v7_smc_switch_mm; 103 107 spectre_v2_method = "firmware"; 104 108 break; 105 109 ··· 111 119 if (spectre_v2_method) 112 120 pr_info("CPU%u: Spectre v2: using %s workaround\n", 113 121 smp_processor_id(), spectre_v2_method); 114 - return; 115 - 116 - bl_error: 117 - pr_err("CPU%u: Spectre v2: incorrect context switching function, system vulnerable\n", 118 - cpu); 119 122 } 120 123 #else 121 124 static void cpu_v7_spectre_init(void)
+1 -1
arch/arm/vfp/vfpmodule.c
··· 573 573 */ 574 574 ufp_exc->fpexc = hwstate->fpexc; 575 575 ufp_exc->fpinst = hwstate->fpinst; 576 - ufp_exc->fpinst2 = ufp_exc->fpinst2; 576 + ufp_exc->fpinst2 = hwstate->fpinst2; 577 577 578 578 /* Ensure that VFP is disabled. */ 579 579 vfp_flush_hwstate(thread);
+1
arch/arm64/kernel/setup.c
··· 313 313 arm64_memblock_init(); 314 314 315 315 paging_init(); 316 + efi_apply_persistent_mem_reservations(); 316 317 317 318 acpi_table_upgrade(); 318 319
+2 -2
arch/parisc/include/asm/spinlock.h
··· 37 37 volatile unsigned int *a; 38 38 39 39 a = __ldcw_align(x); 40 - /* Release with ordered store. */ 41 - __asm__ __volatile__("stw,ma %0,0(%1)" : : "r"(1), "r"(a) : "memory"); 40 + mb(); 41 + *a = 1; 42 42 } 43 43 44 44 static inline int arch_spin_trylock(arch_spinlock_t *x)
+8 -4
arch/parisc/kernel/syscall.S
··· 640 640 sub,<> %r28, %r25, %r0 641 641 2: stw %r24, 0(%r26) 642 642 /* Free lock */ 643 - stw,ma %r20, 0(%sr2,%r20) 643 + sync 644 + stw %r20, 0(%sr2,%r20) 644 645 #if ENABLE_LWS_DEBUG 645 646 /* Clear thread register indicator */ 646 647 stw %r0, 4(%sr2,%r20) ··· 655 654 3: 656 655 /* Error occurred on load or store */ 657 656 /* Free lock */ 658 - stw,ma %r20, 0(%sr2,%r20) 657 + sync 658 + stw %r20, 0(%sr2,%r20) 659 659 #if ENABLE_LWS_DEBUG 660 660 stw %r0, 4(%sr2,%r20) 661 661 #endif ··· 857 855 858 856 cas2_end: 859 857 /* Free lock */ 860 - stw,ma %r20, 0(%sr2,%r20) 858 + sync 859 + stw %r20, 0(%sr2,%r20) 861 860 /* Enable interrupts */ 862 861 ssm PSW_SM_I, %r0 863 862 /* Return to userspace, set no error */ ··· 868 865 22: 869 866 /* Error occurred on load or store */ 870 867 /* Free lock */ 871 - stw,ma %r20, 0(%sr2,%r20) 868 + sync 869 + stw %r20, 0(%sr2,%r20) 872 870 ssm PSW_SM_I, %r0 873 871 ldo 1(%r0),%r28 874 872 b lws_exit
+7 -13
arch/powerpc/include/asm/io.h
··· 268 268 * their hooks, a bitfield is reserved for use by the platform near the 269 269 * top of MMIO addresses (not PIO, those have to cope the hard way). 270 270 * 271 - * This bit field is 12 bits and is at the top of the IO virtual 272 - * addresses PCI_IO_INDIRECT_TOKEN_MASK. 271 + * The highest address in the kernel virtual space are: 273 272 * 274 - * The kernel virtual space is thus: 273 + * d0003fffffffffff # with Hash MMU 274 + * c00fffffffffffff # with Radix MMU 275 275 * 276 - * 0xD000000000000000 : vmalloc 277 - * 0xD000080000000000 : PCI PHB IO space 278 - * 0xD000080080000000 : ioremap 279 - * 0xD0000fffffffffff : end of ioremap region 280 - * 281 - * Since the top 4 bits are reserved as the region ID, we use thus 282 - * the next 12 bits and keep 4 bits available for the future if the 283 - * virtual address space is ever to be extended. 276 + * The top 4 bits are reserved as the region ID on hash, leaving us 8 bits 277 + * that can be used for the field. 284 278 * 285 279 * The direct IO mapping operations will then mask off those bits 286 280 * before doing the actual access, though that only happen when ··· 286 292 */ 287 293 288 294 #ifdef CONFIG_PPC_INDIRECT_MMIO 289 - #define PCI_IO_IND_TOKEN_MASK 0x0fff000000000000ul 290 - #define PCI_IO_IND_TOKEN_SHIFT 48 295 + #define PCI_IO_IND_TOKEN_SHIFT 52 296 + #define PCI_IO_IND_TOKEN_MASK (0xfful << PCI_IO_IND_TOKEN_SHIFT) 291 297 #define PCI_FIX_ADDR(addr) \ 292 298 ((PCI_IO_ADDR)(((unsigned long)(addr)) & ~PCI_IO_IND_TOKEN_MASK)) 293 299 #define PCI_GET_ADDR_TOKEN(addr) \
+2
arch/powerpc/include/asm/ppc-opcode.h
··· 493 493 __PPC_RS(t) | __PPC_RA0(a) | __PPC_RB(b)) 494 494 #define PPC_SLBFEE_DOT(t, b) stringify_in_c(.long PPC_INST_SLBFEE | \ 495 495 __PPC_RT(t) | __PPC_RB(b)) 496 + #define __PPC_SLBFEE_DOT(t, b) stringify_in_c(.long PPC_INST_SLBFEE | \ 497 + ___PPC_RT(t) | ___PPC_RB(b)) 496 498 #define PPC_ICBT(c,a,b) stringify_in_c(.long PPC_INST_ICBT | \ 497 499 __PPC_CT(c) | __PPC_RA0(a) | __PPC_RB(b)) 498 500 /* PASemi instructions */
+1
arch/powerpc/include/asm/ptrace.h
··· 54 54 55 55 #ifdef CONFIG_PPC64 56 56 unsigned long ppr; 57 + unsigned long __pad; /* Maintain 16 byte interrupt stack alignment */ 57 58 #endif 58 59 }; 59 60 #endif
+2
arch/powerpc/kernel/setup_64.c
··· 636 636 { 637 637 unsigned long pa; 638 638 639 + BUILD_BUG_ON(STACK_INT_FRAME_SIZE % 16); 640 + 639 641 pa = memblock_alloc_base_nid(THREAD_SIZE, THREAD_SIZE, limit, 640 642 early_cpu_to_node(cpu), MEMBLOCK_NONE); 641 643 if (!pa) {
+6 -2
arch/powerpc/kvm/trace.h
··· 6 6 7 7 #undef TRACE_SYSTEM 8 8 #define TRACE_SYSTEM kvm 9 - #define TRACE_INCLUDE_PATH . 10 - #define TRACE_INCLUDE_FILE trace 11 9 12 10 /* 13 11 * Tracepoint for guest mode entry. ··· 118 120 #endif /* _TRACE_KVM_H */ 119 121 120 122 /* This part must be outside protection */ 123 + #undef TRACE_INCLUDE_PATH 124 + #undef TRACE_INCLUDE_FILE 125 + 126 + #define TRACE_INCLUDE_PATH . 127 + #define TRACE_INCLUDE_FILE trace 128 + 121 129 #include <trace/define_trace.h>
+7 -2
arch/powerpc/kvm/trace_booke.h
··· 6 6 7 7 #undef TRACE_SYSTEM 8 8 #define TRACE_SYSTEM kvm_booke 9 - #define TRACE_INCLUDE_PATH . 10 - #define TRACE_INCLUDE_FILE trace_booke 11 9 12 10 #define kvm_trace_symbol_exit \ 13 11 {0, "CRITICAL"}, \ ··· 216 218 #endif 217 219 218 220 /* This part must be outside protection */ 221 + 222 + #undef TRACE_INCLUDE_PATH 223 + #undef TRACE_INCLUDE_FILE 224 + 225 + #define TRACE_INCLUDE_PATH . 226 + #define TRACE_INCLUDE_FILE trace_booke 227 + 219 228 #include <trace/define_trace.h>
+7 -2
arch/powerpc/kvm/trace_hv.h
··· 9 9 10 10 #undef TRACE_SYSTEM 11 11 #define TRACE_SYSTEM kvm_hv 12 - #define TRACE_INCLUDE_PATH . 13 - #define TRACE_INCLUDE_FILE trace_hv 14 12 15 13 #define kvm_trace_symbol_hcall \ 16 14 {H_REMOVE, "H_REMOVE"}, \ ··· 495 497 #endif /* _TRACE_KVM_HV_H */ 496 498 497 499 /* This part must be outside protection */ 500 + 501 + #undef TRACE_INCLUDE_PATH 502 + #undef TRACE_INCLUDE_FILE 503 + 504 + #define TRACE_INCLUDE_PATH . 505 + #define TRACE_INCLUDE_FILE trace_hv 506 + 498 507 #include <trace/define_trace.h>
+7 -2
arch/powerpc/kvm/trace_pr.h
··· 8 8 9 9 #undef TRACE_SYSTEM 10 10 #define TRACE_SYSTEM kvm_pr 11 - #define TRACE_INCLUDE_PATH . 12 - #define TRACE_INCLUDE_FILE trace_pr 13 11 14 12 TRACE_EVENT(kvm_book3s_reenter, 15 13 TP_PROTO(int r, struct kvm_vcpu *vcpu), ··· 255 257 #endif /* _TRACE_KVM_H */ 256 258 257 259 /* This part must be outside protection */ 260 + 261 + #undef TRACE_INCLUDE_PATH 262 + #undef TRACE_INCLUDE_FILE 263 + 264 + #define TRACE_INCLUDE_PATH . 265 + #define TRACE_INCLUDE_FILE trace_pr 266 + 258 267 #include <trace/define_trace.h>
+1 -1
arch/powerpc/mm/numa.c
··· 1178 1178 1179 1179 switch (rc) { 1180 1180 case H_FUNCTION: 1181 - printk(KERN_INFO 1181 + printk_once(KERN_INFO 1182 1182 "VPHN is not supported. Disabling polling...\n"); 1183 1183 stop_topology_update(); 1184 1184 break;
+14 -21
arch/powerpc/mm/slb.c
··· 19 19 #include <asm/mmu.h> 20 20 #include <asm/mmu_context.h> 21 21 #include <asm/paca.h> 22 + #include <asm/ppc-opcode.h> 22 23 #include <asm/cputable.h> 23 24 #include <asm/cacheflush.h> 24 25 #include <asm/smp.h> ··· 59 58 return __mk_vsid_data(get_kernel_vsid(ea, ssize), ssize, flags); 60 59 } 61 60 62 - static void assert_slb_exists(unsigned long ea) 61 + static void assert_slb_presence(bool present, unsigned long ea) 63 62 { 64 63 #ifdef CONFIG_DEBUG_VM 65 64 unsigned long tmp; 66 65 67 66 WARN_ON_ONCE(mfmsr() & MSR_EE); 68 67 69 - asm volatile("slbfee. %0, %1" : "=r"(tmp) : "r"(ea) : "cr0"); 70 - WARN_ON(tmp == 0); 71 - #endif 72 - } 68 + if (!cpu_has_feature(CPU_FTR_ARCH_206)) 69 + return; 73 70 74 - static void assert_slb_notexists(unsigned long ea) 75 - { 76 - #ifdef CONFIG_DEBUG_VM 77 - unsigned long tmp; 71 + asm volatile(__PPC_SLBFEE_DOT(%0, %1) : "=r"(tmp) : "r"(ea) : "cr0"); 78 72 79 - WARN_ON_ONCE(mfmsr() & MSR_EE); 80 - 81 - asm volatile("slbfee. %0, %1" : "=r"(tmp) : "r"(ea) : "cr0"); 82 - WARN_ON(tmp != 0); 73 + WARN_ON(present == (tmp == 0)); 83 74 #endif 84 75 } 85 76 ··· 107 114 */ 108 115 slb_shadow_update(ea, ssize, flags, index); 109 116 110 - assert_slb_notexists(ea); 117 + assert_slb_presence(false, ea); 111 118 asm volatile("slbmte %0,%1" : 112 119 : "r" (mk_vsid_data(ea, ssize, flags)), 113 120 "r" (mk_esid_data(ea, ssize, index)) ··· 130 137 "r" (be64_to_cpu(p->save_area[index].esid))); 131 138 } 132 139 133 - assert_slb_exists(local_paca->kstack); 140 + assert_slb_presence(true, local_paca->kstack); 134 141 } 135 142 136 143 /* ··· 178 185 :: "r" (be64_to_cpu(p->save_area[KSTACK_INDEX].vsid)), 179 186 "r" (be64_to_cpu(p->save_area[KSTACK_INDEX].esid)) 180 187 : "memory"); 181 - assert_slb_exists(get_paca()->kstack); 188 + assert_slb_presence(true, get_paca()->kstack); 182 189 183 190 get_paca()->slb_cache_ptr = 0; 184 191 ··· 436 443 ea = (unsigned long) 437 444 get_paca()->slb_cache[i] << SID_SHIFT; 438 445 /* 439 - * Could assert_slb_exists here, but hypervisor 440 - * or machine check could have come in and 441 - * removed the entry at this point. 446 + * Could assert_slb_presence(true) here, but 447 + * hypervisor or machine check could have come 448 + * in and removed the entry at this point. 442 449 */ 443 450 444 451 slbie_data = ea; ··· 669 676 * User preloads should add isync afterwards in case the kernel 670 677 * accesses user memory before it returns to userspace with rfid. 671 678 */ 672 - assert_slb_notexists(ea); 679 + assert_slb_presence(false, ea); 673 680 asm volatile("slbmte %0, %1" : : "r" (vsid_data), "r" (esid_data)); 674 681 675 682 barrier(); ··· 708 715 return -EFAULT; 709 716 710 717 if (ea < H_VMALLOC_END) 711 - flags = get_paca()->vmalloc_sllp; 718 + flags = local_paca->vmalloc_sllp; 712 719 else 713 720 flags = SLB_VSID_KERNEL | mmu_psize_defs[mmu_io_psize].sllp; 714 721 } else {
+4 -60
arch/powerpc/platforms/powernv/npu-dma.c
··· 102 102 } 103 103 EXPORT_SYMBOL(pnv_pci_get_npu_dev); 104 104 105 - #define NPU_DMA_OP_UNSUPPORTED() \ 106 - dev_err_once(dev, "%s operation unsupported for NVLink devices\n", \ 107 - __func__) 108 - 109 - static void *dma_npu_alloc(struct device *dev, size_t size, 110 - dma_addr_t *dma_handle, gfp_t flag, 111 - unsigned long attrs) 112 - { 113 - NPU_DMA_OP_UNSUPPORTED(); 114 - return NULL; 115 - } 116 - 117 - static void dma_npu_free(struct device *dev, size_t size, 118 - void *vaddr, dma_addr_t dma_handle, 119 - unsigned long attrs) 120 - { 121 - NPU_DMA_OP_UNSUPPORTED(); 122 - } 123 - 124 - static dma_addr_t dma_npu_map_page(struct device *dev, struct page *page, 125 - unsigned long offset, size_t size, 126 - enum dma_data_direction direction, 127 - unsigned long attrs) 128 - { 129 - NPU_DMA_OP_UNSUPPORTED(); 130 - return 0; 131 - } 132 - 133 - static int dma_npu_map_sg(struct device *dev, struct scatterlist *sglist, 134 - int nelems, enum dma_data_direction direction, 135 - unsigned long attrs) 136 - { 137 - NPU_DMA_OP_UNSUPPORTED(); 138 - return 0; 139 - } 140 - 141 - static int dma_npu_dma_supported(struct device *dev, u64 mask) 142 - { 143 - NPU_DMA_OP_UNSUPPORTED(); 144 - return 0; 145 - } 146 - 147 - static u64 dma_npu_get_required_mask(struct device *dev) 148 - { 149 - NPU_DMA_OP_UNSUPPORTED(); 150 - return 0; 151 - } 152 - 153 - static const struct dma_map_ops dma_npu_ops = { 154 - .map_page = dma_npu_map_page, 155 - .map_sg = dma_npu_map_sg, 156 - .alloc = dma_npu_alloc, 157 - .free = dma_npu_free, 158 - .dma_supported = dma_npu_dma_supported, 159 - .get_required_mask = dma_npu_get_required_mask, 160 - }; 161 - 162 105 /* 163 106 * Returns the PE assoicated with the PCI device of the given 164 107 * NPU. Returns the linked pci device if pci_dev != NULL. ··· 213 270 rc = pnv_npu_set_window(npe, 0, gpe->table_group.tables[0]); 214 271 215 272 /* 216 - * We don't initialise npu_pe->tce32_table as we always use 217 - * dma_npu_ops which are nops. 273 + * NVLink devices use the same TCE table configuration as 274 + * their parent device so drivers shouldn't be doing DMA 275 + * operations directly on these devices. 218 276 */ 219 - set_dma_ops(&npe->pdev->dev, &dma_npu_ops); 277 + set_dma_ops(&npe->pdev->dev, NULL); 220 278 } 221 279 222 280 /*
+4
arch/riscv/Makefile
··· 77 77 78 78 libs-y += arch/riscv/lib/ 79 79 80 + PHONY += vdso_install 81 + vdso_install: 82 + $(Q)$(MAKE) $(build)=arch/riscv/kernel/vdso $@ 83 + 80 84 all: vmlinux
+1
arch/riscv/configs/defconfig
··· 76 76 CONFIG_NFS_V4_2=y 77 77 CONFIG_ROOT_NFS=y 78 78 CONFIG_CRYPTO_USER_API_HASH=y 79 + CONFIG_PRINTK_TIME=y 79 80 # CONFIG_RCU_TRACE is not set
+2 -2
arch/riscv/include/asm/ptrace.h
··· 56 56 unsigned long sstatus; 57 57 unsigned long sbadaddr; 58 58 unsigned long scause; 59 - /* a0 value before the syscall */ 60 - unsigned long orig_a0; 59 + /* a0 value before the syscall */ 60 + unsigned long orig_a0; 61 61 }; 62 62 63 63 #ifdef CONFIG_64BIT
+6 -6
arch/riscv/kernel/module.c
··· 21 21 { 22 22 if (v != (u32)v) { 23 23 pr_err("%s: value %016llx out of range for 32-bit field\n", 24 - me->name, v); 24 + me->name, (long long)v); 25 25 return -EINVAL; 26 26 } 27 27 *location = v; ··· 102 102 if (offset != (s32)offset) { 103 103 pr_err( 104 104 "%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n", 105 - me->name, v, location); 105 + me->name, (long long)v, location); 106 106 return -EINVAL; 107 107 } 108 108 ··· 144 144 if (IS_ENABLED(CMODEL_MEDLOW)) { 145 145 pr_err( 146 146 "%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n", 147 - me->name, v, location); 147 + me->name, (long long)v, location); 148 148 return -EINVAL; 149 149 } 150 150 ··· 188 188 } else { 189 189 pr_err( 190 190 "%s: can not generate the GOT entry for symbol = %016llx from PC = %p\n", 191 - me->name, v, location); 191 + me->name, (long long)v, location); 192 192 return -EINVAL; 193 193 } 194 194 ··· 212 212 } else { 213 213 pr_err( 214 214 "%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n", 215 - me->name, v, location); 215 + me->name, (long long)v, location); 216 216 return -EINVAL; 217 217 } 218 218 } ··· 234 234 if (offset != fill_v) { 235 235 pr_err( 236 236 "%s: target %016llx can not be addressed by the 32-bit offset from PC = %p\n", 237 - me->name, v, location); 237 + me->name, (long long)v, location); 238 238 return -EINVAL; 239 239 } 240 240
+1 -1
arch/riscv/lib/Makefile
··· 3 3 lib-y += memset.o 4 4 lib-y += uaccess.o 5 5 6 - lib-(CONFIG_64BIT) += tishift.o 6 + lib-$(CONFIG_64BIT) += tishift.o 7 7 8 8 lib-$(CONFIG_32BIT) += udivdi3.o
+25 -8
arch/x86/events/intel/uncore.h
··· 129 129 struct intel_uncore_extra_reg shared_regs[0]; 130 130 }; 131 131 132 - #define UNCORE_BOX_FLAG_INITIATED 0 133 - #define UNCORE_BOX_FLAG_CTL_OFFS8 1 /* event config registers are 8-byte apart */ 132 + /* CFL uncore 8th cbox MSRs */ 133 + #define CFL_UNC_CBO_7_PERFEVTSEL0 0xf70 134 + #define CFL_UNC_CBO_7_PER_CTR0 0xf76 135 + 136 + #define UNCORE_BOX_FLAG_INITIATED 0 137 + /* event config registers are 8-byte apart */ 138 + #define UNCORE_BOX_FLAG_CTL_OFFS8 1 139 + /* CFL 8th CBOX has different MSR space */ 140 + #define UNCORE_BOX_FLAG_CFL8_CBOX_MSR_OFFS 2 134 141 135 142 struct uncore_event_desc { 136 143 struct kobj_attribute attr; ··· 304 297 static inline 305 298 unsigned uncore_msr_event_ctl(struct intel_uncore_box *box, int idx) 306 299 { 307 - return box->pmu->type->event_ctl + 308 - (box->pmu->type->pair_ctr_ctl ? 2 * idx : idx) + 309 - uncore_msr_box_offset(box); 300 + if (test_bit(UNCORE_BOX_FLAG_CFL8_CBOX_MSR_OFFS, &box->flags)) { 301 + return CFL_UNC_CBO_7_PERFEVTSEL0 + 302 + (box->pmu->type->pair_ctr_ctl ? 2 * idx : idx); 303 + } else { 304 + return box->pmu->type->event_ctl + 305 + (box->pmu->type->pair_ctr_ctl ? 2 * idx : idx) + 306 + uncore_msr_box_offset(box); 307 + } 310 308 } 311 309 312 310 static inline 313 311 unsigned uncore_msr_perf_ctr(struct intel_uncore_box *box, int idx) 314 312 { 315 - return box->pmu->type->perf_ctr + 316 - (box->pmu->type->pair_ctr_ctl ? 2 * idx : idx) + 317 - uncore_msr_box_offset(box); 313 + if (test_bit(UNCORE_BOX_FLAG_CFL8_CBOX_MSR_OFFS, &box->flags)) { 314 + return CFL_UNC_CBO_7_PER_CTR0 + 315 + (box->pmu->type->pair_ctr_ctl ? 2 * idx : idx); 316 + } else { 317 + return box->pmu->type->perf_ctr + 318 + (box->pmu->type->pair_ctr_ctl ? 2 * idx : idx) + 319 + uncore_msr_box_offset(box); 320 + } 318 321 } 319 322 320 323 static inline
+119 -2
arch/x86/events/intel/uncore_snb.c
··· 15 15 #define PCI_DEVICE_ID_INTEL_SKL_HQ_IMC 0x1910 16 16 #define PCI_DEVICE_ID_INTEL_SKL_SD_IMC 0x190f 17 17 #define PCI_DEVICE_ID_INTEL_SKL_SQ_IMC 0x191f 18 + #define PCI_DEVICE_ID_INTEL_KBL_Y_IMC 0x590c 19 + #define PCI_DEVICE_ID_INTEL_KBL_U_IMC 0x5904 20 + #define PCI_DEVICE_ID_INTEL_KBL_UQ_IMC 0x5914 21 + #define PCI_DEVICE_ID_INTEL_KBL_SD_IMC 0x590f 22 + #define PCI_DEVICE_ID_INTEL_KBL_SQ_IMC 0x591f 23 + #define PCI_DEVICE_ID_INTEL_CFL_2U_IMC 0x3ecc 24 + #define PCI_DEVICE_ID_INTEL_CFL_4U_IMC 0x3ed0 25 + #define PCI_DEVICE_ID_INTEL_CFL_4H_IMC 0x3e10 26 + #define PCI_DEVICE_ID_INTEL_CFL_6H_IMC 0x3ec4 27 + #define PCI_DEVICE_ID_INTEL_CFL_2S_D_IMC 0x3e0f 28 + #define PCI_DEVICE_ID_INTEL_CFL_4S_D_IMC 0x3e1f 29 + #define PCI_DEVICE_ID_INTEL_CFL_6S_D_IMC 0x3ec2 30 + #define PCI_DEVICE_ID_INTEL_CFL_8S_D_IMC 0x3e30 31 + #define PCI_DEVICE_ID_INTEL_CFL_4S_W_IMC 0x3e18 32 + #define PCI_DEVICE_ID_INTEL_CFL_6S_W_IMC 0x3ec6 33 + #define PCI_DEVICE_ID_INTEL_CFL_8S_W_IMC 0x3e31 34 + #define PCI_DEVICE_ID_INTEL_CFL_4S_S_IMC 0x3e33 35 + #define PCI_DEVICE_ID_INTEL_CFL_6S_S_IMC 0x3eca 36 + #define PCI_DEVICE_ID_INTEL_CFL_8S_S_IMC 0x3e32 18 37 19 38 /* SNB event control */ 20 39 #define SNB_UNC_CTL_EV_SEL_MASK 0x000000ff ··· 221 202 wrmsrl(SKL_UNC_PERF_GLOBAL_CTL, 222 203 SNB_UNC_GLOBAL_CTL_EN | SKL_UNC_GLOBAL_CTL_CORE_ALL); 223 204 } 205 + 206 + /* The 8th CBOX has different MSR space */ 207 + if (box->pmu->pmu_idx == 7) 208 + __set_bit(UNCORE_BOX_FLAG_CFL8_CBOX_MSR_OFFS, &box->flags); 224 209 } 225 210 226 211 static void skl_uncore_msr_enable_box(struct intel_uncore_box *box) ··· 251 228 static struct intel_uncore_type skl_uncore_cbox = { 252 229 .name = "cbox", 253 230 .num_counters = 4, 254 - .num_boxes = 5, 231 + .num_boxes = 8, 255 232 .perf_ctr_bits = 44, 256 233 .fixed_ctr_bits = 48, 257 234 .perf_ctr = SNB_UNC_CBO_0_PER_CTR0, ··· 592 569 PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_SQ_IMC), 593 570 .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 594 571 }, 595 - 572 + { /* IMC */ 573 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_Y_IMC), 574 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 575 + }, 576 + { /* IMC */ 577 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_U_IMC), 578 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 579 + }, 580 + { /* IMC */ 581 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_UQ_IMC), 582 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 583 + }, 584 + { /* IMC */ 585 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_SD_IMC), 586 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 587 + }, 588 + { /* IMC */ 589 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_SQ_IMC), 590 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 591 + }, 592 + { /* IMC */ 593 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_2U_IMC), 594 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 595 + }, 596 + { /* IMC */ 597 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_4U_IMC), 598 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 599 + }, 600 + { /* IMC */ 601 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_4H_IMC), 602 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 603 + }, 604 + { /* IMC */ 605 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_6H_IMC), 606 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 607 + }, 608 + { /* IMC */ 609 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_2S_D_IMC), 610 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 611 + }, 612 + { /* IMC */ 613 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_4S_D_IMC), 614 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 615 + }, 616 + { /* IMC */ 617 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_6S_D_IMC), 618 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 619 + }, 620 + { /* IMC */ 621 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_8S_D_IMC), 622 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 623 + }, 624 + { /* IMC */ 625 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_4S_W_IMC), 626 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 627 + }, 628 + { /* IMC */ 629 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_6S_W_IMC), 630 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 631 + }, 632 + { /* IMC */ 633 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_8S_W_IMC), 634 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 635 + }, 636 + { /* IMC */ 637 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_4S_S_IMC), 638 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 639 + }, 640 + { /* IMC */ 641 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_6S_S_IMC), 642 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 643 + }, 644 + { /* IMC */ 645 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CFL_8S_S_IMC), 646 + .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), 647 + }, 596 648 { /* end: all zeroes */ }, 597 649 }; 598 650 ··· 716 618 IMC_DEV(SKL_HQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core H Quad Core */ 717 619 IMC_DEV(SKL_SD_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Dual Core */ 718 620 IMC_DEV(SKL_SQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Quad Core */ 621 + IMC_DEV(KBL_Y_IMC, &skl_uncore_pci_driver), /* 7th Gen Core Y */ 622 + IMC_DEV(KBL_U_IMC, &skl_uncore_pci_driver), /* 7th Gen Core U */ 623 + IMC_DEV(KBL_UQ_IMC, &skl_uncore_pci_driver), /* 7th Gen Core U Quad Core */ 624 + IMC_DEV(KBL_SD_IMC, &skl_uncore_pci_driver), /* 7th Gen Core S Dual Core */ 625 + IMC_DEV(KBL_SQ_IMC, &skl_uncore_pci_driver), /* 7th Gen Core S Quad Core */ 626 + IMC_DEV(CFL_2U_IMC, &skl_uncore_pci_driver), /* 8th Gen Core U 2 Cores */ 627 + IMC_DEV(CFL_4U_IMC, &skl_uncore_pci_driver), /* 8th Gen Core U 4 Cores */ 628 + IMC_DEV(CFL_4H_IMC, &skl_uncore_pci_driver), /* 8th Gen Core H 4 Cores */ 629 + IMC_DEV(CFL_6H_IMC, &skl_uncore_pci_driver), /* 8th Gen Core H 6 Cores */ 630 + IMC_DEV(CFL_2S_D_IMC, &skl_uncore_pci_driver), /* 8th Gen Core S 2 Cores Desktop */ 631 + IMC_DEV(CFL_4S_D_IMC, &skl_uncore_pci_driver), /* 8th Gen Core S 4 Cores Desktop */ 632 + IMC_DEV(CFL_6S_D_IMC, &skl_uncore_pci_driver), /* 8th Gen Core S 6 Cores Desktop */ 633 + IMC_DEV(CFL_8S_D_IMC, &skl_uncore_pci_driver), /* 8th Gen Core S 8 Cores Desktop */ 634 + IMC_DEV(CFL_4S_W_IMC, &skl_uncore_pci_driver), /* 8th Gen Core S 4 Cores Work Station */ 635 + IMC_DEV(CFL_6S_W_IMC, &skl_uncore_pci_driver), /* 8th Gen Core S 6 Cores Work Station */ 636 + IMC_DEV(CFL_8S_W_IMC, &skl_uncore_pci_driver), /* 8th Gen Core S 8 Cores Work Station */ 637 + IMC_DEV(CFL_4S_S_IMC, &skl_uncore_pci_driver), /* 8th Gen Core S 4 Cores Server */ 638 + IMC_DEV(CFL_6S_S_IMC, &skl_uncore_pci_driver), /* 8th Gen Core S 6 Cores Server */ 639 + IMC_DEV(CFL_8S_S_IMC, &skl_uncore_pci_driver), /* 8th Gen Core S 8 Cores Server */ 719 640 { /* end marker */ } 720 641 }; 721 642
+5 -1
arch/xtensa/include/asm/processor.h
··· 23 23 # error Linux requires the Xtensa Windowed Registers Option. 24 24 #endif 25 25 26 - #define ARCH_SLAB_MINALIGN XCHAL_DATA_WIDTH 26 + /* Xtensa ABI requires stack alignment to be at least 16 */ 27 + 28 + #define STACK_ALIGN (XCHAL_DATA_WIDTH > 16 ? XCHAL_DATA_WIDTH : 16) 29 + 30 + #define ARCH_SLAB_MINALIGN STACK_ALIGN 27 31 28 32 /* 29 33 * User space process size: 1 GB.
+5 -2
arch/xtensa/kernel/head.S
··· 88 88 initialize_mmu 89 89 #if defined(CONFIG_MMU) && XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY 90 90 rsr a2, excsave1 91 - movi a3, 0x08000000 91 + movi a3, XCHAL_KSEG_PADDR 92 + bltu a2, a3, 1f 93 + sub a2, a2, a3 94 + movi a3, XCHAL_KSEG_SIZE 92 95 bgeu a2, a3, 1f 93 - movi a3, 0xd0000000 96 + movi a3, XCHAL_KSEG_CACHED_VADDR 94 97 add a2, a2, a3 95 98 wsr a2, excsave1 96 99 1:
+1
block/bio.c
··· 605 605 if (bio_flagged(bio_src, BIO_THROTTLED)) 606 606 bio_set_flag(bio, BIO_THROTTLED); 607 607 bio->bi_opf = bio_src->bi_opf; 608 + bio->bi_ioprio = bio_src->bi_ioprio; 608 609 bio->bi_write_hint = bio_src->bi_write_hint; 609 610 bio->bi_iter = bio_src->bi_iter; 610 611 bio->bi_io_vec = bio_src->bi_io_vec;
+2 -3
block/blk-core.c
··· 798 798 * dispatch may still be in-progress since we dispatch requests 799 799 * from more than one contexts. 800 800 * 801 - * No need to quiesce queue if it isn't initialized yet since 802 - * blk_freeze_queue() should be enough for cases of passthrough 803 - * request. 801 + * We rely on driver to deal with the race in case that queue 802 + * initialization isn't done. 804 803 */ 805 804 if (q->mq_ops && blk_queue_init_done(q)) 806 805 blk_mq_quiesce_queue(q);
+3 -1
block/blk-lib.c
··· 55 55 return -EINVAL; 56 56 57 57 while (nr_sects) { 58 - unsigned int req_sects = min_t(unsigned int, nr_sects, 58 + sector_t req_sects = min_t(sector_t, nr_sects, 59 59 bio_allowed_max_sectors(q)); 60 + 61 + WARN_ON_ONCE((req_sects << 9) > UINT_MAX); 60 62 61 63 bio = blk_next_bio(bio, 0, gfp_mask); 62 64 bio->bi_iter.bi_sector = sector;
+1
block/bounce.c
··· 248 248 return NULL; 249 249 bio->bi_disk = bio_src->bi_disk; 250 250 bio->bi_opf = bio_src->bi_opf; 251 + bio->bi_ioprio = bio_src->bi_ioprio; 251 252 bio->bi_write_hint = bio_src->bi_write_hint; 252 253 bio->bi_iter.bi_sector = bio_src->bi_iter.bi_sector; 253 254 bio->bi_iter.bi_size = bio_src->bi_iter.bi_size;
+9 -9
crypto/crypto_user_base.c
··· 84 84 { 85 85 struct crypto_report_cipher rcipher; 86 86 87 - strlcpy(rcipher.type, "cipher", sizeof(rcipher.type)); 87 + strncpy(rcipher.type, "cipher", sizeof(rcipher.type)); 88 88 89 89 rcipher.blocksize = alg->cra_blocksize; 90 90 rcipher.min_keysize = alg->cra_cipher.cia_min_keysize; ··· 103 103 { 104 104 struct crypto_report_comp rcomp; 105 105 106 - strlcpy(rcomp.type, "compression", sizeof(rcomp.type)); 106 + strncpy(rcomp.type, "compression", sizeof(rcomp.type)); 107 107 if (nla_put(skb, CRYPTOCFGA_REPORT_COMPRESS, 108 108 sizeof(struct crypto_report_comp), &rcomp)) 109 109 goto nla_put_failure; ··· 117 117 { 118 118 struct crypto_report_acomp racomp; 119 119 120 - strlcpy(racomp.type, "acomp", sizeof(racomp.type)); 120 + strncpy(racomp.type, "acomp", sizeof(racomp.type)); 121 121 122 122 if (nla_put(skb, CRYPTOCFGA_REPORT_ACOMP, 123 123 sizeof(struct crypto_report_acomp), &racomp)) ··· 132 132 { 133 133 struct crypto_report_akcipher rakcipher; 134 134 135 - strlcpy(rakcipher.type, "akcipher", sizeof(rakcipher.type)); 135 + strncpy(rakcipher.type, "akcipher", sizeof(rakcipher.type)); 136 136 137 137 if (nla_put(skb, CRYPTOCFGA_REPORT_AKCIPHER, 138 138 sizeof(struct crypto_report_akcipher), &rakcipher)) ··· 147 147 { 148 148 struct crypto_report_kpp rkpp; 149 149 150 - strlcpy(rkpp.type, "kpp", sizeof(rkpp.type)); 150 + strncpy(rkpp.type, "kpp", sizeof(rkpp.type)); 151 151 152 152 if (nla_put(skb, CRYPTOCFGA_REPORT_KPP, 153 153 sizeof(struct crypto_report_kpp), &rkpp)) ··· 161 161 static int crypto_report_one(struct crypto_alg *alg, 162 162 struct crypto_user_alg *ualg, struct sk_buff *skb) 163 163 { 164 - strlcpy(ualg->cru_name, alg->cra_name, sizeof(ualg->cru_name)); 165 - strlcpy(ualg->cru_driver_name, alg->cra_driver_name, 164 + strncpy(ualg->cru_name, alg->cra_name, sizeof(ualg->cru_name)); 165 + strncpy(ualg->cru_driver_name, alg->cra_driver_name, 166 166 sizeof(ualg->cru_driver_name)); 167 - strlcpy(ualg->cru_module_name, module_name(alg->cra_module), 167 + strncpy(ualg->cru_module_name, module_name(alg->cra_module), 168 168 sizeof(ualg->cru_module_name)); 169 169 170 170 ualg->cru_type = 0; ··· 177 177 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { 178 178 struct crypto_report_larval rl; 179 179 180 - strlcpy(rl.type, "larval", sizeof(rl.type)); 180 + strncpy(rl.type, "larval", sizeof(rl.type)); 181 181 if (nla_put(skb, CRYPTOCFGA_REPORT_LARVAL, 182 182 sizeof(struct crypto_report_larval), &rl)) 183 183 goto nla_put_failure;
+21
crypto/crypto_user_stat.c
··· 37 37 u64 v64; 38 38 u32 v32; 39 39 40 + memset(&raead, 0, sizeof(raead)); 41 + 40 42 strncpy(raead.type, "aead", sizeof(raead.type)); 41 43 42 44 v32 = atomic_read(&alg->encrypt_cnt); ··· 66 64 struct crypto_stat rcipher; 67 65 u64 v64; 68 66 u32 v32; 67 + 68 + memset(&rcipher, 0, sizeof(rcipher)); 69 69 70 70 strlcpy(rcipher.type, "cipher", sizeof(rcipher.type)); 71 71 ··· 97 93 u64 v64; 98 94 u32 v32; 99 95 96 + memset(&rcomp, 0, sizeof(rcomp)); 97 + 100 98 strlcpy(rcomp.type, "compression", sizeof(rcomp.type)); 101 99 v32 = atomic_read(&alg->compress_cnt); 102 100 rcomp.stat_compress_cnt = v32; ··· 126 120 u64 v64; 127 121 u32 v32; 128 122 123 + memset(&racomp, 0, sizeof(racomp)); 124 + 129 125 strlcpy(racomp.type, "acomp", sizeof(racomp.type)); 130 126 v32 = atomic_read(&alg->compress_cnt); 131 127 racomp.stat_compress_cnt = v32; ··· 154 146 struct crypto_stat rakcipher; 155 147 u64 v64; 156 148 u32 v32; 149 + 150 + memset(&rakcipher, 0, sizeof(rakcipher)); 157 151 158 152 strncpy(rakcipher.type, "akcipher", sizeof(rakcipher.type)); 159 153 v32 = atomic_read(&alg->encrypt_cnt); ··· 187 177 struct crypto_stat rkpp; 188 178 u32 v; 189 179 180 + memset(&rkpp, 0, sizeof(rkpp)); 181 + 190 182 strlcpy(rkpp.type, "kpp", sizeof(rkpp.type)); 191 183 192 184 v = atomic_read(&alg->setsecret_cnt); ··· 215 203 u64 v64; 216 204 u32 v32; 217 205 206 + memset(&rhash, 0, sizeof(rhash)); 207 + 218 208 strncpy(rhash.type, "ahash", sizeof(rhash.type)); 219 209 220 210 v32 = atomic_read(&alg->hash_cnt); ··· 240 226 struct crypto_stat rhash; 241 227 u64 v64; 242 228 u32 v32; 229 + 230 + memset(&rhash, 0, sizeof(rhash)); 243 231 244 232 strncpy(rhash.type, "shash", sizeof(rhash.type)); 245 233 ··· 267 251 u64 v64; 268 252 u32 v32; 269 253 254 + memset(&rrng, 0, sizeof(rrng)); 255 + 270 256 strncpy(rrng.type, "rng", sizeof(rrng.type)); 271 257 272 258 v32 = atomic_read(&alg->generate_cnt); ··· 293 275 struct crypto_user_alg *ualg, 294 276 struct sk_buff *skb) 295 277 { 278 + memset(ualg, 0, sizeof(*ualg)); 279 + 296 280 strlcpy(ualg->cru_name, alg->cra_name, sizeof(ualg->cru_name)); 297 281 strlcpy(ualg->cru_driver_name, alg->cra_driver_name, 298 282 sizeof(ualg->cru_driver_name)); ··· 311 291 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { 312 292 struct crypto_stat rl; 313 293 294 + memset(&rl, 0, sizeof(rl)); 314 295 strlcpy(rl.type, "larval", sizeof(rl.type)); 315 296 if (nla_put(skb, CRYPTOCFGA_STAT_LARVAL, 316 297 sizeof(struct crypto_stat), &rl))
+3 -2
crypto/simd.c
··· 124 124 125 125 ctx->cryptd_tfm = cryptd_tfm; 126 126 127 - reqsize = sizeof(struct skcipher_request); 128 - reqsize += crypto_skcipher_reqsize(&cryptd_tfm->base); 127 + reqsize = crypto_skcipher_reqsize(cryptd_skcipher_child(cryptd_tfm)); 128 + reqsize = max(reqsize, crypto_skcipher_reqsize(&cryptd_tfm->base)); 129 + reqsize += sizeof(struct skcipher_request); 129 130 130 131 crypto_skcipher_set_reqsize(tfm, reqsize); 131 132
+1 -1
drivers/acpi/Kconfig
··· 512 512 513 513 config XPOWER_PMIC_OPREGION 514 514 bool "ACPI operation region support for XPower AXP288 PMIC" 515 - depends on MFD_AXP20X_I2C && IOSF_MBI 515 + depends on MFD_AXP20X_I2C && IOSF_MBI=y 516 516 help 517 517 This config adds ACPI operation region support for XPower AXP288 PMIC. 518 518
+5 -14
drivers/acpi/nfit/core.c
··· 2928 2928 return rc; 2929 2929 2930 2930 if (ars_status_process_records(acpi_desc)) 2931 - return -ENOMEM; 2931 + dev_err(acpi_desc->dev, "Failed to process ARS records\n"); 2932 2932 2933 - return 0; 2933 + return rc; 2934 2934 } 2935 2935 2936 2936 static int ars_register(struct acpi_nfit_desc *acpi_desc, ··· 3341 3341 struct nvdimm *nvdimm, unsigned int cmd) 3342 3342 { 3343 3343 struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc); 3344 - struct nfit_spa *nfit_spa; 3345 - int rc = 0; 3346 3344 3347 3345 if (nvdimm) 3348 3346 return 0; ··· 3353 3355 * just needs guarantees that any ARS it initiates are not 3354 3356 * interrupted by any intervening start requests from userspace. 3355 3357 */ 3356 - mutex_lock(&acpi_desc->init_mutex); 3357 - list_for_each_entry(nfit_spa, &acpi_desc->spas, list) 3358 - if (acpi_desc->scrub_spa 3359 - || test_bit(ARS_REQ_SHORT, &nfit_spa->ars_state) 3360 - || test_bit(ARS_REQ_LONG, &nfit_spa->ars_state)) { 3361 - rc = -EBUSY; 3362 - break; 3363 - } 3364 - mutex_unlock(&acpi_desc->init_mutex); 3358 + if (work_busy(&acpi_desc->dwork.work)) 3359 + return -EBUSY; 3365 3360 3366 - return rc; 3361 + return 0; 3367 3362 } 3368 3363 3369 3364 int acpi_nfit_ars_rescan(struct acpi_nfit_desc *acpi_desc,
+1 -1
drivers/ata/libata-core.c
··· 4553 4553 /* These specific Samsung models/firmware-revs do not handle LPM well */ 4554 4554 { "SAMSUNG MZMPC128HBFU-000MV", "CXM14M1Q", ATA_HORKAGE_NOLPM, }, 4555 4555 { "SAMSUNG SSD PM830 mSATA *", "CXM13D1Q", ATA_HORKAGE_NOLPM, }, 4556 - { "SAMSUNG MZ7TD256HAFV-000L9", "DXT02L5Q", ATA_HORKAGE_NOLPM, }, 4556 + { "SAMSUNG MZ7TD256HAFV-000L9", NULL, ATA_HORKAGE_NOLPM, }, 4557 4557 4558 4558 /* devices that don't properly handle queued TRIM commands */ 4559 4559 { "Micron_M500IT_*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM |
+2 -1
drivers/block/floppy.c
··· 4148 4148 bio.bi_end_io = floppy_rb0_cb; 4149 4149 bio_set_op_attrs(&bio, REQ_OP_READ, 0); 4150 4150 4151 + init_completion(&cbdata.complete); 4152 + 4151 4153 submit_bio(&bio); 4152 4154 process_fd_request(); 4153 4155 4154 - init_completion(&cbdata.complete); 4155 4156 wait_for_completion(&cbdata.complete); 4156 4157 4157 4158 __free_page(page);
+6 -1
drivers/cpufreq/imx6q-cpufreq.c
··· 160 160 /* Ensure the arm clock divider is what we expect */ 161 161 ret = clk_set_rate(clks[ARM].clk, new_freq * 1000); 162 162 if (ret) { 163 + int ret1; 164 + 163 165 dev_err(cpu_dev, "failed to set clock rate: %d\n", ret); 164 - regulator_set_voltage_tol(arm_reg, volt_old, 0); 166 + ret1 = regulator_set_voltage_tol(arm_reg, volt_old, 0); 167 + if (ret1) 168 + dev_warn(cpu_dev, 169 + "failed to restore vddarm voltage: %d\n", ret1); 165 170 return ret; 166 171 } 167 172
+7 -33
drivers/cpuidle/cpuidle-arm.c
··· 82 82 { 83 83 int ret; 84 84 struct cpuidle_driver *drv; 85 - struct cpuidle_device *dev; 86 85 87 86 drv = kmemdup(&arm_idle_driver, sizeof(*drv), GFP_KERNEL); 88 87 if (!drv) ··· 102 103 goto out_kfree_drv; 103 104 } 104 105 105 - ret = cpuidle_register_driver(drv); 106 - if (ret) { 107 - if (ret != -EBUSY) 108 - pr_err("Failed to register cpuidle driver\n"); 109 - goto out_kfree_drv; 110 - } 111 - 112 106 /* 113 107 * Call arch CPU operations in order to initialize 114 108 * idle states suspend back-end specific data ··· 109 117 ret = arm_cpuidle_init(cpu); 110 118 111 119 /* 112 - * Skip the cpuidle device initialization if the reported 120 + * Allow the initialization to continue for other CPUs, if the reported 113 121 * failure is a HW misconfiguration/breakage (-ENXIO). 114 122 */ 115 - if (ret == -ENXIO) 116 - return 0; 117 - 118 123 if (ret) { 119 124 pr_err("CPU %d failed to init idle CPU ops\n", cpu); 120 - goto out_unregister_drv; 125 + ret = ret == -ENXIO ? 0 : ret; 126 + goto out_kfree_drv; 121 127 } 122 128 123 - dev = kzalloc(sizeof(*dev), GFP_KERNEL); 124 - if (!dev) { 125 - ret = -ENOMEM; 126 - goto out_unregister_drv; 127 - } 128 - dev->cpu = cpu; 129 - 130 - ret = cpuidle_register_device(dev); 131 - if (ret) { 132 - pr_err("Failed to register cpuidle device for CPU %d\n", 133 - cpu); 134 - goto out_kfree_dev; 135 - } 129 + ret = cpuidle_register(drv, NULL); 130 + if (ret) 131 + goto out_kfree_drv; 136 132 137 133 return 0; 138 134 139 - out_kfree_dev: 140 - kfree(dev); 141 - out_unregister_drv: 142 - cpuidle_unregister_driver(drv); 143 135 out_kfree_drv: 144 136 kfree(drv); 145 137 return ret; ··· 154 178 while (--cpu >= 0) { 155 179 dev = per_cpu(cpuidle_devices, cpu); 156 180 drv = cpuidle_get_cpu_driver(dev); 157 - cpuidle_unregister_device(dev); 158 - cpuidle_unregister_driver(drv); 159 - kfree(dev); 181 + cpuidle_unregister(drv); 160 182 kfree(drv); 161 183 } 162 184
+17 -14
drivers/crypto/hisilicon/sec/sec_algs.c
··· 732 732 int *splits_in_nents; 733 733 int *splits_out_nents = NULL; 734 734 struct sec_request_el *el, *temp; 735 + bool split = skreq->src != skreq->dst; 735 736 736 737 mutex_init(&sec_req->lock); 737 738 sec_req->req_base = &skreq->base; ··· 751 750 if (ret) 752 751 goto err_free_split_sizes; 753 752 754 - if (skreq->src != skreq->dst) { 753 + if (split) { 755 754 sec_req->len_out = sg_nents(skreq->dst); 756 755 ret = sec_map_and_split_sg(skreq->dst, split_sizes, steps, 757 756 &splits_out, &splits_out_nents, ··· 786 785 split_sizes[i], 787 786 skreq->src != skreq->dst, 788 787 splits_in[i], splits_in_nents[i], 789 - splits_out[i], 790 - splits_out_nents[i], info); 788 + split ? splits_out[i] : NULL, 789 + split ? splits_out_nents[i] : 0, 790 + info); 791 791 if (IS_ERR(el)) { 792 792 ret = PTR_ERR(el); 793 793 goto err_free_elements; ··· 808 806 * more refined but this is unlikely to happen so no need. 809 807 */ 810 808 811 - /* Cleanup - all elements in pointer arrays have been coppied */ 812 - kfree(splits_in_nents); 813 - kfree(splits_in); 814 - kfree(splits_out_nents); 815 - kfree(splits_out); 816 - kfree(split_sizes); 817 - 818 809 /* Grab a big lock for a long time to avoid concurrency issues */ 819 810 mutex_lock(&queue->queuelock); 820 811 ··· 822 827 (!queue->havesoftqueue || 823 828 kfifo_avail(&queue->softqueue) > steps)) || 824 829 !list_empty(&ctx->backlog)) { 830 + ret = -EBUSY; 825 831 if ((skreq->base.flags & CRYPTO_TFM_REQ_MAY_BACKLOG)) { 826 832 list_add_tail(&sec_req->backlog_head, &ctx->backlog); 827 833 mutex_unlock(&queue->queuelock); 828 - return -EBUSY; 834 + goto out; 829 835 } 830 836 831 - ret = -EBUSY; 832 837 mutex_unlock(&queue->queuelock); 833 838 goto err_free_elements; 834 839 } ··· 837 842 if (ret) 838 843 goto err_free_elements; 839 844 840 - return -EINPROGRESS; 845 + ret = -EINPROGRESS; 846 + out: 847 + /* Cleanup - all elements in pointer arrays have been copied */ 848 + kfree(splits_in_nents); 849 + kfree(splits_in); 850 + kfree(splits_out_nents); 851 + kfree(splits_out); 852 + kfree(split_sizes); 853 + return ret; 841 854 842 855 err_free_elements: 843 856 list_for_each_entry_safe(el, temp, &sec_req->elements, head) { ··· 857 854 crypto_skcipher_ivsize(atfm), 858 855 DMA_BIDIRECTIONAL); 859 856 err_unmap_out_sg: 860 - if (skreq->src != skreq->dst) 857 + if (split) 861 858 sec_unmap_sg_on_err(skreq->dst, steps, splits_out, 862 859 splits_out_nents, sec_req->len_out, 863 860 info->dev);
+4
drivers/firmware/efi/arm-init.c
··· 265 265 (params.mmap & ~PAGE_MASK))); 266 266 267 267 init_screen_info(); 268 + 269 + /* ARM does not permit early mappings to persist across paging_init() */ 270 + if (IS_ENABLED(CONFIG_ARM)) 271 + efi_memmap_unmap(); 268 272 } 269 273 270 274 static int __init register_gop_device(void)
+1 -1
drivers/firmware/efi/arm-runtime.c
··· 110 110 { 111 111 u64 mapsize; 112 112 113 - if (!efi_enabled(EFI_BOOT) || !efi_enabled(EFI_MEMMAP)) { 113 + if (!efi_enabled(EFI_BOOT)) { 114 114 pr_info("EFI services will not be available.\n"); 115 115 return 0; 116 116 }
+24 -13
drivers/firmware/efi/efi.c
··· 592 592 593 593 early_memunmap(tbl, sizeof(*tbl)); 594 594 } 595 + return 0; 596 + } 595 597 598 + int __init efi_apply_persistent_mem_reservations(void) 599 + { 596 600 if (efi.mem_reserve != EFI_INVALID_TABLE_ADDR) { 597 601 unsigned long prsv = efi.mem_reserve; 598 602 ··· 967 963 } 968 964 969 965 static DEFINE_SPINLOCK(efi_mem_reserve_persistent_lock); 966 + static struct linux_efi_memreserve *efi_memreserve_root __ro_after_init; 970 967 971 968 int efi_mem_reserve_persistent(phys_addr_t addr, u64 size) 972 969 { 973 - struct linux_efi_memreserve *rsv, *parent; 970 + struct linux_efi_memreserve *rsv; 974 971 975 - if (efi.mem_reserve == EFI_INVALID_TABLE_ADDR) 972 + if (!efi_memreserve_root) 976 973 return -ENODEV; 977 974 978 - rsv = kmalloc(sizeof(*rsv), GFP_KERNEL); 975 + rsv = kmalloc(sizeof(*rsv), GFP_ATOMIC); 979 976 if (!rsv) 980 977 return -ENOMEM; 981 - 982 - parent = memremap(efi.mem_reserve, sizeof(*rsv), MEMREMAP_WB); 983 - if (!parent) { 984 - kfree(rsv); 985 - return -ENOMEM; 986 - } 987 978 988 979 rsv->base = addr; 989 980 rsv->size = size; 990 981 991 982 spin_lock(&efi_mem_reserve_persistent_lock); 992 - rsv->next = parent->next; 993 - parent->next = __pa(rsv); 983 + rsv->next = efi_memreserve_root->next; 984 + efi_memreserve_root->next = __pa(rsv); 994 985 spin_unlock(&efi_mem_reserve_persistent_lock); 995 - 996 - memunmap(parent); 997 986 998 987 return 0; 999 988 } 989 + 990 + static int __init efi_memreserve_root_init(void) 991 + { 992 + if (efi.mem_reserve == EFI_INVALID_TABLE_ADDR) 993 + return -ENODEV; 994 + 995 + efi_memreserve_root = memremap(efi.mem_reserve, 996 + sizeof(*efi_memreserve_root), 997 + MEMREMAP_WB); 998 + if (!efi_memreserve_root) 999 + return -ENOMEM; 1000 + return 0; 1001 + } 1002 + early_initcall(efi_memreserve_root_init); 1000 1003 1001 1004 #ifdef CONFIG_KEXEC 1002 1005 static int update_efi_random_seed(struct notifier_block *nb,
+3
drivers/firmware/efi/libstub/arm-stub.c
··· 75 75 efi_guid_t memreserve_table_guid = LINUX_EFI_MEMRESERVE_TABLE_GUID; 76 76 efi_status_t status; 77 77 78 + if (IS_ENABLED(CONFIG_ARM)) 79 + return; 80 + 78 81 status = efi_call_early(allocate_pool, EFI_LOADER_DATA, sizeof(*rsv), 79 82 (void **)&rsv); 80 83 if (status != EFI_SUCCESS) {
+4
drivers/firmware/efi/libstub/fdt.c
··· 158 158 return efi_status; 159 159 } 160 160 } 161 + 162 + /* shrink the FDT back to its minimum size */ 163 + fdt_pack(fdt); 164 + 161 165 return EFI_SUCCESS; 162 166 163 167 fdt_set_fail:
+3
drivers/firmware/efi/memmap.c
··· 118 118 119 119 void __init efi_memmap_unmap(void) 120 120 { 121 + if (!efi_enabled(EFI_MEMMAP)) 122 + return; 123 + 121 124 if (!efi.memmap.late) { 122 125 unsigned long size; 123 126
+1 -1
drivers/firmware/efi/runtime-wrappers.c
··· 67 67 } \ 68 68 \ 69 69 init_completion(&efi_rts_work.efi_rts_comp); \ 70 - INIT_WORK_ONSTACK(&efi_rts_work.work, efi_call_rts); \ 70 + INIT_WORK(&efi_rts_work.work, efi_call_rts); \ 71 71 efi_rts_work.arg1 = _arg1; \ 72 72 efi_rts_work.arg2 = _arg2; \ 73 73 efi_rts_work.arg3 = _arg3; \
+10 -8
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
··· 1632 1632 continue; 1633 1633 } 1634 1634 1635 - /* First check if the entry is already handled */ 1636 - if (cursor.pfn < frag_start) { 1637 - cursor.entry->huge = true; 1638 - amdgpu_vm_pt_next(adev, &cursor); 1639 - continue; 1640 - } 1641 - 1642 1635 /* If it isn't already handled it can't be a huge page */ 1643 1636 if (cursor.entry->huge) { 1644 1637 /* Add the entry to the relocated list to update it. */ ··· 1694 1701 } 1695 1702 } while (frag_start < entry_end); 1696 1703 1697 - if (frag >= shift) 1704 + if (amdgpu_vm_pt_descendant(adev, &cursor)) { 1705 + /* Mark all child entries as huge */ 1706 + while (cursor.pfn < frag_start) { 1707 + cursor.entry->huge = true; 1708 + amdgpu_vm_pt_next(adev, &cursor); 1709 + } 1710 + 1711 + } else if (frag >= shift) { 1712 + /* or just move on to the next on the same level. */ 1698 1713 amdgpu_vm_pt_next(adev, &cursor); 1714 + } 1699 1715 } 1700 1716 1701 1717 return 0;
+3 -3
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
··· 72 72 73 73 /* Program the system aperture low logical page number. */ 74 74 WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_LOW_ADDR, 75 - min(adev->gmc.vram_start, adev->gmc.agp_start) >> 18); 75 + min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18); 76 76 77 77 if (adev->asic_type == CHIP_RAVEN && adev->rev_id >= 0x8) 78 78 /* ··· 82 82 * to get rid of the VM fault and hardware hang. 83 83 */ 84 84 WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR, 85 - max((adev->gmc.vram_end >> 18) + 0x1, 85 + max((adev->gmc.fb_end >> 18) + 0x1, 86 86 adev->gmc.agp_end >> 18)); 87 87 else 88 88 WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR, 89 - max(adev->gmc.vram_end, adev->gmc.agp_end) >> 18); 89 + max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18); 90 90 91 91 /* Set default page address. */ 92 92 value = adev->vram_scratch.gpu_addr - adev->gmc.vram_start
+3 -3
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
··· 90 90 91 91 /* Program the system aperture low logical page number. */ 92 92 WREG32_SOC15(MMHUB, 0, mmMC_VM_SYSTEM_APERTURE_LOW_ADDR, 93 - min(adev->gmc.vram_start, adev->gmc.agp_start) >> 18); 93 + min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18); 94 94 95 95 if (adev->asic_type == CHIP_RAVEN && adev->rev_id >= 0x8) 96 96 /* ··· 100 100 * to get rid of the VM fault and hardware hang. 101 101 */ 102 102 WREG32_SOC15(MMHUB, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR, 103 - max((adev->gmc.vram_end >> 18) + 0x1, 103 + max((adev->gmc.fb_end >> 18) + 0x1, 104 104 adev->gmc.agp_end >> 18)); 105 105 else 106 106 WREG32_SOC15(MMHUB, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR, 107 - max(adev->gmc.vram_end, adev->gmc.agp_end) >> 18); 107 + max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18); 108 108 109 109 /* Set default page address. */ 110 110 value = adev->vram_scratch.gpu_addr - adev->gmc.vram_start +
+1 -1
drivers/gpu/drm/amd/amdgpu/vega10_ih.c
··· 129 129 else 130 130 wptr_off = adev->wb.gpu_addr + (adev->irq.ih.wptr_offs * 4); 131 131 WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_ADDR_LO, lower_32_bits(wptr_off)); 132 - WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_ADDR_HI, upper_32_bits(wptr_off) & 0xFF); 132 + WREG32_SOC15(OSSSYS, 0, mmIH_RB_WPTR_ADDR_HI, upper_32_bits(wptr_off) & 0xFFFF); 133 133 134 134 /* set rptr, wptr to 0 */ 135 135 WREG32_SOC15(OSSSYS, 0, mmIH_RB_RPTR, 0);
+16 -16
drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.c
··· 713 713 for (i = 0; i < wm_with_clock_ranges->num_wm_dmif_sets; i++) { 714 714 table->WatermarkRow[1][i].MinClock = 715 715 cpu_to_le16((uint16_t) 716 - (wm_with_clock_ranges->wm_dmif_clocks_ranges[i].wm_min_dcfclk_clk_in_khz) / 717 - 1000); 716 + (wm_with_clock_ranges->wm_dmif_clocks_ranges[i].wm_min_dcfclk_clk_in_khz / 717 + 1000)); 718 718 table->WatermarkRow[1][i].MaxClock = 719 719 cpu_to_le16((uint16_t) 720 - (wm_with_clock_ranges->wm_dmif_clocks_ranges[i].wm_max_dcfclk_clk_in_khz) / 721 - 1000); 720 + (wm_with_clock_ranges->wm_dmif_clocks_ranges[i].wm_max_dcfclk_clk_in_khz / 721 + 1000)); 722 722 table->WatermarkRow[1][i].MinUclk = 723 723 cpu_to_le16((uint16_t) 724 - (wm_with_clock_ranges->wm_dmif_clocks_ranges[i].wm_min_mem_clk_in_khz) / 725 - 1000); 724 + (wm_with_clock_ranges->wm_dmif_clocks_ranges[i].wm_min_mem_clk_in_khz / 725 + 1000)); 726 726 table->WatermarkRow[1][i].MaxUclk = 727 727 cpu_to_le16((uint16_t) 728 - (wm_with_clock_ranges->wm_dmif_clocks_ranges[i].wm_max_mem_clk_in_khz) / 729 - 1000); 728 + (wm_with_clock_ranges->wm_dmif_clocks_ranges[i].wm_max_mem_clk_in_khz / 729 + 1000)); 730 730 table->WatermarkRow[1][i].WmSetting = (uint8_t) 731 731 wm_with_clock_ranges->wm_dmif_clocks_ranges[i].wm_set_id; 732 732 } ··· 734 734 for (i = 0; i < wm_with_clock_ranges->num_wm_mcif_sets; i++) { 735 735 table->WatermarkRow[0][i].MinClock = 736 736 cpu_to_le16((uint16_t) 737 - (wm_with_clock_ranges->wm_mcif_clocks_ranges[i].wm_min_socclk_clk_in_khz) / 738 - 1000); 737 + (wm_with_clock_ranges->wm_mcif_clocks_ranges[i].wm_min_socclk_clk_in_khz / 738 + 1000)); 739 739 table->WatermarkRow[0][i].MaxClock = 740 740 cpu_to_le16((uint16_t) 741 - (wm_with_clock_ranges->wm_mcif_clocks_ranges[i].wm_max_socclk_clk_in_khz) / 742 - 1000); 741 + (wm_with_clock_ranges->wm_mcif_clocks_ranges[i].wm_max_socclk_clk_in_khz / 742 + 1000)); 743 743 table->WatermarkRow[0][i].MinUclk = 744 744 cpu_to_le16((uint16_t) 745 - (wm_with_clock_ranges->wm_mcif_clocks_ranges[i].wm_min_mem_clk_in_khz) / 746 - 1000); 745 + (wm_with_clock_ranges->wm_mcif_clocks_ranges[i].wm_min_mem_clk_in_khz / 746 + 1000)); 747 747 table->WatermarkRow[0][i].MaxUclk = 748 748 cpu_to_le16((uint16_t) 749 - (wm_with_clock_ranges->wm_mcif_clocks_ranges[i].wm_max_mem_clk_in_khz) / 750 - 1000); 749 + (wm_with_clock_ranges->wm_mcif_clocks_ranges[i].wm_max_mem_clk_in_khz / 750 + 1000)); 751 751 table->WatermarkRow[0][i].WmSetting = (uint8_t) 752 752 wm_with_clock_ranges->wm_mcif_clocks_ranges[i].wm_set_id; 753 753 }
+3
drivers/gpu/drm/drm_dp_mst_topology.c
··· 1275 1275 mutex_lock(&mgr->lock); 1276 1276 mstb = mgr->mst_primary; 1277 1277 1278 + if (!mstb) 1279 + goto out; 1280 + 1278 1281 for (i = 0; i < lct - 1; i++) { 1279 1282 int shift = (i % 2) ? 0 : 4; 1280 1283 int port_num = (rad[i / 2] >> shift) & 0xf;
+1 -1
drivers/gpu/drm/drm_fourcc.c
··· 97 97 98 98 /** 99 99 * drm_driver_legacy_fb_format - compute drm fourcc code from legacy description 100 + * @dev: DRM device 100 101 * @bpp: bits per pixels 101 102 * @depth: bit depth per pixel 102 - * @native: use host native byte order 103 103 * 104 104 * Computes a drm fourcc pixel format code for the given @bpp/@depth values. 105 105 * Unlike drm_mode_legacy_fb_format() this looks at the drivers mode_config,
+1 -1
drivers/gpu/drm/i915/intel_device_info.c
··· 474 474 u8 eu_disabled_mask; 475 475 u32 n_disabled; 476 476 477 - if (!(sseu->subslice_mask[ss] & BIT(ss))) 477 + if (!(sseu->subslice_mask[s] & BIT(ss))) 478 478 /* skip disabled subslice */ 479 479 continue; 480 480
+42 -3
drivers/gpu/drm/i915/intel_display.c
··· 4850 4850 * chroma samples for both of the luma samples, and thus we don't 4851 4851 * actually get the expected MPEG2 chroma siting convention :( 4852 4852 * The same behaviour is observed on pre-SKL platforms as well. 4853 + * 4854 + * Theory behind the formula (note that we ignore sub-pixel 4855 + * source coordinates): 4856 + * s = source sample position 4857 + * d = destination sample position 4858 + * 4859 + * Downscaling 4:1: 4860 + * -0.5 4861 + * | 0.0 4862 + * | | 1.5 (initial phase) 4863 + * | | | 4864 + * v v v 4865 + * | s | s | s | s | 4866 + * | d | 4867 + * 4868 + * Upscaling 1:4: 4869 + * -0.5 4870 + * | -0.375 (initial phase) 4871 + * | | 0.0 4872 + * | | | 4873 + * v v v 4874 + * | s | 4875 + * | d | d | d | d | 4853 4876 */ 4854 - u16 skl_scaler_calc_phase(int sub, bool chroma_cosited) 4877 + u16 skl_scaler_calc_phase(int sub, int scale, bool chroma_cosited) 4855 4878 { 4856 4879 int phase = -0x8000; 4857 4880 u16 trip = 0; 4858 4881 4859 4882 if (chroma_cosited) 4860 4883 phase += (sub - 1) * 0x8000 / sub; 4884 + 4885 + phase += scale / (2 * sub); 4886 + 4887 + /* 4888 + * Hardware initial phase limited to [-0.5:1.5]. 4889 + * Since the max hardware scale factor is 3.0, we 4890 + * should never actually excdeed 1.0 here. 4891 + */ 4892 + WARN_ON(phase < -0x8000 || phase > 0x18000); 4861 4893 4862 4894 if (phase < 0) 4863 4895 phase = 0x10000 + phase; ··· 5099 5067 5100 5068 if (crtc->config->pch_pfit.enabled) { 5101 5069 u16 uv_rgb_hphase, uv_rgb_vphase; 5070 + int pfit_w, pfit_h, hscale, vscale; 5102 5071 int id; 5103 5072 5104 5073 if (WARN_ON(crtc->config->scaler_state.scaler_id < 0)) 5105 5074 return; 5106 5075 5107 - uv_rgb_hphase = skl_scaler_calc_phase(1, false); 5108 - uv_rgb_vphase = skl_scaler_calc_phase(1, false); 5076 + pfit_w = (crtc->config->pch_pfit.size >> 16) & 0xFFFF; 5077 + pfit_h = crtc->config->pch_pfit.size & 0xFFFF; 5078 + 5079 + hscale = (crtc->config->pipe_src_w << 16) / pfit_w; 5080 + vscale = (crtc->config->pipe_src_h << 16) / pfit_h; 5081 + 5082 + uv_rgb_hphase = skl_scaler_calc_phase(1, hscale, false); 5083 + uv_rgb_vphase = skl_scaler_calc_phase(1, vscale, false); 5109 5084 5110 5085 id = scaler_state->scaler_id; 5111 5086 I915_WRITE(SKL_PS_CTRL(pipe, id), PS_SCALER_EN |
+4 -4
drivers/gpu/drm/i915/intel_dp_mst.c
··· 452 452 if (!intel_connector) 453 453 return NULL; 454 454 455 + intel_connector->get_hw_state = intel_dp_mst_get_hw_state; 456 + intel_connector->mst_port = intel_dp; 457 + intel_connector->port = port; 458 + 455 459 connector = &intel_connector->base; 456 460 ret = drm_connector_init(dev, connector, &intel_dp_mst_connector_funcs, 457 461 DRM_MODE_CONNECTOR_DisplayPort); ··· 465 461 } 466 462 467 463 drm_connector_helper_add(connector, &intel_dp_mst_connector_helper_funcs); 468 - 469 - intel_connector->get_hw_state = intel_dp_mst_get_hw_state; 470 - intel_connector->mst_port = intel_dp; 471 - intel_connector->port = port; 472 464 473 465 for_each_pipe(dev_priv, pipe) { 474 466 struct drm_encoder *enc =
+1 -1
drivers/gpu/drm/i915/intel_drv.h
··· 1646 1646 void intel_crtc_arm_fifo_underrun(struct intel_crtc *crtc, 1647 1647 struct intel_crtc_state *crtc_state); 1648 1648 1649 - u16 skl_scaler_calc_phase(int sub, bool chroma_center); 1649 + u16 skl_scaler_calc_phase(int sub, int scale, bool chroma_center); 1650 1650 int skl_update_scaler_crtc(struct intel_crtc_state *crtc_state); 1651 1651 int skl_max_scale(const struct intel_crtc_state *crtc_state, 1652 1652 u32 pixel_format);
+52 -22
drivers/gpu/drm/i915/intel_hotplug.c
··· 228 228 drm_for_each_connector_iter(connector, &conn_iter) { 229 229 struct intel_connector *intel_connector = to_intel_connector(connector); 230 230 231 - if (intel_connector->encoder->hpd_pin == pin) { 231 + /* Don't check MST ports, they don't have pins */ 232 + if (!intel_connector->mst_port && 233 + intel_connector->encoder->hpd_pin == pin) { 232 234 if (connector->polled != intel_connector->polled) 233 235 DRM_DEBUG_DRIVER("Reenabling HPD on connector %s\n", 234 236 connector->name); ··· 397 395 struct intel_encoder *encoder; 398 396 bool storm_detected = false; 399 397 bool queue_dig = false, queue_hp = false; 398 + u32 long_hpd_pulse_mask = 0; 399 + u32 short_hpd_pulse_mask = 0; 400 + enum hpd_pin pin; 400 401 401 402 if (!pin_mask) 402 403 return; 403 404 404 405 spin_lock(&dev_priv->irq_lock); 405 - for_each_intel_encoder(&dev_priv->drm, encoder) { 406 - enum hpd_pin pin = encoder->hpd_pin; 407 - bool has_hpd_pulse = intel_encoder_has_hpd_pulse(encoder); 408 406 407 + /* 408 + * Determine whether ->hpd_pulse() exists for each pin, and 409 + * whether we have a short or a long pulse. This is needed 410 + * as each pin may have up to two encoders (HDMI and DP) and 411 + * only the one of them (DP) will have ->hpd_pulse(). 412 + */ 413 + for_each_intel_encoder(&dev_priv->drm, encoder) { 414 + bool has_hpd_pulse = intel_encoder_has_hpd_pulse(encoder); 415 + enum port port = encoder->port; 416 + bool long_hpd; 417 + 418 + pin = encoder->hpd_pin; 409 419 if (!(BIT(pin) & pin_mask)) 410 420 continue; 411 421 412 - if (has_hpd_pulse) { 413 - bool long_hpd = long_mask & BIT(pin); 414 - enum port port = encoder->port; 422 + if (!has_hpd_pulse) 423 + continue; 415 424 416 - DRM_DEBUG_DRIVER("digital hpd port %c - %s\n", port_name(port), 417 - long_hpd ? "long" : "short"); 418 - /* 419 - * For long HPD pulses we want to have the digital queue happen, 420 - * but we still want HPD storm detection to function. 421 - */ 422 - queue_dig = true; 423 - if (long_hpd) { 424 - dev_priv->hotplug.long_port_mask |= (1 << port); 425 - } else { 426 - /* for short HPD just trigger the digital queue */ 427 - dev_priv->hotplug.short_port_mask |= (1 << port); 428 - continue; 429 - } 425 + long_hpd = long_mask & BIT(pin); 426 + 427 + DRM_DEBUG_DRIVER("digital hpd port %c - %s\n", port_name(port), 428 + long_hpd ? "long" : "short"); 429 + queue_dig = true; 430 + 431 + if (long_hpd) { 432 + long_hpd_pulse_mask |= BIT(pin); 433 + dev_priv->hotplug.long_port_mask |= BIT(port); 434 + } else { 435 + short_hpd_pulse_mask |= BIT(pin); 436 + dev_priv->hotplug.short_port_mask |= BIT(port); 430 437 } 438 + } 439 + 440 + /* Now process each pin just once */ 441 + for_each_hpd_pin(pin) { 442 + bool long_hpd; 443 + 444 + if (!(BIT(pin) & pin_mask)) 445 + continue; 431 446 432 447 if (dev_priv->hotplug.stats[pin].state == HPD_DISABLED) { 433 448 /* ··· 461 442 if (dev_priv->hotplug.stats[pin].state != HPD_ENABLED) 462 443 continue; 463 444 464 - if (!has_hpd_pulse) { 445 + /* 446 + * Delegate to ->hpd_pulse() if one of the encoders for this 447 + * pin has it, otherwise let the hotplug_work deal with this 448 + * pin directly. 449 + */ 450 + if (((short_hpd_pulse_mask | long_hpd_pulse_mask) & BIT(pin))) { 451 + long_hpd = long_hpd_pulse_mask & BIT(pin); 452 + } else { 465 453 dev_priv->hotplug.event_bits |= BIT(pin); 454 + long_hpd = true; 466 455 queue_hp = true; 467 456 } 457 + 458 + if (!long_hpd) 459 + continue; 468 460 469 461 if (intel_hpd_irq_storm_detect(dev_priv, pin)) { 470 462 dev_priv->hotplug.event_bits &= ~BIT(pin);
+13 -1
drivers/gpu/drm/i915/intel_lrc.c
··· 424 424 425 425 reg_state[CTX_RING_TAIL+1] = intel_ring_set_tail(rq->ring, rq->tail); 426 426 427 - /* True 32b PPGTT with dynamic page allocation: update PDP 427 + /* 428 + * True 32b PPGTT with dynamic page allocation: update PDP 428 429 * registers and point the unallocated PDPs to scratch page. 429 430 * PML4 is allocated during ppgtt init, so this is not needed 430 431 * in 48-bit mode. ··· 433 432 if (ppgtt && !i915_vm_is_48bit(&ppgtt->vm)) 434 433 execlists_update_context_pdps(ppgtt, reg_state); 435 434 435 + /* 436 + * Make sure the context image is complete before we submit it to HW. 437 + * 438 + * Ostensibly, writes (including the WCB) should be flushed prior to 439 + * an uncached write such as our mmio register access, the empirical 440 + * evidence (esp. on Braswell) suggests that the WC write into memory 441 + * may not be visible to the HW prior to the completion of the UC 442 + * register write and that we may begin execution from the context 443 + * before its image is complete leading to invalid PD chasing. 444 + */ 445 + wmb(); 436 446 return ce->lrc_desc; 437 447 } 438 448
+36 -2
drivers/gpu/drm/i915/intel_ringbuffer.c
··· 91 91 gen4_render_ring_flush(struct i915_request *rq, u32 mode) 92 92 { 93 93 u32 cmd, *cs; 94 + int i; 94 95 95 96 /* 96 97 * read/write caches: ··· 128 127 cmd |= MI_INVALIDATE_ISP; 129 128 } 130 129 131 - cs = intel_ring_begin(rq, 2); 130 + i = 2; 131 + if (mode & EMIT_INVALIDATE) 132 + i += 20; 133 + 134 + cs = intel_ring_begin(rq, i); 132 135 if (IS_ERR(cs)) 133 136 return PTR_ERR(cs); 134 137 135 138 *cs++ = cmd; 136 - *cs++ = MI_NOOP; 139 + 140 + /* 141 + * A random delay to let the CS invalidate take effect? Without this 142 + * delay, the GPU relocation path fails as the CS does not see 143 + * the updated contents. Just as important, if we apply the flushes 144 + * to the EMIT_FLUSH branch (i.e. immediately after the relocation 145 + * write and before the invalidate on the next batch), the relocations 146 + * still fail. This implies that is a delay following invalidation 147 + * that is required to reset the caches as opposed to a delay to 148 + * ensure the memory is written. 149 + */ 150 + if (mode & EMIT_INVALIDATE) { 151 + *cs++ = GFX_OP_PIPE_CONTROL(4) | PIPE_CONTROL_QW_WRITE; 152 + *cs++ = i915_ggtt_offset(rq->engine->scratch) | 153 + PIPE_CONTROL_GLOBAL_GTT; 154 + *cs++ = 0; 155 + *cs++ = 0; 156 + 157 + for (i = 0; i < 12; i++) 158 + *cs++ = MI_FLUSH; 159 + 160 + *cs++ = GFX_OP_PIPE_CONTROL(4) | PIPE_CONTROL_QW_WRITE; 161 + *cs++ = i915_ggtt_offset(rq->engine->scratch) | 162 + PIPE_CONTROL_GLOBAL_GTT; 163 + *cs++ = 0; 164 + *cs++ = 0; 165 + } 166 + 167 + *cs++ = cmd; 168 + 137 169 intel_ring_advance(rq, cs); 138 170 139 171 return 0;
+7 -9
drivers/gpu/drm/i915/intel_runtime_pm.c
··· 2749 2749 }, 2750 2750 }, 2751 2751 { 2752 + .name = "DC off", 2753 + .domains = ICL_DISPLAY_DC_OFF_POWER_DOMAINS, 2754 + .ops = &gen9_dc_off_power_well_ops, 2755 + .id = DISP_PW_ID_NONE, 2756 + }, 2757 + { 2752 2758 .name = "power well 2", 2753 2759 .domains = ICL_PW_2_POWER_DOMAINS, 2754 2760 .ops = &hsw_power_well_ops, ··· 2764 2758 .hsw.idx = ICL_PW_CTL_IDX_PW_2, 2765 2759 .hsw.has_fuses = true, 2766 2760 }, 2767 - }, 2768 - { 2769 - .name = "DC off", 2770 - .domains = ICL_DISPLAY_DC_OFF_POWER_DOMAINS, 2771 - .ops = &gen9_dc_off_power_well_ops, 2772 - .id = DISP_PW_ID_NONE, 2773 2761 }, 2774 2762 { 2775 2763 .name = "power well 3", ··· 3176 3176 void icl_dbuf_slices_update(struct drm_i915_private *dev_priv, 3177 3177 u8 req_slices) 3178 3178 { 3179 - u8 hw_enabled_slices = dev_priv->wm.skl_hw.ddb.enabled_slices; 3180 - u32 val; 3179 + const u8 hw_enabled_slices = dev_priv->wm.skl_hw.ddb.enabled_slices; 3181 3180 bool ret; 3182 3181 3183 3182 if (req_slices > intel_dbuf_max_slices(dev_priv)) { ··· 3187 3188 if (req_slices == hw_enabled_slices || req_slices == 0) 3188 3189 return; 3189 3190 3190 - val = I915_READ(DBUF_CTL_S2); 3191 3191 if (req_slices > hw_enabled_slices) 3192 3192 ret = intel_dbuf_slice_set(dev_priv, DBUF_CTL_S2, true); 3193 3193 else
+54 -39
drivers/gpu/drm/i915/intel_sprite.c
··· 302 302 return min(8192 * cpp, 32768); 303 303 } 304 304 305 + static void 306 + skl_program_scaler(struct intel_plane *plane, 307 + const struct intel_crtc_state *crtc_state, 308 + const struct intel_plane_state *plane_state) 309 + { 310 + struct drm_i915_private *dev_priv = to_i915(plane->base.dev); 311 + enum pipe pipe = plane->pipe; 312 + int scaler_id = plane_state->scaler_id; 313 + const struct intel_scaler *scaler = 314 + &crtc_state->scaler_state.scalers[scaler_id]; 315 + int crtc_x = plane_state->base.dst.x1; 316 + int crtc_y = plane_state->base.dst.y1; 317 + uint32_t crtc_w = drm_rect_width(&plane_state->base.dst); 318 + uint32_t crtc_h = drm_rect_height(&plane_state->base.dst); 319 + u16 y_hphase, uv_rgb_hphase; 320 + u16 y_vphase, uv_rgb_vphase; 321 + int hscale, vscale; 322 + 323 + hscale = drm_rect_calc_hscale(&plane_state->base.src, 324 + &plane_state->base.dst, 325 + 0, INT_MAX); 326 + vscale = drm_rect_calc_vscale(&plane_state->base.src, 327 + &plane_state->base.dst, 328 + 0, INT_MAX); 329 + 330 + /* TODO: handle sub-pixel coordinates */ 331 + if (plane_state->base.fb->format->format == DRM_FORMAT_NV12) { 332 + y_hphase = skl_scaler_calc_phase(1, hscale, false); 333 + y_vphase = skl_scaler_calc_phase(1, vscale, false); 334 + 335 + /* MPEG2 chroma siting convention */ 336 + uv_rgb_hphase = skl_scaler_calc_phase(2, hscale, true); 337 + uv_rgb_vphase = skl_scaler_calc_phase(2, vscale, false); 338 + } else { 339 + /* not used */ 340 + y_hphase = 0; 341 + y_vphase = 0; 342 + 343 + uv_rgb_hphase = skl_scaler_calc_phase(1, hscale, false); 344 + uv_rgb_vphase = skl_scaler_calc_phase(1, vscale, false); 345 + } 346 + 347 + I915_WRITE_FW(SKL_PS_CTRL(pipe, scaler_id), 348 + PS_SCALER_EN | PS_PLANE_SEL(plane->id) | scaler->mode); 349 + I915_WRITE_FW(SKL_PS_PWR_GATE(pipe, scaler_id), 0); 350 + I915_WRITE_FW(SKL_PS_VPHASE(pipe, scaler_id), 351 + PS_Y_PHASE(y_vphase) | PS_UV_RGB_PHASE(uv_rgb_vphase)); 352 + I915_WRITE_FW(SKL_PS_HPHASE(pipe, scaler_id), 353 + PS_Y_PHASE(y_hphase) | PS_UV_RGB_PHASE(uv_rgb_hphase)); 354 + I915_WRITE_FW(SKL_PS_WIN_POS(pipe, scaler_id), (crtc_x << 16) | crtc_y); 355 + I915_WRITE_FW(SKL_PS_WIN_SZ(pipe, scaler_id), (crtc_w << 16) | crtc_h); 356 + } 357 + 305 358 void 306 359 skl_update_plane(struct intel_plane *plane, 307 360 const struct intel_crtc_state *crtc_state, 308 361 const struct intel_plane_state *plane_state) 309 362 { 310 363 struct drm_i915_private *dev_priv = to_i915(plane->base.dev); 311 - const struct drm_framebuffer *fb = plane_state->base.fb; 312 364 enum plane_id plane_id = plane->id; 313 365 enum pipe pipe = plane->pipe; 314 366 u32 plane_ctl = plane_state->ctl; ··· 370 318 u32 aux_stride = skl_plane_stride(plane_state, 1); 371 319 int crtc_x = plane_state->base.dst.x1; 372 320 int crtc_y = plane_state->base.dst.y1; 373 - uint32_t crtc_w = drm_rect_width(&plane_state->base.dst); 374 - uint32_t crtc_h = drm_rect_height(&plane_state->base.dst); 375 321 uint32_t x = plane_state->color_plane[0].x; 376 322 uint32_t y = plane_state->color_plane[0].y; 377 323 uint32_t src_w = drm_rect_width(&plane_state->base.src) >> 16; ··· 379 329 /* Sizes are 0 based */ 380 330 src_w--; 381 331 src_h--; 382 - crtc_w--; 383 - crtc_h--; 384 332 385 333 spin_lock_irqsave(&dev_priv->uncore.lock, irqflags); 386 334 ··· 401 353 (plane_state->color_plane[1].y << 16) | 402 354 plane_state->color_plane[1].x); 403 355 404 - /* program plane scaler */ 405 356 if (plane_state->scaler_id >= 0) { 406 - int scaler_id = plane_state->scaler_id; 407 - const struct intel_scaler *scaler = 408 - &crtc_state->scaler_state.scalers[scaler_id]; 409 - u16 y_hphase, uv_rgb_hphase; 410 - u16 y_vphase, uv_rgb_vphase; 411 - 412 - /* TODO: handle sub-pixel coordinates */ 413 - if (fb->format->format == DRM_FORMAT_NV12) { 414 - y_hphase = skl_scaler_calc_phase(1, false); 415 - y_vphase = skl_scaler_calc_phase(1, false); 416 - 417 - /* MPEG2 chroma siting convention */ 418 - uv_rgb_hphase = skl_scaler_calc_phase(2, true); 419 - uv_rgb_vphase = skl_scaler_calc_phase(2, false); 420 - } else { 421 - /* not used */ 422 - y_hphase = 0; 423 - y_vphase = 0; 424 - 425 - uv_rgb_hphase = skl_scaler_calc_phase(1, false); 426 - uv_rgb_vphase = skl_scaler_calc_phase(1, false); 427 - } 428 - 429 - I915_WRITE_FW(SKL_PS_CTRL(pipe, scaler_id), 430 - PS_SCALER_EN | PS_PLANE_SEL(plane_id) | scaler->mode); 431 - I915_WRITE_FW(SKL_PS_PWR_GATE(pipe, scaler_id), 0); 432 - I915_WRITE_FW(SKL_PS_VPHASE(pipe, scaler_id), 433 - PS_Y_PHASE(y_vphase) | PS_UV_RGB_PHASE(uv_rgb_vphase)); 434 - I915_WRITE_FW(SKL_PS_HPHASE(pipe, scaler_id), 435 - PS_Y_PHASE(y_hphase) | PS_UV_RGB_PHASE(uv_rgb_hphase)); 436 - I915_WRITE_FW(SKL_PS_WIN_POS(pipe, scaler_id), (crtc_x << 16) | crtc_y); 437 - I915_WRITE_FW(SKL_PS_WIN_SZ(pipe, scaler_id), 438 - ((crtc_w + 1) << 16)|(crtc_h + 1)); 357 + skl_program_scaler(plane, crtc_state, plane_state); 439 358 440 359 I915_WRITE_FW(PLANE_POS(pipe, plane_id), 0); 441 360 } else {
+8 -7
drivers/gpu/drm/meson/meson_venc.c
··· 854 854 unsigned int sof_lines; 855 855 unsigned int vsync_lines; 856 856 857 + /* Use VENCI for 480i and 576i and double HDMI pixels */ 858 + if (mode->flags & DRM_MODE_FLAG_DBLCLK) { 859 + hdmi_repeat = true; 860 + use_enci = true; 861 + venc_hdmi_latency = 1; 862 + } 863 + 857 864 if (meson_venc_hdmi_supported_vic(vic)) { 858 865 vmode = meson_venc_hdmi_get_vic_vmode(vic); 859 866 if (!vmode) { ··· 872 865 } else { 873 866 meson_venc_hdmi_get_dmt_vmode(mode, &vmode_dmt); 874 867 vmode = &vmode_dmt; 875 - } 876 - 877 - /* Use VENCI for 480i and 576i and double HDMI pixels */ 878 - if (mode->flags & DRM_MODE_FLAG_DBLCLK) { 879 - hdmi_repeat = true; 880 - use_enci = true; 881 - venc_hdmi_latency = 1; 868 + use_enci = false; 882 869 } 883 870 884 871 /* Repeat VENC pixels for 480/576i/p, 720p50/60 and 1080p50/60 */
+11 -11
drivers/gpu/drm/omapdrm/dss/dsi.c
··· 5409 5409 5410 5410 /* DSI on OMAP3 doesn't have register DSI_GNQ, set number 5411 5411 * of data to 3 by default */ 5412 - if (dsi->data->quirks & DSI_QUIRK_GNQ) 5412 + if (dsi->data->quirks & DSI_QUIRK_GNQ) { 5413 + dsi_runtime_get(dsi); 5413 5414 /* NB_DATA_LANES */ 5414 5415 dsi->num_lanes_supported = 1 + REG_GET(dsi, DSI_GNQ, 11, 9); 5415 - else 5416 + dsi_runtime_put(dsi); 5417 + } else { 5416 5418 dsi->num_lanes_supported = 3; 5419 + } 5417 5420 5418 5421 r = dsi_init_output(dsi); 5419 5422 if (r) ··· 5429 5426 } 5430 5427 5431 5428 r = of_platform_populate(dev->of_node, NULL, NULL, dev); 5432 - if (r) 5429 + if (r) { 5433 5430 DSSERR("Failed to populate DSI child devices: %d\n", r); 5431 + goto err_uninit_output; 5432 + } 5434 5433 5435 5434 r = component_add(&pdev->dev, &dsi_component_ops); 5436 5435 if (r) 5437 - goto err_uninit_output; 5436 + goto err_of_depopulate; 5438 5437 5439 5438 return 0; 5440 5439 5440 + err_of_depopulate: 5441 + of_platform_depopulate(dev); 5441 5442 err_uninit_output: 5442 5443 dsi_uninit_output(dsi); 5443 5444 err_pm_disable: ··· 5477 5470 /* wait for current handler to finish before turning the DSI off */ 5478 5471 synchronize_irq(dsi->irq); 5479 5472 5480 - dispc_runtime_put(dsi->dss->dispc); 5481 - 5482 5473 return 0; 5483 5474 } 5484 5475 5485 5476 static int dsi_runtime_resume(struct device *dev) 5486 5477 { 5487 5478 struct dsi_data *dsi = dev_get_drvdata(dev); 5488 - int r; 5489 - 5490 - r = dispc_runtime_get(dsi->dss->dispc); 5491 - if (r) 5492 - return r; 5493 5479 5494 5480 dsi->is_enabled = true; 5495 5481 /* ensure the irq handler sees the is_enabled value */
+10 -1
drivers/gpu/drm/omapdrm/dss/dss.c
··· 1484 1484 dss); 1485 1485 1486 1486 /* Add all the child devices as components. */ 1487 + r = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); 1488 + if (r) 1489 + goto err_uninit_debugfs; 1490 + 1487 1491 omapdss_gather_components(&pdev->dev); 1488 1492 1489 1493 device_for_each_child(&pdev->dev, &match, dss_add_child_component); 1490 1494 1491 1495 r = component_master_add_with_match(&pdev->dev, &dss_component_ops, match); 1492 1496 if (r) 1493 - goto err_uninit_debugfs; 1497 + goto err_of_depopulate; 1494 1498 1495 1499 return 0; 1500 + 1501 + err_of_depopulate: 1502 + of_platform_depopulate(&pdev->dev); 1496 1503 1497 1504 err_uninit_debugfs: 1498 1505 dss_debugfs_remove_file(dss->debugfs.clk); ··· 1528 1521 static int dss_remove(struct platform_device *pdev) 1529 1522 { 1530 1523 struct dss_device *dss = platform_get_drvdata(pdev); 1524 + 1525 + of_platform_depopulate(&pdev->dev); 1531 1526 1532 1527 component_master_del(&pdev->dev, &dss_component_ops); 1533 1528
+9 -28
drivers/gpu/drm/omapdrm/dss/hdmi4.c
··· 635 635 636 636 hdmi->dss = dss; 637 637 638 - r = hdmi_pll_init(dss, hdmi->pdev, &hdmi->pll, &hdmi->wp); 638 + r = hdmi_runtime_get(hdmi); 639 639 if (r) 640 640 return r; 641 + 642 + r = hdmi_pll_init(dss, hdmi->pdev, &hdmi->pll, &hdmi->wp); 643 + if (r) 644 + goto err_runtime_put; 641 645 642 646 r = hdmi4_cec_init(hdmi->pdev, &hdmi->core, &hdmi->wp); 643 647 if (r) ··· 656 652 hdmi->debugfs = dss_debugfs_create_file(dss, "hdmi", hdmi_dump_regs, 657 653 hdmi); 658 654 655 + hdmi_runtime_put(hdmi); 656 + 659 657 return 0; 660 658 661 659 err_cec_uninit: 662 660 hdmi4_cec_uninit(&hdmi->core); 663 661 err_pll_uninit: 664 662 hdmi_pll_uninit(&hdmi->pll); 663 + err_runtime_put: 664 + hdmi_runtime_put(hdmi); 665 665 return r; 666 666 } 667 667 ··· 841 833 return 0; 842 834 } 843 835 844 - static int hdmi_runtime_suspend(struct device *dev) 845 - { 846 - struct omap_hdmi *hdmi = dev_get_drvdata(dev); 847 - 848 - dispc_runtime_put(hdmi->dss->dispc); 849 - 850 - return 0; 851 - } 852 - 853 - static int hdmi_runtime_resume(struct device *dev) 854 - { 855 - struct omap_hdmi *hdmi = dev_get_drvdata(dev); 856 - int r; 857 - 858 - r = dispc_runtime_get(hdmi->dss->dispc); 859 - if (r < 0) 860 - return r; 861 - 862 - return 0; 863 - } 864 - 865 - static const struct dev_pm_ops hdmi_pm_ops = { 866 - .runtime_suspend = hdmi_runtime_suspend, 867 - .runtime_resume = hdmi_runtime_resume, 868 - }; 869 - 870 836 static const struct of_device_id hdmi_of_match[] = { 871 837 { .compatible = "ti,omap4-hdmi", }, 872 838 {}, ··· 851 869 .remove = hdmi4_remove, 852 870 .driver = { 853 871 .name = "omapdss_hdmi", 854 - .pm = &hdmi_pm_ops, 855 872 .of_match_table = hdmi_of_match, 856 873 .suppress_bind_attrs = true, 857 874 },
-27
drivers/gpu/drm/omapdrm/dss/hdmi5.c
··· 825 825 return 0; 826 826 } 827 827 828 - static int hdmi_runtime_suspend(struct device *dev) 829 - { 830 - struct omap_hdmi *hdmi = dev_get_drvdata(dev); 831 - 832 - dispc_runtime_put(hdmi->dss->dispc); 833 - 834 - return 0; 835 - } 836 - 837 - static int hdmi_runtime_resume(struct device *dev) 838 - { 839 - struct omap_hdmi *hdmi = dev_get_drvdata(dev); 840 - int r; 841 - 842 - r = dispc_runtime_get(hdmi->dss->dispc); 843 - if (r < 0) 844 - return r; 845 - 846 - return 0; 847 - } 848 - 849 - static const struct dev_pm_ops hdmi_pm_ops = { 850 - .runtime_suspend = hdmi_runtime_suspend, 851 - .runtime_resume = hdmi_runtime_resume, 852 - }; 853 - 854 828 static const struct of_device_id hdmi_of_match[] = { 855 829 { .compatible = "ti,omap5-hdmi", }, 856 830 { .compatible = "ti,dra7-hdmi", }, ··· 836 862 .remove = hdmi5_remove, 837 863 .driver = { 838 864 .name = "omapdss_hdmi5", 839 - .pm = &hdmi_pm_ops, 840 865 .of_match_table = hdmi_of_match, 841 866 .suppress_bind_attrs = true, 842 867 },
-7
drivers/gpu/drm/omapdrm/dss/venc.c
··· 946 946 if (venc->tv_dac_clk) 947 947 clk_disable_unprepare(venc->tv_dac_clk); 948 948 949 - dispc_runtime_put(venc->dss->dispc); 950 - 951 949 return 0; 952 950 } 953 951 954 952 static int venc_runtime_resume(struct device *dev) 955 953 { 956 954 struct venc_device *venc = dev_get_drvdata(dev); 957 - int r; 958 - 959 - r = dispc_runtime_get(venc->dss->dispc); 960 - if (r < 0) 961 - return r; 962 955 963 956 if (venc->tv_dac_clk) 964 957 clk_prepare_enable(venc->tv_dac_clk);
+6
drivers/gpu/drm/omapdrm/omap_crtc.c
··· 350 350 static void omap_crtc_atomic_enable(struct drm_crtc *crtc, 351 351 struct drm_crtc_state *old_state) 352 352 { 353 + struct omap_drm_private *priv = crtc->dev->dev_private; 353 354 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 354 355 int ret; 355 356 356 357 DBG("%s", omap_crtc->name); 358 + 359 + priv->dispc_ops->runtime_get(priv->dispc); 357 360 358 361 spin_lock_irq(&crtc->dev->event_lock); 359 362 drm_crtc_vblank_on(crtc); ··· 370 367 static void omap_crtc_atomic_disable(struct drm_crtc *crtc, 371 368 struct drm_crtc_state *old_state) 372 369 { 370 + struct omap_drm_private *priv = crtc->dev->dev_private; 373 371 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 374 372 375 373 DBG("%s", omap_crtc->name); ··· 383 379 spin_unlock_irq(&crtc->dev->event_lock); 384 380 385 381 drm_crtc_vblank_off(crtc); 382 + 383 + priv->dispc_ops->runtime_put(priv->dispc); 386 384 } 387 385 388 386 static enum drm_mode_status omap_crtc_mode_valid(struct drm_crtc *crtc,
+35 -13
drivers/net/can/dev.c
··· 477 477 } 478 478 EXPORT_SYMBOL_GPL(can_put_echo_skb); 479 479 480 + struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8 *len_ptr) 481 + { 482 + struct can_priv *priv = netdev_priv(dev); 483 + struct sk_buff *skb = priv->echo_skb[idx]; 484 + struct canfd_frame *cf; 485 + 486 + if (idx >= priv->echo_skb_max) { 487 + netdev_err(dev, "%s: BUG! Trying to access can_priv::echo_skb out of bounds (%u/max %u)\n", 488 + __func__, idx, priv->echo_skb_max); 489 + return NULL; 490 + } 491 + 492 + if (!skb) { 493 + netdev_err(dev, "%s: BUG! Trying to echo non existing skb: can_priv::echo_skb[%u]\n", 494 + __func__, idx); 495 + return NULL; 496 + } 497 + 498 + /* Using "struct canfd_frame::len" for the frame 499 + * length is supported on both CAN and CANFD frames. 500 + */ 501 + cf = (struct canfd_frame *)skb->data; 502 + *len_ptr = cf->len; 503 + priv->echo_skb[idx] = NULL; 504 + 505 + return skb; 506 + } 507 + 480 508 /* 481 509 * Get the skb from the stack and loop it back locally 482 510 * ··· 514 486 */ 515 487 unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx) 516 488 { 517 - struct can_priv *priv = netdev_priv(dev); 489 + struct sk_buff *skb; 490 + u8 len; 518 491 519 - BUG_ON(idx >= priv->echo_skb_max); 492 + skb = __can_get_echo_skb(dev, idx, &len); 493 + if (!skb) 494 + return 0; 520 495 521 - if (priv->echo_skb[idx]) { 522 - struct sk_buff *skb = priv->echo_skb[idx]; 523 - struct can_frame *cf = (struct can_frame *)skb->data; 524 - u8 dlc = cf->can_dlc; 496 + netif_rx(skb); 525 497 526 - netif_rx(priv->echo_skb[idx]); 527 - priv->echo_skb[idx] = NULL; 528 - 529 - return dlc; 530 - } 531 - 532 - return 0; 498 + return len; 533 499 } 534 500 EXPORT_SYMBOL_GPL(can_get_echo_skb); 535 501
+60 -48
drivers/net/can/flexcan.c
··· 135 135 136 136 /* FLEXCAN interrupt flag register (IFLAG) bits */ 137 137 /* Errata ERR005829 step7: Reserve first valid MB */ 138 - #define FLEXCAN_TX_MB_RESERVED_OFF_FIFO 8 139 - #define FLEXCAN_TX_MB_OFF_FIFO 9 138 + #define FLEXCAN_TX_MB_RESERVED_OFF_FIFO 8 140 139 #define FLEXCAN_TX_MB_RESERVED_OFF_TIMESTAMP 0 141 - #define FLEXCAN_TX_MB_OFF_TIMESTAMP 1 142 - #define FLEXCAN_RX_MB_OFF_TIMESTAMP_FIRST (FLEXCAN_TX_MB_OFF_TIMESTAMP + 1) 143 - #define FLEXCAN_RX_MB_OFF_TIMESTAMP_LAST 63 144 - #define FLEXCAN_IFLAG_MB(x) BIT(x) 140 + #define FLEXCAN_TX_MB 63 141 + #define FLEXCAN_RX_MB_OFF_TIMESTAMP_FIRST (FLEXCAN_TX_MB_RESERVED_OFF_TIMESTAMP + 1) 142 + #define FLEXCAN_RX_MB_OFF_TIMESTAMP_LAST (FLEXCAN_TX_MB - 1) 143 + #define FLEXCAN_IFLAG_MB(x) BIT(x & 0x1f) 145 144 #define FLEXCAN_IFLAG_RX_FIFO_OVERFLOW BIT(7) 146 145 #define FLEXCAN_IFLAG_RX_FIFO_WARN BIT(6) 147 146 #define FLEXCAN_IFLAG_RX_FIFO_AVAILABLE BIT(5) ··· 258 259 struct can_rx_offload offload; 259 260 260 261 struct flexcan_regs __iomem *regs; 261 - struct flexcan_mb __iomem *tx_mb; 262 262 struct flexcan_mb __iomem *tx_mb_reserved; 263 - u8 tx_mb_idx; 264 263 u32 reg_ctrl_default; 265 264 u32 reg_imask1_default; 266 265 u32 reg_imask2_default; ··· 512 515 static netdev_tx_t flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev) 513 516 { 514 517 const struct flexcan_priv *priv = netdev_priv(dev); 518 + struct flexcan_regs __iomem *regs = priv->regs; 515 519 struct can_frame *cf = (struct can_frame *)skb->data; 516 520 u32 can_id; 517 521 u32 data; ··· 535 537 536 538 if (cf->can_dlc > 0) { 537 539 data = be32_to_cpup((__be32 *)&cf->data[0]); 538 - priv->write(data, &priv->tx_mb->data[0]); 540 + priv->write(data, &regs->mb[FLEXCAN_TX_MB].data[0]); 539 541 } 540 542 if (cf->can_dlc > 4) { 541 543 data = be32_to_cpup((__be32 *)&cf->data[4]); 542 - priv->write(data, &priv->tx_mb->data[1]); 544 + priv->write(data, &regs->mb[FLEXCAN_TX_MB].data[1]); 543 545 } 544 546 545 547 can_put_echo_skb(skb, dev, 0); 546 548 547 - priv->write(can_id, &priv->tx_mb->can_id); 548 - priv->write(ctrl, &priv->tx_mb->can_ctrl); 549 + priv->write(can_id, &regs->mb[FLEXCAN_TX_MB].can_id); 550 + priv->write(ctrl, &regs->mb[FLEXCAN_TX_MB].can_ctrl); 549 551 550 552 /* Errata ERR005829 step8: 551 553 * Write twice INACTIVE(0x8) code to first MB. ··· 561 563 static void flexcan_irq_bus_err(struct net_device *dev, u32 reg_esr) 562 564 { 563 565 struct flexcan_priv *priv = netdev_priv(dev); 566 + struct flexcan_regs __iomem *regs = priv->regs; 564 567 struct sk_buff *skb; 565 568 struct can_frame *cf; 566 569 bool rx_errors = false, tx_errors = false; 570 + u32 timestamp; 571 + 572 + timestamp = priv->read(&regs->timer) << 16; 567 573 568 574 skb = alloc_can_err_skb(dev, &cf); 569 575 if (unlikely(!skb)) ··· 614 612 if (tx_errors) 615 613 dev->stats.tx_errors++; 616 614 617 - can_rx_offload_irq_queue_err_skb(&priv->offload, skb); 615 + can_rx_offload_queue_sorted(&priv->offload, skb, timestamp); 618 616 } 619 617 620 618 static void flexcan_irq_state(struct net_device *dev, u32 reg_esr) 621 619 { 622 620 struct flexcan_priv *priv = netdev_priv(dev); 621 + struct flexcan_regs __iomem *regs = priv->regs; 623 622 struct sk_buff *skb; 624 623 struct can_frame *cf; 625 624 enum can_state new_state, rx_state, tx_state; 626 625 int flt; 627 626 struct can_berr_counter bec; 627 + u32 timestamp; 628 + 629 + timestamp = priv->read(&regs->timer) << 16; 628 630 629 631 flt = reg_esr & FLEXCAN_ESR_FLT_CONF_MASK; 630 632 if (likely(flt == FLEXCAN_ESR_FLT_CONF_ACTIVE)) { ··· 658 652 if (unlikely(new_state == CAN_STATE_BUS_OFF)) 659 653 can_bus_off(dev); 660 654 661 - can_rx_offload_irq_queue_err_skb(&priv->offload, skb); 655 + can_rx_offload_queue_sorted(&priv->offload, skb, timestamp); 662 656 } 663 657 664 658 static inline struct flexcan_priv *rx_offload_to_priv(struct can_rx_offload *offload) ··· 726 720 priv->write(BIT(n - 32), &regs->iflag2); 727 721 } else { 728 722 priv->write(FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, &regs->iflag1); 729 - priv->read(&regs->timer); 730 723 } 724 + 725 + /* Read the Free Running Timer. It is optional but recommended 726 + * to unlock Mailbox as soon as possible and make it available 727 + * for reception. 728 + */ 729 + priv->read(&regs->timer); 731 730 732 731 return 1; 733 732 } ··· 743 732 struct flexcan_regs __iomem *regs = priv->regs; 744 733 u32 iflag1, iflag2; 745 734 746 - iflag2 = priv->read(&regs->iflag2) & priv->reg_imask2_default; 747 - iflag1 = priv->read(&regs->iflag1) & priv->reg_imask1_default & 748 - ~FLEXCAN_IFLAG_MB(priv->tx_mb_idx); 735 + iflag2 = priv->read(&regs->iflag2) & priv->reg_imask2_default & 736 + ~FLEXCAN_IFLAG_MB(FLEXCAN_TX_MB); 737 + iflag1 = priv->read(&regs->iflag1) & priv->reg_imask1_default; 749 738 750 739 return (u64)iflag2 << 32 | iflag1; 751 740 } ··· 757 746 struct flexcan_priv *priv = netdev_priv(dev); 758 747 struct flexcan_regs __iomem *regs = priv->regs; 759 748 irqreturn_t handled = IRQ_NONE; 760 - u32 reg_iflag1, reg_esr; 749 + u32 reg_iflag2, reg_esr; 761 750 enum can_state last_state = priv->can.state; 762 - 763 - reg_iflag1 = priv->read(&regs->iflag1); 764 751 765 752 /* reception interrupt */ 766 753 if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) { ··· 773 764 break; 774 765 } 775 766 } else { 767 + u32 reg_iflag1; 768 + 769 + reg_iflag1 = priv->read(&regs->iflag1); 776 770 if (reg_iflag1 & FLEXCAN_IFLAG_RX_FIFO_AVAILABLE) { 777 771 handled = IRQ_HANDLED; 778 772 can_rx_offload_irq_offload_fifo(&priv->offload); ··· 791 779 } 792 780 } 793 781 782 + reg_iflag2 = priv->read(&regs->iflag2); 783 + 794 784 /* transmission complete interrupt */ 795 - if (reg_iflag1 & FLEXCAN_IFLAG_MB(priv->tx_mb_idx)) { 785 + if (reg_iflag2 & FLEXCAN_IFLAG_MB(FLEXCAN_TX_MB)) { 786 + u32 reg_ctrl = priv->read(&regs->mb[FLEXCAN_TX_MB].can_ctrl); 787 + 796 788 handled = IRQ_HANDLED; 797 - stats->tx_bytes += can_get_echo_skb(dev, 0); 789 + stats->tx_bytes += can_rx_offload_get_echo_skb(&priv->offload, 790 + 0, reg_ctrl << 16); 798 791 stats->tx_packets++; 799 792 can_led_event(dev, CAN_LED_EVENT_TX); 800 793 801 794 /* after sending a RTR frame MB is in RX mode */ 802 795 priv->write(FLEXCAN_MB_CODE_TX_INACTIVE, 803 - &priv->tx_mb->can_ctrl); 804 - priv->write(FLEXCAN_IFLAG_MB(priv->tx_mb_idx), &regs->iflag1); 796 + &regs->mb[FLEXCAN_TX_MB].can_ctrl); 797 + priv->write(FLEXCAN_IFLAG_MB(FLEXCAN_TX_MB), &regs->iflag2); 805 798 netif_wake_queue(dev); 806 799 } 807 800 ··· 948 931 reg_mcr &= ~FLEXCAN_MCR_MAXMB(0xff); 949 932 reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT | FLEXCAN_MCR_SUPV | 950 933 FLEXCAN_MCR_WRN_EN | FLEXCAN_MCR_SRX_DIS | FLEXCAN_MCR_IRMQ | 951 - FLEXCAN_MCR_IDAM_C; 934 + FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_MAXMB(FLEXCAN_TX_MB); 952 935 953 - if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) { 936 + if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) 954 937 reg_mcr &= ~FLEXCAN_MCR_FEN; 955 - reg_mcr |= FLEXCAN_MCR_MAXMB(priv->offload.mb_last); 956 - } else { 957 - reg_mcr |= FLEXCAN_MCR_FEN | 958 - FLEXCAN_MCR_MAXMB(priv->tx_mb_idx); 959 - } 938 + else 939 + reg_mcr |= FLEXCAN_MCR_FEN; 940 + 960 941 netdev_dbg(dev, "%s: writing mcr=0x%08x", __func__, reg_mcr); 961 942 priv->write(reg_mcr, &regs->mcr); 962 943 ··· 997 982 priv->write(reg_ctrl2, &regs->ctrl2); 998 983 } 999 984 1000 - /* clear and invalidate all mailboxes first */ 1001 - for (i = priv->tx_mb_idx; i < ARRAY_SIZE(regs->mb); i++) { 1002 - priv->write(FLEXCAN_MB_CODE_RX_INACTIVE, 1003 - &regs->mb[i].can_ctrl); 1004 - } 1005 - 1006 985 if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) { 1007 - for (i = priv->offload.mb_first; i <= priv->offload.mb_last; i++) 986 + for (i = priv->offload.mb_first; i <= priv->offload.mb_last; i++) { 1008 987 priv->write(FLEXCAN_MB_CODE_RX_EMPTY, 1009 988 &regs->mb[i].can_ctrl); 989 + } 990 + } else { 991 + /* clear and invalidate unused mailboxes first */ 992 + for (i = FLEXCAN_TX_MB_RESERVED_OFF_FIFO; i <= ARRAY_SIZE(regs->mb); i++) { 993 + priv->write(FLEXCAN_MB_CODE_RX_INACTIVE, 994 + &regs->mb[i].can_ctrl); 995 + } 1010 996 } 1011 997 1012 998 /* Errata ERR005829: mark first TX mailbox as INACTIVE */ ··· 1016 1000 1017 1001 /* mark TX mailbox as INACTIVE */ 1018 1002 priv->write(FLEXCAN_MB_CODE_TX_INACTIVE, 1019 - &priv->tx_mb->can_ctrl); 1003 + &regs->mb[FLEXCAN_TX_MB].can_ctrl); 1020 1004 1021 1005 /* acceptance mask/acceptance code (accept everything) */ 1022 1006 priv->write(0x0, &regs->rxgmask); ··· 1371 1355 priv->devtype_data = devtype_data; 1372 1356 priv->reg_xceiver = reg_xceiver; 1373 1357 1374 - if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) { 1375 - priv->tx_mb_idx = FLEXCAN_TX_MB_OFF_TIMESTAMP; 1358 + if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) 1376 1359 priv->tx_mb_reserved = &regs->mb[FLEXCAN_TX_MB_RESERVED_OFF_TIMESTAMP]; 1377 - } else { 1378 - priv->tx_mb_idx = FLEXCAN_TX_MB_OFF_FIFO; 1360 + else 1379 1361 priv->tx_mb_reserved = &regs->mb[FLEXCAN_TX_MB_RESERVED_OFF_FIFO]; 1380 - } 1381 - priv->tx_mb = &regs->mb[priv->tx_mb_idx]; 1382 1362 1383 - priv->reg_imask1_default = FLEXCAN_IFLAG_MB(priv->tx_mb_idx); 1384 - priv->reg_imask2_default = 0; 1363 + priv->reg_imask1_default = 0; 1364 + priv->reg_imask2_default = FLEXCAN_IFLAG_MB(FLEXCAN_TX_MB); 1385 1365 1386 1366 priv->offload.mailbox_read = flexcan_mailbox_read; 1387 1367
+4 -1
drivers/net/can/rcar/rcar_can.c
··· 24 24 25 25 #define RCAR_CAN_DRV_NAME "rcar_can" 26 26 27 + #define RCAR_SUPPORTED_CLOCKS (BIT(CLKR_CLKP1) | BIT(CLKR_CLKP2) | \ 28 + BIT(CLKR_CLKEXT)) 29 + 27 30 /* Mailbox configuration: 28 31 * mailbox 60 - 63 - Rx FIFO mailboxes 29 32 * mailbox 56 - 59 - Tx FIFO mailboxes ··· 792 789 goto fail_clk; 793 790 } 794 791 795 - if (clock_select >= ARRAY_SIZE(clock_names)) { 792 + if (!(BIT(clock_select) & RCAR_SUPPORTED_CLOCKS)) { 796 793 err = -EINVAL; 797 794 dev_err(&pdev->dev, "invalid CAN clock selected\n"); 798 795 goto fail_clk;
+49 -2
drivers/net/can/rx-offload.c
··· 211 211 } 212 212 EXPORT_SYMBOL_GPL(can_rx_offload_irq_offload_fifo); 213 213 214 - int can_rx_offload_irq_queue_err_skb(struct can_rx_offload *offload, struct sk_buff *skb) 214 + int can_rx_offload_queue_sorted(struct can_rx_offload *offload, 215 + struct sk_buff *skb, u32 timestamp) 216 + { 217 + struct can_rx_offload_cb *cb; 218 + unsigned long flags; 219 + 220 + if (skb_queue_len(&offload->skb_queue) > 221 + offload->skb_queue_len_max) 222 + return -ENOMEM; 223 + 224 + cb = can_rx_offload_get_cb(skb); 225 + cb->timestamp = timestamp; 226 + 227 + spin_lock_irqsave(&offload->skb_queue.lock, flags); 228 + __skb_queue_add_sort(&offload->skb_queue, skb, can_rx_offload_compare); 229 + spin_unlock_irqrestore(&offload->skb_queue.lock, flags); 230 + 231 + can_rx_offload_schedule(offload); 232 + 233 + return 0; 234 + } 235 + EXPORT_SYMBOL_GPL(can_rx_offload_queue_sorted); 236 + 237 + unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload, 238 + unsigned int idx, u32 timestamp) 239 + { 240 + struct net_device *dev = offload->dev; 241 + struct net_device_stats *stats = &dev->stats; 242 + struct sk_buff *skb; 243 + u8 len; 244 + int err; 245 + 246 + skb = __can_get_echo_skb(dev, idx, &len); 247 + if (!skb) 248 + return 0; 249 + 250 + err = can_rx_offload_queue_sorted(offload, skb, timestamp); 251 + if (err) { 252 + stats->rx_errors++; 253 + stats->tx_fifo_errors++; 254 + } 255 + 256 + return len; 257 + } 258 + EXPORT_SYMBOL_GPL(can_rx_offload_get_echo_skb); 259 + 260 + int can_rx_offload_queue_tail(struct can_rx_offload *offload, 261 + struct sk_buff *skb) 215 262 { 216 263 if (skb_queue_len(&offload->skb_queue) > 217 264 offload->skb_queue_len_max) ··· 269 222 270 223 return 0; 271 224 } 272 - EXPORT_SYMBOL_GPL(can_rx_offload_irq_queue_err_skb); 225 + EXPORT_SYMBOL_GPL(can_rx_offload_queue_tail); 273 226 274 227 static int can_rx_offload_init_queue(struct net_device *dev, struct can_rx_offload *offload, unsigned int weight) 275 228 {
+1 -1
drivers/net/can/spi/hi311x.c
··· 760 760 { 761 761 struct hi3110_priv *priv = netdev_priv(net); 762 762 struct spi_device *spi = priv->spi; 763 - unsigned long flags = IRQF_ONESHOT | IRQF_TRIGGER_RISING; 763 + unsigned long flags = IRQF_ONESHOT | IRQF_TRIGGER_HIGH; 764 764 int ret; 765 765 766 766 ret = open_candev(net);
+2 -2
drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c
··· 528 528 context = &priv->tx_contexts[i]; 529 529 530 530 context->echo_index = i; 531 - can_put_echo_skb(skb, netdev, context->echo_index); 532 531 ++priv->active_tx_contexts; 533 532 if (priv->active_tx_contexts >= (int)dev->max_tx_urbs) 534 533 netif_stop_queue(netdev); ··· 552 553 dev_kfree_skb(skb); 553 554 spin_lock_irqsave(&priv->tx_contexts_lock, flags); 554 555 555 - can_free_echo_skb(netdev, context->echo_index); 556 556 context->echo_index = dev->max_tx_urbs; 557 557 --priv->active_tx_contexts; 558 558 netif_wake_queue(netdev); ··· 561 563 } 562 564 563 565 context->priv = priv; 566 + 567 + can_put_echo_skb(skb, netdev, context->echo_index); 564 568 565 569 usb_fill_bulk_urb(urb, dev->udev, 566 570 usb_sndbulkpipe(dev->udev,
+5 -5
drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c
··· 1019 1019 new_state : CAN_STATE_ERROR_ACTIVE; 1020 1020 1021 1021 can_change_state(netdev, cf, tx_state, rx_state); 1022 + 1023 + if (priv->can.restart_ms && 1024 + old_state >= CAN_STATE_BUS_OFF && 1025 + new_state < CAN_STATE_BUS_OFF) 1026 + cf->can_id |= CAN_ERR_RESTARTED; 1022 1027 } 1023 1028 1024 1029 if (new_state == CAN_STATE_BUS_OFF) { ··· 1033 1028 1034 1029 can_bus_off(netdev); 1035 1030 } 1036 - 1037 - if (priv->can.restart_ms && 1038 - old_state >= CAN_STATE_BUS_OFF && 1039 - new_state < CAN_STATE_BUS_OFF) 1040 - cf->can_id |= CAN_ERR_RESTARTED; 1041 1031 } 1042 1032 1043 1033 if (!skb) {
-7
drivers/net/can/usb/ucan.c
··· 35 35 #include <linux/slab.h> 36 36 #include <linux/usb.h> 37 37 38 - #include <linux/can.h> 39 - #include <linux/can/dev.h> 40 - #include <linux/can/error.h> 41 - 42 38 #define UCAN_DRIVER_NAME "ucan" 43 39 #define UCAN_MAX_RX_URBS 8 44 40 /* the CAN controller needs a while to enable/disable the bus */ ··· 1571 1575 /* disconnect the device */ 1572 1576 static void ucan_disconnect(struct usb_interface *intf) 1573 1577 { 1574 - struct usb_device *udev; 1575 1578 struct ucan_priv *up = usb_get_intfdata(intf); 1576 - 1577 - udev = interface_to_usbdev(intf); 1578 1579 1579 1580 usb_set_intfdata(intf, NULL); 1580 1581
+7
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
··· 2191 2191 #define PMF_DMAE_C(bp) (BP_PORT(bp) * MAX_DMAE_C_PER_PORT + \ 2192 2192 E1HVN_MAX) 2193 2193 2194 + /* Following is the DMAE channel number allocation for the clients. 2195 + * MFW: OCBB/OCSD implementations use DMAE channels 14/15 respectively. 2196 + * Driver: 0-3 and 8-11 (for PF dmae operations) 2197 + * 4 and 12 (for stats requests) 2198 + */ 2199 + #define BNX2X_FW_DMAE_C 13 /* Channel for FW DMAE operations */ 2200 + 2194 2201 /* PCIE link and speed */ 2195 2202 #define PCICFG_LINK_WIDTH 0x1f00000 2196 2203 #define PCICFG_LINK_WIDTH_SHIFT 20
+1
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
··· 6149 6149 rdata->sd_vlan_tag = cpu_to_le16(start_params->sd_vlan_tag); 6150 6150 rdata->path_id = BP_PATH(bp); 6151 6151 rdata->network_cos_mode = start_params->network_cos_mode; 6152 + rdata->dmae_cmd_id = BNX2X_FW_DMAE_C; 6152 6153 6153 6154 rdata->vxlan_dst_port = cpu_to_le16(start_params->vxlan_dst_port); 6154 6155 rdata->geneve_dst_port = cpu_to_le16(start_params->geneve_dst_port);
+68 -2
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 1675 1675 } else { 1676 1676 if (rxcmp1->rx_cmp_cfa_code_errors_v2 & RX_CMP_L4_CS_ERR_BITS) { 1677 1677 if (dev->features & NETIF_F_RXCSUM) 1678 - cpr->rx_l4_csum_errors++; 1678 + bnapi->cp_ring.rx_l4_csum_errors++; 1679 1679 } 1680 1680 } 1681 1681 ··· 8714 8714 return rc; 8715 8715 } 8716 8716 8717 + static int bnxt_dbg_hwrm_ring_info_get(struct bnxt *bp, u8 ring_type, 8718 + u32 ring_id, u32 *prod, u32 *cons) 8719 + { 8720 + struct hwrm_dbg_ring_info_get_output *resp = bp->hwrm_cmd_resp_addr; 8721 + struct hwrm_dbg_ring_info_get_input req = {0}; 8722 + int rc; 8723 + 8724 + bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_DBG_RING_INFO_GET, -1, -1); 8725 + req.ring_type = ring_type; 8726 + req.fw_ring_id = cpu_to_le32(ring_id); 8727 + mutex_lock(&bp->hwrm_cmd_lock); 8728 + rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); 8729 + if (!rc) { 8730 + *prod = le32_to_cpu(resp->producer_index); 8731 + *cons = le32_to_cpu(resp->consumer_index); 8732 + } 8733 + mutex_unlock(&bp->hwrm_cmd_lock); 8734 + return rc; 8735 + } 8736 + 8717 8737 static void bnxt_dump_tx_sw_state(struct bnxt_napi *bnapi) 8718 8738 { 8719 8739 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; ··· 8841 8821 bnxt_queue_sp_work(bp); 8842 8822 } 8843 8823 } 8824 + 8825 + if ((bp->flags & BNXT_FLAG_CHIP_P5) && netif_carrier_ok(dev)) { 8826 + set_bit(BNXT_RING_COAL_NOW_SP_EVENT, &bp->sp_event); 8827 + bnxt_queue_sp_work(bp); 8828 + } 8844 8829 bnxt_restart_timer: 8845 8830 mod_timer(&bp->timer, jiffies + bp->current_interval); 8846 8831 } ··· 8874 8849 if (test_bit(BNXT_STATE_OPEN, &bp->state)) 8875 8850 bnxt_reset_task(bp, silent); 8876 8851 bnxt_rtnl_unlock_sp(bp); 8852 + } 8853 + 8854 + static void bnxt_chk_missed_irq(struct bnxt *bp) 8855 + { 8856 + int i; 8857 + 8858 + if (!(bp->flags & BNXT_FLAG_CHIP_P5)) 8859 + return; 8860 + 8861 + for (i = 0; i < bp->cp_nr_rings; i++) { 8862 + struct bnxt_napi *bnapi = bp->bnapi[i]; 8863 + struct bnxt_cp_ring_info *cpr; 8864 + u32 fw_ring_id; 8865 + int j; 8866 + 8867 + if (!bnapi) 8868 + continue; 8869 + 8870 + cpr = &bnapi->cp_ring; 8871 + for (j = 0; j < 2; j++) { 8872 + struct bnxt_cp_ring_info *cpr2 = cpr->cp_ring_arr[j]; 8873 + u32 val[2]; 8874 + 8875 + if (!cpr2 || cpr2->has_more_work || 8876 + !bnxt_has_work(bp, cpr2)) 8877 + continue; 8878 + 8879 + if (cpr2->cp_raw_cons != cpr2->last_cp_raw_cons) { 8880 + cpr2->last_cp_raw_cons = cpr2->cp_raw_cons; 8881 + continue; 8882 + } 8883 + fw_ring_id = cpr2->cp_ring_struct.fw_ring_id; 8884 + bnxt_dbg_hwrm_ring_info_get(bp, 8885 + DBG_RING_INFO_GET_REQ_RING_TYPE_L2_CMPL, 8886 + fw_ring_id, &val[0], &val[1]); 8887 + cpr->missed_irqs++; 8888 + } 8889 + } 8877 8890 } 8878 8891 8879 8892 static void bnxt_cfg_ntp_filters(struct bnxt *); ··· 8992 8929 8993 8930 if (test_and_clear_bit(BNXT_FLOW_STATS_SP_EVENT, &bp->sp_event)) 8994 8931 bnxt_tc_flow_stats_work(bp); 8932 + 8933 + if (test_and_clear_bit(BNXT_RING_COAL_NOW_SP_EVENT, &bp->sp_event)) 8934 + bnxt_chk_missed_irq(bp); 8995 8935 8996 8936 /* These functions below will clear BNXT_STATE_IN_SP_TASK. They 8997 8937 * must be the last functions to be called before exiting. ··· 10153 10087 } 10154 10088 10155 10089 bnxt_hwrm_func_qcfg(bp); 10090 + bnxt_hwrm_vnic_qcaps(bp); 10156 10091 bnxt_hwrm_port_led_qcaps(bp); 10157 10092 bnxt_ethtool_init(bp); 10158 10093 bnxt_dcb_init(bp); ··· 10187 10120 VNIC_RSS_CFG_REQ_HASH_TYPE_UDP_IPV6; 10188 10121 } 10189 10122 10190 - bnxt_hwrm_vnic_qcaps(bp); 10191 10123 if (bnxt_rfs_supported(bp)) { 10192 10124 dev->hw_features |= NETIF_F_NTUPLE; 10193 10125 if (bnxt_rfs_capable(bp)) {
+4
drivers/net/ethernet/broadcom/bnxt/bnxt.h
··· 798 798 u8 had_work_done:1; 799 799 u8 has_more_work:1; 800 800 801 + u32 last_cp_raw_cons; 802 + 801 803 struct bnxt_coal rx_ring_coal; 802 804 u64 rx_packets; 803 805 u64 rx_bytes; ··· 818 816 dma_addr_t hw_stats_map; 819 817 u32 hw_stats_ctx_id; 820 818 u64 rx_l4_csum_errors; 819 + u64 missed_irqs; 821 820 822 821 struct bnxt_ring_struct cp_ring_struct; 823 822 ··· 1530 1527 #define BNXT_LINK_SPEED_CHNG_SP_EVENT 14 1531 1528 #define BNXT_FLOW_STATS_SP_EVENT 15 1532 1529 #define BNXT_UPDATE_PHY_SP_EVENT 16 1530 + #define BNXT_RING_COAL_NOW_SP_EVENT 17 1533 1531 1534 1532 struct bnxt_hw_resc hw_resc; 1535 1533 struct bnxt_pf_info pf;
+6 -3
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
··· 137 137 return rc; 138 138 } 139 139 140 - #define BNXT_NUM_STATS 21 140 + #define BNXT_NUM_STATS 22 141 141 142 142 #define BNXT_RX_STATS_ENTRY(counter) \ 143 143 { BNXT_RX_STATS_OFFSET(counter), __stringify(counter) } ··· 384 384 for (k = 0; k < stat_fields; j++, k++) 385 385 buf[j] = le64_to_cpu(hw_stats[k]); 386 386 buf[j++] = cpr->rx_l4_csum_errors; 387 + buf[j++] = cpr->missed_irqs; 387 388 388 389 bnxt_sw_func_stats[RX_TOTAL_DISCARDS].counter += 389 390 le64_to_cpu(cpr->hw_stats->rx_discard_pkts); ··· 468 467 sprintf(buf, "[%d]: tpa_aborts", i); 469 468 buf += ETH_GSTRING_LEN; 470 469 sprintf(buf, "[%d]: rx_l4_csum_errors", i); 470 + buf += ETH_GSTRING_LEN; 471 + sprintf(buf, "[%d]: missed_irqs", i); 471 472 buf += ETH_GSTRING_LEN; 472 473 } 473 474 for (i = 0; i < BNXT_NUM_SW_FUNC_STATS; i++) { ··· 2945 2942 record->asic_state = 0; 2946 2943 strlcpy(record->system_name, utsname()->nodename, 2947 2944 sizeof(record->system_name)); 2948 - record->year = cpu_to_le16(tm.tm_year); 2949 - record->month = cpu_to_le16(tm.tm_mon); 2945 + record->year = cpu_to_le16(tm.tm_year + 1900); 2946 + record->month = cpu_to_le16(tm.tm_mon + 1); 2950 2947 record->day = cpu_to_le16(tm.tm_mday); 2951 2948 record->hour = cpu_to_le16(tm.tm_hour); 2952 2949 record->minute = cpu_to_le16(tm.tm_min);
+3
drivers/net/ethernet/broadcom/bnxt/bnxt_ulp.c
··· 43 43 if (ulp_id == BNXT_ROCE_ULP) { 44 44 unsigned int max_stat_ctxs; 45 45 46 + if (bp->flags & BNXT_FLAG_CHIP_P5) 47 + return -EOPNOTSUPP; 48 + 46 49 max_stat_ctxs = bnxt_get_max_func_stat_ctxs(bp); 47 50 if (max_stat_ctxs <= BNXT_MIN_ROCE_STAT_CTXS || 48 51 bp->num_stat_ctxs == max_stat_ctxs)
-1
drivers/net/ethernet/chelsio/Kconfig
··· 67 67 config CHELSIO_T4 68 68 tristate "Chelsio Communications T4/T5/T6 Ethernet support" 69 69 depends on PCI && (IPV6 || IPV6=n) 70 - depends on THERMAL || !THERMAL 71 70 select FW_LOADER 72 71 select MDIO 73 72 select ZLIB_DEFLATE
+1 -3
drivers/net/ethernet/chelsio/cxgb4/Makefile
··· 12 12 cxgb4-$(CONFIG_CHELSIO_T4_DCB) += cxgb4_dcb.o 13 13 cxgb4-$(CONFIG_CHELSIO_T4_FCOE) += cxgb4_fcoe.o 14 14 cxgb4-$(CONFIG_DEBUG_FS) += cxgb4_debugfs.o 15 - ifdef CONFIG_THERMAL 16 - cxgb4-objs += cxgb4_thermal.o 17 - endif 15 + cxgb4-$(CONFIG_THERMAL) += cxgb4_thermal.o
+2 -2
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
··· 5871 5871 if (!is_t4(adapter->params.chip)) 5872 5872 cxgb4_ptp_init(adapter); 5873 5873 5874 - if (IS_ENABLED(CONFIG_THERMAL) && 5874 + if (IS_REACHABLE(CONFIG_THERMAL) && 5875 5875 !is_t4(adapter->params.chip) && (adapter->flags & FW_OK)) 5876 5876 cxgb4_thermal_init(adapter); 5877 5877 ··· 5940 5940 5941 5941 if (!is_t4(adapter->params.chip)) 5942 5942 cxgb4_ptp_stop(adapter); 5943 - if (IS_ENABLED(CONFIG_THERMAL)) 5943 + if (IS_REACHABLE(CONFIG_THERMAL)) 5944 5944 cxgb4_thermal_remove(adapter); 5945 5945 5946 5946 /* If we allocated filters, free up state associated with any
+3 -2
drivers/net/ethernet/lantiq_xrx200.c
··· 512 512 err = register_netdev(net_dev); 513 513 if (err) 514 514 goto err_unprepare_clk; 515 - return err; 515 + 516 + return 0; 516 517 517 518 err_unprepare_clk: 518 519 clk_disable_unprepare(priv->clk); ··· 521 520 err_uninit_dma: 522 521 xrx200_hw_cleanup(priv); 523 522 524 - return 0; 523 + return err; 525 524 } 526 525 527 526 static int xrx200_remove(struct platform_device *pdev)
+3 -9
drivers/net/ethernet/marvell/mvneta.c
··· 3343 3343 if (state->interface != PHY_INTERFACE_MODE_NA && 3344 3344 state->interface != PHY_INTERFACE_MODE_QSGMII && 3345 3345 state->interface != PHY_INTERFACE_MODE_SGMII && 3346 - state->interface != PHY_INTERFACE_MODE_2500BASEX && 3347 3346 !phy_interface_mode_is_8023z(state->interface) && 3348 3347 !phy_interface_mode_is_rgmii(state->interface)) { 3349 3348 bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS); ··· 3356 3357 /* Asymmetric pause is unsupported */ 3357 3358 phylink_set(mask, Pause); 3358 3359 3359 - /* We cannot use 1Gbps when using the 2.5G interface. */ 3360 - if (state->interface == PHY_INTERFACE_MODE_2500BASEX) { 3361 - phylink_set(mask, 2500baseT_Full); 3362 - phylink_set(mask, 2500baseX_Full); 3363 - } else { 3364 - phylink_set(mask, 1000baseT_Full); 3365 - phylink_set(mask, 1000baseX_Full); 3366 - } 3360 + /* Half-duplex at speeds higher than 100Mbit is unsupported */ 3361 + phylink_set(mask, 1000baseT_Full); 3362 + phylink_set(mask, 1000baseX_Full); 3367 3363 3368 3364 if (!phy_interface_mode_is_8023z(state->interface)) { 3369 3365 /* 10M and 100M are only supported in non-802.3z mode */
+1 -1
drivers/net/ethernet/mellanox/mlx4/alloc.c
··· 337 337 static u32 __mlx4_alloc_from_zone(struct mlx4_zone_entry *zone, int count, 338 338 int align, u32 skip_mask, u32 *puid) 339 339 { 340 - u32 uid; 340 + u32 uid = 0; 341 341 u32 res; 342 342 struct mlx4_zone_allocator *zone_alloc = zone->allocator; 343 343 struct mlx4_zone_entry *curr_node;
+2 -2
drivers/net/ethernet/mellanox/mlx4/mlx4.h
··· 540 540 struct resource_allocator { 541 541 spinlock_t alloc_lock; /* protect quotas */ 542 542 union { 543 - int res_reserved; 544 - int res_port_rsvd[MLX4_MAX_PORTS]; 543 + unsigned int res_reserved; 544 + unsigned int res_port_rsvd[MLX4_MAX_PORTS]; 545 545 }; 546 546 union { 547 547 int res_free;
+1
drivers/net/ethernet/mellanox/mlx4/mr.c
··· 363 363 container_of((void *)mpt_entry, struct mlx4_cmd_mailbox, 364 364 buf); 365 365 366 + (*mpt_entry)->lkey = 0; 366 367 err = mlx4_SW2HW_MPT(dev, mailbox, key); 367 368 } 368 369
+7 -7
drivers/net/ethernet/qlogic/qed/qed_dcbx.c
··· 191 191 static void 192 192 qed_dcbx_set_params(struct qed_dcbx_results *p_data, 193 193 struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, 194 - bool enable, u8 prio, u8 tc, 194 + bool app_tlv, bool enable, u8 prio, u8 tc, 195 195 enum dcbx_protocol_type type, 196 196 enum qed_pci_personality personality) 197 197 { ··· 210 210 p_data->arr[type].dont_add_vlan0 = true; 211 211 212 212 /* QM reconf data */ 213 - if (p_hwfn->hw_info.personality == personality) 213 + if (app_tlv && p_hwfn->hw_info.personality == personality) 214 214 qed_hw_info_set_offload_tc(&p_hwfn->hw_info, tc); 215 215 216 216 /* Configure dcbx vlan priority in doorbell block for roce EDPM */ ··· 225 225 static void 226 226 qed_dcbx_update_app_info(struct qed_dcbx_results *p_data, 227 227 struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, 228 - bool enable, u8 prio, u8 tc, 228 + bool app_tlv, bool enable, u8 prio, u8 tc, 229 229 enum dcbx_protocol_type type) 230 230 { 231 231 enum qed_pci_personality personality; ··· 240 240 241 241 personality = qed_dcbx_app_update[i].personality; 242 242 243 - qed_dcbx_set_params(p_data, p_hwfn, p_ptt, enable, 243 + qed_dcbx_set_params(p_data, p_hwfn, p_ptt, app_tlv, enable, 244 244 prio, tc, type, personality); 245 245 } 246 246 } ··· 319 319 enable = true; 320 320 } 321 321 322 - qed_dcbx_update_app_info(p_data, p_hwfn, p_ptt, enable, 323 - priority, tc, type); 322 + qed_dcbx_update_app_info(p_data, p_hwfn, p_ptt, true, 323 + enable, priority, tc, type); 324 324 } 325 325 } 326 326 ··· 341 341 continue; 342 342 343 343 enable = (type == DCBX_PROTOCOL_ETH) ? false : !!dcbx_version; 344 - qed_dcbx_update_app_info(p_data, p_hwfn, p_ptt, enable, 344 + qed_dcbx_update_app_info(p_data, p_hwfn, p_ptt, false, enable, 345 345 priority, tc, type); 346 346 } 347 347
+11 -4
drivers/net/ethernet/qlogic/qed/qed_dev.c
··· 185 185 qed_iscsi_free(p_hwfn); 186 186 qed_ooo_free(p_hwfn); 187 187 } 188 + 189 + if (QED_IS_RDMA_PERSONALITY(p_hwfn)) 190 + qed_rdma_info_free(p_hwfn); 191 + 188 192 qed_iov_free(p_hwfn); 189 193 qed_l2_free(p_hwfn); 190 194 qed_dmae_info_free(p_hwfn); ··· 1081 1077 if (rc) 1082 1078 goto alloc_err; 1083 1079 rc = qed_ooo_alloc(p_hwfn); 1080 + if (rc) 1081 + goto alloc_err; 1082 + } 1083 + 1084 + if (QED_IS_RDMA_PERSONALITY(p_hwfn)) { 1085 + rc = qed_rdma_info_alloc(p_hwfn); 1084 1086 if (rc) 1085 1087 goto alloc_err; 1086 1088 } ··· 2112 2102 if (!p_ptt) 2113 2103 return -EAGAIN; 2114 2104 2115 - /* If roce info is allocated it means roce is initialized and should 2116 - * be enabled in searcher. 2117 - */ 2118 2105 if (p_hwfn->p_rdma_info && 2119 - p_hwfn->b_rdma_enabled_in_prs) 2106 + p_hwfn->p_rdma_info->active && p_hwfn->b_rdma_enabled_in_prs) 2120 2107 qed_wr(p_hwfn, p_ptt, p_hwfn->rdma_prs_search_reg, 0x1); 2121 2108 2122 2109 /* Re-open incoming traffic */
+2
drivers/net/ethernet/qlogic/qed/qed_int.c
··· 992 992 */ 993 993 do { 994 994 index = p_sb_attn->sb_index; 995 + /* finish reading index before the loop condition */ 996 + dma_rmb(); 995 997 attn_bits = le32_to_cpu(p_sb_attn->atten_bits); 996 998 attn_acks = le32_to_cpu(p_sb_attn->atten_ack); 997 999 } while (index != p_sb_attn->sb_index);
+1 -1
drivers/net/ethernet/qlogic/qed/qed_main.c
··· 1782 1782 return -EBUSY; 1783 1783 } 1784 1784 rc = qed_mcp_drain(hwfn, ptt); 1785 + qed_ptt_release(hwfn, ptt); 1785 1786 if (rc) 1786 1787 return rc; 1787 - qed_ptt_release(hwfn, ptt); 1788 1788 } 1789 1789 1790 1790 return 0;
+29 -21
drivers/net/ethernet/qlogic/qed/qed_rdma.c
··· 140 140 return FEAT_NUM((struct qed_hwfn *)p_hwfn, QED_PF_L2_QUE) + rel_sb_id; 141 141 } 142 142 143 - static int qed_rdma_alloc(struct qed_hwfn *p_hwfn, 144 - struct qed_ptt *p_ptt, 145 - struct qed_rdma_start_in_params *params) 143 + int qed_rdma_info_alloc(struct qed_hwfn *p_hwfn) 146 144 { 147 145 struct qed_rdma_info *p_rdma_info; 146 + 147 + p_rdma_info = kzalloc(sizeof(*p_rdma_info), GFP_KERNEL); 148 + if (!p_rdma_info) 149 + return -ENOMEM; 150 + 151 + spin_lock_init(&p_rdma_info->lock); 152 + 153 + p_hwfn->p_rdma_info = p_rdma_info; 154 + return 0; 155 + } 156 + 157 + void qed_rdma_info_free(struct qed_hwfn *p_hwfn) 158 + { 159 + kfree(p_hwfn->p_rdma_info); 160 + p_hwfn->p_rdma_info = NULL; 161 + } 162 + 163 + static int qed_rdma_alloc(struct qed_hwfn *p_hwfn) 164 + { 165 + struct qed_rdma_info *p_rdma_info = p_hwfn->p_rdma_info; 148 166 u32 num_cons, num_tasks; 149 167 int rc = -ENOMEM; 150 168 151 169 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "Allocating RDMA\n"); 152 170 153 - /* Allocate a struct with current pf rdma info */ 154 - p_rdma_info = kzalloc(sizeof(*p_rdma_info), GFP_KERNEL); 155 - if (!p_rdma_info) 156 - return rc; 157 - 158 - p_hwfn->p_rdma_info = p_rdma_info; 159 171 if (QED_IS_IWARP_PERSONALITY(p_hwfn)) 160 172 p_rdma_info->proto = PROTOCOLID_IWARP; 161 173 else ··· 195 183 /* Allocate a struct with device params and fill it */ 196 184 p_rdma_info->dev = kzalloc(sizeof(*p_rdma_info->dev), GFP_KERNEL); 197 185 if (!p_rdma_info->dev) 198 - goto free_rdma_info; 186 + return rc; 199 187 200 188 /* Allocate a struct with port params and fill it */ 201 189 p_rdma_info->port = kzalloc(sizeof(*p_rdma_info->port), GFP_KERNEL); ··· 310 298 kfree(p_rdma_info->port); 311 299 free_rdma_dev: 312 300 kfree(p_rdma_info->dev); 313 - free_rdma_info: 314 - kfree(p_rdma_info); 315 301 316 302 return rc; 317 303 } ··· 380 370 381 371 kfree(p_rdma_info->port); 382 372 kfree(p_rdma_info->dev); 383 - 384 - kfree(p_rdma_info); 385 373 } 386 374 387 375 static void qed_rdma_free_tid(void *rdma_cxt, u32 itid) ··· 687 679 688 680 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "RDMA setup\n"); 689 681 690 - spin_lock_init(&p_hwfn->p_rdma_info->lock); 691 - 692 682 qed_rdma_init_devinfo(p_hwfn, params); 693 683 qed_rdma_init_port(p_hwfn); 694 684 qed_rdma_init_events(p_hwfn, params); ··· 733 727 /* Disable RoCE search */ 734 728 qed_wr(p_hwfn, p_ptt, p_hwfn->rdma_prs_search_reg, 0); 735 729 p_hwfn->b_rdma_enabled_in_prs = false; 736 - 730 + p_hwfn->p_rdma_info->active = 0; 737 731 qed_wr(p_hwfn, p_ptt, PRS_REG_ROCE_DEST_QP_MAX_PF, 0); 738 732 739 733 ll2_ethertype_en = qed_rd(p_hwfn, p_ptt, PRS_REG_LIGHT_L2_ETHERTYPE_EN); ··· 1242 1236 u8 max_stats_queues; 1243 1237 int rc; 1244 1238 1245 - if (!rdma_cxt || !in_params || !out_params || !p_hwfn->p_rdma_info) { 1239 + if (!rdma_cxt || !in_params || !out_params || 1240 + !p_hwfn->p_rdma_info->active) { 1246 1241 DP_ERR(p_hwfn->cdev, 1247 1242 "qed roce create qp failed due to NULL entry (rdma_cxt=%p, in=%p, out=%p, roce_info=?\n", 1248 1243 rdma_cxt, in_params, out_params); ··· 1809 1802 { 1810 1803 bool result; 1811 1804 1812 - /* if rdma info has not been allocated, naturally there are no qps */ 1813 - if (!p_hwfn->p_rdma_info) 1805 + /* if rdma wasn't activated yet, naturally there are no qps */ 1806 + if (!p_hwfn->p_rdma_info->active) 1814 1807 return false; 1815 1808 1816 1809 spin_lock_bh(&p_hwfn->p_rdma_info->lock); ··· 1856 1849 if (!p_ptt) 1857 1850 goto err; 1858 1851 1859 - rc = qed_rdma_alloc(p_hwfn, p_ptt, params); 1852 + rc = qed_rdma_alloc(p_hwfn); 1860 1853 if (rc) 1861 1854 goto err1; 1862 1855 ··· 1865 1858 goto err2; 1866 1859 1867 1860 qed_ptt_release(p_hwfn, p_ptt); 1861 + p_hwfn->p_rdma_info->active = 1; 1868 1862 1869 1863 return rc; 1870 1864
+5
drivers/net/ethernet/qlogic/qed/qed_rdma.h
··· 102 102 u16 max_queue_zones; 103 103 enum protocol_type proto; 104 104 struct qed_iwarp_info iwarp; 105 + u8 active:1; 105 106 }; 106 107 107 108 struct qed_rdma_qp { ··· 177 176 #if IS_ENABLED(CONFIG_QED_RDMA) 178 177 void qed_rdma_dpm_bar(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt); 179 178 void qed_rdma_dpm_conf(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt); 179 + int qed_rdma_info_alloc(struct qed_hwfn *p_hwfn); 180 + void qed_rdma_info_free(struct qed_hwfn *p_hwfn); 180 181 #else 181 182 static inline void qed_rdma_dpm_conf(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) {} 182 183 static inline void qed_rdma_dpm_bar(struct qed_hwfn *p_hwfn, 183 184 struct qed_ptt *p_ptt) {} 185 + static inline int qed_rdma_info_alloc(struct qed_hwfn *p_hwfn) {return -EINVAL;} 186 + static inline void qed_rdma_info_free(struct qed_hwfn *p_hwfn) {} 184 187 #endif 185 188 186 189 int
+5 -5
drivers/net/phy/mdio-gpio.c
··· 63 63 * assume the pin serves as pull-up. If direction is 64 64 * output, the default value is high. 65 65 */ 66 - gpiod_set_value(bitbang->mdo, 1); 66 + gpiod_set_value_cansleep(bitbang->mdo, 1); 67 67 return; 68 68 } 69 69 ··· 78 78 struct mdio_gpio_info *bitbang = 79 79 container_of(ctrl, struct mdio_gpio_info, ctrl); 80 80 81 - return gpiod_get_value(bitbang->mdio); 81 + return gpiod_get_value_cansleep(bitbang->mdio); 82 82 } 83 83 84 84 static void mdio_set(struct mdiobb_ctrl *ctrl, int what) ··· 87 87 container_of(ctrl, struct mdio_gpio_info, ctrl); 88 88 89 89 if (bitbang->mdo) 90 - gpiod_set_value(bitbang->mdo, what); 90 + gpiod_set_value_cansleep(bitbang->mdo, what); 91 91 else 92 - gpiod_set_value(bitbang->mdio, what); 92 + gpiod_set_value_cansleep(bitbang->mdio, what); 93 93 } 94 94 95 95 static void mdc_set(struct mdiobb_ctrl *ctrl, int what) ··· 97 97 struct mdio_gpio_info *bitbang = 98 98 container_of(ctrl, struct mdio_gpio_info, ctrl); 99 99 100 - gpiod_set_value(bitbang->mdc, what); 100 + gpiod_set_value_cansleep(bitbang->mdc, what); 101 101 } 102 102 103 103 static const struct mdiobb_ops mdio_gpio_ops = {
+6 -1
drivers/net/tun.c
··· 1540 1540 1541 1541 if (!rx_batched || (!more && skb_queue_empty(queue))) { 1542 1542 local_bh_disable(); 1543 + skb_record_rx_queue(skb, tfile->queue_index); 1543 1544 netif_receive_skb(skb); 1544 1545 local_bh_enable(); 1545 1546 return; ··· 1560 1559 struct sk_buff *nskb; 1561 1560 1562 1561 local_bh_disable(); 1563 - while ((nskb = __skb_dequeue(&process_queue))) 1562 + while ((nskb = __skb_dequeue(&process_queue))) { 1563 + skb_record_rx_queue(nskb, tfile->queue_index); 1564 1564 netif_receive_skb(nskb); 1565 + } 1566 + skb_record_rx_queue(skb, tfile->queue_index); 1565 1567 netif_receive_skb(skb); 1566 1568 local_bh_enable(); 1567 1569 } ··· 2475 2471 !tfile->detached) 2476 2472 rxhash = __skb_get_hash_symmetric(skb); 2477 2473 2474 + skb_record_rx_queue(skb, tfile->queue_index); 2478 2475 netif_receive_skb(skb); 2479 2476 2480 2477 stats = get_cpu_ptr(tun->pcpu_stats);
-5
drivers/pci/pci-acpi.c
··· 793 793 { 794 794 struct pci_dev *pci_dev = to_pci_dev(dev); 795 795 struct acpi_device *adev = ACPI_COMPANION(dev); 796 - int node; 797 796 798 797 if (!adev) 799 798 return; 800 - 801 - node = acpi_get_node(adev->handle); 802 - if (node != NUMA_NO_NODE) 803 - set_dev_node(dev, node); 804 799 805 800 pci_acpi_optimize_delay(pci_dev, adev->handle); 806 801
+1 -1
drivers/pinctrl/meson/pinctrl-meson-gxbb.c
··· 830 830 831 831 static struct meson_bank meson_gxbb_aobus_banks[] = { 832 832 /* name first last irq pullen pull dir out in */ 833 - BANK("AO", GPIOAO_0, GPIOAO_13, 0, 13, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), 833 + BANK("AO", GPIOAO_0, GPIOAO_13, 0, 13, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0), 834 834 }; 835 835 836 836 static struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = {
+1 -1
drivers/pinctrl/meson/pinctrl-meson-gxl.c
··· 807 807 808 808 static struct meson_bank meson_gxl_aobus_banks[] = { 809 809 /* name first last irq pullen pull dir out in */ 810 - BANK("AO", GPIOAO_0, GPIOAO_9, 0, 9, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), 810 + BANK("AO", GPIOAO_0, GPIOAO_9, 0, 9, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0), 811 811 }; 812 812 813 813 static struct meson_pinctrl_data meson_gxl_periphs_pinctrl_data = {
+1 -1
drivers/pinctrl/meson/pinctrl-meson.c
··· 192 192 dev_dbg(pc->dev, "pin %u: disable bias\n", pin); 193 193 194 194 meson_calc_reg_and_bit(bank, pin, REG_PULL, &reg, &bit); 195 - ret = regmap_update_bits(pc->reg_pull, reg, 195 + ret = regmap_update_bits(pc->reg_pullen, reg, 196 196 BIT(bit), 0); 197 197 if (ret) 198 198 return ret;
+1 -1
drivers/pinctrl/meson/pinctrl-meson8.c
··· 1053 1053 1054 1054 static struct meson_bank meson8_aobus_banks[] = { 1055 1055 /* name first last irq pullen pull dir out in */ 1056 - BANK("AO", GPIOAO_0, GPIO_TEST_N, 0, 13, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), 1056 + BANK("AO", GPIOAO_0, GPIO_TEST_N, 0, 13, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0), 1057 1057 }; 1058 1058 1059 1059 static struct meson_pinctrl_data meson8_cbus_pinctrl_data = {
+1 -1
drivers/pinctrl/meson/pinctrl-meson8b.c
··· 906 906 907 907 static struct meson_bank meson8b_aobus_banks[] = { 908 908 /* name first lastc irq pullen pull dir out in */ 909 - BANK("AO", GPIOAO_0, GPIO_TEST_N, 0, 13, 0, 0, 0, 16, 0, 0, 0, 16, 1, 0), 909 + BANK("AO", GPIOAO_0, GPIO_TEST_N, 0, 13, 0, 16, 0, 0, 0, 0, 0, 16, 1, 0), 910 910 }; 911 911 912 912 static struct meson_pinctrl_data meson8b_cbus_pinctrl_data = {
+3 -1
drivers/rtc/hctosys.c
··· 50 50 tv64.tv_sec = rtc_tm_to_time64(&tm); 51 51 52 52 #if BITS_PER_LONG == 32 53 - if (tv64.tv_sec > INT_MAX) 53 + if (tv64.tv_sec > INT_MAX) { 54 + err = -ERANGE; 54 55 goto err_read; 56 + } 55 57 #endif 56 58 57 59 err = do_settimeofday64(&tv64);
+12 -4
drivers/rtc/rtc-cmos.c
··· 257 257 struct cmos_rtc *cmos = dev_get_drvdata(dev); 258 258 unsigned char rtc_control; 259 259 260 + /* This not only a rtc_op, but also called directly */ 260 261 if (!is_valid_irq(cmos->irq)) 261 262 return -EIO; 262 263 ··· 453 452 unsigned char mon, mday, hrs, min, sec, rtc_control; 454 453 int ret; 455 454 455 + /* This not only a rtc_op, but also called directly */ 456 456 if (!is_valid_irq(cmos->irq)) 457 457 return -EIO; 458 458 ··· 518 516 struct cmos_rtc *cmos = dev_get_drvdata(dev); 519 517 unsigned long flags; 520 518 521 - if (!is_valid_irq(cmos->irq)) 522 - return -EINVAL; 523 - 524 519 spin_lock_irqsave(&rtc_lock, flags); 525 520 526 521 if (enabled) ··· 576 577 .set_alarm = cmos_set_alarm, 577 578 .proc = cmos_procfs, 578 579 .alarm_irq_enable = cmos_alarm_irq_enable, 580 + }; 581 + 582 + static const struct rtc_class_ops cmos_rtc_ops_no_alarm = { 583 + .read_time = cmos_read_time, 584 + .set_time = cmos_set_time, 585 + .proc = cmos_procfs, 579 586 }; 580 587 581 588 /*----------------------------------------------------------------*/ ··· 860 855 dev_dbg(dev, "IRQ %d is already in use\n", rtc_irq); 861 856 goto cleanup1; 862 857 } 858 + 859 + cmos_rtc.rtc->ops = &cmos_rtc_ops; 860 + } else { 861 + cmos_rtc.rtc->ops = &cmos_rtc_ops_no_alarm; 863 862 } 864 863 865 - cmos_rtc.rtc->ops = &cmos_rtc_ops; 866 864 cmos_rtc.rtc->nvram_old_abi = true; 867 865 retval = rtc_register_device(cmos_rtc.rtc); 868 866 if (retval)
+3
drivers/rtc/rtc-pcf2127.c
··· 303 303 memcpy(buf + 1, val, val_size); 304 304 305 305 ret = i2c_master_send(client, buf, val_size + 1); 306 + 307 + kfree(buf); 308 + 306 309 if (ret != val_size + 1) 307 310 return ret < 0 ? ret : -EIO; 308 311
+1 -1
drivers/s390/net/ism_drv.c
··· 415 415 break; 416 416 417 417 clear_bit_inv(bit, bv); 418 + ism->sba->dmbe_mask[bit + ISM_DMB_BIT_OFFSET] = 0; 418 419 barrier(); 419 420 smcd_handle_irq(ism->smcd, bit + ISM_DMB_BIT_OFFSET); 420 - ism->sba->dmbe_mask[bit + ISM_DMB_BIT_OFFSET] = 0; 421 421 } 422 422 423 423 if (ism->sba->e) {
+1
drivers/scsi/Kconfig
··· 578 578 config SCSI_MYRS 579 579 tristate "Mylex DAC960/DAC1100 PCI RAID Controller (SCSI Interface)" 580 580 depends on PCI 581 + depends on !CPU_BIG_ENDIAN || COMPILE_TEST 581 582 select RAID_ATTRS 582 583 help 583 584 This driver adds support for the Mylex DAC960, AcceleRAID, and
+1 -1
drivers/scsi/NCR5380.c
··· 1198 1198 1199 1199 out: 1200 1200 if (!hostdata->selecting) 1201 - return NULL; 1201 + return false; 1202 1202 hostdata->selecting = NULL; 1203 1203 return ret; 1204 1204 }
-2
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
··· 904 904 { 905 905 struct hisi_hba *hisi_hba = dq->hisi_hba; 906 906 struct hisi_sas_slot *s, *s1, *s2 = NULL; 907 - struct list_head *dq_list; 908 907 int dlvry_queue = dq->id; 909 908 int wp; 910 909 911 - dq_list = &dq->list; 912 910 list_for_each_entry_safe(s, s1, &dq->list, delivery) { 913 911 if (!s->ready) 914 912 break;
-2
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
··· 1670 1670 { 1671 1671 struct hisi_hba *hisi_hba = dq->hisi_hba; 1672 1672 struct hisi_sas_slot *s, *s1, *s2 = NULL; 1673 - struct list_head *dq_list; 1674 1673 int dlvry_queue = dq->id; 1675 1674 int wp; 1676 1675 1677 - dq_list = &dq->list; 1678 1676 list_for_each_entry_safe(s, s1, &dq->list, delivery) { 1679 1677 if (!s->ready) 1680 1678 break;
-2
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
··· 886 886 { 887 887 struct hisi_hba *hisi_hba = dq->hisi_hba; 888 888 struct hisi_sas_slot *s, *s1, *s2 = NULL; 889 - struct list_head *dq_list; 890 889 int dlvry_queue = dq->id; 891 890 int wp; 892 891 893 - dq_list = &dq->list; 894 892 list_for_each_entry_safe(s, s1, &dq->list, delivery) { 895 893 if (!s->ready) 896 894 break;
+2
drivers/scsi/lpfc/lpfc_debugfs.c
··· 698 698 rport = lpfc_ndlp_get_nrport(ndlp); 699 699 if (rport) 700 700 nrport = rport->remoteport; 701 + else 702 + nrport = NULL; 701 703 spin_unlock(&phba->hbalock); 702 704 if (!nrport) 703 705 continue;
+2 -1
drivers/scsi/myrb.c
··· 1049 1049 enquiry2->fw.firmware_type = '0'; 1050 1050 enquiry2->fw.turn_id = 0; 1051 1051 } 1052 - sprintf(cb->fw_version, "%d.%02d-%c-%02d", 1052 + snprintf(cb->fw_version, sizeof(cb->fw_version), 1053 + "%d.%02d-%c-%02d", 1053 1054 enquiry2->fw.major_version, 1054 1055 enquiry2->fw.minor_version, 1055 1056 enquiry2->fw.firmware_type,
+8 -5
drivers/scsi/myrs.c
··· 163 163 dma_addr_t ctlr_info_addr; 164 164 union myrs_sgl *sgl; 165 165 unsigned char status; 166 - struct myrs_ctlr_info old; 166 + unsigned short ldev_present, ldev_critical, ldev_offline; 167 167 168 - memcpy(&old, cs->ctlr_info, sizeof(struct myrs_ctlr_info)); 168 + ldev_present = cs->ctlr_info->ldev_present; 169 + ldev_critical = cs->ctlr_info->ldev_critical; 170 + ldev_offline = cs->ctlr_info->ldev_offline; 171 + 169 172 ctlr_info_addr = dma_map_single(&cs->pdev->dev, cs->ctlr_info, 170 173 sizeof(struct myrs_ctlr_info), 171 174 DMA_FROM_DEVICE); ··· 201 198 cs->ctlr_info->rbld_active + 202 199 cs->ctlr_info->exp_active != 0) 203 200 cs->needs_update = true; 204 - if (cs->ctlr_info->ldev_present != old.ldev_present || 205 - cs->ctlr_info->ldev_critical != old.ldev_critical || 206 - cs->ctlr_info->ldev_offline != old.ldev_offline) 201 + if (cs->ctlr_info->ldev_present != ldev_present || 202 + cs->ctlr_info->ldev_critical != ldev_critical || 203 + cs->ctlr_info->ldev_offline != ldev_offline) 207 204 shost_printk(KERN_INFO, cs->host, 208 205 "Logical drive count changes (%d/%d/%d)\n", 209 206 cs->ctlr_info->ldev_critical,
+1
drivers/scsi/qla2xxx/qla_init.c
··· 4763 4763 fcport->loop_id = FC_NO_LOOP_ID; 4764 4764 qla2x00_set_fcport_state(fcport, FCS_UNCONFIGURED); 4765 4765 fcport->supported_classes = FC_COS_UNSPECIFIED; 4766 + fcport->fp_speed = PORT_SPEED_UNKNOWN; 4766 4767 4767 4768 fcport->ct_desc.ct_sns = dma_alloc_coherent(&vha->hw->pdev->dev, 4768 4769 sizeof(struct ct_sns_pkt), &fcport->ct_desc.ct_sns_dma,
+1 -1
drivers/scsi/qla2xxx/qla_os.c
··· 67 67 MODULE_PARM_DESC(ql2xplogiabsentdevice, 68 68 "Option to enable PLOGI to devices that are not present after " 69 69 "a Fabric scan. This is needed for several broken switches. " 70 - "Default is 0 - no PLOGI. 1 - perfom PLOGI."); 70 + "Default is 0 - no PLOGI. 1 - perform PLOGI."); 71 71 72 72 int ql2xloginretrycount = 0; 73 73 module_param(ql2xloginretrycount, int, S_IRUGO);
+8
drivers/scsi/scsi_lib.c
··· 697 697 */ 698 698 scsi_mq_uninit_cmd(cmd); 699 699 700 + /* 701 + * queue is still alive, so grab the ref for preventing it 702 + * from being cleaned up during running queue. 703 + */ 704 + percpu_ref_get(&q->q_usage_counter); 705 + 700 706 __blk_mq_end_request(req, error); 701 707 702 708 if (scsi_target(sdev)->single_lun || ··· 710 704 kblockd_schedule_work(&sdev->requeue_work); 711 705 else 712 706 blk_mq_run_hw_queues(q, true); 707 + 708 + percpu_ref_put(&q->q_usage_counter); 713 709 } else { 714 710 unsigned long flags; 715 711
-7
drivers/scsi/ufs/ufshcd.c
··· 8099 8099 err = -ENOMEM; 8100 8100 goto out_error; 8101 8101 } 8102 - 8103 - /* 8104 - * Do not use blk-mq at this time because blk-mq does not support 8105 - * runtime pm. 8106 - */ 8107 - host->use_blk_mq = false; 8108 - 8109 8102 hba = shost_priv(host); 8110 8103 hba->host = host; 8111 8104 hba->dev = dev;
+2 -2
drivers/target/target_core_transport.c
··· 1778 1778 void transport_generic_request_failure(struct se_cmd *cmd, 1779 1779 sense_reason_t sense_reason) 1780 1780 { 1781 - int ret = 0; 1781 + int ret = 0, post_ret; 1782 1782 1783 1783 pr_debug("-----[ Storage Engine Exception; sense_reason %d\n", 1784 1784 sense_reason); ··· 1790 1790 transport_complete_task_attr(cmd); 1791 1791 1792 1792 if (cmd->transport_complete_callback) 1793 - cmd->transport_complete_callback(cmd, false, NULL); 1793 + cmd->transport_complete_callback(cmd, false, &post_ret); 1794 1794 1795 1795 if (transport_check_aborted_status(cmd, 1)) 1796 1796 return;
+10 -1
fs/afs/rxrpc.c
··· 576 576 { 577 577 signed long rtt2, timeout; 578 578 long ret; 579 + bool stalled = false; 579 580 u64 rtt; 580 581 u32 life, last_life; 581 582 ··· 610 609 611 610 life = rxrpc_kernel_check_life(call->net->socket, call->rxcall); 612 611 if (timeout == 0 && 613 - life == last_life && signal_pending(current)) 612 + life == last_life && signal_pending(current)) { 613 + if (stalled) 614 614 break; 615 + __set_current_state(TASK_RUNNING); 616 + rxrpc_kernel_probe_life(call->net->socket, call->rxcall); 617 + timeout = rtt2; 618 + stalled = true; 619 + continue; 620 + } 615 621 616 622 if (life != last_life) { 617 623 timeout = rtt2; 618 624 last_life = life; 625 + stalled = false; 619 626 } 620 627 621 628 timeout = schedule_timeout(timeout);
+12 -4
fs/fuse/dev.c
··· 165 165 166 166 static void fuse_drop_waiting(struct fuse_conn *fc) 167 167 { 168 - if (fc->connected) { 169 - atomic_dec(&fc->num_waiting); 170 - } else if (atomic_dec_and_test(&fc->num_waiting)) { 168 + /* 169 + * lockess check of fc->connected is okay, because atomic_dec_and_test() 170 + * provides a memory barrier mached with the one in fuse_wait_aborted() 171 + * to ensure no wake-up is missed. 172 + */ 173 + if (atomic_dec_and_test(&fc->num_waiting) && 174 + !READ_ONCE(fc->connected)) { 171 175 /* wake up aborters */ 172 176 wake_up_all(&fc->blocked_waitq); 173 177 } ··· 1772 1768 req->in.args[1].size = total_len; 1773 1769 1774 1770 err = fuse_request_send_notify_reply(fc, req, outarg->notify_unique); 1775 - if (err) 1771 + if (err) { 1776 1772 fuse_retrieve_end(fc, req); 1773 + fuse_put_request(fc, req); 1774 + } 1777 1775 1778 1776 return err; 1779 1777 } ··· 2225 2219 2226 2220 void fuse_wait_aborted(struct fuse_conn *fc) 2227 2221 { 2222 + /* matches implicit memory barrier in fuse_drop_waiting() */ 2223 + smp_mb(); 2228 2224 wait_event(fc->blocked_waitq, atomic_read(&fc->num_waiting) == 0); 2229 2225 } 2230 2226
+3 -1
fs/fuse/file.c
··· 2924 2924 } 2925 2925 2926 2926 if (io->async) { 2927 + bool blocking = io->blocking; 2928 + 2927 2929 fuse_aio_complete(io, ret < 0 ? ret : 0, -1); 2928 2930 2929 2931 /* we have a non-extending, async request, so return */ 2930 - if (!io->blocking) 2932 + if (!blocking) 2931 2933 return -EIOCBQUEUED; 2932 2934 2933 2935 wait_for_completion(&wait);
+27 -27
fs/gfs2/bmap.c
··· 826 826 ret = gfs2_meta_inode_buffer(ip, &dibh); 827 827 if (ret) 828 828 goto unlock; 829 - iomap->private = dibh; 829 + mp->mp_bh[0] = dibh; 830 830 831 831 if (gfs2_is_stuffed(ip)) { 832 832 if (flags & IOMAP_WRITE) { ··· 863 863 len = lblock_stop - lblock + 1; 864 864 iomap->length = len << inode->i_blkbits; 865 865 866 - get_bh(dibh); 867 - mp->mp_bh[0] = dibh; 868 - 869 866 height = ip->i_height; 870 867 while ((lblock + 1) * sdp->sd_sb.sb_bsize > sdp->sd_heightsize[height]) 871 868 height++; ··· 895 898 iomap->bdev = inode->i_sb->s_bdev; 896 899 unlock: 897 900 up_read(&ip->i_rw_mutex); 898 - if (ret && dibh) 899 - brelse(dibh); 900 901 return ret; 901 902 902 903 do_alloc: ··· 975 980 976 981 static int gfs2_iomap_begin_write(struct inode *inode, loff_t pos, 977 982 loff_t length, unsigned flags, 978 - struct iomap *iomap) 983 + struct iomap *iomap, 984 + struct metapath *mp) 979 985 { 980 - struct metapath mp = { .mp_aheight = 1, }; 981 986 struct gfs2_inode *ip = GFS2_I(inode); 982 987 struct gfs2_sbd *sdp = GFS2_SB(inode); 983 988 unsigned int data_blocks = 0, ind_blocks = 0, rblocks; ··· 991 996 unstuff = gfs2_is_stuffed(ip) && 992 997 pos + length > gfs2_max_stuffed_size(ip); 993 998 994 - ret = gfs2_iomap_get(inode, pos, length, flags, iomap, &mp); 999 + ret = gfs2_iomap_get(inode, pos, length, flags, iomap, mp); 995 1000 if (ret) 996 - goto out_release; 1001 + goto out_unlock; 997 1002 998 1003 alloc_required = unstuff || iomap->type == IOMAP_HOLE; 999 1004 ··· 1008 1013 1009 1014 ret = gfs2_quota_lock_check(ip, &ap); 1010 1015 if (ret) 1011 - goto out_release; 1016 + goto out_unlock; 1012 1017 1013 1018 ret = gfs2_inplace_reserve(ip, &ap); 1014 1019 if (ret) ··· 1033 1038 ret = gfs2_unstuff_dinode(ip, NULL); 1034 1039 if (ret) 1035 1040 goto out_trans_end; 1036 - release_metapath(&mp); 1037 - brelse(iomap->private); 1038 - iomap->private = NULL; 1041 + release_metapath(mp); 1039 1042 ret = gfs2_iomap_get(inode, iomap->offset, iomap->length, 1040 - flags, iomap, &mp); 1043 + flags, iomap, mp); 1041 1044 if (ret) 1042 1045 goto out_trans_end; 1043 1046 } 1044 1047 1045 1048 if (iomap->type == IOMAP_HOLE) { 1046 - ret = gfs2_iomap_alloc(inode, iomap, flags, &mp); 1049 + ret = gfs2_iomap_alloc(inode, iomap, flags, mp); 1047 1050 if (ret) { 1048 1051 gfs2_trans_end(sdp); 1049 1052 gfs2_inplace_release(ip); ··· 1049 1056 goto out_qunlock; 1050 1057 } 1051 1058 } 1052 - release_metapath(&mp); 1053 1059 if (!gfs2_is_stuffed(ip) && gfs2_is_jdata(ip)) 1054 1060 iomap->page_done = gfs2_iomap_journaled_page_done; 1055 1061 return 0; ··· 1061 1069 out_qunlock: 1062 1070 if (alloc_required) 1063 1071 gfs2_quota_unlock(ip); 1064 - out_release: 1065 - if (iomap->private) 1066 - brelse(iomap->private); 1067 - release_metapath(&mp); 1072 + out_unlock: 1068 1073 gfs2_write_unlock(inode); 1069 1074 return ret; 1070 1075 } ··· 1077 1088 1078 1089 trace_gfs2_iomap_start(ip, pos, length, flags); 1079 1090 if ((flags & IOMAP_WRITE) && !(flags & IOMAP_DIRECT)) { 1080 - ret = gfs2_iomap_begin_write(inode, pos, length, flags, iomap); 1091 + ret = gfs2_iomap_begin_write(inode, pos, length, flags, iomap, &mp); 1081 1092 } else { 1082 1093 ret = gfs2_iomap_get(inode, pos, length, flags, iomap, &mp); 1083 - release_metapath(&mp); 1094 + 1084 1095 /* 1085 1096 * Silently fall back to buffered I/O for stuffed files or if 1086 1097 * we've hot a hole (see gfs2_file_direct_write). ··· 1089 1100 iomap->type != IOMAP_MAPPED) 1090 1101 ret = -ENOTBLK; 1091 1102 } 1103 + if (!ret) { 1104 + get_bh(mp.mp_bh[0]); 1105 + iomap->private = mp.mp_bh[0]; 1106 + } 1107 + release_metapath(&mp); 1092 1108 trace_gfs2_iomap_end(ip, iomap, ret); 1093 1109 return ret; 1094 1110 } ··· 1902 1908 if (ret < 0) 1903 1909 goto out; 1904 1910 1905 - /* issue read-ahead on metadata */ 1906 - if (mp.mp_aheight > 1) { 1907 - for (; ret > 1; ret--) { 1908 - metapointer_range(&mp, mp.mp_aheight - ret, 1911 + /* On the first pass, issue read-ahead on metadata. */ 1912 + if (mp.mp_aheight > 1 && strip_h == ip->i_height - 1) { 1913 + unsigned int height = mp.mp_aheight - 1; 1914 + 1915 + /* No read-ahead for data blocks. */ 1916 + if (mp.mp_aheight - 1 == strip_h) 1917 + height--; 1918 + 1919 + for (; height >= mp.mp_aheight - ret; height--) { 1920 + metapointer_range(&mp, height, 1909 1921 start_list, start_aligned, 1910 1922 end_list, end_aligned, 1911 1923 &start, &end);
+2 -1
fs/gfs2/rgrp.c
··· 733 733 734 734 if (gl) { 735 735 glock_clear_object(gl, rgd); 736 + gfs2_rgrp_brelse(rgd); 736 737 gfs2_glock_put(gl); 737 738 } 738 739 ··· 1175 1174 * @rgd: the struct gfs2_rgrpd describing the RG to read in 1176 1175 * 1177 1176 * Read in all of a Resource Group's header and bitmap blocks. 1178 - * Caller must eventually call gfs2_rgrp_relse() to free the bitmaps. 1177 + * Caller must eventually call gfs2_rgrp_brelse() to free the bitmaps. 1179 1178 * 1180 1179 * Returns: errno 1181 1180 */
+5 -2
fs/inode.c
··· 730 730 return LRU_REMOVED; 731 731 } 732 732 733 - /* recently referenced inodes get one more pass */ 734 - if (inode->i_state & I_REFERENCED) { 733 + /* 734 + * Recently referenced inodes and inodes with many attached pages 735 + * get one more pass. 736 + */ 737 + if (inode->i_state & I_REFERENCED || inode->i_data.nrpages > 1) { 735 738 inode->i_state &= ~I_REFERENCED; 736 739 spin_unlock(&inode->i_lock); 737 740 return LRU_ROTATE;
+3 -3
fs/namespace.c
··· 695 695 696 696 hlist_for_each_entry(mp, chain, m_hash) { 697 697 if (mp->m_dentry == dentry) { 698 - /* might be worth a WARN_ON() */ 699 - if (d_unlinked(dentry)) 700 - return ERR_PTR(-ENOENT); 701 698 mp->m_count++; 702 699 return mp; 703 700 } ··· 708 711 int ret; 709 712 710 713 if (d_mountpoint(dentry)) { 714 + /* might be worth a WARN_ON() */ 715 + if (d_unlinked(dentry)) 716 + return ERR_PTR(-ENOENT); 711 717 mountpoint: 712 718 read_seqlock_excl(&mount_lock); 713 719 mp = lookup_mountpoint(dentry);
+2 -2
fs/nfs/callback_proc.c
··· 66 66 out_iput: 67 67 rcu_read_unlock(); 68 68 trace_nfs4_cb_getattr(cps->clp, &args->fh, inode, -ntohl(res->status)); 69 - iput(inode); 69 + nfs_iput_and_deactive(inode); 70 70 out: 71 71 dprintk("%s: exit with status = %d\n", __func__, ntohl(res->status)); 72 72 return res->status; ··· 108 108 } 109 109 trace_nfs4_cb_recall(cps->clp, &args->fh, inode, 110 110 &args->stateid, -ntohl(res)); 111 - iput(inode); 111 + nfs_iput_and_deactive(inode); 112 112 out: 113 113 dprintk("%s: exit with status = %d\n", __func__, ntohl(res)); 114 114 return res;
+9 -2
fs/nfs/delegation.c
··· 850 850 const struct nfs_fh *fhandle) 851 851 { 852 852 struct nfs_delegation *delegation; 853 - struct inode *res = NULL; 853 + struct inode *freeme, *res = NULL; 854 854 855 855 list_for_each_entry_rcu(delegation, &server->delegations, super_list) { 856 856 spin_lock(&delegation->lock); 857 857 if (delegation->inode != NULL && 858 858 nfs_compare_fh(fhandle, &NFS_I(delegation->inode)->fh) == 0) { 859 - res = igrab(delegation->inode); 859 + freeme = igrab(delegation->inode); 860 + if (freeme && nfs_sb_active(freeme->i_sb)) 861 + res = freeme; 860 862 spin_unlock(&delegation->lock); 861 863 if (res != NULL) 862 864 return res; 865 + if (freeme) { 866 + rcu_read_unlock(); 867 + iput(freeme); 868 + rcu_read_lock(); 869 + } 863 870 return ERR_PTR(-EAGAIN); 864 871 } 865 872 spin_unlock(&delegation->lock);
+6 -4
fs/nfs/nfs4state.c
··· 2601 2601 nfs4_clear_state_manager_bit(clp); 2602 2602 /* Did we race with an attempt to give us more work? */ 2603 2603 if (clp->cl_state == 0) 2604 - break; 2604 + return; 2605 2605 if (test_and_set_bit(NFS4CLNT_MANAGER_RUNNING, &clp->cl_state) != 0) 2606 - break; 2607 - } while (refcount_read(&clp->cl_count) > 1); 2608 - return; 2606 + return; 2607 + } while (refcount_read(&clp->cl_count) > 1 && !signalled()); 2608 + goto out_drain; 2609 + 2609 2610 out_error: 2610 2611 if (strlen(section)) 2611 2612 section_sep = ": "; ··· 2614 2613 " with error %d\n", section_sep, section, 2615 2614 clp->cl_hostname, -status); 2616 2615 ssleep(1); 2616 + out_drain: 2617 2617 nfs4_end_drain_session(clp); 2618 2618 nfs4_clear_state_manager_bit(clp); 2619 2619 }
+3
fs/nfsd/nfs4proc.c
··· 1038 1038 { 1039 1039 __be32 status; 1040 1040 1041 + if (!cstate->save_fh.fh_dentry) 1042 + return nfserr_nofilehandle; 1043 + 1041 1044 status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->save_fh, 1042 1045 src_stateid, RD_STATE, src, NULL); 1043 1046 if (status) {
+5 -5
fs/notify/fanotify/fanotify.c
··· 115 115 continue; 116 116 mark = iter_info->marks[type]; 117 117 /* 118 - * if the event is for a child and this inode doesn't care about 119 - * events on the child, don't send it! 118 + * If the event is for a child and this mark doesn't care about 119 + * events on a child, don't send it! 120 120 */ 121 - if (type == FSNOTIFY_OBJ_TYPE_INODE && 122 - (event_mask & FS_EVENT_ON_CHILD) && 123 - !(mark->mask & FS_EVENT_ON_CHILD)) 121 + if (event_mask & FS_EVENT_ON_CHILD && 122 + (type != FSNOTIFY_OBJ_TYPE_INODE || 123 + !(mark->mask & FS_EVENT_ON_CHILD))) 124 124 continue; 125 125 126 126 marks_mask |= mark->mask;
+5 -2
fs/notify/fsnotify.c
··· 167 167 parent = dget_parent(dentry); 168 168 p_inode = parent->d_inode; 169 169 170 - if (unlikely(!fsnotify_inode_watches_children(p_inode))) 170 + if (unlikely(!fsnotify_inode_watches_children(p_inode))) { 171 171 __fsnotify_update_child_dentry_flags(p_inode); 172 - else if (p_inode->i_fsnotify_mask & mask) { 172 + } else if (p_inode->i_fsnotify_mask & mask & ALL_FSNOTIFY_EVENTS) { 173 173 struct name_snapshot name; 174 174 175 175 /* we are notifying a parent so come up with the new mask which ··· 339 339 sb = mnt->mnt.mnt_sb; 340 340 mnt_or_sb_mask = mnt->mnt_fsnotify_mask | sb->s_fsnotify_mask; 341 341 } 342 + /* An event "on child" is not intended for a mount/sb mark */ 343 + if (mask & FS_EVENT_ON_CHILD) 344 + mnt_or_sb_mask = 0; 342 345 343 346 /* 344 347 * Optimization: srcu_read_lock() has a memory barrier which can
+10 -2
fs/ocfs2/aops.c
··· 2411 2411 /* this io's submitter should not have unlocked this before we could */ 2412 2412 BUG_ON(!ocfs2_iocb_is_rw_locked(iocb)); 2413 2413 2414 - if (bytes > 0 && private) 2415 - ret = ocfs2_dio_end_io_write(inode, private, offset, bytes); 2414 + if (bytes <= 0) 2415 + mlog_ratelimited(ML_ERROR, "Direct IO failed, bytes = %lld", 2416 + (long long)bytes); 2417 + if (private) { 2418 + if (bytes > 0) 2419 + ret = ocfs2_dio_end_io_write(inode, private, offset, 2420 + bytes); 2421 + else 2422 + ocfs2_dio_free_write_ctx(inode, private); 2423 + } 2416 2424 2417 2425 ocfs2_iocb_clear_rw_locked(iocb); 2418 2426
+9
fs/ocfs2/cluster/masklog.h
··· 178 178 ##__VA_ARGS__); \ 179 179 } while (0) 180 180 181 + #define mlog_ratelimited(mask, fmt, ...) \ 182 + do { \ 183 + static DEFINE_RATELIMIT_STATE(_rs, \ 184 + DEFAULT_RATELIMIT_INTERVAL, \ 185 + DEFAULT_RATELIMIT_BURST); \ 186 + if (__ratelimit(&_rs)) \ 187 + mlog(mask, fmt, ##__VA_ARGS__); \ 188 + } while (0) 189 + 181 190 #define mlog_errno(st) ({ \ 182 191 int _st = (st); \ 183 192 if (_st != -ERESTARTSYS && _st != -EINTR && \
+1
include/linux/can/dev.h
··· 169 169 170 170 void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, 171 171 unsigned int idx); 172 + struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8 *len_ptr); 172 173 unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx); 173 174 void can_free_echo_skb(struct net_device *dev, unsigned int idx); 174 175
+6 -1
include/linux/can/rx-offload.h
··· 41 41 int can_rx_offload_add_fifo(struct net_device *dev, struct can_rx_offload *offload, unsigned int weight); 42 42 int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload, u64 reg); 43 43 int can_rx_offload_irq_offload_fifo(struct can_rx_offload *offload); 44 - int can_rx_offload_irq_queue_err_skb(struct can_rx_offload *offload, struct sk_buff *skb); 44 + int can_rx_offload_queue_sorted(struct can_rx_offload *offload, 45 + struct sk_buff *skb, u32 timestamp); 46 + unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload, 47 + unsigned int idx, u32 timestamp); 48 + int can_rx_offload_queue_tail(struct can_rx_offload *offload, 49 + struct sk_buff *skb); 45 50 void can_rx_offload_reset(struct can_rx_offload *offload); 46 51 void can_rx_offload_del(struct can_rx_offload *offload); 47 52 void can_rx_offload_enable(struct can_rx_offload *offload);
+7
include/linux/efi.h
··· 1167 1167 extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused); 1168 1168 1169 1169 extern bool efi_is_table_address(unsigned long phys_addr); 1170 + 1171 + extern int efi_apply_persistent_mem_reservations(void); 1170 1172 #else 1171 1173 static inline bool efi_enabled(int feature) 1172 1174 { ··· 1186 1184 static inline bool efi_is_table_address(unsigned long phys_addr) 1187 1185 { 1188 1186 return false; 1187 + } 1188 + 1189 + static inline int efi_apply_persistent_mem_reservations(void) 1190 + { 1191 + return 0; 1189 1192 } 1190 1193 #endif 1191 1194
+2 -1
include/net/af_rxrpc.h
··· 77 77 struct sockaddr_rxrpc *, struct key *); 78 78 int rxrpc_kernel_check_call(struct socket *, struct rxrpc_call *, 79 79 enum rxrpc_call_completion *, u32 *); 80 - u32 rxrpc_kernel_check_life(struct socket *, struct rxrpc_call *); 80 + u32 rxrpc_kernel_check_life(const struct socket *, const struct rxrpc_call *); 81 + void rxrpc_kernel_probe_life(struct socket *, struct rxrpc_call *); 81 82 u32 rxrpc_kernel_get_epoch(struct socket *, struct rxrpc_call *); 82 83 bool rxrpc_kernel_get_reply_time(struct socket *, struct rxrpc_call *, 83 84 ktime_t *);
+4 -4
include/trace/events/kyber.h
··· 31 31 32 32 TP_fast_assign( 33 33 __entry->dev = disk_devt(dev_to_disk(kobj_to_dev(q->kobj.parent))); 34 - strlcpy(__entry->domain, domain, DOMAIN_LEN); 35 - strlcpy(__entry->type, type, DOMAIN_LEN); 34 + strlcpy(__entry->domain, domain, sizeof(__entry->domain)); 35 + strlcpy(__entry->type, type, sizeof(__entry->type)); 36 36 __entry->percentile = percentile; 37 37 __entry->numerator = numerator; 38 38 __entry->denominator = denominator; ··· 60 60 61 61 TP_fast_assign( 62 62 __entry->dev = disk_devt(dev_to_disk(kobj_to_dev(q->kobj.parent))); 63 - strlcpy(__entry->domain, domain, DOMAIN_LEN); 63 + strlcpy(__entry->domain, domain, sizeof(__entry->domain)); 64 64 __entry->depth = depth; 65 65 ), 66 66 ··· 82 82 83 83 TP_fast_assign( 84 84 __entry->dev = disk_devt(dev_to_disk(kobj_to_dev(q->kobj.parent))); 85 - strlcpy(__entry->domain, domain, DOMAIN_LEN); 85 + strlcpy(__entry->domain, domain, sizeof(__entry->domain)); 86 86 ), 87 87 88 88 TP_printk("%d,%d %s", MAJOR(__entry->dev), MINOR(__entry->dev),
+2
include/trace/events/rxrpc.h
··· 181 181 enum rxrpc_propose_ack_trace { 182 182 rxrpc_propose_ack_client_tx_end, 183 183 rxrpc_propose_ack_input_data, 184 + rxrpc_propose_ack_ping_for_check_life, 184 185 rxrpc_propose_ack_ping_for_keepalive, 185 186 rxrpc_propose_ack_ping_for_lost_ack, 186 187 rxrpc_propose_ack_ping_for_lost_reply, ··· 381 380 #define rxrpc_propose_ack_traces \ 382 381 EM(rxrpc_propose_ack_client_tx_end, "ClTxEnd") \ 383 382 EM(rxrpc_propose_ack_input_data, "DataIn ") \ 383 + EM(rxrpc_propose_ack_ping_for_check_life, "ChkLife") \ 384 384 EM(rxrpc_propose_ack_ping_for_keepalive, "KeepAlv") \ 385 385 EM(rxrpc_propose_ack_ping_for_lost_ack, "LostAck") \ 386 386 EM(rxrpc_propose_ack_ping_for_lost_reply, "LostRpl") \
+2 -2
kernel/debug/kdb/kdb_bt.c
··· 179 179 kdb_printf("no process for cpu %ld\n", cpu); 180 180 return 0; 181 181 } 182 - sprintf(buf, "btt 0x%p\n", KDB_TSK(cpu)); 182 + sprintf(buf, "btt 0x%px\n", KDB_TSK(cpu)); 183 183 kdb_parse(buf); 184 184 return 0; 185 185 } 186 186 kdb_printf("btc: cpu status: "); 187 187 kdb_parse("cpu\n"); 188 188 for_each_online_cpu(cpu) { 189 - sprintf(buf, "btt 0x%p\n", KDB_TSK(cpu)); 189 + sprintf(buf, "btt 0x%px\n", KDB_TSK(cpu)); 190 190 kdb_parse(buf); 191 191 touch_nmi_watchdog(); 192 192 }
+9 -6
kernel/debug/kdb/kdb_io.c
··· 216 216 int count; 217 217 int i; 218 218 int diag, dtab_count; 219 - int key; 219 + int key, buf_size, ret; 220 220 221 221 222 222 diag = kdbgetintenv("DTABCOUNT", &dtab_count); ··· 336 336 else 337 337 p_tmp = tmpbuffer; 338 338 len = strlen(p_tmp); 339 - count = kallsyms_symbol_complete(p_tmp, 340 - sizeof(tmpbuffer) - 341 - (p_tmp - tmpbuffer)); 339 + buf_size = sizeof(tmpbuffer) - (p_tmp - tmpbuffer); 340 + count = kallsyms_symbol_complete(p_tmp, buf_size); 342 341 if (tab == 2 && count > 0) { 343 342 kdb_printf("\n%d symbols are found.", count); 344 343 if (count > dtab_count) { ··· 349 350 } 350 351 kdb_printf("\n"); 351 352 for (i = 0; i < count; i++) { 352 - if (WARN_ON(!kallsyms_symbol_next(p_tmp, i))) 353 + ret = kallsyms_symbol_next(p_tmp, i, buf_size); 354 + if (WARN_ON(!ret)) 353 355 break; 354 - kdb_printf("%s ", p_tmp); 356 + if (ret != -E2BIG) 357 + kdb_printf("%s ", p_tmp); 358 + else 359 + kdb_printf("%s... ", p_tmp); 355 360 *(p_tmp + len) = '\0'; 356 361 } 357 362 if (i >= dtab_count)
+2 -2
kernel/debug/kdb/kdb_keyboard.c
··· 173 173 case KT_LATIN: 174 174 if (isprint(keychar)) 175 175 break; /* printable characters */ 176 - /* drop through */ 176 + /* fall through */ 177 177 case KT_SPEC: 178 178 if (keychar == K_ENTER) 179 179 break; 180 - /* drop through */ 180 + /* fall through */ 181 181 default: 182 182 return -1; /* ignore unprintables */ 183 183 }
+10 -25
kernel/debug/kdb/kdb_main.c
··· 1192 1192 if (reason == KDB_REASON_DEBUG) { 1193 1193 /* special case below */ 1194 1194 } else { 1195 - kdb_printf("\nEntering kdb (current=0x%p, pid %d) ", 1195 + kdb_printf("\nEntering kdb (current=0x%px, pid %d) ", 1196 1196 kdb_current, kdb_current ? kdb_current->pid : 0); 1197 1197 #if defined(CONFIG_SMP) 1198 1198 kdb_printf("on processor %d ", raw_smp_processor_id()); ··· 1208 1208 */ 1209 1209 switch (db_result) { 1210 1210 case KDB_DB_BPT: 1211 - kdb_printf("\nEntering kdb (0x%p, pid %d) ", 1211 + kdb_printf("\nEntering kdb (0x%px, pid %d) ", 1212 1212 kdb_current, kdb_current->pid); 1213 1213 #if defined(CONFIG_SMP) 1214 1214 kdb_printf("on processor %d ", raw_smp_processor_id()); ··· 1493 1493 char cbuf[32]; 1494 1494 char *c = cbuf; 1495 1495 int i; 1496 + int j; 1496 1497 unsigned long word; 1497 1498 1498 1499 memset(cbuf, '\0', sizeof(cbuf)); ··· 1539 1538 wc.word = word; 1540 1539 #define printable_char(c) \ 1541 1540 ({unsigned char __c = c; isascii(__c) && isprint(__c) ? __c : '.'; }) 1542 - switch (bytesperword) { 1543 - case 8: 1541 + for (j = 0; j < bytesperword; j++) 1544 1542 *c++ = printable_char(*cp++); 1545 - *c++ = printable_char(*cp++); 1546 - *c++ = printable_char(*cp++); 1547 - *c++ = printable_char(*cp++); 1548 - addr += 4; 1549 - case 4: 1550 - *c++ = printable_char(*cp++); 1551 - *c++ = printable_char(*cp++); 1552 - addr += 2; 1553 - case 2: 1554 - *c++ = printable_char(*cp++); 1555 - addr++; 1556 - case 1: 1557 - *c++ = printable_char(*cp++); 1558 - addr++; 1559 - break; 1560 - } 1543 + addr += bytesperword; 1561 1544 #undef printable_char 1562 1545 } 1563 1546 } ··· 2033 2048 if (mod->state == MODULE_STATE_UNFORMED) 2034 2049 continue; 2035 2050 2036 - kdb_printf("%-20s%8u 0x%p ", mod->name, 2051 + kdb_printf("%-20s%8u 0x%px ", mod->name, 2037 2052 mod->core_layout.size, (void *)mod); 2038 2053 #ifdef CONFIG_MODULE_UNLOAD 2039 2054 kdb_printf("%4d ", module_refcount(mod)); ··· 2044 2059 kdb_printf(" (Loading)"); 2045 2060 else 2046 2061 kdb_printf(" (Live)"); 2047 - kdb_printf(" 0x%p", mod->core_layout.base); 2062 + kdb_printf(" 0x%px", mod->core_layout.base); 2048 2063 2049 2064 #ifdef CONFIG_MODULE_UNLOAD 2050 2065 { ··· 2326 2341 return; 2327 2342 2328 2343 cpu = kdb_process_cpu(p); 2329 - kdb_printf("0x%p %8d %8d %d %4d %c 0x%p %c%s\n", 2344 + kdb_printf("0x%px %8d %8d %d %4d %c 0x%px %c%s\n", 2330 2345 (void *)p, p->pid, p->parent->pid, 2331 2346 kdb_task_has_cpu(p), kdb_process_cpu(p), 2332 2347 kdb_task_state_char(p), ··· 2339 2354 } else { 2340 2355 if (KDB_TSK(cpu) != p) 2341 2356 kdb_printf(" Error: does not match running " 2342 - "process table (0x%p)\n", KDB_TSK(cpu)); 2357 + "process table (0x%px)\n", KDB_TSK(cpu)); 2343 2358 } 2344 2359 } 2345 2360 } ··· 2672 2687 for_each_kdbcmd(kp, i) { 2673 2688 if (kp->cmd_name && (strcmp(kp->cmd_name, cmd) == 0)) { 2674 2689 kdb_printf("Duplicate kdb command registered: " 2675 - "%s, func %p help %s\n", cmd, func, help); 2690 + "%s, func %px help %s\n", cmd, func, help); 2676 2691 return 1; 2677 2692 } 2678 2693 }
+1 -1
kernel/debug/kdb/kdb_private.h
··· 83 83 unsigned long sym_start; 84 84 unsigned long sym_end; 85 85 } kdb_symtab_t; 86 - extern int kallsyms_symbol_next(char *prefix_name, int flag); 86 + extern int kallsyms_symbol_next(char *prefix_name, int flag, int buf_size); 87 87 extern int kallsyms_symbol_complete(char *prefix_name, int max_len); 88 88 89 89 /* Exported Symbols for kernel loadable modules to use. */
+14 -14
kernel/debug/kdb/kdb_support.c
··· 40 40 int kdbgetsymval(const char *symname, kdb_symtab_t *symtab) 41 41 { 42 42 if (KDB_DEBUG(AR)) 43 - kdb_printf("kdbgetsymval: symname=%s, symtab=%p\n", symname, 43 + kdb_printf("kdbgetsymval: symname=%s, symtab=%px\n", symname, 44 44 symtab); 45 45 memset(symtab, 0, sizeof(*symtab)); 46 46 symtab->sym_start = kallsyms_lookup_name(symname); ··· 88 88 char *knt1 = NULL; 89 89 90 90 if (KDB_DEBUG(AR)) 91 - kdb_printf("kdbnearsym: addr=0x%lx, symtab=%p\n", addr, symtab); 91 + kdb_printf("kdbnearsym: addr=0x%lx, symtab=%px\n", addr, symtab); 92 92 memset(symtab, 0, sizeof(*symtab)); 93 93 94 94 if (addr < 4096) ··· 149 149 symtab->mod_name = "kernel"; 150 150 if (KDB_DEBUG(AR)) 151 151 kdb_printf("kdbnearsym: returns %d symtab->sym_start=0x%lx, " 152 - "symtab->mod_name=%p, symtab->sym_name=%p (%s)\n", ret, 152 + "symtab->mod_name=%px, symtab->sym_name=%px (%s)\n", ret, 153 153 symtab->sym_start, symtab->mod_name, symtab->sym_name, 154 154 symtab->sym_name); 155 155 ··· 221 221 * Parameters: 222 222 * prefix_name prefix of a symbol name to lookup 223 223 * flag 0 means search from the head, 1 means continue search. 224 + * buf_size maximum length that can be written to prefix_name 225 + * buffer 224 226 * Returns: 225 227 * 1 if a symbol matches the given prefix. 226 228 * 0 if no string found 227 229 */ 228 - int kallsyms_symbol_next(char *prefix_name, int flag) 230 + int kallsyms_symbol_next(char *prefix_name, int flag, int buf_size) 229 231 { 230 232 int prefix_len = strlen(prefix_name); 231 233 static loff_t pos; ··· 237 235 pos = 0; 238 236 239 237 while ((name = kdb_walk_kallsyms(&pos))) { 240 - if (strncmp(name, prefix_name, prefix_len) == 0) { 241 - strncpy(prefix_name, name, strlen(name)+1); 242 - return 1; 243 - } 238 + if (!strncmp(name, prefix_name, prefix_len)) 239 + return strscpy(prefix_name, name, buf_size); 244 240 } 245 241 return 0; 246 242 } ··· 432 432 *word = w8; 433 433 break; 434 434 } 435 - /* drop through */ 435 + /* fall through */ 436 436 default: 437 437 diag = KDB_BADWIDTH; 438 438 kdb_printf("kdb_getphysword: bad width %ld\n", (long) size); ··· 481 481 *word = w8; 482 482 break; 483 483 } 484 - /* drop through */ 484 + /* fall through */ 485 485 default: 486 486 diag = KDB_BADWIDTH; 487 487 kdb_printf("kdb_getword: bad width %ld\n", (long) size); ··· 525 525 diag = kdb_putarea(addr, w8); 526 526 break; 527 527 } 528 - /* drop through */ 528 + /* fall through */ 529 529 default: 530 530 diag = KDB_BADWIDTH; 531 531 kdb_printf("kdb_putword: bad width %ld\n", (long) size); ··· 887 887 __func__, dah_first); 888 888 if (dah_first) { 889 889 h_used = (struct debug_alloc_header *)debug_alloc_pool; 890 - kdb_printf("%s: h_used %p size %d\n", __func__, h_used, 890 + kdb_printf("%s: h_used %px size %d\n", __func__, h_used, 891 891 h_used->size); 892 892 } 893 893 do { 894 894 h_used = (struct debug_alloc_header *) 895 895 ((char *)h_free + dah_overhead + h_free->size); 896 - kdb_printf("%s: h_used %p size %d caller %p\n", 896 + kdb_printf("%s: h_used %px size %d caller %px\n", 897 897 __func__, h_used, h_used->size, h_used->caller); 898 898 h_free = (struct debug_alloc_header *) 899 899 (debug_alloc_pool + h_free->next); ··· 902 902 ((char *)h_free + dah_overhead + h_free->size); 903 903 if ((char *)h_used - debug_alloc_pool != 904 904 sizeof(debug_alloc_pool_aligned)) 905 - kdb_printf("%s: h_used %p size %d caller %p\n", 905 + kdb_printf("%s: h_used %px size %d caller %px\n", 906 906 __func__, h_used, h_used->size, h_used->caller); 907 907 out: 908 908 spin_unlock(&dap_lock);
+48 -14
kernel/sched/fair.c
··· 5674 5674 return target; 5675 5675 } 5676 5676 5677 - static unsigned long cpu_util_wake(int cpu, struct task_struct *p); 5677 + static unsigned long cpu_util_without(int cpu, struct task_struct *p); 5678 5678 5679 - static unsigned long capacity_spare_wake(int cpu, struct task_struct *p) 5679 + static unsigned long capacity_spare_without(int cpu, struct task_struct *p) 5680 5680 { 5681 - return max_t(long, capacity_of(cpu) - cpu_util_wake(cpu, p), 0); 5681 + return max_t(long, capacity_of(cpu) - cpu_util_without(cpu, p), 0); 5682 5682 } 5683 5683 5684 5684 /* ··· 5738 5738 5739 5739 avg_load += cfs_rq_load_avg(&cpu_rq(i)->cfs); 5740 5740 5741 - spare_cap = capacity_spare_wake(i, p); 5741 + spare_cap = capacity_spare_without(i, p); 5742 5742 5743 5743 if (spare_cap > max_spare_cap) 5744 5744 max_spare_cap = spare_cap; ··· 5889 5889 return prev_cpu; 5890 5890 5891 5891 /* 5892 - * We need task's util for capacity_spare_wake, sync it up to prev_cpu's 5893 - * last_update_time. 5892 + * We need task's util for capacity_spare_without, sync it up to 5893 + * prev_cpu's last_update_time. 5894 5894 */ 5895 5895 if (!(sd_flag & SD_BALANCE_FORK)) 5896 5896 sync_entity_load_avg(&p->se); ··· 6216 6216 } 6217 6217 6218 6218 /* 6219 - * cpu_util_wake: Compute CPU utilization with any contributions from 6220 - * the waking task p removed. 6219 + * cpu_util_without: compute cpu utilization without any contributions from *p 6220 + * @cpu: the CPU which utilization is requested 6221 + * @p: the task which utilization should be discounted 6222 + * 6223 + * The utilization of a CPU is defined by the utilization of tasks currently 6224 + * enqueued on that CPU as well as tasks which are currently sleeping after an 6225 + * execution on that CPU. 6226 + * 6227 + * This method returns the utilization of the specified CPU by discounting the 6228 + * utilization of the specified task, whenever the task is currently 6229 + * contributing to the CPU utilization. 6221 6230 */ 6222 - static unsigned long cpu_util_wake(int cpu, struct task_struct *p) 6231 + static unsigned long cpu_util_without(int cpu, struct task_struct *p) 6223 6232 { 6224 6233 struct cfs_rq *cfs_rq; 6225 6234 unsigned int util; ··· 6240 6231 cfs_rq = &cpu_rq(cpu)->cfs; 6241 6232 util = READ_ONCE(cfs_rq->avg.util_avg); 6242 6233 6243 - /* Discount task's blocked util from CPU's util */ 6234 + /* Discount task's util from CPU's util */ 6244 6235 util -= min_t(unsigned int, util, task_util(p)); 6245 6236 6246 6237 /* ··· 6249 6240 * a) if *p is the only task sleeping on this CPU, then: 6250 6241 * cpu_util (== task_util) > util_est (== 0) 6251 6242 * and thus we return: 6252 - * cpu_util_wake = (cpu_util - task_util) = 0 6243 + * cpu_util_without = (cpu_util - task_util) = 0 6253 6244 * 6254 6245 * b) if other tasks are SLEEPING on this CPU, which is now exiting 6255 6246 * IDLE, then: 6256 6247 * cpu_util >= task_util 6257 6248 * cpu_util > util_est (== 0) 6258 6249 * and thus we discount *p's blocked utilization to return: 6259 - * cpu_util_wake = (cpu_util - task_util) >= 0 6250 + * cpu_util_without = (cpu_util - task_util) >= 0 6260 6251 * 6261 6252 * c) if other tasks are RUNNABLE on that CPU and 6262 6253 * util_est > cpu_util ··· 6269 6260 * covered by the following code when estimated utilization is 6270 6261 * enabled. 6271 6262 */ 6272 - if (sched_feat(UTIL_EST)) 6273 - util = max(util, READ_ONCE(cfs_rq->avg.util_est.enqueued)); 6263 + if (sched_feat(UTIL_EST)) { 6264 + unsigned int estimated = 6265 + READ_ONCE(cfs_rq->avg.util_est.enqueued); 6266 + 6267 + /* 6268 + * Despite the following checks we still have a small window 6269 + * for a possible race, when an execl's select_task_rq_fair() 6270 + * races with LB's detach_task(): 6271 + * 6272 + * detach_task() 6273 + * p->on_rq = TASK_ON_RQ_MIGRATING; 6274 + * ---------------------------------- A 6275 + * deactivate_task() \ 6276 + * dequeue_task() + RaceTime 6277 + * util_est_dequeue() / 6278 + * ---------------------------------- B 6279 + * 6280 + * The additional check on "current == p" it's required to 6281 + * properly fix the execl regression and it helps in further 6282 + * reducing the chances for the above race. 6283 + */ 6284 + if (unlikely(task_on_rq_queued(p) || current == p)) { 6285 + estimated -= min_t(unsigned int, estimated, 6286 + (_task_util_est(p) | UTIL_AVG_UNCHANGED)); 6287 + } 6288 + util = max(util, estimated); 6289 + } 6274 6290 6275 6291 /* 6276 6292 * Utilization (estimated) can exceed the CPU capacity, thus let's
+24 -23
kernel/sched/psi.c
··· 633 633 */ 634 634 void cgroup_move_task(struct task_struct *task, struct css_set *to) 635 635 { 636 - bool move_psi = !psi_disabled; 637 636 unsigned int task_flags = 0; 638 637 struct rq_flags rf; 639 638 struct rq *rq; 640 639 641 - if (move_psi) { 642 - rq = task_rq_lock(task, &rf); 643 - 644 - if (task_on_rq_queued(task)) 645 - task_flags = TSK_RUNNING; 646 - else if (task->in_iowait) 647 - task_flags = TSK_IOWAIT; 648 - 649 - if (task->flags & PF_MEMSTALL) 650 - task_flags |= TSK_MEMSTALL; 651 - 652 - if (task_flags) 653 - psi_task_change(task, task_flags, 0); 640 + if (psi_disabled) { 641 + /* 642 + * Lame to do this here, but the scheduler cannot be locked 643 + * from the outside, so we move cgroups from inside sched/. 644 + */ 645 + rcu_assign_pointer(task->cgroups, to); 646 + return; 654 647 } 655 648 656 - /* 657 - * Lame to do this here, but the scheduler cannot be locked 658 - * from the outside, so we move cgroups from inside sched/. 659 - */ 649 + rq = task_rq_lock(task, &rf); 650 + 651 + if (task_on_rq_queued(task)) 652 + task_flags = TSK_RUNNING; 653 + else if (task->in_iowait) 654 + task_flags = TSK_IOWAIT; 655 + 656 + if (task->flags & PF_MEMSTALL) 657 + task_flags |= TSK_MEMSTALL; 658 + 659 + if (task_flags) 660 + psi_task_change(task, task_flags, 0); 661 + 662 + /* See comment above */ 660 663 rcu_assign_pointer(task->cgroups, to); 661 664 662 - if (move_psi) { 663 - if (task_flags) 664 - psi_task_change(task, 0, task_flags); 665 + if (task_flags) 666 + psi_task_change(task, 0, task_flags); 665 667 666 - task_rq_unlock(rq, task, &rf); 667 - } 668 + task_rq_unlock(rq, task, &rf); 668 669 } 669 670 #endif /* CONFIG_CGROUPS */ 670 671
+1 -2
lib/ubsan.c
··· 427 427 EXPORT_SYMBOL(__ubsan_handle_shift_out_of_bounds); 428 428 429 429 430 - void __noreturn 431 - __ubsan_handle_builtin_unreachable(struct unreachable_data *data) 430 + void __ubsan_handle_builtin_unreachable(struct unreachable_data *data) 432 431 { 433 432 unsigned long flags; 434 433
+8 -2
mm/gup.c
··· 385 385 * @vma: vm_area_struct mapping @address 386 386 * @address: virtual address to look up 387 387 * @flags: flags modifying lookup behaviour 388 - * @page_mask: on output, *page_mask is set according to the size of the page 388 + * @ctx: contains dev_pagemap for %ZONE_DEVICE memory pinning and a 389 + * pointer to output page_mask 389 390 * 390 391 * @flags can have FOLL_ flags set, defined in <linux/mm.h> 391 392 * 392 - * Returns the mapped (struct page *), %NULL if no mapping exists, or 393 + * When getting pages from ZONE_DEVICE memory, the @ctx->pgmap caches 394 + * the device's dev_pagemap metadata to avoid repeating expensive lookups. 395 + * 396 + * On output, the @ctx->page_mask is set according to the size of the page. 397 + * 398 + * Return: the mapped (struct page *), %NULL if no mapping exists, or 393 399 * an error pointer if there is a mapping to something not represented 394 400 * by a page descriptor (see also vm_normal_page()). 395 401 */
+19 -4
mm/hugetlb.c
··· 3233 3233 int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, 3234 3234 struct vm_area_struct *vma) 3235 3235 { 3236 - pte_t *src_pte, *dst_pte, entry; 3236 + pte_t *src_pte, *dst_pte, entry, dst_entry; 3237 3237 struct page *ptepage; 3238 3238 unsigned long addr; 3239 3239 int cow; ··· 3261 3261 break; 3262 3262 } 3263 3263 3264 - /* If the pagetables are shared don't copy or take references */ 3265 - if (dst_pte == src_pte) 3264 + /* 3265 + * If the pagetables are shared don't copy or take references. 3266 + * dst_pte == src_pte is the common case of src/dest sharing. 3267 + * 3268 + * However, src could have 'unshared' and dst shares with 3269 + * another vma. If dst_pte !none, this implies sharing. 3270 + * Check here before taking page table lock, and once again 3271 + * after taking the lock below. 3272 + */ 3273 + dst_entry = huge_ptep_get(dst_pte); 3274 + if ((dst_pte == src_pte) || !huge_pte_none(dst_entry)) 3266 3275 continue; 3267 3276 3268 3277 dst_ptl = huge_pte_lock(h, dst, dst_pte); 3269 3278 src_ptl = huge_pte_lockptr(h, src, src_pte); 3270 3279 spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING); 3271 3280 entry = huge_ptep_get(src_pte); 3272 - if (huge_pte_none(entry)) { /* skip none entry */ 3281 + dst_entry = huge_ptep_get(dst_pte); 3282 + if (huge_pte_none(entry) || !huge_pte_none(dst_entry)) { 3283 + /* 3284 + * Skip if src entry none. Also, skip in the 3285 + * unlikely case dst entry !none as this implies 3286 + * sharing with another vma. 3287 + */ 3273 3288 ; 3274 3289 } else if (unlikely(is_hugetlb_entry_migration(entry) || 3275 3290 is_hugetlb_entry_hwpoisoned(entry))) {
+1 -1
mm/memblock.c
··· 1179 1179 1180 1180 #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP 1181 1181 /* 1182 - * Common iterator interface used to define for_each_mem_range(). 1182 + * Common iterator interface used to define for_each_mem_pfn_range(). 1183 1183 */ 1184 1184 void __init_memblock __next_mem_pfn_range(int *idx, int nid, 1185 1185 unsigned long *out_start_pfn,
+17 -11
mm/page_alloc.c
··· 4061 4061 int reserve_flags; 4062 4062 4063 4063 /* 4064 - * In the slowpath, we sanity check order to avoid ever trying to 4065 - * reclaim >= MAX_ORDER areas which will never succeed. Callers may 4066 - * be using allocators in order of preference for an area that is 4067 - * too large. 4068 - */ 4069 - if (order >= MAX_ORDER) { 4070 - WARN_ON_ONCE(!(gfp_mask & __GFP_NOWARN)); 4071 - return NULL; 4072 - } 4073 - 4074 - /* 4075 4064 * We also sanity check to catch abuse of atomic reserves being used by 4076 4065 * callers that are not in atomic context. 4077 4066 */ ··· 4352 4363 unsigned int alloc_flags = ALLOC_WMARK_LOW; 4353 4364 gfp_t alloc_mask; /* The gfp_t that was actually used for allocation */ 4354 4365 struct alloc_context ac = { }; 4366 + 4367 + /* 4368 + * There are several places where we assume that the order value is sane 4369 + * so bail out early if the request is out of bound. 4370 + */ 4371 + if (unlikely(order >= MAX_ORDER)) { 4372 + WARN_ON_ONCE(!(gfp_mask & __GFP_NOWARN)); 4373 + return NULL; 4374 + } 4355 4375 4356 4376 gfp_mask &= gfp_allowed_mask; 4357 4377 alloc_mask = gfp_mask; ··· 7785 7787 7786 7788 if (PageReserved(page)) 7787 7789 goto unmovable; 7790 + 7791 + /* 7792 + * If the zone is movable and we have ruled out all reserved 7793 + * pages then it should be reasonably safe to assume the rest 7794 + * is movable. 7795 + */ 7796 + if (zone_idx(zone) == ZONE_MOVABLE) 7797 + continue; 7788 7798 7789 7799 /* 7790 7800 * Hugepages are not in LRU lists, but they're movable.
+1 -3
mm/shmem.c
··· 2563 2563 inode_lock(inode); 2564 2564 /* We're holding i_mutex so we can access i_size directly */ 2565 2565 2566 - if (offset < 0) 2567 - offset = -EINVAL; 2568 - else if (offset >= inode->i_size) 2566 + if (offset < 0 || offset >= inode->i_size) 2569 2567 offset = -ENXIO; 2570 2568 else { 2571 2569 start = offset >> PAGE_SHIFT;
+3 -3
mm/swapfile.c
··· 2813 2813 unsigned int type; 2814 2814 int i; 2815 2815 2816 - p = kzalloc(sizeof(*p), GFP_KERNEL); 2816 + p = kvzalloc(sizeof(*p), GFP_KERNEL); 2817 2817 if (!p) 2818 2818 return ERR_PTR(-ENOMEM); 2819 2819 ··· 2824 2824 } 2825 2825 if (type >= MAX_SWAPFILES) { 2826 2826 spin_unlock(&swap_lock); 2827 - kfree(p); 2827 + kvfree(p); 2828 2828 return ERR_PTR(-EPERM); 2829 2829 } 2830 2830 if (type >= nr_swapfiles) { ··· 2838 2838 smp_wmb(); 2839 2839 nr_swapfiles++; 2840 2840 } else { 2841 - kfree(p); 2841 + kvfree(p); 2842 2842 p = swap_info[type]; 2843 2843 /* 2844 2844 * Do not memset this entry: a racing procfs swap_next()
+4 -3
mm/vmstat.c
··· 1827 1827 1828 1828 /* 1829 1829 * The fast way of checking if there are any vmstat diffs. 1830 - * This works because the diffs are byte sized items. 1831 1830 */ 1832 - if (memchr_inv(p->vm_stat_diff, 0, NR_VM_ZONE_STAT_ITEMS)) 1831 + if (memchr_inv(p->vm_stat_diff, 0, NR_VM_ZONE_STAT_ITEMS * 1832 + sizeof(p->vm_stat_diff[0]))) 1833 1833 return true; 1834 1834 #ifdef CONFIG_NUMA 1835 - if (memchr_inv(p->vm_numa_stat_diff, 0, NR_VM_NUMA_STAT_ITEMS)) 1835 + if (memchr_inv(p->vm_numa_stat_diff, 0, NR_VM_NUMA_STAT_ITEMS * 1836 + sizeof(p->vm_numa_stat_diff[0]))) 1836 1837 return true; 1837 1838 #endif 1838 1839 }
+63 -40
mm/z3fold.c
··· 99 99 #define NCHUNKS ((PAGE_SIZE - ZHDR_SIZE_ALIGNED) >> CHUNK_SHIFT) 100 100 101 101 #define BUDDY_MASK (0x3) 102 + #define BUDDY_SHIFT 2 102 103 103 104 /** 104 105 * struct z3fold_pool - stores metadata for each z3fold pool ··· 146 145 MIDDLE_CHUNK_MAPPED, 147 146 NEEDS_COMPACTING, 148 147 PAGE_STALE, 149 - UNDER_RECLAIM 148 + PAGE_CLAIMED, /* by either reclaim or free */ 150 149 }; 151 150 152 151 /***************** ··· 175 174 clear_bit(MIDDLE_CHUNK_MAPPED, &page->private); 176 175 clear_bit(NEEDS_COMPACTING, &page->private); 177 176 clear_bit(PAGE_STALE, &page->private); 178 - clear_bit(UNDER_RECLAIM, &page->private); 177 + clear_bit(PAGE_CLAIMED, &page->private); 179 178 180 179 spin_lock_init(&zhdr->page_lock); 181 180 kref_init(&zhdr->refcount); ··· 224 223 unsigned long handle; 225 224 226 225 handle = (unsigned long)zhdr; 227 - if (bud != HEADLESS) 228 - handle += (bud + zhdr->first_num) & BUDDY_MASK; 226 + if (bud != HEADLESS) { 227 + handle |= (bud + zhdr->first_num) & BUDDY_MASK; 228 + if (bud == LAST) 229 + handle |= (zhdr->last_chunks << BUDDY_SHIFT); 230 + } 229 231 return handle; 230 232 } 231 233 ··· 236 232 static struct z3fold_header *handle_to_z3fold_header(unsigned long handle) 237 233 { 238 234 return (struct z3fold_header *)(handle & PAGE_MASK); 235 + } 236 + 237 + /* only for LAST bud, returns zero otherwise */ 238 + static unsigned short handle_to_chunks(unsigned long handle) 239 + { 240 + return (handle & ~PAGE_MASK) >> BUDDY_SHIFT; 239 241 } 240 242 241 243 /* ··· 730 720 page = virt_to_page(zhdr); 731 721 732 722 if (test_bit(PAGE_HEADLESS, &page->private)) { 733 - /* HEADLESS page stored */ 734 - bud = HEADLESS; 735 - } else { 736 - z3fold_page_lock(zhdr); 737 - bud = handle_to_buddy(handle); 738 - 739 - switch (bud) { 740 - case FIRST: 741 - zhdr->first_chunks = 0; 742 - break; 743 - case MIDDLE: 744 - zhdr->middle_chunks = 0; 745 - zhdr->start_middle = 0; 746 - break; 747 - case LAST: 748 - zhdr->last_chunks = 0; 749 - break; 750 - default: 751 - pr_err("%s: unknown bud %d\n", __func__, bud); 752 - WARN_ON(1); 753 - z3fold_page_unlock(zhdr); 754 - return; 723 + /* if a headless page is under reclaim, just leave. 724 + * NB: we use test_and_set_bit for a reason: if the bit 725 + * has not been set before, we release this page 726 + * immediately so we don't care about its value any more. 727 + */ 728 + if (!test_and_set_bit(PAGE_CLAIMED, &page->private)) { 729 + spin_lock(&pool->lock); 730 + list_del(&page->lru); 731 + spin_unlock(&pool->lock); 732 + free_z3fold_page(page); 733 + atomic64_dec(&pool->pages_nr); 755 734 } 735 + return; 756 736 } 757 737 758 - if (bud == HEADLESS) { 759 - spin_lock(&pool->lock); 760 - list_del(&page->lru); 761 - spin_unlock(&pool->lock); 762 - free_z3fold_page(page); 763 - atomic64_dec(&pool->pages_nr); 738 + /* Non-headless case */ 739 + z3fold_page_lock(zhdr); 740 + bud = handle_to_buddy(handle); 741 + 742 + switch (bud) { 743 + case FIRST: 744 + zhdr->first_chunks = 0; 745 + break; 746 + case MIDDLE: 747 + zhdr->middle_chunks = 0; 748 + break; 749 + case LAST: 750 + zhdr->last_chunks = 0; 751 + break; 752 + default: 753 + pr_err("%s: unknown bud %d\n", __func__, bud); 754 + WARN_ON(1); 755 + z3fold_page_unlock(zhdr); 764 756 return; 765 757 } 766 758 ··· 770 758 atomic64_dec(&pool->pages_nr); 771 759 return; 772 760 } 773 - if (test_bit(UNDER_RECLAIM, &page->private)) { 761 + if (test_bit(PAGE_CLAIMED, &page->private)) { 774 762 z3fold_page_unlock(zhdr); 775 763 return; 776 764 } ··· 848 836 } 849 837 list_for_each_prev(pos, &pool->lru) { 850 838 page = list_entry(pos, struct page, lru); 851 - if (test_bit(PAGE_HEADLESS, &page->private)) 852 - /* candidate found */ 853 - break; 839 + 840 + /* this bit could have been set by free, in which case 841 + * we pass over to the next page in the pool. 842 + */ 843 + if (test_and_set_bit(PAGE_CLAIMED, &page->private)) 844 + continue; 854 845 855 846 zhdr = page_address(page); 856 - if (!z3fold_page_trylock(zhdr)) 847 + if (test_bit(PAGE_HEADLESS, &page->private)) 848 + break; 849 + 850 + if (!z3fold_page_trylock(zhdr)) { 851 + zhdr = NULL; 857 852 continue; /* can't evict at this point */ 853 + } 858 854 kref_get(&zhdr->refcount); 859 855 list_del_init(&zhdr->buddy); 860 856 zhdr->cpu = -1; 861 - set_bit(UNDER_RECLAIM, &page->private); 862 857 break; 863 858 } 859 + 860 + if (!zhdr) 861 + break; 864 862 865 863 list_del_init(&page->lru); 866 864 spin_unlock(&pool->lock); ··· 920 898 if (test_bit(PAGE_HEADLESS, &page->private)) { 921 899 if (ret == 0) { 922 900 free_z3fold_page(page); 901 + atomic64_dec(&pool->pages_nr); 923 902 return 0; 924 903 } 925 904 spin_lock(&pool->lock); ··· 928 905 spin_unlock(&pool->lock); 929 906 } else { 930 907 z3fold_page_lock(zhdr); 931 - clear_bit(UNDER_RECLAIM, &page->private); 908 + clear_bit(PAGE_CLAIMED, &page->private); 932 909 if (kref_put(&zhdr->refcount, 933 910 release_z3fold_page_locked)) { 934 911 atomic64_dec(&pool->pages_nr); ··· 987 964 set_bit(MIDDLE_CHUNK_MAPPED, &page->private); 988 965 break; 989 966 case LAST: 990 - addr += PAGE_SIZE - (zhdr->last_chunks << CHUNK_SHIFT); 967 + addr += PAGE_SIZE - (handle_to_chunks(handle) << CHUNK_SHIFT); 991 968 break; 992 969 default: 993 970 pr_err("unknown buddy id %d\n", buddy);
+4 -2
net/batman-adv/bat_v_elp.c
··· 352 352 */ 353 353 int batadv_v_elp_iface_enable(struct batadv_hard_iface *hard_iface) 354 354 { 355 + static const size_t tvlv_padding = sizeof(__be32); 355 356 struct batadv_elp_packet *elp_packet; 356 357 unsigned char *elp_buff; 357 358 u32 random_seqno; 358 359 size_t size; 359 360 int res = -ENOMEM; 360 361 361 - size = ETH_HLEN + NET_IP_ALIGN + BATADV_ELP_HLEN; 362 + size = ETH_HLEN + NET_IP_ALIGN + BATADV_ELP_HLEN + tvlv_padding; 362 363 hard_iface->bat_v.elp_skb = dev_alloc_skb(size); 363 364 if (!hard_iface->bat_v.elp_skb) 364 365 goto out; 365 366 366 367 skb_reserve(hard_iface->bat_v.elp_skb, ETH_HLEN + NET_IP_ALIGN); 367 - elp_buff = skb_put_zero(hard_iface->bat_v.elp_skb, BATADV_ELP_HLEN); 368 + elp_buff = skb_put_zero(hard_iface->bat_v.elp_skb, 369 + BATADV_ELP_HLEN + tvlv_padding); 368 370 elp_packet = (struct batadv_elp_packet *)elp_buff; 369 371 370 372 elp_packet->packet_type = BATADV_ELP;
+1 -1
net/batman-adv/fragmentation.c
··· 275 275 kfree(entry); 276 276 277 277 packet = (struct batadv_frag_packet *)skb_out->data; 278 - size = ntohs(packet->total_size); 278 + size = ntohs(packet->total_size) + hdr_size; 279 279 280 280 /* Make room for the rest of the fragments. */ 281 281 if (pskb_expand_head(skb_out, 0, size - skb_out->len, GFP_ATOMIC) < 0) {
+7
net/bridge/br_private.h
··· 102 102 struct metadata_dst *tunnel_dst; 103 103 }; 104 104 105 + /* private vlan flags */ 106 + enum { 107 + BR_VLFLAG_PER_PORT_STATS = BIT(0), 108 + }; 109 + 105 110 /** 106 111 * struct net_bridge_vlan - per-vlan entry 107 112 * 108 113 * @vnode: rhashtable member 109 114 * @vid: VLAN id 110 115 * @flags: bridge vlan flags 116 + * @priv_flags: private (in-kernel) bridge vlan flags 111 117 * @stats: per-cpu VLAN statistics 112 118 * @br: if MASTER flag set, this points to a bridge struct 113 119 * @port: if MASTER flag unset, this points to a port struct ··· 133 127 struct rhash_head tnode; 134 128 u16 vid; 135 129 u16 flags; 130 + u16 priv_flags; 136 131 struct br_vlan_stats __percpu *stats; 137 132 union { 138 133 struct net_bridge *br;
+2 -1
net/bridge/br_vlan.c
··· 197 197 v = container_of(rcu, struct net_bridge_vlan, rcu); 198 198 WARN_ON(br_vlan_is_master(v)); 199 199 /* if we had per-port stats configured then free them here */ 200 - if (v->brvlan->stats != v->stats) 200 + if (v->priv_flags & BR_VLFLAG_PER_PORT_STATS) 201 201 free_percpu(v->stats); 202 202 v->stats = NULL; 203 203 kfree(v); ··· 264 264 err = -ENOMEM; 265 265 goto out_filt; 266 266 } 267 + v->priv_flags |= BR_VLFLAG_PER_PORT_STATS; 267 268 } else { 268 269 v->stats = masterv->stats; 269 270 }
+9 -8
net/can/raw.c
··· 745 745 } else 746 746 ifindex = ro->ifindex; 747 747 748 - if (ro->fd_frames) { 749 - if (unlikely(size != CANFD_MTU && size != CAN_MTU)) 750 - return -EINVAL; 751 - } else { 752 - if (unlikely(size != CAN_MTU)) 753 - return -EINVAL; 754 - } 755 - 756 748 dev = dev_get_by_index(sock_net(sk), ifindex); 757 749 if (!dev) 758 750 return -ENXIO; 751 + 752 + err = -EINVAL; 753 + if (ro->fd_frames && dev->mtu == CANFD_MTU) { 754 + if (unlikely(size != CANFD_MTU && size != CAN_MTU)) 755 + goto put_dev; 756 + } else { 757 + if (unlikely(size != CAN_MTU)) 758 + goto put_dev; 759 + } 759 760 760 761 skb = sock_alloc_send_skb(sk, size + sizeof(struct can_skb_priv), 761 762 msg->msg_flags & MSG_DONTWAIT, &err);
+4
net/core/dev.c
··· 5664 5664 __vlan_hwaccel_clear_tag(skb); 5665 5665 skb->dev = napi->dev; 5666 5666 skb->skb_iif = 0; 5667 + 5668 + /* eth_type_trans() assumes pkt_type is PACKET_HOST */ 5669 + skb->pkt_type = PACKET_HOST; 5670 + 5667 5671 skb->encapsulation = 0; 5668 5672 skb_shinfo(skb)->gso_type = 0; 5669 5673 skb->truesize = SKB_TRUESIZE(skb_end_offset(skb));
+1 -1
net/ipv4/ip_tunnel_core.c
··· 80 80 81 81 iph->version = 4; 82 82 iph->ihl = sizeof(struct iphdr) >> 2; 83 - iph->frag_off = df; 83 + iph->frag_off = ip_mtu_locked(&rt->dst) ? 0 : df; 84 84 iph->protocol = proto; 85 85 iph->tos = tos; 86 86 iph->daddr = dst;
+8 -6
net/ipv6/route.c
··· 2232 2232 if (rt) { 2233 2233 rcu_read_lock(); 2234 2234 if (rt->rt6i_flags & RTF_CACHE) { 2235 - if (dst_hold_safe(&rt->dst)) 2236 - rt6_remove_exception_rt(rt); 2235 + rt6_remove_exception_rt(rt); 2237 2236 } else { 2238 2237 struct fib6_info *from; 2239 2238 struct fib6_node *fn; ··· 2359 2360 2360 2361 void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, __be32 mtu) 2361 2362 { 2363 + int oif = sk->sk_bound_dev_if; 2362 2364 struct dst_entry *dst; 2363 2365 2364 - ip6_update_pmtu(skb, sock_net(sk), mtu, 2365 - sk->sk_bound_dev_if, sk->sk_mark, sk->sk_uid); 2366 + if (!oif && skb->dev) 2367 + oif = l3mdev_master_ifindex(skb->dev); 2368 + 2369 + ip6_update_pmtu(skb, sock_net(sk), mtu, oif, sk->sk_mark, sk->sk_uid); 2366 2370 2367 2371 dst = __sk_dst_get(sk); 2368 2372 if (!dst || !dst->obsolete || ··· 3217 3215 if (cfg->fc_flags & RTF_GATEWAY && 3218 3216 !ipv6_addr_equal(&cfg->fc_gateway, &rt->rt6i_gateway)) 3219 3217 goto out; 3220 - if (dst_hold_safe(&rt->dst)) 3221 - rc = rt6_remove_exception_rt(rt); 3218 + 3219 + rc = rt6_remove_exception_rt(rt); 3222 3220 out: 3223 3221 return rc; 3224 3222 }
+4 -5
net/l2tp/l2tp_core.c
··· 1490 1490 goto err_sock; 1491 1491 } 1492 1492 1493 - sk = sock->sk; 1494 - 1495 - sock_hold(sk); 1496 - tunnel->sock = sk; 1497 1493 tunnel->l2tp_net = net; 1498 - 1499 1494 pn = l2tp_pernet(net); 1500 1495 1501 1496 spin_lock_bh(&pn->l2tp_tunnel_list_lock); ··· 1504 1509 } 1505 1510 list_add_rcu(&tunnel->list, &pn->l2tp_tunnel_list); 1506 1511 spin_unlock_bh(&pn->l2tp_tunnel_list_lock); 1512 + 1513 + sk = sock->sk; 1514 + sock_hold(sk); 1515 + tunnel->sock = sk; 1507 1516 1508 1517 if (tunnel->encap == L2TP_ENCAPTYPE_UDP) { 1509 1518 struct udp_tunnel_sock_cfg udp_cfg = {
+23 -4
net/rxrpc/af_rxrpc.c
··· 375 375 * getting ACKs from the server. Returns a number representing the life state 376 376 * which can be compared to that returned by a previous call. 377 377 * 378 - * If this is a client call, ping ACKs will be sent to the server to find out 379 - * whether it's still responsive and whether the call is still alive on the 380 - * server. 378 + * If the life state stalls, rxrpc_kernel_probe_life() should be called and 379 + * then 2RTT waited. 381 380 */ 382 - u32 rxrpc_kernel_check_life(struct socket *sock, struct rxrpc_call *call) 381 + u32 rxrpc_kernel_check_life(const struct socket *sock, 382 + const struct rxrpc_call *call) 383 383 { 384 384 return call->acks_latest; 385 385 } 386 386 EXPORT_SYMBOL(rxrpc_kernel_check_life); 387 + 388 + /** 389 + * rxrpc_kernel_probe_life - Poke the peer to see if it's still alive 390 + * @sock: The socket the call is on 391 + * @call: The call to check 392 + * 393 + * In conjunction with rxrpc_kernel_check_life(), allow a kernel service to 394 + * find out whether a call is still alive by pinging it. This should cause the 395 + * life state to be bumped in about 2*RTT. 396 + * 397 + * The must be called in TASK_RUNNING state on pain of might_sleep() objecting. 398 + */ 399 + void rxrpc_kernel_probe_life(struct socket *sock, struct rxrpc_call *call) 400 + { 401 + rxrpc_propose_ACK(call, RXRPC_ACK_PING, 0, 0, true, false, 402 + rxrpc_propose_ack_ping_for_check_life); 403 + rxrpc_send_ack_packet(call, true, NULL); 404 + } 405 + EXPORT_SYMBOL(rxrpc_kernel_probe_life); 387 406 388 407 /** 389 408 * rxrpc_kernel_get_epoch - Retrieve the epoch value from a call.
+2 -1
net/sched/act_pedit.c
··· 201 201 goto out_release; 202 202 } 203 203 } else { 204 - return err; 204 + ret = err; 205 + goto out_free; 205 206 } 206 207 207 208 p = to_pedit(*a);
+18 -11
net/sched/sch_fq.c
··· 476 476 goto begin; 477 477 } 478 478 prefetch(&skb->end); 479 - f->credit -= qdisc_pkt_len(skb); 479 + plen = qdisc_pkt_len(skb); 480 + f->credit -= plen; 480 481 481 - if (ktime_to_ns(skb->tstamp) || !q->rate_enable) 482 + if (!q->rate_enable) 482 483 goto out; 483 484 484 485 rate = q->flow_max_rate; 485 - if (skb->sk) 486 - rate = min(skb->sk->sk_pacing_rate, rate); 487 486 488 - if (rate <= q->low_rate_threshold) { 489 - f->credit = 0; 490 - plen = qdisc_pkt_len(skb); 491 - } else { 492 - plen = max(qdisc_pkt_len(skb), q->quantum); 493 - if (f->credit > 0) 494 - goto out; 487 + /* If EDT time was provided for this skb, we need to 488 + * update f->time_next_packet only if this qdisc enforces 489 + * a flow max rate. 490 + */ 491 + if (!skb->tstamp) { 492 + if (skb->sk) 493 + rate = min(skb->sk->sk_pacing_rate, rate); 494 + 495 + if (rate <= q->low_rate_threshold) { 496 + f->credit = 0; 497 + } else { 498 + plen = max(plen, q->quantum); 499 + if (f->credit > 0) 500 + goto out; 501 + } 495 502 } 496 503 if (rate != ~0UL) { 497 504 u64 len = (u64)plen * NSEC_PER_SEC;
+1 -1
net/socket.c
··· 853 853 struct socket *sock = file->private_data; 854 854 855 855 if (unlikely(!sock->ops->splice_read)) 856 - return -EINVAL; 856 + return generic_file_splice_read(file, ppos, pipe, len, flags); 857 857 858 858 return sock->ops->splice_read(sock, ppos, pipe, len, flags); 859 859 }
+1 -7
net/sunrpc/auth_generic.c
··· 281 281 { 282 282 struct auth_cred *acred = &container_of(cred, struct generic_cred, 283 283 gc_base)->acred; 284 - bool ret; 285 - 286 - get_rpccred(cred); 287 - ret = test_bit(RPC_CRED_KEY_EXPIRE_SOON, &acred->ac_flags); 288 - put_rpccred(cred); 289 - 290 - return ret; 284 + return test_bit(RPC_CRED_KEY_EXPIRE_SOON, &acred->ac_flags); 291 285 } 292 286 293 287 static const struct rpc_credops generic_credops = {
+42 -19
net/sunrpc/auth_gss/auth_gss.c
··· 1239 1239 return &gss_auth->rpc_auth; 1240 1240 } 1241 1241 1242 + static struct gss_cred * 1243 + gss_dup_cred(struct gss_auth *gss_auth, struct gss_cred *gss_cred) 1244 + { 1245 + struct gss_cred *new; 1246 + 1247 + /* Make a copy of the cred so that we can reference count it */ 1248 + new = kzalloc(sizeof(*gss_cred), GFP_NOIO); 1249 + if (new) { 1250 + struct auth_cred acred = { 1251 + .uid = gss_cred->gc_base.cr_uid, 1252 + }; 1253 + struct gss_cl_ctx *ctx = 1254 + rcu_dereference_protected(gss_cred->gc_ctx, 1); 1255 + 1256 + rpcauth_init_cred(&new->gc_base, &acred, 1257 + &gss_auth->rpc_auth, 1258 + &gss_nullops); 1259 + new->gc_base.cr_flags = 1UL << RPCAUTH_CRED_UPTODATE; 1260 + new->gc_service = gss_cred->gc_service; 1261 + new->gc_principal = gss_cred->gc_principal; 1262 + kref_get(&gss_auth->kref); 1263 + rcu_assign_pointer(new->gc_ctx, ctx); 1264 + gss_get_ctx(ctx); 1265 + } 1266 + return new; 1267 + } 1268 + 1242 1269 /* 1243 - * gss_destroying_context will cause the RPCSEC_GSS to send a NULL RPC call 1270 + * gss_send_destroy_context will cause the RPCSEC_GSS to send a NULL RPC call 1244 1271 * to the server with the GSS control procedure field set to 1245 1272 * RPC_GSS_PROC_DESTROY. This should normally cause the server to release 1246 1273 * all RPCSEC_GSS state associated with that context. 1247 1274 */ 1248 - static int 1249 - gss_destroying_context(struct rpc_cred *cred) 1275 + static void 1276 + gss_send_destroy_context(struct rpc_cred *cred) 1250 1277 { 1251 1278 struct gss_cred *gss_cred = container_of(cred, struct gss_cred, gc_base); 1252 1279 struct gss_auth *gss_auth = container_of(cred->cr_auth, struct gss_auth, rpc_auth); 1253 1280 struct gss_cl_ctx *ctx = rcu_dereference_protected(gss_cred->gc_ctx, 1); 1281 + struct gss_cred *new; 1254 1282 struct rpc_task *task; 1255 1283 1256 - if (test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) == 0) 1257 - return 0; 1284 + new = gss_dup_cred(gss_auth, gss_cred); 1285 + if (new) { 1286 + ctx->gc_proc = RPC_GSS_PROC_DESTROY; 1258 1287 1259 - ctx->gc_proc = RPC_GSS_PROC_DESTROY; 1260 - cred->cr_ops = &gss_nullops; 1288 + task = rpc_call_null(gss_auth->client, &new->gc_base, 1289 + RPC_TASK_ASYNC|RPC_TASK_SOFT); 1290 + if (!IS_ERR(task)) 1291 + rpc_put_task(task); 1261 1292 1262 - /* Take a reference to ensure the cred will be destroyed either 1263 - * by the RPC call or by the put_rpccred() below */ 1264 - get_rpccred(cred); 1265 - 1266 - task = rpc_call_null(gss_auth->client, cred, RPC_TASK_ASYNC|RPC_TASK_SOFT); 1267 - if (!IS_ERR(task)) 1268 - rpc_put_task(task); 1269 - 1270 - put_rpccred(cred); 1271 - return 1; 1293 + put_rpccred(&new->gc_base); 1294 + } 1272 1295 } 1273 1296 1274 1297 /* gss_destroy_cred (and gss_free_ctx) are used to clean up after failure ··· 1353 1330 gss_destroy_cred(struct rpc_cred *cred) 1354 1331 { 1355 1332 1356 - if (gss_destroying_context(cred)) 1357 - return; 1333 + if (test_and_clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) != 0) 1334 + gss_send_destroy_context(cred); 1358 1335 gss_destroy_nullcred(cred); 1359 1336 } 1360 1337
+3 -4
net/sunrpc/xdr.c
··· 546 546 static __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr, 547 547 size_t nbytes) 548 548 { 549 - static __be32 *p; 549 + __be32 *p; 550 550 int space_left; 551 551 int frag1bytes, frag2bytes; 552 552 ··· 673 673 WARN_ON_ONCE(xdr->iov); 674 674 return; 675 675 } 676 - if (fraglen) { 676 + if (fraglen) 677 677 xdr->end = head->iov_base + head->iov_len; 678 - xdr->page_ptr--; 679 - } 680 678 /* (otherwise assume xdr->end is already set) */ 679 + xdr->page_ptr--; 681 680 head->iov_len = len; 682 681 buf->len = len; 683 682 xdr->p = head->iov_base + head->iov_len;
+10 -9
net/tipc/discover.c
··· 166 166 167 167 /* Apply trial address if we just left trial period */ 168 168 if (!trial && !self) { 169 - tipc_net_finalize(net, tn->trial_addr); 169 + tipc_sched_net_finalize(net, tn->trial_addr); 170 + msg_set_prevnode(buf_msg(d->skb), tn->trial_addr); 170 171 msg_set_type(buf_msg(d->skb), DSC_REQ_MSG); 171 172 } 172 173 ··· 301 300 goto exit; 302 301 } 303 302 304 - /* Trial period over ? */ 305 - if (!time_before(jiffies, tn->addr_trial_end)) { 306 - /* Did we just leave it ? */ 307 - if (!tipc_own_addr(net)) 308 - tipc_net_finalize(net, tn->trial_addr); 309 - 310 - msg_set_type(buf_msg(d->skb), DSC_REQ_MSG); 311 - msg_set_prevnode(buf_msg(d->skb), tipc_own_addr(net)); 303 + /* Did we just leave trial period ? */ 304 + if (!time_before(jiffies, tn->addr_trial_end) && !tipc_own_addr(net)) { 305 + mod_timer(&d->timer, jiffies + TIPC_DISC_INIT); 306 + spin_unlock_bh(&d->lock); 307 + tipc_sched_net_finalize(net, tn->trial_addr); 308 + return; 312 309 } 313 310 314 311 /* Adjust timeout interval according to discovery phase */ ··· 318 319 d->timer_intv = TIPC_DISC_SLOW; 319 320 else if (!d->num_nodes && d->timer_intv > TIPC_DISC_FAST) 320 321 d->timer_intv = TIPC_DISC_FAST; 322 + msg_set_type(buf_msg(d->skb), DSC_REQ_MSG); 323 + msg_set_prevnode(buf_msg(d->skb), tn->trial_addr); 321 324 } 322 325 323 326 mod_timer(&d->timer, jiffies + d->timer_intv);
+37 -8
net/tipc/net.c
··· 104 104 * - A local spin_lock protecting the queue of subscriber events. 105 105 */ 106 106 107 + struct tipc_net_work { 108 + struct work_struct work; 109 + struct net *net; 110 + u32 addr; 111 + }; 112 + 113 + static void tipc_net_finalize(struct net *net, u32 addr); 114 + 107 115 int tipc_net_init(struct net *net, u8 *node_id, u32 addr) 108 116 { 109 117 if (tipc_own_id(net)) { ··· 127 119 return 0; 128 120 } 129 121 130 - void tipc_net_finalize(struct net *net, u32 addr) 122 + static void tipc_net_finalize(struct net *net, u32 addr) 131 123 { 132 124 struct tipc_net *tn = tipc_net(net); 133 125 134 - if (!cmpxchg(&tn->node_addr, 0, addr)) { 135 - tipc_set_node_addr(net, addr); 136 - tipc_named_reinit(net); 137 - tipc_sk_reinit(net); 138 - tipc_nametbl_publish(net, TIPC_CFG_SRV, addr, addr, 139 - TIPC_CLUSTER_SCOPE, 0, addr); 140 - } 126 + if (cmpxchg(&tn->node_addr, 0, addr)) 127 + return; 128 + tipc_set_node_addr(net, addr); 129 + tipc_named_reinit(net); 130 + tipc_sk_reinit(net); 131 + tipc_nametbl_publish(net, TIPC_CFG_SRV, addr, addr, 132 + TIPC_CLUSTER_SCOPE, 0, addr); 133 + } 134 + 135 + static void tipc_net_finalize_work(struct work_struct *work) 136 + { 137 + struct tipc_net_work *fwork; 138 + 139 + fwork = container_of(work, struct tipc_net_work, work); 140 + tipc_net_finalize(fwork->net, fwork->addr); 141 + kfree(fwork); 142 + } 143 + 144 + void tipc_sched_net_finalize(struct net *net, u32 addr) 145 + { 146 + struct tipc_net_work *fwork = kzalloc(sizeof(*fwork), GFP_ATOMIC); 147 + 148 + if (!fwork) 149 + return; 150 + INIT_WORK(&fwork->work, tipc_net_finalize_work); 151 + fwork->net = net; 152 + fwork->addr = addr; 153 + schedule_work(&fwork->work); 141 154 } 142 155 143 156 void tipc_net_stop(struct net *net)
+1 -1
net/tipc/net.h
··· 42 42 extern const struct nla_policy tipc_nl_net_policy[]; 43 43 44 44 int tipc_net_init(struct net *net, u8 *node_id, u32 addr); 45 - void tipc_net_finalize(struct net *net, u32 addr); 45 + void tipc_sched_net_finalize(struct net *net, u32 addr); 46 46 void tipc_net_stop(struct net *net); 47 47 int tipc_nl_net_dump(struct sk_buff *skb, struct netlink_callback *cb); 48 48 int tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info);
+11 -4
net/tipc/socket.c
··· 1555 1555 /** 1556 1556 * tipc_sk_anc_data_recv - optionally capture ancillary data for received message 1557 1557 * @m: descriptor for message info 1558 - * @msg: received message header 1558 + * @skb: received message buffer 1559 1559 * @tsk: TIPC port associated with message 1560 1560 * 1561 1561 * Note: Ancillary data is not captured if not requested by receiver. 1562 1562 * 1563 1563 * Returns 0 if successful, otherwise errno 1564 1564 */ 1565 - static int tipc_sk_anc_data_recv(struct msghdr *m, struct tipc_msg *msg, 1565 + static int tipc_sk_anc_data_recv(struct msghdr *m, struct sk_buff *skb, 1566 1566 struct tipc_sock *tsk) 1567 1567 { 1568 + struct tipc_msg *msg; 1568 1569 u32 anc_data[3]; 1569 1570 u32 err; 1570 1571 u32 dest_type; ··· 1574 1573 1575 1574 if (likely(m->msg_controllen == 0)) 1576 1575 return 0; 1576 + msg = buf_msg(skb); 1577 1577 1578 1578 /* Optionally capture errored message object(s) */ 1579 1579 err = msg ? msg_errcode(msg) : 0; ··· 1585 1583 if (res) 1586 1584 return res; 1587 1585 if (anc_data[1]) { 1586 + if (skb_linearize(skb)) 1587 + return -ENOMEM; 1588 + msg = buf_msg(skb); 1588 1589 res = put_cmsg(m, SOL_TIPC, TIPC_RETDATA, anc_data[1], 1589 1590 msg_data(msg)); 1590 1591 if (res) ··· 1749 1744 1750 1745 /* Collect msg meta data, including error code and rejected data */ 1751 1746 tipc_sk_set_orig_addr(m, skb); 1752 - rc = tipc_sk_anc_data_recv(m, hdr, tsk); 1747 + rc = tipc_sk_anc_data_recv(m, skb, tsk); 1753 1748 if (unlikely(rc)) 1754 1749 goto exit; 1750 + hdr = buf_msg(skb); 1755 1751 1756 1752 /* Capture data if non-error msg, otherwise just set return value */ 1757 1753 if (likely(!err)) { ··· 1862 1856 /* Collect msg meta data, incl. error code and rejected data */ 1863 1857 if (!copied) { 1864 1858 tipc_sk_set_orig_addr(m, skb); 1865 - rc = tipc_sk_anc_data_recv(m, hdr, tsk); 1859 + rc = tipc_sk_anc_data_recv(m, skb, tsk); 1866 1860 if (rc) 1867 1861 break; 1862 + hdr = buf_msg(skb); 1868 1863 } 1869 1864 1870 1865 /* Copy data if msg ok, otherwise return error/partial data */
+1 -1
scripts/faddr2line
··· 71 71 72 72 # Try to figure out the source directory prefix so we can remove it from the 73 73 # addr2line output. HACK ALERT: This assumes that start_kernel() is in 74 - # kernel/init.c! This only works for vmlinux. Otherwise it falls back to 74 + # init/main.c! This only works for vmlinux. Otherwise it falls back to 75 75 # printing the absolute path. 76 76 find_dir_prefix() { 77 77 local objfile=$1
-1
scripts/spdxcheck.py
··· 168 168 self.curline = 0 169 169 try: 170 170 for line in fd: 171 - line = line.decode(locale.getpreferredencoding(False), errors='ignore') 172 171 self.curline += 1 173 172 if self.curline > maxlines: 174 173 break
+1
security/integrity/digsig_asymmetric.c
··· 106 106 107 107 pks.pkey_algo = "rsa"; 108 108 pks.hash_algo = hash_algo_name[hdr->hash_algo]; 109 + pks.encoding = "pkcs1"; 109 110 pks.digest = (u8 *)data; 110 111 pks.digest_size = datalen; 111 112 pks.s = hdr->sig;
+3
security/selinux/hooks.c
··· 5318 5318 addr_buf = address; 5319 5319 5320 5320 while (walk_size < addrlen) { 5321 + if (walk_size + sizeof(sa_family_t) > addrlen) 5322 + return -EINVAL; 5323 + 5321 5324 addr = addr_buf; 5322 5325 switch (addr->sa_family) { 5323 5326 case AF_UNSPEC:
+7 -3
security/selinux/ss/mls.c
··· 245 245 char *rangep[2]; 246 246 247 247 if (!pol->mls_enabled) { 248 - if ((def_sid != SECSID_NULL && oldc) || (*scontext) == '\0') 249 - return 0; 250 - return -EINVAL; 248 + /* 249 + * With no MLS, only return -EINVAL if there is a MLS field 250 + * and it did not come from an xattr. 251 + */ 252 + if (oldc && def_sid == SECSID_NULL) 253 + return -EINVAL; 254 + return 0; 251 255 } 252 256 253 257 /*
+4 -4
tools/testing/nvdimm/test/nfit.c
··· 140 140 [6] = NFIT_DIMM_HANDLE(1, 0, 0, 0, 1), 141 141 }; 142 142 143 - static unsigned long dimm_fail_cmd_flags[NUM_DCR]; 144 - static int dimm_fail_cmd_code[NUM_DCR]; 143 + static unsigned long dimm_fail_cmd_flags[ARRAY_SIZE(handle)]; 144 + static int dimm_fail_cmd_code[ARRAY_SIZE(handle)]; 145 145 146 146 static const struct nd_intel_smart smart_def = { 147 147 .flags = ND_INTEL_SMART_HEALTH_VALID ··· 205 205 unsigned long deadline; 206 206 spinlock_t lock; 207 207 } ars_state; 208 - struct device *dimm_dev[NUM_DCR]; 208 + struct device *dimm_dev[ARRAY_SIZE(handle)]; 209 209 struct nd_intel_smart *smart; 210 210 struct nd_intel_smart_threshold *smart_threshold; 211 211 struct badrange badrange; ··· 2680 2680 u32 nfit_handle = __to_nfit_memdev(nfit_mem)->device_handle; 2681 2681 int i; 2682 2682 2683 - for (i = 0; i < NUM_DCR; i++) 2683 + for (i = 0; i < ARRAY_SIZE(handle); i++) 2684 2684 if (nfit_handle == handle[i]) 2685 2685 dev_set_drvdata(nfit_test->dimm_dev[i], 2686 2686 nfit_mem);
+18 -3
tools/testing/selftests/powerpc/mm/wild_bctr.c
··· 47 47 return 0; 48 48 } 49 49 50 - #define REG_POISON 0x5a5aUL 51 - #define POISONED_REG(n) ((REG_POISON << 48) | ((n) << 32) | (REG_POISON << 16) | (n)) 50 + #define REG_POISON 0x5a5a 51 + #define POISONED_REG(n) ((((unsigned long)REG_POISON) << 48) | ((n) << 32) | \ 52 + (((unsigned long)REG_POISON) << 16) | (n)) 52 53 53 54 static inline void poison_regs(void) 54 55 { ··· 106 105 } 107 106 } 108 107 108 + #ifdef _CALL_AIXDESC 109 + struct opd { 110 + unsigned long ip; 111 + unsigned long toc; 112 + unsigned long env; 113 + }; 114 + static struct opd bad_opd = { 115 + .ip = BAD_NIP, 116 + }; 117 + #define BAD_FUNC (&bad_opd) 118 + #else 119 + #define BAD_FUNC BAD_NIP 120 + #endif 121 + 109 122 int test_wild_bctr(void) 110 123 { 111 124 int (*func_ptr)(void); ··· 148 133 149 134 poison_regs(); 150 135 151 - func_ptr = (int (*)(void))BAD_NIP; 136 + func_ptr = (int (*)(void))BAD_FUNC; 152 137 func_ptr(); 153 138 154 139 FAIL_IF(1); /* we didn't segv? */
+13 -5
tools/testing/selftests/tc-testing/tdc.py
··· 134 134 (rawout, serr) = proc.communicate() 135 135 136 136 if proc.returncode != 0 and len(serr) > 0: 137 - foutput = serr.decode("utf-8") 137 + foutput = serr.decode("utf-8", errors="ignore") 138 138 else: 139 - foutput = rawout.decode("utf-8") 139 + foutput = rawout.decode("utf-8", errors="ignore") 140 140 141 141 proc.stdout.close() 142 142 proc.stderr.close() ··· 169 169 file=sys.stderr) 170 170 print("\n{} *** Error message: \"{}\"".format(prefix, foutput), 171 171 file=sys.stderr) 172 + print("returncode {}; expected {}".format(proc.returncode, 173 + exit_codes)) 172 174 print("\n{} *** Aborting test run.".format(prefix), file=sys.stderr) 173 175 print("\n\n{} *** stdout ***".format(proc.stdout), file=sys.stderr) 174 176 print("\n\n{} *** stderr ***".format(proc.stderr), file=sys.stderr) ··· 197 195 print('-----> execute stage') 198 196 pm.call_pre_execute() 199 197 (p, procout) = exec_cmd(args, pm, 'execute', tidx["cmdUnderTest"]) 200 - exit_code = p.returncode 198 + if p: 199 + exit_code = p.returncode 200 + else: 201 + exit_code = None 202 + 201 203 pm.call_post_execute() 202 204 203 - if (exit_code != int(tidx["expExitCode"])): 205 + if (exit_code is None or exit_code != int(tidx["expExitCode"])): 204 206 result = False 205 - print("exit:", exit_code, int(tidx["expExitCode"])) 207 + print("exit: {!r}".format(exit_code)) 208 + print("exit: {}".format(int(tidx["expExitCode"]))) 209 + #print("exit: {!r} {}".format(exit_code, int(tidx["expExitCode"]))) 206 210 print(procout) 207 211 else: 208 212 if args.verbose > 0: