Contents of /trunk/kernel-alx/patches-4.9/0101-4.9.2-all-fixes.patch
Parent Directory | Revision Log
Revision 2956 -
(show annotations)
(download)
Mon Jul 24 12:03:46 2017 UTC (7 years, 2 months ago) by niro
File size: 141140 byte(s)
Mon Jul 24 12:03:46 2017 UTC (7 years, 2 months ago) by niro
File size: 141140 byte(s)
-added patches-4.9
1 | diff --git a/Documentation/sphinx/rstFlatTable.py b/Documentation/sphinx/rstFlatTable.py |
2 | index 55f275793028..25feb0d35e7a 100755 |
3 | --- a/Documentation/sphinx/rstFlatTable.py |
4 | +++ b/Documentation/sphinx/rstFlatTable.py |
5 | @@ -157,6 +157,11 @@ class ListTableBuilder(object): |
6 | def buildTableNode(self): |
7 | |
8 | colwidths = self.directive.get_column_widths(self.max_cols) |
9 | + if isinstance(colwidths, tuple): |
10 | + # Since docutils 0.13, get_column_widths returns a (widths, |
11 | + # colwidths) tuple, where widths is a string (i.e. 'auto'). |
12 | + # See https://sourceforge.net/p/docutils/patches/120/. |
13 | + colwidths = colwidths[1] |
14 | stub_columns = self.directive.options.get('stub-columns', 0) |
15 | header_rows = self.directive.options.get('header-rows', 0) |
16 | |
17 | diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt |
18 | index 6bbceb9a3a19..1f5eab4ef88f 100644 |
19 | --- a/Documentation/virtual/kvm/api.txt |
20 | +++ b/Documentation/virtual/kvm/api.txt |
21 | @@ -2050,6 +2050,7 @@ registers, find a list below: |
22 | PPC | KVM_REG_PPC_TM_VSCR | 32 |
23 | PPC | KVM_REG_PPC_TM_DSCR | 64 |
24 | PPC | KVM_REG_PPC_TM_TAR | 64 |
25 | + PPC | KVM_REG_PPC_TM_XER | 64 |
26 | | | |
27 | MIPS | KVM_REG_MIPS_R0 | 64 |
28 | ... |
29 | diff --git a/Makefile b/Makefile |
30 | index ab3cd5128889..c9ce897465c5 100644 |
31 | --- a/Makefile |
32 | +++ b/Makefile |
33 | @@ -1,6 +1,6 @@ |
34 | VERSION = 4 |
35 | PATCHLEVEL = 9 |
36 | -SUBLEVEL = 1 |
37 | +SUBLEVEL = 2 |
38 | EXTRAVERSION = |
39 | NAME = Roaring Lionus |
40 | |
41 | diff --git a/arch/arc/include/asm/cacheflush.h b/arch/arc/include/asm/cacheflush.h |
42 | index a093adbdb017..fc662f49c55a 100644 |
43 | --- a/arch/arc/include/asm/cacheflush.h |
44 | +++ b/arch/arc/include/asm/cacheflush.h |
45 | @@ -85,6 +85,10 @@ void flush_anon_page(struct vm_area_struct *vma, |
46 | */ |
47 | #define PG_dc_clean PG_arch_1 |
48 | |
49 | +#define CACHE_COLORS_NUM 4 |
50 | +#define CACHE_COLORS_MSK (CACHE_COLORS_NUM - 1) |
51 | +#define CACHE_COLOR(addr) (((unsigned long)(addr) >> (PAGE_SHIFT)) & CACHE_COLORS_MSK) |
52 | + |
53 | /* |
54 | * Simple wrapper over config option |
55 | * Bootup code ensures that hardware matches kernel configuration |
56 | @@ -94,8 +98,6 @@ static inline int cache_is_vipt_aliasing(void) |
57 | return IS_ENABLED(CONFIG_ARC_CACHE_VIPT_ALIASING); |
58 | } |
59 | |
60 | -#define CACHE_COLOR(addr) (((unsigned long)(addr) >> (PAGE_SHIFT)) & 1) |
61 | - |
62 | /* |
63 | * checks if two addresses (after page aligning) index into same cache set |
64 | */ |
65 | diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c |
66 | index 50d71695cd4e..8147583c4434 100644 |
67 | --- a/arch/arc/mm/cache.c |
68 | +++ b/arch/arc/mm/cache.c |
69 | @@ -979,11 +979,16 @@ void arc_cache_init(void) |
70 | /* check for D-Cache aliasing on ARCompact: ARCv2 has PIPT */ |
71 | if (is_isa_arcompact()) { |
72 | int handled = IS_ENABLED(CONFIG_ARC_CACHE_VIPT_ALIASING); |
73 | - |
74 | - if (dc->alias && !handled) |
75 | - panic("Enable CONFIG_ARC_CACHE_VIPT_ALIASING\n"); |
76 | - else if (!dc->alias && handled) |
77 | + int num_colors = dc->sz_k/dc->assoc/TO_KB(PAGE_SIZE); |
78 | + |
79 | + if (dc->alias) { |
80 | + if (!handled) |
81 | + panic("Enable CONFIG_ARC_CACHE_VIPT_ALIASING\n"); |
82 | + if (CACHE_COLORS_NUM != num_colors) |
83 | + panic("CACHE_COLORS_NUM not optimized for config\n"); |
84 | + } else if (!dc->alias && handled) { |
85 | panic("Disable CONFIG_ARC_CACHE_VIPT_ALIASING\n"); |
86 | + } |
87 | } |
88 | } |
89 | |
90 | diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi b/arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi |
91 | index 5fda583351d7..906fb836d241 100644 |
92 | --- a/arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi |
93 | +++ b/arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi |
94 | @@ -21,6 +21,10 @@ |
95 | reg = <0x0 0x80000000 0x1 0x0>; |
96 | }; |
97 | |
98 | + gpu@57000000 { |
99 | + vdd-supply = <&vdd_gpu>; |
100 | + }; |
101 | + |
102 | /* debug port */ |
103 | serial@70006000 { |
104 | status = "okay"; |
105 | @@ -291,4 +295,18 @@ |
106 | clock-frequency = <32768>; |
107 | }; |
108 | }; |
109 | + |
110 | + regulators { |
111 | + vdd_gpu: regulator@100 { |
112 | + compatible = "pwm-regulator"; |
113 | + reg = <100>; |
114 | + pwms = <&pwm 1 4880>; |
115 | + regulator-name = "VDD_GPU"; |
116 | + regulator-min-microvolt = <710000>; |
117 | + regulator-max-microvolt = <1320000>; |
118 | + enable-gpios = <&pmic 6 GPIO_ACTIVE_HIGH>; |
119 | + regulator-ramp-delay = <80>; |
120 | + regulator-enable-ramp-delay = <1000>; |
121 | + }; |
122 | + }; |
123 | }; |
124 | diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c |
125 | index 83037cd62d01..0c848c18ca44 100644 |
126 | --- a/arch/arm64/kvm/hyp/switch.c |
127 | +++ b/arch/arm64/kvm/hyp/switch.c |
128 | @@ -85,7 +85,13 @@ static void __hyp_text __activate_traps(struct kvm_vcpu *vcpu) |
129 | write_sysreg(val, hcr_el2); |
130 | /* Trap on AArch32 cp15 c15 accesses (EL1 or EL0) */ |
131 | write_sysreg(1 << 15, hstr_el2); |
132 | - /* Make sure we trap PMU access from EL0 to EL2 */ |
133 | + /* |
134 | + * Make sure we trap PMU access from EL0 to EL2. Also sanitize |
135 | + * PMSELR_EL0 to make sure it never contains the cycle |
136 | + * counter, which could make a PMXEVCNTR_EL0 access UNDEF at |
137 | + * EL1 instead of being trapped to EL2. |
138 | + */ |
139 | + write_sysreg(0, pmselr_el0); |
140 | write_sysreg(ARMV8_PMU_USERENR_MASK, pmuserenr_el0); |
141 | write_sysreg(vcpu->arch.mdcr_el2, mdcr_el2); |
142 | __activate_traps_arch()(); |
143 | diff --git a/arch/powerpc/boot/ps3-head.S b/arch/powerpc/boot/ps3-head.S |
144 | index b6fcbaf5027b..3dc44b05fb97 100644 |
145 | --- a/arch/powerpc/boot/ps3-head.S |
146 | +++ b/arch/powerpc/boot/ps3-head.S |
147 | @@ -57,11 +57,6 @@ __system_reset_overlay: |
148 | bctr |
149 | |
150 | 1: |
151 | - /* Save the value at addr zero for a null pointer write check later. */ |
152 | - |
153 | - li r4, 0 |
154 | - lwz r3, 0(r4) |
155 | - |
156 | /* Primary delays then goes to _zimage_start in wrapper. */ |
157 | |
158 | or 31, 31, 31 /* db16cyc */ |
159 | diff --git a/arch/powerpc/boot/ps3.c b/arch/powerpc/boot/ps3.c |
160 | index 4ec2d86d3c50..a05558a7e51a 100644 |
161 | --- a/arch/powerpc/boot/ps3.c |
162 | +++ b/arch/powerpc/boot/ps3.c |
163 | @@ -119,13 +119,12 @@ void ps3_copy_vectors(void) |
164 | flush_cache((void *)0x100, 512); |
165 | } |
166 | |
167 | -void platform_init(unsigned long null_check) |
168 | +void platform_init(void) |
169 | { |
170 | const u32 heapsize = 0x1000000 - (u32)_end; /* 16MiB */ |
171 | void *chosen; |
172 | unsigned long ft_addr; |
173 | u64 rm_size; |
174 | - unsigned long val; |
175 | |
176 | console_ops.write = ps3_console_write; |
177 | platform_ops.exit = ps3_exit; |
178 | @@ -153,11 +152,6 @@ void platform_init(unsigned long null_check) |
179 | |
180 | printf(" flat tree at 0x%lx\n\r", ft_addr); |
181 | |
182 | - val = *(unsigned long *)0; |
183 | - |
184 | - if (val != null_check) |
185 | - printf("null check failed: %lx != %lx\n\r", val, null_check); |
186 | - |
187 | ((kernel_entry_t)0)(ft_addr, 0, NULL); |
188 | |
189 | ps3_exit(); |
190 | diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper |
191 | index 404b3aabdb4d..76fe3ccfd381 100755 |
192 | --- a/arch/powerpc/boot/wrapper |
193 | +++ b/arch/powerpc/boot/wrapper |
194 | @@ -181,6 +181,28 @@ case "$elfformat" in |
195 | elf32-powerpc) format=elf32ppc ;; |
196 | esac |
197 | |
198 | +ld_version() |
199 | +{ |
200 | + # Poached from scripts/ld-version.sh, but we don't want to call that because |
201 | + # this script (wrapper) is distributed separately from the kernel source. |
202 | + # Extract linker version number from stdin and turn into single number. |
203 | + awk '{ |
204 | + gsub(".*\\)", ""); |
205 | + gsub(".*version ", ""); |
206 | + gsub("-.*", ""); |
207 | + split($1,a, "."); |
208 | + print a[1]*100000000 + a[2]*1000000 + a[3]*10000; |
209 | + exit |
210 | + }' |
211 | +} |
212 | + |
213 | +# Do not include PT_INTERP segment when linking pie. Non-pie linking |
214 | +# just ignores this option. |
215 | +LD_VERSION=$(${CROSS}ld --version | ld_version) |
216 | +LD_NO_DL_MIN_VERSION=$(echo 2.26 | ld_version) |
217 | +if [ "$LD_VERSION" -ge "$LD_NO_DL_MIN_VERSION" ] ; then |
218 | + nodl="--no-dynamic-linker" |
219 | +fi |
220 | |
221 | platformo=$object/"$platform".o |
222 | lds=$object/zImage.lds |
223 | @@ -446,7 +468,7 @@ if [ "$platform" != "miboot" ]; then |
224 | text_start="-Ttext $link_address" |
225 | fi |
226 | #link everything |
227 | - ${CROSS}ld -m $format -T $lds $text_start $pie -o "$ofile" \ |
228 | + ${CROSS}ld -m $format -T $lds $text_start $pie $nodl -o "$ofile" \ |
229 | $platformo $tmp $object/wrapper.a |
230 | rm $tmp |
231 | fi |
232 | diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h |
233 | index 28350a294b1e..5e12e19940e2 100644 |
234 | --- a/arch/powerpc/include/asm/kvm_host.h |
235 | +++ b/arch/powerpc/include/asm/kvm_host.h |
236 | @@ -546,6 +546,7 @@ struct kvm_vcpu_arch { |
237 | u64 tfiar; |
238 | |
239 | u32 cr_tm; |
240 | + u64 xer_tm; |
241 | u64 lr_tm; |
242 | u64 ctr_tm; |
243 | u64 amr_tm; |
244 | diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h |
245 | index c93cf35ce379..0fb1326c3ea2 100644 |
246 | --- a/arch/powerpc/include/uapi/asm/kvm.h |
247 | +++ b/arch/powerpc/include/uapi/asm/kvm.h |
248 | @@ -596,6 +596,7 @@ struct kvm_get_htab_header { |
249 | #define KVM_REG_PPC_TM_VSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U32 | 0x67) |
250 | #define KVM_REG_PPC_TM_DSCR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x68) |
251 | #define KVM_REG_PPC_TM_TAR (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x69) |
252 | +#define KVM_REG_PPC_TM_XER (KVM_REG_PPC_TM | KVM_REG_SIZE_U64 | 0x6a) |
253 | |
254 | /* PPC64 eXternal Interrupt Controller Specification */ |
255 | #define KVM_DEV_XICS_GRP_SOURCES 1 /* 64-bit source attributes */ |
256 | diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c |
257 | index caec7bf3b99a..c833d88c423d 100644 |
258 | --- a/arch/powerpc/kernel/asm-offsets.c |
259 | +++ b/arch/powerpc/kernel/asm-offsets.c |
260 | @@ -569,6 +569,7 @@ int main(void) |
261 | DEFINE(VCPU_VRS_TM, offsetof(struct kvm_vcpu, arch.vr_tm.vr)); |
262 | DEFINE(VCPU_VRSAVE_TM, offsetof(struct kvm_vcpu, arch.vrsave_tm)); |
263 | DEFINE(VCPU_CR_TM, offsetof(struct kvm_vcpu, arch.cr_tm)); |
264 | + DEFINE(VCPU_XER_TM, offsetof(struct kvm_vcpu, arch.xer_tm)); |
265 | DEFINE(VCPU_LR_TM, offsetof(struct kvm_vcpu, arch.lr_tm)); |
266 | DEFINE(VCPU_CTR_TM, offsetof(struct kvm_vcpu, arch.ctr_tm)); |
267 | DEFINE(VCPU_AMR_TM, offsetof(struct kvm_vcpu, arch.amr_tm)); |
268 | diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S |
269 | index 04c546e20cc0..1f7f908f186e 100644 |
270 | --- a/arch/powerpc/kernel/head_64.S |
271 | +++ b/arch/powerpc/kernel/head_64.S |
272 | @@ -214,9 +214,9 @@ booting_thread_hwid: |
273 | */ |
274 | _GLOBAL(book3e_start_thread) |
275 | LOAD_REG_IMMEDIATE(r5, MSR_KERNEL) |
276 | - cmpi 0, r3, 0 |
277 | + cmpwi r3, 0 |
278 | beq 10f |
279 | - cmpi 0, r3, 1 |
280 | + cmpwi r3, 1 |
281 | beq 11f |
282 | /* If the thread id is invalid, just exit. */ |
283 | b 13f |
284 | @@ -241,9 +241,9 @@ _GLOBAL(book3e_start_thread) |
285 | * r3 = the thread physical id |
286 | */ |
287 | _GLOBAL(book3e_stop_thread) |
288 | - cmpi 0, r3, 0 |
289 | + cmpwi r3, 0 |
290 | beq 10f |
291 | - cmpi 0, r3, 1 |
292 | + cmpwi r3, 1 |
293 | beq 10f |
294 | /* If the thread id is invalid, just exit. */ |
295 | b 13f |
296 | diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c |
297 | index 3686471be32b..094deb60c6fe 100644 |
298 | --- a/arch/powerpc/kvm/book3s_hv.c |
299 | +++ b/arch/powerpc/kvm/book3s_hv.c |
300 | @@ -1288,6 +1288,9 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id, |
301 | case KVM_REG_PPC_TM_CR: |
302 | *val = get_reg_val(id, vcpu->arch.cr_tm); |
303 | break; |
304 | + case KVM_REG_PPC_TM_XER: |
305 | + *val = get_reg_val(id, vcpu->arch.xer_tm); |
306 | + break; |
307 | case KVM_REG_PPC_TM_LR: |
308 | *val = get_reg_val(id, vcpu->arch.lr_tm); |
309 | break; |
310 | @@ -1498,6 +1501,9 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id, |
311 | case KVM_REG_PPC_TM_CR: |
312 | vcpu->arch.cr_tm = set_reg_val(id, *val); |
313 | break; |
314 | + case KVM_REG_PPC_TM_XER: |
315 | + vcpu->arch.xer_tm = set_reg_val(id, *val); |
316 | + break; |
317 | case KVM_REG_PPC_TM_LR: |
318 | vcpu->arch.lr_tm = set_reg_val(id, *val); |
319 | break; |
320 | diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c |
321 | index 99b4e9d5dd23..5420d060c6f6 100644 |
322 | --- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c |
323 | +++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c |
324 | @@ -653,6 +653,8 @@ long kvmppc_h_protect(struct kvm_vcpu *vcpu, unsigned long flags, |
325 | HPTE_V_ABSENT); |
326 | do_tlbies(kvm, &rb, 1, global_invalidates(kvm, flags), |
327 | true); |
328 | + /* Don't lose R/C bit updates done by hardware */ |
329 | + r |= be64_to_cpu(hpte[1]) & (HPTE_R_R | HPTE_R_C); |
330 | hpte[1] = cpu_to_be64(r); |
331 | } |
332 | } |
333 | diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S |
334 | index c3c1d1bcfc67..6f81adb112f1 100644 |
335 | --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S |
336 | +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S |
337 | @@ -2600,11 +2600,13 @@ kvmppc_save_tm: |
338 | mfctr r7 |
339 | mfspr r8, SPRN_AMR |
340 | mfspr r10, SPRN_TAR |
341 | + mfxer r11 |
342 | std r5, VCPU_LR_TM(r9) |
343 | stw r6, VCPU_CR_TM(r9) |
344 | std r7, VCPU_CTR_TM(r9) |
345 | std r8, VCPU_AMR_TM(r9) |
346 | std r10, VCPU_TAR_TM(r9) |
347 | + std r11, VCPU_XER_TM(r9) |
348 | |
349 | /* Restore r12 as trap number. */ |
350 | lwz r12, VCPU_TRAP(r9) |
351 | @@ -2697,11 +2699,13 @@ kvmppc_restore_tm: |
352 | ld r7, VCPU_CTR_TM(r4) |
353 | ld r8, VCPU_AMR_TM(r4) |
354 | ld r9, VCPU_TAR_TM(r4) |
355 | + ld r10, VCPU_XER_TM(r4) |
356 | mtlr r5 |
357 | mtcr r6 |
358 | mtctr r7 |
359 | mtspr SPRN_AMR, r8 |
360 | mtspr SPRN_TAR, r9 |
361 | + mtxer r10 |
362 | |
363 | /* |
364 | * Load up PPR and DSCR values but don't put them in the actual SPRs |
365 | diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c |
366 | index 7f7ba5f23f13..d027f2eb3559 100644 |
367 | --- a/arch/s390/kernel/setup.c |
368 | +++ b/arch/s390/kernel/setup.c |
369 | @@ -445,7 +445,7 @@ static void __init setup_resources(void) |
370 | * part of the System RAM resource. |
371 | */ |
372 | if (crashk_res.end) { |
373 | - memblock_add(crashk_res.start, resource_size(&crashk_res)); |
374 | + memblock_add_node(crashk_res.start, resource_size(&crashk_res), 0); |
375 | memblock_reserve(crashk_res.start, resource_size(&crashk_res)); |
376 | insert_resource(&iomem_resource, &crashk_res); |
377 | } |
378 | diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S |
379 | index 21b352a11b49..edba8606b99a 100644 |
380 | --- a/arch/x86/entry/entry_32.S |
381 | +++ b/arch/x86/entry/entry_32.S |
382 | @@ -889,8 +889,8 @@ ftrace_graph_call: |
383 | jmp ftrace_stub |
384 | #endif |
385 | |
386 | -.globl ftrace_stub |
387 | -ftrace_stub: |
388 | +/* This is weak to keep gas from relaxing the jumps */ |
389 | +WEAK(ftrace_stub) |
390 | ret |
391 | END(ftrace_caller) |
392 | |
393 | diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c |
394 | index 6e395c996900..7fe88bb57e36 100644 |
395 | --- a/arch/x86/events/core.c |
396 | +++ b/arch/x86/events/core.c |
397 | @@ -365,7 +365,11 @@ int x86_add_exclusive(unsigned int what) |
398 | { |
399 | int i; |
400 | |
401 | - if (x86_pmu.lbr_pt_coexist) |
402 | + /* |
403 | + * When lbr_pt_coexist we allow PT to coexist with either LBR or BTS. |
404 | + * LBR and BTS are still mutually exclusive. |
405 | + */ |
406 | + if (x86_pmu.lbr_pt_coexist && what == x86_lbr_exclusive_pt) |
407 | return 0; |
408 | |
409 | if (!atomic_inc_not_zero(&x86_pmu.lbr_exclusive[what])) { |
410 | @@ -388,7 +392,7 @@ int x86_add_exclusive(unsigned int what) |
411 | |
412 | void x86_del_exclusive(unsigned int what) |
413 | { |
414 | - if (x86_pmu.lbr_pt_coexist) |
415 | + if (x86_pmu.lbr_pt_coexist && what == x86_lbr_exclusive_pt) |
416 | return; |
417 | |
418 | atomic_dec(&x86_pmu.lbr_exclusive[what]); |
419 | diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c |
420 | index da51e5a3e2ff..fec8a461bdef 100644 |
421 | --- a/arch/x86/events/intel/cstate.c |
422 | +++ b/arch/x86/events/intel/cstate.c |
423 | @@ -594,6 +594,9 @@ static int __init cstate_probe(const struct cstate_model *cm) |
424 | |
425 | static inline void cstate_cleanup(void) |
426 | { |
427 | + cpuhp_remove_state_nocalls(CPUHP_AP_PERF_X86_CSTATE_ONLINE); |
428 | + cpuhp_remove_state_nocalls(CPUHP_AP_PERF_X86_CSTATE_STARTING); |
429 | + |
430 | if (has_cstate_core) |
431 | perf_pmu_unregister(&cstate_core_pmu); |
432 | |
433 | @@ -606,16 +609,16 @@ static int __init cstate_init(void) |
434 | int err; |
435 | |
436 | cpuhp_setup_state(CPUHP_AP_PERF_X86_CSTATE_STARTING, |
437 | - "AP_PERF_X86_CSTATE_STARTING", cstate_cpu_init, |
438 | - NULL); |
439 | + "perf/x86/cstate:starting", cstate_cpu_init, NULL); |
440 | cpuhp_setup_state(CPUHP_AP_PERF_X86_CSTATE_ONLINE, |
441 | - "AP_PERF_X86_CSTATE_ONLINE", NULL, cstate_cpu_exit); |
442 | + "perf/x86/cstate:online", NULL, cstate_cpu_exit); |
443 | |
444 | if (has_cstate_core) { |
445 | err = perf_pmu_register(&cstate_core_pmu, cstate_core_pmu.name, -1); |
446 | if (err) { |
447 | has_cstate_core = false; |
448 | pr_info("Failed to register cstate core pmu\n"); |
449 | + cstate_cleanup(); |
450 | return err; |
451 | } |
452 | } |
453 | @@ -629,8 +632,7 @@ static int __init cstate_init(void) |
454 | return err; |
455 | } |
456 | } |
457 | - |
458 | - return err; |
459 | + return 0; |
460 | } |
461 | |
462 | static int __init cstate_pmu_init(void) |
463 | @@ -655,8 +657,6 @@ module_init(cstate_pmu_init); |
464 | |
465 | static void __exit cstate_pmu_exit(void) |
466 | { |
467 | - cpuhp_remove_state_nocalls(CPUHP_AP_PERF_X86_CSTATE_ONLINE); |
468 | - cpuhp_remove_state_nocalls(CPUHP_AP_PERF_X86_CSTATE_STARTING); |
469 | cstate_cleanup(); |
470 | } |
471 | module_exit(cstate_pmu_exit); |
472 | diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h |
473 | index a77ee026643d..bcbb1d2ae10b 100644 |
474 | --- a/arch/x86/events/perf_event.h |
475 | +++ b/arch/x86/events/perf_event.h |
476 | @@ -604,7 +604,7 @@ struct x86_pmu { |
477 | u64 lbr_sel_mask; /* LBR_SELECT valid bits */ |
478 | const int *lbr_sel_map; /* lbr_select mappings */ |
479 | bool lbr_double_abort; /* duplicated lbr aborts */ |
480 | - bool lbr_pt_coexist; /* LBR may coexist with PT */ |
481 | + bool lbr_pt_coexist; /* (LBR|BTS) may coexist with PT */ |
482 | |
483 | /* |
484 | * Intel PT/LBR/BTS are exclusive |
485 | diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c |
486 | index 88c657b057e2..f2234918e494 100644 |
487 | --- a/arch/x86/kernel/apic/apic.c |
488 | +++ b/arch/x86/kernel/apic/apic.c |
489 | @@ -2159,21 +2159,6 @@ int __generic_processor_info(int apicid, int version, bool enabled) |
490 | } |
491 | |
492 | /* |
493 | - * This can happen on physical hotplug. The sanity check at boot time |
494 | - * is done from native_smp_prepare_cpus() after num_possible_cpus() is |
495 | - * established. |
496 | - */ |
497 | - if (topology_update_package_map(apicid, cpu) < 0) { |
498 | - int thiscpu = max + disabled_cpus; |
499 | - |
500 | - pr_warning("APIC: Package limit reached. Processor %d/0x%x ignored.\n", |
501 | - thiscpu, apicid); |
502 | - |
503 | - disabled_cpus++; |
504 | - return -ENOSPC; |
505 | - } |
506 | - |
507 | - /* |
508 | * Validate version |
509 | */ |
510 | if (version == 0x0) { |
511 | diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c |
512 | index cc9e980c68ec..c2048b44851c 100644 |
513 | --- a/arch/x86/kernel/cpu/common.c |
514 | +++ b/arch/x86/kernel/cpu/common.c |
515 | @@ -979,29 +979,21 @@ static void x86_init_cache_qos(struct cpuinfo_x86 *c) |
516 | } |
517 | |
518 | /* |
519 | - * The physical to logical package id mapping is initialized from the |
520 | - * acpi/mptables information. Make sure that CPUID actually agrees with |
521 | - * that. |
522 | + * Validate that ACPI/mptables have the same information about the |
523 | + * effective APIC id and update the package map. |
524 | */ |
525 | -static void sanitize_package_id(struct cpuinfo_x86 *c) |
526 | +static void validate_apic_and_package_id(struct cpuinfo_x86 *c) |
527 | { |
528 | #ifdef CONFIG_SMP |
529 | - unsigned int pkg, apicid, cpu = smp_processor_id(); |
530 | + unsigned int apicid, cpu = smp_processor_id(); |
531 | |
532 | apicid = apic->cpu_present_to_apicid(cpu); |
533 | - pkg = apicid >> boot_cpu_data.x86_coreid_bits; |
534 | |
535 | - if (apicid != c->initial_apicid) { |
536 | - pr_err(FW_BUG "CPU%u: APIC id mismatch. Firmware: %x CPUID: %x\n", |
537 | + if (apicid != c->apicid) { |
538 | + pr_err(FW_BUG "CPU%u: APIC id mismatch. Firmware: %x APIC: %x\n", |
539 | cpu, apicid, c->initial_apicid); |
540 | - c->initial_apicid = apicid; |
541 | } |
542 | - if (pkg != c->phys_proc_id) { |
543 | - pr_err(FW_BUG "CPU%u: Using firmware package id %u instead of %u\n", |
544 | - cpu, pkg, c->phys_proc_id); |
545 | - c->phys_proc_id = pkg; |
546 | - } |
547 | - c->logical_proc_id = topology_phys_to_logical_pkg(pkg); |
548 | + BUG_ON(topology_update_package_map(c->phys_proc_id, cpu)); |
549 | #else |
550 | c->logical_proc_id = 0; |
551 | #endif |
552 | @@ -1132,7 +1124,6 @@ static void identify_cpu(struct cpuinfo_x86 *c) |
553 | #ifdef CONFIG_NUMA |
554 | numa_add_cpu(smp_processor_id()); |
555 | #endif |
556 | - sanitize_package_id(c); |
557 | } |
558 | |
559 | /* |
560 | @@ -1188,6 +1179,7 @@ void identify_secondary_cpu(struct cpuinfo_x86 *c) |
561 | enable_sep_cpu(); |
562 | #endif |
563 | mtrr_ap_init(); |
564 | + validate_apic_and_package_id(c); |
565 | } |
566 | |
567 | struct msr_range { |
568 | diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c |
569 | index 42f5eb7b4f6c..e9bbe02950ad 100644 |
570 | --- a/arch/x86/kernel/smpboot.c |
571 | +++ b/arch/x86/kernel/smpboot.c |
572 | @@ -104,7 +104,6 @@ static unsigned int max_physical_pkg_id __read_mostly; |
573 | unsigned int __max_logical_packages __read_mostly; |
574 | EXPORT_SYMBOL(__max_logical_packages); |
575 | static unsigned int logical_packages __read_mostly; |
576 | -static bool logical_packages_frozen __read_mostly; |
577 | |
578 | /* Maximum number of SMT threads on any online core */ |
579 | int __max_smt_threads __read_mostly; |
580 | @@ -263,9 +262,14 @@ static void notrace start_secondary(void *unused) |
581 | cpu_startup_entry(CPUHP_AP_ONLINE_IDLE); |
582 | } |
583 | |
584 | -int topology_update_package_map(unsigned int apicid, unsigned int cpu) |
585 | +/** |
586 | + * topology_update_package_map - Update the physical to logical package map |
587 | + * @pkg: The physical package id as retrieved via CPUID |
588 | + * @cpu: The cpu for which this is updated |
589 | + */ |
590 | +int topology_update_package_map(unsigned int pkg, unsigned int cpu) |
591 | { |
592 | - unsigned int new, pkg = apicid >> boot_cpu_data.x86_coreid_bits; |
593 | + unsigned int new; |
594 | |
595 | /* Called from early boot ? */ |
596 | if (!physical_package_map) |
597 | @@ -278,16 +282,17 @@ int topology_update_package_map(unsigned int apicid, unsigned int cpu) |
598 | if (test_and_set_bit(pkg, physical_package_map)) |
599 | goto found; |
600 | |
601 | - if (logical_packages_frozen) { |
602 | - physical_to_logical_pkg[pkg] = -1; |
603 | - pr_warn("APIC(%x) Package %u exceeds logical package max\n", |
604 | - apicid, pkg); |
605 | + if (logical_packages >= __max_logical_packages) { |
606 | + pr_warn("Package %u of CPU %u exceeds BIOS package data %u.\n", |
607 | + logical_packages, cpu, __max_logical_packages); |
608 | return -ENOSPC; |
609 | } |
610 | |
611 | new = logical_packages++; |
612 | - pr_info("APIC(%x) Converting physical %u to logical package %u\n", |
613 | - apicid, pkg, new); |
614 | + if (new != pkg) { |
615 | + pr_info("CPU %u Converting physical %u to logical package %u\n", |
616 | + cpu, pkg, new); |
617 | + } |
618 | physical_to_logical_pkg[pkg] = new; |
619 | |
620 | found: |
621 | @@ -308,9 +313,9 @@ int topology_phys_to_logical_pkg(unsigned int phys_pkg) |
622 | } |
623 | EXPORT_SYMBOL(topology_phys_to_logical_pkg); |
624 | |
625 | -static void __init smp_init_package_map(void) |
626 | +static void __init smp_init_package_map(struct cpuinfo_x86 *c, unsigned int cpu) |
627 | { |
628 | - unsigned int ncpus, cpu; |
629 | + unsigned int ncpus; |
630 | size_t size; |
631 | |
632 | /* |
633 | @@ -355,27 +360,9 @@ static void __init smp_init_package_map(void) |
634 | size = BITS_TO_LONGS(max_physical_pkg_id) * sizeof(unsigned long); |
635 | physical_package_map = kzalloc(size, GFP_KERNEL); |
636 | |
637 | - for_each_present_cpu(cpu) { |
638 | - unsigned int apicid = apic->cpu_present_to_apicid(cpu); |
639 | - |
640 | - if (apicid == BAD_APICID || !apic->apic_id_valid(apicid)) |
641 | - continue; |
642 | - if (!topology_update_package_map(apicid, cpu)) |
643 | - continue; |
644 | - pr_warn("CPU %u APICId %x disabled\n", cpu, apicid); |
645 | - per_cpu(x86_bios_cpu_apicid, cpu) = BAD_APICID; |
646 | - set_cpu_possible(cpu, false); |
647 | - set_cpu_present(cpu, false); |
648 | - } |
649 | - |
650 | - if (logical_packages > __max_logical_packages) { |
651 | - pr_warn("Detected more packages (%u), then computed by BIOS data (%u).\n", |
652 | - logical_packages, __max_logical_packages); |
653 | - logical_packages_frozen = true; |
654 | - __max_logical_packages = logical_packages; |
655 | - } |
656 | - |
657 | pr_info("Max logical packages: %u\n", __max_logical_packages); |
658 | + |
659 | + topology_update_package_map(c->phys_proc_id, cpu); |
660 | } |
661 | |
662 | void __init smp_store_boot_cpu_info(void) |
663 | @@ -385,7 +372,7 @@ void __init smp_store_boot_cpu_info(void) |
664 | |
665 | *c = boot_cpu_data; |
666 | c->cpu_index = id; |
667 | - smp_init_package_map(); |
668 | + smp_init_package_map(c, id); |
669 | } |
670 | |
671 | /* |
672 | diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c |
673 | index 5382b82462fc..64774f419c72 100644 |
674 | --- a/arch/x86/kvm/vmx.c |
675 | +++ b/arch/x86/kvm/vmx.c |
676 | @@ -1343,10 +1343,10 @@ static inline bool nested_cpu_has_posted_intr(struct vmcs12 *vmcs12) |
677 | return vmcs12->pin_based_vm_exec_control & PIN_BASED_POSTED_INTR; |
678 | } |
679 | |
680 | -static inline bool is_exception(u32 intr_info) |
681 | +static inline bool is_nmi(u32 intr_info) |
682 | { |
683 | return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VALID_MASK)) |
684 | - == (INTR_TYPE_HARD_EXCEPTION | INTR_INFO_VALID_MASK); |
685 | + == (INTR_TYPE_NMI_INTR | INTR_INFO_VALID_MASK); |
686 | } |
687 | |
688 | static void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 exit_reason, |
689 | @@ -5476,7 +5476,7 @@ static int handle_exception(struct kvm_vcpu *vcpu) |
690 | if (is_machine_check(intr_info)) |
691 | return handle_machine_check(vcpu); |
692 | |
693 | - if ((intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI_INTR) |
694 | + if (is_nmi(intr_info)) |
695 | return 1; /* already handled by vmx_vcpu_run() */ |
696 | |
697 | if (is_no_device(intr_info)) { |
698 | @@ -8018,7 +8018,7 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu) |
699 | |
700 | switch (exit_reason) { |
701 | case EXIT_REASON_EXCEPTION_NMI: |
702 | - if (!is_exception(intr_info)) |
703 | + if (is_nmi(intr_info)) |
704 | return false; |
705 | else if (is_page_fault(intr_info)) |
706 | return enable_ept; |
707 | @@ -8611,8 +8611,7 @@ static void vmx_complete_atomic_exit(struct vcpu_vmx *vmx) |
708 | kvm_machine_check(); |
709 | |
710 | /* We need to handle NMIs before interrupts are enabled */ |
711 | - if ((exit_intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI_INTR && |
712 | - (exit_intr_info & INTR_INFO_VALID_MASK)) { |
713 | + if (is_nmi(exit_intr_info)) { |
714 | kvm_before_handle_nmi(&vmx->vcpu); |
715 | asm("int $2"); |
716 | kvm_after_handle_nmi(&vmx->vcpu); |
717 | diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c |
718 | index 9fa27ceeecfd..311acad7dad2 100644 |
719 | --- a/arch/x86/xen/smp.c |
720 | +++ b/arch/x86/xen/smp.c |
721 | @@ -87,12 +87,6 @@ static void cpu_bringup(void) |
722 | cpu_data(cpu).x86_max_cores = 1; |
723 | set_cpu_sibling_map(cpu); |
724 | |
725 | - /* |
726 | - * identify_cpu() may have set logical_pkg_id to -1 due |
727 | - * to incorrect phys_proc_id. Let's re-comupte it. |
728 | - */ |
729 | - topology_update_package_map(apic->cpu_present_to_apicid(cpu), cpu); |
730 | - |
731 | xen_setup_cpu_clockevents(); |
732 | |
733 | notify_cpu_starting(cpu); |
734 | diff --git a/block/bsg.c b/block/bsg.c |
735 | index d214e929ce18..b9a53615bdef 100644 |
736 | --- a/block/bsg.c |
737 | +++ b/block/bsg.c |
738 | @@ -655,6 +655,9 @@ bsg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) |
739 | |
740 | dprintk("%s: write %Zd bytes\n", bd->name, count); |
741 | |
742 | + if (unlikely(segment_eq(get_fs(), KERNEL_DS))) |
743 | + return -EINVAL; |
744 | + |
745 | bsg_set_block(bd, file); |
746 | |
747 | bytes_written = 0; |
748 | diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c |
749 | index a6b36fc53aec..02ded25c82e4 100644 |
750 | --- a/drivers/acpi/video_detect.c |
751 | +++ b/drivers/acpi/video_detect.c |
752 | @@ -296,6 +296,26 @@ static const struct dmi_system_id video_detect_dmi_table[] = { |
753 | DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V131"), |
754 | }, |
755 | }, |
756 | + { |
757 | + /* https://bugzilla.redhat.com/show_bug.cgi?id=1123661 */ |
758 | + .callback = video_detect_force_native, |
759 | + .ident = "Dell XPS 17 L702X", |
760 | + .matches = { |
761 | + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), |
762 | + DMI_MATCH(DMI_PRODUCT_NAME, "Dell System XPS L702X"), |
763 | + }, |
764 | + }, |
765 | + { |
766 | + /* https://bugzilla.redhat.com/show_bug.cgi?id=1204476 */ |
767 | + /* https://bugs.launchpad.net/ubuntu/+source/linux-lts-trusty/+bug/1416940 */ |
768 | + .callback = video_detect_force_native, |
769 | + .ident = "HP Pavilion dv6", |
770 | + .matches = { |
771 | + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), |
772 | + DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv6 Notebook PC"), |
773 | + }, |
774 | + }, |
775 | + |
776 | { }, |
777 | }; |
778 | |
779 | diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c |
780 | index 22d1760a4278..a95e1e572697 100644 |
781 | --- a/drivers/base/firmware_class.c |
782 | +++ b/drivers/base/firmware_class.c |
783 | @@ -955,13 +955,14 @@ static int _request_firmware_load(struct firmware_priv *fw_priv, |
784 | timeout = MAX_JIFFY_OFFSET; |
785 | } |
786 | |
787 | - retval = wait_for_completion_interruptible_timeout(&buf->completion, |
788 | + timeout = wait_for_completion_interruptible_timeout(&buf->completion, |
789 | timeout); |
790 | - if (retval == -ERESTARTSYS || !retval) { |
791 | + if (timeout == -ERESTARTSYS || !timeout) { |
792 | + retval = timeout; |
793 | mutex_lock(&fw_lock); |
794 | fw_load_abort(fw_priv); |
795 | mutex_unlock(&fw_lock); |
796 | - } else if (retval > 0) { |
797 | + } else if (timeout > 0) { |
798 | retval = 0; |
799 | } |
800 | |
801 | diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c |
802 | index 8c7763fd9efc..3bbd2a58db47 100644 |
803 | --- a/drivers/clk/bcm/clk-bcm2835.c |
804 | +++ b/drivers/clk/bcm/clk-bcm2835.c |
805 | @@ -751,7 +751,9 @@ static void bcm2835_pll_divider_off(struct clk_hw *hw) |
806 | cprman_write(cprman, data->cm_reg, |
807 | (cprman_read(cprman, data->cm_reg) & |
808 | ~data->load_mask) | data->hold_mask); |
809 | - cprman_write(cprman, data->a2w_reg, A2W_PLL_CHANNEL_DISABLE); |
810 | + cprman_write(cprman, data->a2w_reg, |
811 | + cprman_read(cprman, data->a2w_reg) | |
812 | + A2W_PLL_CHANNEL_DISABLE); |
813 | spin_unlock(&cprman->regs_lock); |
814 | } |
815 | |
816 | diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c |
817 | index 5b0042776ec7..adba614b3965 100644 |
818 | --- a/drivers/gpio/gpio-stmpe.c |
819 | +++ b/drivers/gpio/gpio-stmpe.c |
820 | @@ -413,7 +413,7 @@ static irqreturn_t stmpe_gpio_irq(int irq, void *dev) |
821 | stmpe->partnum != STMPE1801) { |
822 | stmpe_reg_write(stmpe, statmsbreg + i, status[i]); |
823 | stmpe_reg_write(stmpe, |
824 | - stmpe->regs[STMPE_IDX_GPEDR_LSB + i], |
825 | + stmpe->regs[STMPE_IDX_GPEDR_MSB] + i, |
826 | status[i]); |
827 | } |
828 | } |
829 | diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c |
830 | index 868128a676ba..90621fb93941 100644 |
831 | --- a/drivers/gpio/gpiolib.c |
832 | +++ b/drivers/gpio/gpiolib.c |
833 | @@ -986,7 +986,8 @@ static int gpio_chrdev_open(struct inode *inode, struct file *filp) |
834 | return -ENODEV; |
835 | get_device(&gdev->dev); |
836 | filp->private_data = gdev; |
837 | - return 0; |
838 | + |
839 | + return nonseekable_open(inode, filp); |
840 | } |
841 | |
842 | /** |
843 | @@ -1011,7 +1012,7 @@ static const struct file_operations gpio_fileops = { |
844 | .release = gpio_chrdev_release, |
845 | .open = gpio_chrdev_open, |
846 | .owner = THIS_MODULE, |
847 | - .llseek = noop_llseek, |
848 | + .llseek = no_llseek, |
849 | .unlocked_ioctl = gpio_ioctl, |
850 | #ifdef CONFIG_COMPAT |
851 | .compat_ioctl = gpio_ioctl_compat, |
852 | diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c |
853 | index 9260caef74fa..882404cefbc2 100644 |
854 | --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c |
855 | +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c |
856 | @@ -2577,6 +2577,9 @@ static int dce_v10_0_cursor_move_locked(struct drm_crtc *crtc, |
857 | struct amdgpu_device *adev = crtc->dev->dev_private; |
858 | int xorigin = 0, yorigin = 0; |
859 | |
860 | + amdgpu_crtc->cursor_x = x; |
861 | + amdgpu_crtc->cursor_y = y; |
862 | + |
863 | /* avivo cursor are offset into the total surface */ |
864 | x += crtc->x; |
865 | y += crtc->y; |
866 | @@ -2596,9 +2599,6 @@ static int dce_v10_0_cursor_move_locked(struct drm_crtc *crtc, |
867 | WREG32(mmCUR_SIZE + amdgpu_crtc->crtc_offset, |
868 | ((amdgpu_crtc->cursor_width - 1) << 16) | (amdgpu_crtc->cursor_height - 1)); |
869 | |
870 | - amdgpu_crtc->cursor_x = x; |
871 | - amdgpu_crtc->cursor_y = y; |
872 | - |
873 | return 0; |
874 | } |
875 | |
876 | @@ -2661,12 +2661,11 @@ static int dce_v10_0_crtc_cursor_set2(struct drm_crtc *crtc, |
877 | return ret; |
878 | } |
879 | |
880 | - amdgpu_crtc->cursor_width = width; |
881 | - amdgpu_crtc->cursor_height = height; |
882 | - |
883 | dce_v10_0_lock_cursor(crtc, true); |
884 | |
885 | - if (hot_x != amdgpu_crtc->cursor_hot_x || |
886 | + if (width != amdgpu_crtc->cursor_width || |
887 | + height != amdgpu_crtc->cursor_height || |
888 | + hot_x != amdgpu_crtc->cursor_hot_x || |
889 | hot_y != amdgpu_crtc->cursor_hot_y) { |
890 | int x, y; |
891 | |
892 | @@ -2675,6 +2674,8 @@ static int dce_v10_0_crtc_cursor_set2(struct drm_crtc *crtc, |
893 | |
894 | dce_v10_0_cursor_move_locked(crtc, x, y); |
895 | |
896 | + amdgpu_crtc->cursor_width = width; |
897 | + amdgpu_crtc->cursor_height = height; |
898 | amdgpu_crtc->cursor_hot_x = hot_x; |
899 | amdgpu_crtc->cursor_hot_y = hot_y; |
900 | } |
901 | diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c |
902 | index 367739bd1927..7ddc32127d88 100644 |
903 | --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c |
904 | +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c |
905 | @@ -2593,6 +2593,9 @@ static int dce_v11_0_cursor_move_locked(struct drm_crtc *crtc, |
906 | struct amdgpu_device *adev = crtc->dev->dev_private; |
907 | int xorigin = 0, yorigin = 0; |
908 | |
909 | + amdgpu_crtc->cursor_x = x; |
910 | + amdgpu_crtc->cursor_y = y; |
911 | + |
912 | /* avivo cursor are offset into the total surface */ |
913 | x += crtc->x; |
914 | y += crtc->y; |
915 | @@ -2612,9 +2615,6 @@ static int dce_v11_0_cursor_move_locked(struct drm_crtc *crtc, |
916 | WREG32(mmCUR_SIZE + amdgpu_crtc->crtc_offset, |
917 | ((amdgpu_crtc->cursor_width - 1) << 16) | (amdgpu_crtc->cursor_height - 1)); |
918 | |
919 | - amdgpu_crtc->cursor_x = x; |
920 | - amdgpu_crtc->cursor_y = y; |
921 | - |
922 | return 0; |
923 | } |
924 | |
925 | @@ -2677,12 +2677,11 @@ static int dce_v11_0_crtc_cursor_set2(struct drm_crtc *crtc, |
926 | return ret; |
927 | } |
928 | |
929 | - amdgpu_crtc->cursor_width = width; |
930 | - amdgpu_crtc->cursor_height = height; |
931 | - |
932 | dce_v11_0_lock_cursor(crtc, true); |
933 | |
934 | - if (hot_x != amdgpu_crtc->cursor_hot_x || |
935 | + if (width != amdgpu_crtc->cursor_width || |
936 | + height != amdgpu_crtc->cursor_height || |
937 | + hot_x != amdgpu_crtc->cursor_hot_x || |
938 | hot_y != amdgpu_crtc->cursor_hot_y) { |
939 | int x, y; |
940 | |
941 | @@ -2691,6 +2690,8 @@ static int dce_v11_0_crtc_cursor_set2(struct drm_crtc *crtc, |
942 | |
943 | dce_v11_0_cursor_move_locked(crtc, x, y); |
944 | |
945 | + amdgpu_crtc->cursor_width = width; |
946 | + amdgpu_crtc->cursor_height = height; |
947 | amdgpu_crtc->cursor_hot_x = hot_x; |
948 | amdgpu_crtc->cursor_hot_y = hot_y; |
949 | } |
950 | diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c |
951 | index 15f9fc0514b2..fde6ee1f6f2b 100644 |
952 | --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c |
953 | +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c |
954 | @@ -1933,6 +1933,9 @@ static int dce_v6_0_cursor_move_locked(struct drm_crtc *crtc, |
955 | |
956 | int w = amdgpu_crtc->cursor_width; |
957 | |
958 | + amdgpu_crtc->cursor_x = x; |
959 | + amdgpu_crtc->cursor_y = y; |
960 | + |
961 | /* avivo cursor are offset into the total surface */ |
962 | x += crtc->x; |
963 | y += crtc->y; |
964 | @@ -1952,8 +1955,6 @@ static int dce_v6_0_cursor_move_locked(struct drm_crtc *crtc, |
965 | WREG32(EVERGREEN_CUR_SIZE + amdgpu_crtc->crtc_offset, |
966 | ((w - 1) << 16) | (amdgpu_crtc->cursor_height - 1)); |
967 | |
968 | - amdgpu_crtc->cursor_x = x; |
969 | - amdgpu_crtc->cursor_y = y; |
970 | return 0; |
971 | } |
972 | |
973 | @@ -2016,12 +2017,11 @@ static int dce_v6_0_crtc_cursor_set2(struct drm_crtc *crtc, |
974 | return ret; |
975 | } |
976 | |
977 | - amdgpu_crtc->cursor_width = width; |
978 | - amdgpu_crtc->cursor_height = height; |
979 | - |
980 | dce_v6_0_lock_cursor(crtc, true); |
981 | |
982 | - if (hot_x != amdgpu_crtc->cursor_hot_x || |
983 | + if (width != amdgpu_crtc->cursor_width || |
984 | + height != amdgpu_crtc->cursor_height || |
985 | + hot_x != amdgpu_crtc->cursor_hot_x || |
986 | hot_y != amdgpu_crtc->cursor_hot_y) { |
987 | int x, y; |
988 | |
989 | @@ -2030,6 +2030,8 @@ static int dce_v6_0_crtc_cursor_set2(struct drm_crtc *crtc, |
990 | |
991 | dce_v6_0_cursor_move_locked(crtc, x, y); |
992 | |
993 | + amdgpu_crtc->cursor_width = width; |
994 | + amdgpu_crtc->cursor_height = height; |
995 | amdgpu_crtc->cursor_hot_x = hot_x; |
996 | amdgpu_crtc->cursor_hot_y = hot_y; |
997 | } |
998 | diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c |
999 | index 8c4d808db0f1..7d9ffde0a628 100644 |
1000 | --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c |
1001 | +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c |
1002 | @@ -2465,6 +2465,9 @@ static int dce_v8_0_cursor_move_locked(struct drm_crtc *crtc, |
1003 | struct amdgpu_device *adev = crtc->dev->dev_private; |
1004 | int xorigin = 0, yorigin = 0; |
1005 | |
1006 | + amdgpu_crtc->cursor_x = x; |
1007 | + amdgpu_crtc->cursor_y = y; |
1008 | + |
1009 | /* avivo cursor are offset into the total surface */ |
1010 | x += crtc->x; |
1011 | y += crtc->y; |
1012 | @@ -2484,9 +2487,6 @@ static int dce_v8_0_cursor_move_locked(struct drm_crtc *crtc, |
1013 | WREG32(mmCUR_SIZE + amdgpu_crtc->crtc_offset, |
1014 | ((amdgpu_crtc->cursor_width - 1) << 16) | (amdgpu_crtc->cursor_height - 1)); |
1015 | |
1016 | - amdgpu_crtc->cursor_x = x; |
1017 | - amdgpu_crtc->cursor_y = y; |
1018 | - |
1019 | return 0; |
1020 | } |
1021 | |
1022 | @@ -2549,12 +2549,11 @@ static int dce_v8_0_crtc_cursor_set2(struct drm_crtc *crtc, |
1023 | return ret; |
1024 | } |
1025 | |
1026 | - amdgpu_crtc->cursor_width = width; |
1027 | - amdgpu_crtc->cursor_height = height; |
1028 | - |
1029 | dce_v8_0_lock_cursor(crtc, true); |
1030 | |
1031 | - if (hot_x != amdgpu_crtc->cursor_hot_x || |
1032 | + if (width != amdgpu_crtc->cursor_width || |
1033 | + height != amdgpu_crtc->cursor_height || |
1034 | + hot_x != amdgpu_crtc->cursor_hot_x || |
1035 | hot_y != amdgpu_crtc->cursor_hot_y) { |
1036 | int x, y; |
1037 | |
1038 | @@ -2563,6 +2562,8 @@ static int dce_v8_0_crtc_cursor_set2(struct drm_crtc *crtc, |
1039 | |
1040 | dce_v8_0_cursor_move_locked(crtc, x, y); |
1041 | |
1042 | + amdgpu_crtc->cursor_width = width; |
1043 | + amdgpu_crtc->cursor_height = height; |
1044 | amdgpu_crtc->cursor_hot_x = hot_x; |
1045 | amdgpu_crtc->cursor_hot_y = hot_y; |
1046 | } |
1047 | diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c |
1048 | index bb97182dc749..a88d365be4c5 100644 |
1049 | --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c |
1050 | +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c |
1051 | @@ -3947,8 +3947,12 @@ static int gfx_v8_0_init_save_restore_list(struct amdgpu_device *adev) |
1052 | temp = mmRLC_SRM_INDEX_CNTL_ADDR_0; |
1053 | data = mmRLC_SRM_INDEX_CNTL_DATA_0; |
1054 | for (i = 0; i < sizeof(unique_indices) / sizeof(int); i++) { |
1055 | - amdgpu_mm_wreg(adev, temp + i, unique_indices[i] & 0x3FFFF, false); |
1056 | - amdgpu_mm_wreg(adev, data + i, unique_indices[i] >> 20, false); |
1057 | + if (unique_indices[i] != 0) { |
1058 | + amdgpu_mm_wreg(adev, temp + i, |
1059 | + unique_indices[i] & 0x3FFFF, false); |
1060 | + amdgpu_mm_wreg(adev, data + i, |
1061 | + unique_indices[i] >> 20, false); |
1062 | + } |
1063 | } |
1064 | kfree(register_list_format); |
1065 | |
1066 | @@ -3994,7 +3998,7 @@ static void cz_enable_sck_slow_down_on_power_down(struct amdgpu_device *adev, |
1067 | |
1068 | static void cz_enable_cp_power_gating(struct amdgpu_device *adev, bool enable) |
1069 | { |
1070 | - WREG32_FIELD(RLC_PG_CNTL, CP_PG_DISABLE, enable ? 1 : 0); |
1071 | + WREG32_FIELD(RLC_PG_CNTL, CP_PG_DISABLE, enable ? 0 : 1); |
1072 | } |
1073 | |
1074 | static void gfx_v8_0_init_pg(struct amdgpu_device *adev) |
1075 | @@ -5891,29 +5895,24 @@ static void gfx_v8_0_update_coarse_grain_clock_gating(struct amdgpu_device *adev |
1076 | adev->gfx.rlc.funcs->enter_safe_mode(adev); |
1077 | |
1078 | if (enable && (adev->cg_flags & AMD_CG_SUPPORT_GFX_CGCG)) { |
1079 | - /* 1 enable cntx_empty_int_enable/cntx_busy_int_enable/ |
1080 | - * Cmp_busy/GFX_Idle interrupts |
1081 | - */ |
1082 | - gfx_v8_0_enable_gui_idle_interrupt(adev, true); |
1083 | - |
1084 | temp1 = data1 = RREG32(mmRLC_CGTT_MGCG_OVERRIDE); |
1085 | data1 &= ~RLC_CGTT_MGCG_OVERRIDE__CGCG_MASK; |
1086 | if (temp1 != data1) |
1087 | WREG32(mmRLC_CGTT_MGCG_OVERRIDE, data1); |
1088 | |
1089 | - /* 2 wait for RLC_SERDES_CU_MASTER & RLC_SERDES_NONCU_MASTER idle */ |
1090 | + /* : wait for RLC_SERDES_CU_MASTER & RLC_SERDES_NONCU_MASTER idle */ |
1091 | gfx_v8_0_wait_for_rlc_serdes(adev); |
1092 | |
1093 | - /* 3 - clear cgcg override */ |
1094 | + /* 2 - clear cgcg override */ |
1095 | gfx_v8_0_send_serdes_cmd(adev, BPM_REG_CGCG_OVERRIDE, CLE_BPM_SERDES_CMD); |
1096 | |
1097 | /* wait for RLC_SERDES_CU_MASTER & RLC_SERDES_NONCU_MASTER idle */ |
1098 | gfx_v8_0_wait_for_rlc_serdes(adev); |
1099 | |
1100 | - /* 4 - write cmd to set CGLS */ |
1101 | + /* 3 - write cmd to set CGLS */ |
1102 | gfx_v8_0_send_serdes_cmd(adev, BPM_REG_CGLS_EN, SET_BPM_SERDES_CMD); |
1103 | |
1104 | - /* 5 - enable cgcg */ |
1105 | + /* 4 - enable cgcg */ |
1106 | data |= RLC_CGCG_CGLS_CTRL__CGCG_EN_MASK; |
1107 | |
1108 | if (adev->cg_flags & AMD_CG_SUPPORT_GFX_CGLS) { |
1109 | @@ -5931,6 +5930,11 @@ static void gfx_v8_0_update_coarse_grain_clock_gating(struct amdgpu_device *adev |
1110 | |
1111 | if (temp != data) |
1112 | WREG32(mmRLC_CGCG_CGLS_CTRL, data); |
1113 | + |
1114 | + /* 5 enable cntx_empty_int_enable/cntx_busy_int_enable/ |
1115 | + * Cmp_busy/GFX_Idle interrupts |
1116 | + */ |
1117 | + gfx_v8_0_enable_gui_idle_interrupt(adev, true); |
1118 | } else { |
1119 | /* disable cntx_empty_int_enable & GFX Idle interrupt */ |
1120 | gfx_v8_0_enable_gui_idle_interrupt(adev, false); |
1121 | diff --git a/drivers/gpu/drm/amd/amdgpu/si_dpm.c b/drivers/gpu/drm/amd/amdgpu/si_dpm.c |
1122 | index d6f85b1a0b93..6d2ea76f4eb6 100644 |
1123 | --- a/drivers/gpu/drm/amd/amdgpu/si_dpm.c |
1124 | +++ b/drivers/gpu/drm/amd/amdgpu/si_dpm.c |
1125 | @@ -3504,6 +3504,7 @@ static void si_apply_state_adjust_rules(struct amdgpu_device *adev, |
1126 | (adev->pdev->revision == 0x80) || |
1127 | (adev->pdev->revision == 0x81) || |
1128 | (adev->pdev->revision == 0x83) || |
1129 | + (adev->pdev->revision == 0x87) || |
1130 | (adev->pdev->device == 0x6604) || |
1131 | (adev->pdev->device == 0x6605)) { |
1132 | max_sclk = 75000; |
1133 | @@ -7713,6 +7714,7 @@ static int si_dpm_init_microcode(struct amdgpu_device *adev) |
1134 | (adev->pdev->revision == 0x80) || |
1135 | (adev->pdev->revision == 0x81) || |
1136 | (adev->pdev->revision == 0x83) || |
1137 | + (adev->pdev->revision == 0x87) || |
1138 | (adev->pdev->device == 0x6604) || |
1139 | (adev->pdev->device == 0x6605)) |
1140 | chip_name = "oland_k"; |
1141 | diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c |
1142 | index 76310ac7ef0d..dca1b13fda2f 100644 |
1143 | --- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c |
1144 | +++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c |
1145 | @@ -1958,6 +1958,12 @@ int fiji_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) |
1146 | int res; |
1147 | uint64_t tmp64; |
1148 | |
1149 | + if (hwmgr->thermal_controller.fanInfo.bNoFan) { |
1150 | + phm_cap_unset(hwmgr->platform_descriptor.platformCaps, |
1151 | + PHM_PlatformCaps_MicrocodeFanControl); |
1152 | + return 0; |
1153 | + } |
1154 | + |
1155 | if (smu_data->smu7_data.fan_table_start == 0) { |
1156 | phm_cap_unset(hwmgr->platform_descriptor.platformCaps, |
1157 | PHM_PlatformCaps_MicrocodeFanControl); |
1158 | diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c |
1159 | index 8c889caba420..6c26b83655d0 100644 |
1160 | --- a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c |
1161 | +++ b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c |
1162 | @@ -2006,6 +2006,12 @@ int iceland_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) |
1163 | if (!phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_MicrocodeFanControl)) |
1164 | return 0; |
1165 | |
1166 | + if (hwmgr->thermal_controller.fanInfo.bNoFan) { |
1167 | + phm_cap_unset(hwmgr->platform_descriptor.platformCaps, |
1168 | + PHM_PlatformCaps_MicrocodeFanControl); |
1169 | + return 0; |
1170 | + } |
1171 | + |
1172 | if (0 == smu7_data->fan_table_start) { |
1173 | phm_cap_unset(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_MicrocodeFanControl); |
1174 | return 0; |
1175 | diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c |
1176 | index 71bb2f8dc157..8ca1a3341dea 100644 |
1177 | --- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c |
1178 | +++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c |
1179 | @@ -1885,6 +1885,12 @@ int polaris10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) |
1180 | int res; |
1181 | uint64_t tmp64; |
1182 | |
1183 | + if (hwmgr->thermal_controller.fanInfo.bNoFan) { |
1184 | + phm_cap_unset(hwmgr->platform_descriptor.platformCaps, |
1185 | + PHM_PlatformCaps_MicrocodeFanControl); |
1186 | + return 0; |
1187 | + } |
1188 | + |
1189 | if (smu_data->smu7_data.fan_table_start == 0) { |
1190 | phm_cap_unset(hwmgr->platform_descriptor.platformCaps, |
1191 | PHM_PlatformCaps_MicrocodeFanControl); |
1192 | diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smc.c b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smc.c |
1193 | index de2a24d85f48..a6619e530fe3 100644 |
1194 | --- a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smc.c |
1195 | +++ b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smc.c |
1196 | @@ -2496,6 +2496,12 @@ int tonga_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) |
1197 | PHM_PlatformCaps_MicrocodeFanControl)) |
1198 | return 0; |
1199 | |
1200 | + if (hwmgr->thermal_controller.fanInfo.bNoFan) { |
1201 | + phm_cap_unset(hwmgr->platform_descriptor.platformCaps, |
1202 | + PHM_PlatformCaps_MicrocodeFanControl); |
1203 | + return 0; |
1204 | + } |
1205 | + |
1206 | if (0 == smu_data->smu7_data.fan_table_start) { |
1207 | phm_cap_unset(hwmgr->platform_descriptor.platformCaps, |
1208 | PHM_PlatformCaps_MicrocodeFanControl); |
1209 | diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c |
1210 | index 904beaa932d0..f75c6421db62 100644 |
1211 | --- a/drivers/gpu/drm/ast/ast_main.c |
1212 | +++ b/drivers/gpu/drm/ast/ast_main.c |
1213 | @@ -223,7 +223,8 @@ static int ast_get_dram_info(struct drm_device *dev) |
1214 | ast_write32(ast, 0x10000, 0xfc600309); |
1215 | |
1216 | do { |
1217 | - ; |
1218 | + if (pci_channel_offline(dev->pdev)) |
1219 | + return -EIO; |
1220 | } while (ast_read32(ast, 0x10000) != 0x01); |
1221 | data = ast_read32(ast, 0x10004); |
1222 | |
1223 | @@ -428,7 +429,9 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags) |
1224 | ast_detect_chip(dev, &need_post); |
1225 | |
1226 | if (ast->chip != AST1180) { |
1227 | - ast_get_dram_info(dev); |
1228 | + ret = ast_get_dram_info(dev); |
1229 | + if (ret) |
1230 | + goto out_free; |
1231 | ast->vram_size = ast_get_vram_info(dev); |
1232 | DRM_INFO("dram %d %d %d %08x\n", ast->mclk, ast->dram_type, ast->dram_bus_width, ast->vram_size); |
1233 | } |
1234 | diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c |
1235 | index 50eb944fb78a..8f3ca526bd1b 100644 |
1236 | --- a/drivers/gpu/drm/gma500/psb_drv.c |
1237 | +++ b/drivers/gpu/drm/gma500/psb_drv.c |
1238 | @@ -473,6 +473,9 @@ static const struct file_operations psb_gem_fops = { |
1239 | .open = drm_open, |
1240 | .release = drm_release, |
1241 | .unlocked_ioctl = psb_unlocked_ioctl, |
1242 | +#ifdef CONFIG_COMPAT |
1243 | + .compat_ioctl = drm_compat_ioctl, |
1244 | +#endif |
1245 | .mmap = drm_gem_mmap, |
1246 | .poll = drm_poll, |
1247 | .read = drm_read, |
1248 | diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c |
1249 | index 59989e8ee5dc..9a71ed546b90 100644 |
1250 | --- a/drivers/gpu/drm/i915/i915_gem_stolen.c |
1251 | +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c |
1252 | @@ -55,10 +55,9 @@ int i915_gem_stolen_insert_node_in_range(struct drm_i915_private *dev_priv, |
1253 | return -ENODEV; |
1254 | |
1255 | /* See the comment at the drm_mm_init() call for more about this check. |
1256 | - * WaSkipStolenMemoryFirstPage:bdw,chv,kbl (incomplete) |
1257 | + * WaSkipStolenMemoryFirstPage:bdw+ (incomplete) |
1258 | */ |
1259 | - if (start < 4096 && (IS_GEN8(dev_priv) || |
1260 | - IS_KBL_REVID(dev_priv, 0, KBL_REVID_A0))) |
1261 | + if (start < 4096 && INTEL_GEN(dev_priv) >= 8) |
1262 | start = 4096; |
1263 | |
1264 | mutex_lock(&dev_priv->mm.stolen_lock); |
1265 | diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c |
1266 | index 1012eeea1324..306fc54c161b 100644 |
1267 | --- a/drivers/gpu/drm/i915/i915_sysfs.c |
1268 | +++ b/drivers/gpu/drm/i915/i915_sysfs.c |
1269 | @@ -460,7 +460,7 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev, |
1270 | |
1271 | static DEVICE_ATTR(gt_act_freq_mhz, S_IRUGO, gt_act_freq_mhz_show, NULL); |
1272 | static DEVICE_ATTR(gt_cur_freq_mhz, S_IRUGO, gt_cur_freq_mhz_show, NULL); |
1273 | -static DEVICE_ATTR(gt_boost_freq_mhz, S_IRUGO, gt_boost_freq_mhz_show, gt_boost_freq_mhz_store); |
1274 | +static DEVICE_ATTR(gt_boost_freq_mhz, S_IRUGO | S_IWUSR, gt_boost_freq_mhz_show, gt_boost_freq_mhz_store); |
1275 | static DEVICE_ATTR(gt_max_freq_mhz, S_IRUGO | S_IWUSR, gt_max_freq_mhz_show, gt_max_freq_mhz_store); |
1276 | static DEVICE_ATTR(gt_min_freq_mhz, S_IRUGO | S_IWUSR, gt_min_freq_mhz_show, gt_min_freq_mhz_store); |
1277 | |
1278 | diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c |
1279 | index 3cb70d73239b..71441c329603 100644 |
1280 | --- a/drivers/gpu/drm/i915/intel_display.c |
1281 | +++ b/drivers/gpu/drm/i915/intel_display.c |
1282 | @@ -13970,8 +13970,9 @@ static int intel_modeset_checks(struct drm_atomic_state *state) |
1283 | |
1284 | DRM_DEBUG_KMS("New cdclk calculated to be atomic %u, actual %u\n", |
1285 | intel_state->cdclk, intel_state->dev_cdclk); |
1286 | - } else |
1287 | + } else { |
1288 | to_intel_atomic_state(state)->cdclk = dev_priv->atomic_cdclk_freq; |
1289 | + } |
1290 | |
1291 | intel_modeset_clear_plls(state); |
1292 | |
1293 | @@ -14072,8 +14073,9 @@ static int intel_atomic_check(struct drm_device *dev, |
1294 | |
1295 | if (ret) |
1296 | return ret; |
1297 | - } else |
1298 | - intel_state->cdclk = dev_priv->cdclk_freq; |
1299 | + } else { |
1300 | + intel_state->cdclk = dev_priv->atomic_cdclk_freq; |
1301 | + } |
1302 | |
1303 | ret = drm_atomic_helper_check_planes(dev, state); |
1304 | if (ret) |
1305 | @@ -16441,6 +16443,7 @@ void intel_modeset_init(struct drm_device *dev) |
1306 | |
1307 | intel_update_czclk(dev_priv); |
1308 | intel_update_cdclk(dev); |
1309 | + dev_priv->atomic_cdclk_freq = dev_priv->cdclk_freq; |
1310 | |
1311 | intel_shared_dpll_init(dev); |
1312 | |
1313 | diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c |
1314 | index cd154ce6b6c1..34601574fc6e 100644 |
1315 | --- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c |
1316 | +++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c |
1317 | @@ -296,7 +296,8 @@ static void chv_exec_gpio(struct drm_i915_private *dev_priv, |
1318 | mutex_lock(&dev_priv->sb_lock); |
1319 | vlv_iosf_sb_write(dev_priv, port, cfg1, 0); |
1320 | vlv_iosf_sb_write(dev_priv, port, cfg0, |
1321 | - CHV_GPIO_GPIOCFG_GPO | CHV_GPIO_GPIOTXSTATE(value)); |
1322 | + CHV_GPIO_GPIOEN | CHV_GPIO_GPIOCFG_GPO | |
1323 | + CHV_GPIO_GPIOTXSTATE(value)); |
1324 | mutex_unlock(&dev_priv->sb_lock); |
1325 | } |
1326 | |
1327 | diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c |
1328 | index a38c2fefe85a..23ed3f5972fa 100644 |
1329 | --- a/drivers/gpu/drm/i915/intel_runtime_pm.c |
1330 | +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c |
1331 | @@ -1065,7 +1065,18 @@ static bool vlv_power_well_enabled(struct drm_i915_private *dev_priv, |
1332 | |
1333 | static void vlv_init_display_clock_gating(struct drm_i915_private *dev_priv) |
1334 | { |
1335 | - I915_WRITE(DSPCLK_GATE_D, VRHUNIT_CLOCK_GATE_DISABLE); |
1336 | + u32 val; |
1337 | + |
1338 | + /* |
1339 | + * On driver load, a pipe may be active and driving a DSI display. |
1340 | + * Preserve DPOUNIT_CLOCK_GATE_DISABLE to avoid the pipe getting stuck |
1341 | + * (and never recovering) in this case. intel_dsi_post_disable() will |
1342 | + * clear it when we turn off the display. |
1343 | + */ |
1344 | + val = I915_READ(DSPCLK_GATE_D); |
1345 | + val &= DPOUNIT_CLOCK_GATE_DISABLE; |
1346 | + val |= VRHUNIT_CLOCK_GATE_DISABLE; |
1347 | + I915_WRITE(DSPCLK_GATE_D, val); |
1348 | |
1349 | /* |
1350 | * Disable trickle feed and enable pnd deadline calculation |
1351 | diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c |
1352 | index a1570b109434..23ffe8571a99 100644 |
1353 | --- a/drivers/gpu/drm/nouveau/nouveau_bios.c |
1354 | +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c |
1355 | @@ -333,6 +333,9 @@ get_fp_strap(struct drm_device *dev, struct nvbios *bios) |
1356 | if (bios->major_version < 5 && bios->data[0x48] & 0x4) |
1357 | return NVReadVgaCrtc5758(dev, 0, 0xf) & 0xf; |
1358 | |
1359 | + if (drm->device.info.family >= NV_DEVICE_INFO_V0_MAXWELL) |
1360 | + return nvif_rd32(device, 0x001800) & 0x0000000f; |
1361 | + else |
1362 | if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) |
1363 | return (nvif_rd32(device, NV_PEXTDEV_BOOT_0) >> 24) & 0xf; |
1364 | else |
1365 | diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c |
1366 | index 343b8659472c..a2e6a81669e7 100644 |
1367 | --- a/drivers/gpu/drm/nouveau/nouveau_bo.c |
1368 | +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c |
1369 | @@ -1209,6 +1209,7 @@ nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem) |
1370 | nvbo->page_shift != vma->vm->mmu->lpg_shift)) { |
1371 | nvkm_vm_map(vma, new_mem->mm_node); |
1372 | } else { |
1373 | + WARN_ON(ttm_bo_wait(bo, false, false)); |
1374 | nvkm_vm_unmap(vma); |
1375 | } |
1376 | } |
1377 | diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c |
1378 | index 7218a067a6c5..e0d7f8472ac6 100644 |
1379 | --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c |
1380 | +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c |
1381 | @@ -1851,7 +1851,7 @@ nvf1_chipset = { |
1382 | .fb = gk104_fb_new, |
1383 | .fuse = gf100_fuse_new, |
1384 | .gpio = gk104_gpio_new, |
1385 | - .i2c = gf119_i2c_new, |
1386 | + .i2c = gk104_i2c_new, |
1387 | .ibus = gk104_ibus_new, |
1388 | .iccsense = gf100_iccsense_new, |
1389 | .imem = nv50_instmem_new, |
1390 | @@ -1965,7 +1965,7 @@ nv117_chipset = { |
1391 | .fb = gm107_fb_new, |
1392 | .fuse = gm107_fuse_new, |
1393 | .gpio = gk104_gpio_new, |
1394 | - .i2c = gf119_i2c_new, |
1395 | + .i2c = gk104_i2c_new, |
1396 | .ibus = gk104_ibus_new, |
1397 | .iccsense = gf100_iccsense_new, |
1398 | .imem = nv50_instmem_new, |
1399 | @@ -1999,7 +1999,7 @@ nv118_chipset = { |
1400 | .fb = gm107_fb_new, |
1401 | .fuse = gm107_fuse_new, |
1402 | .gpio = gk104_gpio_new, |
1403 | - .i2c = gf119_i2c_new, |
1404 | + .i2c = gk104_i2c_new, |
1405 | .ibus = gk104_ibus_new, |
1406 | .iccsense = gf100_iccsense_new, |
1407 | .imem = nv50_instmem_new, |
1408 | diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogf100.c |
1409 | index cbc67f262322..12d964260a29 100644 |
1410 | --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogf100.c |
1411 | +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogf100.c |
1412 | @@ -60,6 +60,7 @@ gf100_fifo_gpfifo_engine_fini(struct nvkm_fifo_chan *base, |
1413 | struct nvkm_gpuobj *inst = chan->base.inst; |
1414 | int ret = 0; |
1415 | |
1416 | + mutex_lock(&subdev->mutex); |
1417 | nvkm_wr32(device, 0x002634, chan->base.chid); |
1418 | if (nvkm_msec(device, 2000, |
1419 | if (nvkm_rd32(device, 0x002634) == chan->base.chid) |
1420 | @@ -67,10 +68,12 @@ gf100_fifo_gpfifo_engine_fini(struct nvkm_fifo_chan *base, |
1421 | ) < 0) { |
1422 | nvkm_error(subdev, "channel %d [%s] kick timeout\n", |
1423 | chan->base.chid, chan->base.object.client->name); |
1424 | - ret = -EBUSY; |
1425 | - if (suspend) |
1426 | - return ret; |
1427 | + ret = -ETIMEDOUT; |
1428 | } |
1429 | + mutex_unlock(&subdev->mutex); |
1430 | + |
1431 | + if (ret && suspend) |
1432 | + return ret; |
1433 | |
1434 | if (offset) { |
1435 | nvkm_kmap(inst); |
1436 | diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c |
1437 | index ed4351032ed6..a2df4f3e7763 100644 |
1438 | --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c |
1439 | +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c |
1440 | @@ -40,7 +40,9 @@ gk104_fifo_gpfifo_kick(struct gk104_fifo_chan *chan) |
1441 | struct nvkm_subdev *subdev = &fifo->base.engine.subdev; |
1442 | struct nvkm_device *device = subdev->device; |
1443 | struct nvkm_client *client = chan->base.object.client; |
1444 | + int ret = 0; |
1445 | |
1446 | + mutex_lock(&subdev->mutex); |
1447 | nvkm_wr32(device, 0x002634, chan->base.chid); |
1448 | if (nvkm_msec(device, 2000, |
1449 | if (!(nvkm_rd32(device, 0x002634) & 0x00100000)) |
1450 | @@ -48,10 +50,10 @@ gk104_fifo_gpfifo_kick(struct gk104_fifo_chan *chan) |
1451 | ) < 0) { |
1452 | nvkm_error(subdev, "channel %d [%s] kick timeout\n", |
1453 | chan->base.chid, client->name); |
1454 | - return -EBUSY; |
1455 | + ret = -ETIMEDOUT; |
1456 | } |
1457 | - |
1458 | - return 0; |
1459 | + mutex_unlock(&subdev->mutex); |
1460 | + return ret; |
1461 | } |
1462 | |
1463 | static u32 |
1464 | diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c |
1465 | index 157919c788e6..6584d505460c 100644 |
1466 | --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c |
1467 | +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c |
1468 | @@ -1756,6 +1756,50 @@ gf100_gr_ = { |
1469 | }; |
1470 | |
1471 | int |
1472 | +gf100_gr_ctor_fw_legacy(struct gf100_gr *gr, const char *fwname, |
1473 | + struct gf100_gr_fuc *fuc, int ret) |
1474 | +{ |
1475 | + struct nvkm_subdev *subdev = &gr->base.engine.subdev; |
1476 | + struct nvkm_device *device = subdev->device; |
1477 | + const struct firmware *fw; |
1478 | + char f[32]; |
1479 | + |
1480 | + /* see if this firmware has a legacy path */ |
1481 | + if (!strcmp(fwname, "fecs_inst")) |
1482 | + fwname = "fuc409c"; |
1483 | + else if (!strcmp(fwname, "fecs_data")) |
1484 | + fwname = "fuc409d"; |
1485 | + else if (!strcmp(fwname, "gpccs_inst")) |
1486 | + fwname = "fuc41ac"; |
1487 | + else if (!strcmp(fwname, "gpccs_data")) |
1488 | + fwname = "fuc41ad"; |
1489 | + else { |
1490 | + /* nope, let's just return the error we got */ |
1491 | + nvkm_error(subdev, "failed to load %s\n", fwname); |
1492 | + return ret; |
1493 | + } |
1494 | + |
1495 | + /* yes, try to load from the legacy path */ |
1496 | + nvkm_debug(subdev, "%s: falling back to legacy path\n", fwname); |
1497 | + |
1498 | + snprintf(f, sizeof(f), "nouveau/nv%02x_%s", device->chipset, fwname); |
1499 | + ret = request_firmware(&fw, f, device->dev); |
1500 | + if (ret) { |
1501 | + snprintf(f, sizeof(f), "nouveau/%s", fwname); |
1502 | + ret = request_firmware(&fw, f, device->dev); |
1503 | + if (ret) { |
1504 | + nvkm_error(subdev, "failed to load %s\n", fwname); |
1505 | + return ret; |
1506 | + } |
1507 | + } |
1508 | + |
1509 | + fuc->size = fw->size; |
1510 | + fuc->data = kmemdup(fw->data, fuc->size, GFP_KERNEL); |
1511 | + release_firmware(fw); |
1512 | + return (fuc->data != NULL) ? 0 : -ENOMEM; |
1513 | +} |
1514 | + |
1515 | +int |
1516 | gf100_gr_ctor_fw(struct gf100_gr *gr, const char *fwname, |
1517 | struct gf100_gr_fuc *fuc) |
1518 | { |
1519 | @@ -1765,10 +1809,8 @@ gf100_gr_ctor_fw(struct gf100_gr *gr, const char *fwname, |
1520 | int ret; |
1521 | |
1522 | ret = nvkm_firmware_get(device, fwname, &fw); |
1523 | - if (ret) { |
1524 | - nvkm_error(subdev, "failed to load %s\n", fwname); |
1525 | - return ret; |
1526 | - } |
1527 | + if (ret) |
1528 | + return gf100_gr_ctor_fw_legacy(gr, fwname, fuc, ret); |
1529 | |
1530 | fuc->size = fw->size; |
1531 | fuc->data = kmemdup(fw->data, fuc->size, GFP_KERNEL); |
1532 | diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h |
1533 | index 212800ecdce9..7d1d3c6b4b72 100644 |
1534 | --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h |
1535 | +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h |
1536 | @@ -12,6 +12,7 @@ struct nvbios_source { |
1537 | bool rw; |
1538 | bool ignore_checksum; |
1539 | bool no_pcir; |
1540 | + bool require_checksum; |
1541 | }; |
1542 | |
1543 | int nvbios_extend(struct nvkm_bios *, u32 length); |
1544 | diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c |
1545 | index b2557e87afdd..7deb81b6dbac 100644 |
1546 | --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c |
1547 | +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c |
1548 | @@ -86,9 +86,12 @@ shadow_image(struct nvkm_bios *bios, int idx, u32 offset, struct shadow *mthd) |
1549 | nvbios_checksum(&bios->data[image.base], image.size)) { |
1550 | nvkm_debug(subdev, "%08x: checksum failed\n", |
1551 | image.base); |
1552 | - if (mthd->func->rw) |
1553 | + if (!mthd->func->require_checksum) { |
1554 | + if (mthd->func->rw) |
1555 | + score += 1; |
1556 | score += 1; |
1557 | - score += 1; |
1558 | + } else |
1559 | + return 0; |
1560 | } else { |
1561 | score += 3; |
1562 | } |
1563 | diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowacpi.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowacpi.c |
1564 | index 8fecb5ff22a0..06572f8ce914 100644 |
1565 | --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowacpi.c |
1566 | +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowacpi.c |
1567 | @@ -99,6 +99,7 @@ nvbios_acpi_fast = { |
1568 | .init = acpi_init, |
1569 | .read = acpi_read_fast, |
1570 | .rw = false, |
1571 | + .require_checksum = true, |
1572 | }; |
1573 | |
1574 | const struct nvbios_source |
1575 | diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c |
1576 | index 39c2a38e54f7..0c7ef250dcaf 100644 |
1577 | --- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c |
1578 | +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/base.c |
1579 | @@ -47,8 +47,10 @@ nvkm_ltc_tags_clear(struct nvkm_ltc *ltc, u32 first, u32 count) |
1580 | |
1581 | BUG_ON((first > limit) || (limit >= ltc->num_tags)); |
1582 | |
1583 | + mutex_lock(<c->subdev.mutex); |
1584 | ltc->func->cbc_clear(ltc, first, limit); |
1585 | ltc->func->cbc_wait(ltc); |
1586 | + mutex_unlock(<c->subdev.mutex); |
1587 | } |
1588 | |
1589 | int |
1590 | diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c |
1591 | index 2a10e24b34b1..87a72476d313 100644 |
1592 | --- a/drivers/gpu/drm/radeon/radeon_cursor.c |
1593 | +++ b/drivers/gpu/drm/radeon/radeon_cursor.c |
1594 | @@ -90,6 +90,9 @@ static void radeon_show_cursor(struct drm_crtc *crtc) |
1595 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); |
1596 | struct radeon_device *rdev = crtc->dev->dev_private; |
1597 | |
1598 | + if (radeon_crtc->cursor_out_of_bounds) |
1599 | + return; |
1600 | + |
1601 | if (ASIC_IS_DCE4(rdev)) { |
1602 | WREG32(EVERGREEN_CUR_SURFACE_ADDRESS_HIGH + radeon_crtc->crtc_offset, |
1603 | upper_32_bits(radeon_crtc->cursor_addr)); |
1604 | @@ -148,16 +151,17 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y) |
1605 | x += crtc->x; |
1606 | y += crtc->y; |
1607 | } |
1608 | - DRM_DEBUG("x %d y %d c->x %d c->y %d\n", x, y, crtc->x, crtc->y); |
1609 | |
1610 | - if (x < 0) { |
1611 | + if (x < 0) |
1612 | xorigin = min(-x, radeon_crtc->max_cursor_width - 1); |
1613 | - x = 0; |
1614 | - } |
1615 | - if (y < 0) { |
1616 | + if (y < 0) |
1617 | yorigin = min(-y, radeon_crtc->max_cursor_height - 1); |
1618 | - y = 0; |
1619 | + |
1620 | + if (!ASIC_IS_AVIVO(rdev)) { |
1621 | + x += crtc->x; |
1622 | + y += crtc->y; |
1623 | } |
1624 | + DRM_DEBUG("x %d y %d c->x %d c->y %d\n", x, y, crtc->x, crtc->y); |
1625 | |
1626 | /* fixed on DCE6 and newer */ |
1627 | if (ASIC_IS_AVIVO(rdev) && !ASIC_IS_DCE6(rdev)) { |
1628 | @@ -180,27 +184,31 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y) |
1629 | if (i > 1) { |
1630 | int cursor_end, frame_end; |
1631 | |
1632 | - cursor_end = x - xorigin + w; |
1633 | + cursor_end = x + w; |
1634 | frame_end = crtc->x + crtc->mode.crtc_hdisplay; |
1635 | if (cursor_end >= frame_end) { |
1636 | w = w - (cursor_end - frame_end); |
1637 | if (!(frame_end & 0x7f)) |
1638 | w--; |
1639 | - } else { |
1640 | - if (!(cursor_end & 0x7f)) |
1641 | - w--; |
1642 | + } else if (cursor_end <= 0) { |
1643 | + goto out_of_bounds; |
1644 | + } else if (!(cursor_end & 0x7f)) { |
1645 | + w--; |
1646 | } |
1647 | if (w <= 0) { |
1648 | - w = 1; |
1649 | - cursor_end = x - xorigin + w; |
1650 | - if (!(cursor_end & 0x7f)) { |
1651 | - x--; |
1652 | - WARN_ON_ONCE(x < 0); |
1653 | - } |
1654 | + goto out_of_bounds; |
1655 | } |
1656 | } |
1657 | } |
1658 | |
1659 | + if (x <= (crtc->x - w) || y <= (crtc->y - radeon_crtc->cursor_height) || |
1660 | + x >= (crtc->x + crtc->mode.crtc_hdisplay) || |
1661 | + y >= (crtc->y + crtc->mode.crtc_vdisplay)) |
1662 | + goto out_of_bounds; |
1663 | + |
1664 | + x += xorigin; |
1665 | + y += yorigin; |
1666 | + |
1667 | if (ASIC_IS_DCE4(rdev)) { |
1668 | WREG32(EVERGREEN_CUR_POSITION + radeon_crtc->crtc_offset, (x << 16) | y); |
1669 | WREG32(EVERGREEN_CUR_HOT_SPOT + radeon_crtc->crtc_offset, (xorigin << 16) | yorigin); |
1670 | @@ -212,6 +220,9 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y) |
1671 | WREG32(AVIVO_D1CUR_SIZE + radeon_crtc->crtc_offset, |
1672 | ((w - 1) << 16) | (radeon_crtc->cursor_height - 1)); |
1673 | } else { |
1674 | + x -= crtc->x; |
1675 | + y -= crtc->y; |
1676 | + |
1677 | if (crtc->mode.flags & DRM_MODE_FLAG_DBLSCAN) |
1678 | y *= 2; |
1679 | |
1680 | @@ -232,6 +243,19 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y) |
1681 | radeon_crtc->cursor_x = x; |
1682 | radeon_crtc->cursor_y = y; |
1683 | |
1684 | + if (radeon_crtc->cursor_out_of_bounds) { |
1685 | + radeon_crtc->cursor_out_of_bounds = false; |
1686 | + if (radeon_crtc->cursor_bo) |
1687 | + radeon_show_cursor(crtc); |
1688 | + } |
1689 | + |
1690 | + return 0; |
1691 | + |
1692 | + out_of_bounds: |
1693 | + if (!radeon_crtc->cursor_out_of_bounds) { |
1694 | + radeon_hide_cursor(crtc); |
1695 | + radeon_crtc->cursor_out_of_bounds = true; |
1696 | + } |
1697 | return 0; |
1698 | } |
1699 | |
1700 | @@ -297,22 +321,23 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc, |
1701 | return ret; |
1702 | } |
1703 | |
1704 | - radeon_crtc->cursor_width = width; |
1705 | - radeon_crtc->cursor_height = height; |
1706 | - |
1707 | radeon_lock_cursor(crtc, true); |
1708 | |
1709 | - if (hot_x != radeon_crtc->cursor_hot_x || |
1710 | + if (width != radeon_crtc->cursor_width || |
1711 | + height != radeon_crtc->cursor_height || |
1712 | + hot_x != radeon_crtc->cursor_hot_x || |
1713 | hot_y != radeon_crtc->cursor_hot_y) { |
1714 | int x, y; |
1715 | |
1716 | x = radeon_crtc->cursor_x + radeon_crtc->cursor_hot_x - hot_x; |
1717 | y = radeon_crtc->cursor_y + radeon_crtc->cursor_hot_y - hot_y; |
1718 | |
1719 | - radeon_cursor_move_locked(crtc, x, y); |
1720 | - |
1721 | + radeon_crtc->cursor_width = width; |
1722 | + radeon_crtc->cursor_height = height; |
1723 | radeon_crtc->cursor_hot_x = hot_x; |
1724 | radeon_crtc->cursor_hot_y = hot_y; |
1725 | + |
1726 | + radeon_cursor_move_locked(crtc, x, y); |
1727 | } |
1728 | |
1729 | radeon_show_cursor(crtc); |
1730 | diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h |
1731 | index bb75201a24ba..f1da484864a9 100644 |
1732 | --- a/drivers/gpu/drm/radeon/radeon_mode.h |
1733 | +++ b/drivers/gpu/drm/radeon/radeon_mode.h |
1734 | @@ -330,6 +330,7 @@ struct radeon_crtc { |
1735 | u16 lut_r[256], lut_g[256], lut_b[256]; |
1736 | bool enabled; |
1737 | bool can_tile; |
1738 | + bool cursor_out_of_bounds; |
1739 | uint32_t crtc_offset; |
1740 | struct drm_gem_object *cursor_bo; |
1741 | uint64_t cursor_addr; |
1742 | diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c |
1743 | index e402be8821c4..125c7e82c3d1 100644 |
1744 | --- a/drivers/gpu/drm/radeon/si.c |
1745 | +++ b/drivers/gpu/drm/radeon/si.c |
1746 | @@ -1714,6 +1714,7 @@ static int si_init_microcode(struct radeon_device *rdev) |
1747 | (rdev->pdev->revision == 0x80) || |
1748 | (rdev->pdev->revision == 0x81) || |
1749 | (rdev->pdev->revision == 0x83) || |
1750 | + (rdev->pdev->revision == 0x87) || |
1751 | (rdev->pdev->device == 0x6604) || |
1752 | (rdev->pdev->device == 0x6605)) |
1753 | new_smc = true; |
1754 | diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c |
1755 | index c49934527a87..8b5e697f2549 100644 |
1756 | --- a/drivers/gpu/drm/radeon/si_dpm.c |
1757 | +++ b/drivers/gpu/drm/radeon/si_dpm.c |
1758 | @@ -3026,6 +3026,7 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev, |
1759 | (rdev->pdev->revision == 0x80) || |
1760 | (rdev->pdev->revision == 0x81) || |
1761 | (rdev->pdev->revision == 0x83) || |
1762 | + (rdev->pdev->revision == 0x87) || |
1763 | (rdev->pdev->device == 0x6604) || |
1764 | (rdev->pdev->device == 0x6605)) { |
1765 | max_sclk = 75000; |
1766 | diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c |
1767 | index 96a85cd39580..1bc1d4795243 100644 |
1768 | --- a/drivers/hv/channel_mgmt.c |
1769 | +++ b/drivers/hv/channel_mgmt.c |
1770 | @@ -389,6 +389,7 @@ void vmbus_free_channels(void) |
1771 | { |
1772 | struct vmbus_channel *channel, *tmp; |
1773 | |
1774 | + mutex_lock(&vmbus_connection.channel_mutex); |
1775 | list_for_each_entry_safe(channel, tmp, &vmbus_connection.chn_list, |
1776 | listentry) { |
1777 | /* hv_process_channel_removal() needs this */ |
1778 | @@ -396,6 +397,7 @@ void vmbus_free_channels(void) |
1779 | |
1780 | vmbus_device_unregister(channel->device_obj); |
1781 | } |
1782 | + mutex_unlock(&vmbus_connection.channel_mutex); |
1783 | } |
1784 | |
1785 | /* |
1786 | diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c |
1787 | index 51f81d64ca37..a6ea387b5b00 100644 |
1788 | --- a/drivers/hwtracing/stm/core.c |
1789 | +++ b/drivers/hwtracing/stm/core.c |
1790 | @@ -361,7 +361,7 @@ static int stm_char_open(struct inode *inode, struct file *file) |
1791 | struct stm_file *stmf; |
1792 | struct device *dev; |
1793 | unsigned int major = imajor(inode); |
1794 | - int err = -ENODEV; |
1795 | + int err = -ENOMEM; |
1796 | |
1797 | dev = class_find_device(&stm_class, NULL, &major, major_match); |
1798 | if (!dev) |
1799 | @@ -369,8 +369,9 @@ static int stm_char_open(struct inode *inode, struct file *file) |
1800 | |
1801 | stmf = kzalloc(sizeof(*stmf), GFP_KERNEL); |
1802 | if (!stmf) |
1803 | - return -ENOMEM; |
1804 | + goto err_put_device; |
1805 | |
1806 | + err = -ENODEV; |
1807 | stm_output_init(&stmf->output); |
1808 | stmf->stm = to_stm_device(dev); |
1809 | |
1810 | @@ -382,9 +383,10 @@ static int stm_char_open(struct inode *inode, struct file *file) |
1811 | return nonseekable_open(inode, file); |
1812 | |
1813 | err_free: |
1814 | + kfree(stmf); |
1815 | +err_put_device: |
1816 | /* matches class_find_device() above */ |
1817 | put_device(dev); |
1818 | - kfree(stmf); |
1819 | |
1820 | return err; |
1821 | } |
1822 | diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c |
1823 | index 40cbd6bdb73b..2395fe2021c9 100644 |
1824 | --- a/drivers/infiniband/core/mad.c |
1825 | +++ b/drivers/infiniband/core/mad.c |
1826 | @@ -1746,7 +1746,7 @@ find_mad_agent(struct ib_mad_port_private *port_priv, |
1827 | if (!class) |
1828 | goto out; |
1829 | if (convert_mgmt_class(mad_hdr->mgmt_class) >= |
1830 | - IB_MGMT_MAX_METHODS) |
1831 | + ARRAY_SIZE(class->method_table)) |
1832 | goto out; |
1833 | method = class->method_table[convert_mgmt_class( |
1834 | mad_hdr->mgmt_class)]; |
1835 | diff --git a/drivers/infiniband/core/multicast.c b/drivers/infiniband/core/multicast.c |
1836 | index e51b739f6ea3..322cb67b07a9 100644 |
1837 | --- a/drivers/infiniband/core/multicast.c |
1838 | +++ b/drivers/infiniband/core/multicast.c |
1839 | @@ -518,8 +518,11 @@ static void join_handler(int status, struct ib_sa_mcmember_rec *rec, |
1840 | process_join_error(group, status); |
1841 | else { |
1842 | int mgids_changed, is_mgid0; |
1843 | - ib_find_pkey(group->port->dev->device, group->port->port_num, |
1844 | - be16_to_cpu(rec->pkey), &pkey_index); |
1845 | + |
1846 | + if (ib_find_pkey(group->port->dev->device, |
1847 | + group->port->port_num, be16_to_cpu(rec->pkey), |
1848 | + &pkey_index)) |
1849 | + pkey_index = MCAST_INVALID_PKEY_INDEX; |
1850 | |
1851 | spin_lock_irq(&group->port->lock); |
1852 | if (group->state == MCAST_BUSY && |
1853 | diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c |
1854 | index 6329c971c22f..4b892ca2b13a 100644 |
1855 | --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c |
1856 | +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c |
1857 | @@ -2501,7 +2501,7 @@ static int i40iw_get_hw_stats(struct ib_device *ibdev, |
1858 | return -ENOSYS; |
1859 | } |
1860 | |
1861 | - memcpy(&stats->value[0], &hw_stats, sizeof(*hw_stats)); |
1862 | + memcpy(&stats->value[0], hw_stats, sizeof(*hw_stats)); |
1863 | |
1864 | return stats->num_counters; |
1865 | } |
1866 | diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c |
1867 | index c3e60e4bde6e..486d576e55bc 100644 |
1868 | --- a/drivers/infiniband/sw/rxe/rxe_qp.c |
1869 | +++ b/drivers/infiniband/sw/rxe/rxe_qp.c |
1870 | @@ -855,4 +855,5 @@ void rxe_qp_cleanup(void *arg) |
1871 | free_rd_atomic_resources(qp); |
1872 | |
1873 | kernel_sock_shutdown(qp->sk, SHUT_RDWR); |
1874 | + sock_release(qp->sk); |
1875 | } |
1876 | diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c |
1877 | index 1909dd252c94..fddff403d5d2 100644 |
1878 | --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c |
1879 | +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c |
1880 | @@ -575,8 +575,11 @@ void ipoib_mcast_join_task(struct work_struct *work) |
1881 | if (!test_bit(IPOIB_FLAG_OPER_UP, &priv->flags)) |
1882 | return; |
1883 | |
1884 | - if (ib_query_port(priv->ca, priv->port, &port_attr) || |
1885 | - port_attr.state != IB_PORT_ACTIVE) { |
1886 | + if (ib_query_port(priv->ca, priv->port, &port_attr)) { |
1887 | + ipoib_dbg(priv, "ib_query_port() failed\n"); |
1888 | + return; |
1889 | + } |
1890 | + if (port_attr.state != IB_PORT_ACTIVE) { |
1891 | ipoib_dbg(priv, "port state is not ACTIVE (state = %d) suspending join task\n", |
1892 | port_attr.state); |
1893 | return; |
1894 | diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c |
1895 | index 2adfd86c869a..930424e55439 100644 |
1896 | --- a/drivers/input/misc/drv260x.c |
1897 | +++ b/drivers/input/misc/drv260x.c |
1898 | @@ -592,7 +592,6 @@ static int drv260x_probe(struct i2c_client *client, |
1899 | } |
1900 | |
1901 | haptics->input_dev->name = "drv260x:haptics"; |
1902 | - haptics->input_dev->dev.parent = client->dev.parent; |
1903 | haptics->input_dev->close = drv260x_close; |
1904 | input_set_drvdata(haptics->input_dev, haptics); |
1905 | input_set_capability(haptics->input_dev, EV_FF, FF_RUMBLE); |
1906 | diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c |
1907 | index 92ac251e91e6..cce6057b9aca 100644 |
1908 | --- a/drivers/md/raid5.c |
1909 | +++ b/drivers/md/raid5.c |
1910 | @@ -6984,6 +6984,15 @@ static int raid5_run(struct mddev *mddev) |
1911 | stripe = (stripe | (stripe-1)) + 1; |
1912 | mddev->queue->limits.discard_alignment = stripe; |
1913 | mddev->queue->limits.discard_granularity = stripe; |
1914 | + |
1915 | + /* |
1916 | + * We use 16-bit counter of active stripes in bi_phys_segments |
1917 | + * (minus one for over-loaded initialization) |
1918 | + */ |
1919 | + blk_queue_max_hw_sectors(mddev->queue, 0xfffe * STRIPE_SECTORS); |
1920 | + blk_queue_max_discard_sectors(mddev->queue, |
1921 | + 0xfffe * STRIPE_SECTORS); |
1922 | + |
1923 | /* |
1924 | * unaligned part of discard request will be ignored, so can't |
1925 | * guarantee discard_zeroes_data |
1926 | diff --git a/drivers/media/dvb-frontends/mn88472.c b/drivers/media/dvb-frontends/mn88472.c |
1927 | index 18fb2df1e2bd..72650116732c 100644 |
1928 | --- a/drivers/media/dvb-frontends/mn88472.c |
1929 | +++ b/drivers/media/dvb-frontends/mn88472.c |
1930 | @@ -488,18 +488,6 @@ static int mn88472_probe(struct i2c_client *client, |
1931 | goto err_kfree; |
1932 | } |
1933 | |
1934 | - /* Check demod answers with correct chip id */ |
1935 | - ret = regmap_read(dev->regmap[0], 0xff, &utmp); |
1936 | - if (ret) |
1937 | - goto err_regmap_0_regmap_exit; |
1938 | - |
1939 | - dev_dbg(&client->dev, "chip id=%02x\n", utmp); |
1940 | - |
1941 | - if (utmp != 0x02) { |
1942 | - ret = -ENODEV; |
1943 | - goto err_regmap_0_regmap_exit; |
1944 | - } |
1945 | - |
1946 | /* |
1947 | * Chip has three I2C addresses for different register banks. Used |
1948 | * addresses are 0x18, 0x1a and 0x1c. We register two dummy clients, |
1949 | @@ -536,6 +524,18 @@ static int mn88472_probe(struct i2c_client *client, |
1950 | } |
1951 | i2c_set_clientdata(dev->client[2], dev); |
1952 | |
1953 | + /* Check demod answers with correct chip id */ |
1954 | + ret = regmap_read(dev->regmap[2], 0xff, &utmp); |
1955 | + if (ret) |
1956 | + goto err_regmap_2_regmap_exit; |
1957 | + |
1958 | + dev_dbg(&client->dev, "chip id=%02x\n", utmp); |
1959 | + |
1960 | + if (utmp != 0x02) { |
1961 | + ret = -ENODEV; |
1962 | + goto err_regmap_2_regmap_exit; |
1963 | + } |
1964 | + |
1965 | /* Sleep because chip is active by default */ |
1966 | ret = regmap_write(dev->regmap[2], 0x05, 0x3e); |
1967 | if (ret) |
1968 | diff --git a/drivers/media/dvb-frontends/mn88473.c b/drivers/media/dvb-frontends/mn88473.c |
1969 | index 451974a1d7ed..2932bdc8fa94 100644 |
1970 | --- a/drivers/media/dvb-frontends/mn88473.c |
1971 | +++ b/drivers/media/dvb-frontends/mn88473.c |
1972 | @@ -485,18 +485,6 @@ static int mn88473_probe(struct i2c_client *client, |
1973 | goto err_kfree; |
1974 | } |
1975 | |
1976 | - /* Check demod answers with correct chip id */ |
1977 | - ret = regmap_read(dev->regmap[0], 0xff, &uitmp); |
1978 | - if (ret) |
1979 | - goto err_regmap_0_regmap_exit; |
1980 | - |
1981 | - dev_dbg(&client->dev, "chip id=%02x\n", uitmp); |
1982 | - |
1983 | - if (uitmp != 0x03) { |
1984 | - ret = -ENODEV; |
1985 | - goto err_regmap_0_regmap_exit; |
1986 | - } |
1987 | - |
1988 | /* |
1989 | * Chip has three I2C addresses for different register banks. Used |
1990 | * addresses are 0x18, 0x1a and 0x1c. We register two dummy clients, |
1991 | @@ -533,6 +521,18 @@ static int mn88473_probe(struct i2c_client *client, |
1992 | } |
1993 | i2c_set_clientdata(dev->client[2], dev); |
1994 | |
1995 | + /* Check demod answers with correct chip id */ |
1996 | + ret = regmap_read(dev->regmap[2], 0xff, &uitmp); |
1997 | + if (ret) |
1998 | + goto err_regmap_2_regmap_exit; |
1999 | + |
2000 | + dev_dbg(&client->dev, "chip id=%02x\n", uitmp); |
2001 | + |
2002 | + if (uitmp != 0x03) { |
2003 | + ret = -ENODEV; |
2004 | + goto err_regmap_2_regmap_exit; |
2005 | + } |
2006 | + |
2007 | /* Sleep because chip is active by default */ |
2008 | ret = regmap_write(dev->regmap[2], 0x05, 0x3e); |
2009 | if (ret) |
2010 | diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c |
2011 | index 4740da39d698..7268e706e216 100644 |
2012 | --- a/drivers/media/i2c/tvp5150.c |
2013 | +++ b/drivers/media/i2c/tvp5150.c |
2014 | @@ -815,6 +815,7 @@ static int tvp5150_s_ctrl(struct v4l2_ctrl *ctrl) |
2015 | return 0; |
2016 | case V4L2_CID_HUE: |
2017 | tvp5150_write(sd, TVP5150_HUE_CTL, ctrl->val); |
2018 | + break; |
2019 | case V4L2_CID_TEST_PATTERN: |
2020 | decoder->enable = ctrl->val ? false : true; |
2021 | tvp5150_selmux(sd); |
2022 | diff --git a/drivers/media/pci/solo6x10/solo6x10.h b/drivers/media/pci/solo6x10/solo6x10.h |
2023 | index 5bd498735a66..3f8da5e8c430 100644 |
2024 | --- a/drivers/media/pci/solo6x10/solo6x10.h |
2025 | +++ b/drivers/media/pci/solo6x10/solo6x10.h |
2026 | @@ -284,7 +284,10 @@ static inline u32 solo_reg_read(struct solo_dev *solo_dev, int reg) |
2027 | static inline void solo_reg_write(struct solo_dev *solo_dev, int reg, |
2028 | u32 data) |
2029 | { |
2030 | + u16 val; |
2031 | + |
2032 | writel(data, solo_dev->reg_base + reg); |
2033 | + pci_read_config_word(solo_dev->pdev, PCI_STATUS, &val); |
2034 | } |
2035 | |
2036 | static inline void solo_irq_on(struct solo_dev *dev, u32 mask) |
2037 | diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c |
2038 | index 0a5b8f5e011e..3436eda58855 100644 |
2039 | --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c |
2040 | +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c |
2041 | @@ -1082,6 +1082,7 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev, |
2042 | idx); |
2043 | if (ret == 0) |
2044 | return child; |
2045 | + device_del(child); |
2046 | } |
2047 | |
2048 | put_device(child); |
2049 | diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c |
2050 | index 6fe02350578d..f999a8d3c9c4 100644 |
2051 | --- a/drivers/misc/mei/client.c |
2052 | +++ b/drivers/misc/mei/client.c |
2053 | @@ -686,7 +686,7 @@ void mei_host_client_init(struct mei_device *dev) |
2054 | |
2055 | pm_runtime_mark_last_busy(dev->dev); |
2056 | dev_dbg(dev->dev, "rpm: autosuspend\n"); |
2057 | - pm_runtime_autosuspend(dev->dev); |
2058 | + pm_request_autosuspend(dev->dev); |
2059 | } |
2060 | |
2061 | /** |
2062 | diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h |
2063 | index 7ad15d678878..c8307e8b4c16 100644 |
2064 | --- a/drivers/misc/mei/hw-me-regs.h |
2065 | +++ b/drivers/misc/mei/hw-me-regs.h |
2066 | @@ -122,6 +122,8 @@ |
2067 | #define MEI_DEV_ID_SPT_H 0xA13A /* Sunrise Point H */ |
2068 | #define MEI_DEV_ID_SPT_H_2 0xA13B /* Sunrise Point H 2 */ |
2069 | |
2070 | +#define MEI_DEV_ID_LBG 0xA1BA /* Lewisburg (SPT) */ |
2071 | + |
2072 | #define MEI_DEV_ID_BXT_M 0x1A9A /* Broxton M */ |
2073 | #define MEI_DEV_ID_APL_I 0x5A9A /* Apollo Lake I */ |
2074 | |
2075 | diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c |
2076 | index f3ffd883b232..f9c6ec4b98ab 100644 |
2077 | --- a/drivers/misc/mei/pci-me.c |
2078 | +++ b/drivers/misc/mei/pci-me.c |
2079 | @@ -87,6 +87,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = { |
2080 | {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_2, mei_me_pch8_cfg)}, |
2081 | {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H, mei_me_pch8_sps_cfg)}, |
2082 | {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H_2, mei_me_pch8_sps_cfg)}, |
2083 | + {MEI_PCI_DEVICE(MEI_DEV_ID_LBG, mei_me_pch8_cfg)}, |
2084 | |
2085 | {MEI_PCI_DEVICE(MEI_DEV_ID_BXT_M, mei_me_pch8_cfg)}, |
2086 | {MEI_PCI_DEVICE(MEI_DEV_ID_APL_I, mei_me_pch8_cfg)}, |
2087 | diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c |
2088 | index 73c762a28dfe..f6f40a1673ae 100644 |
2089 | --- a/drivers/mmc/core/sd.c |
2090 | +++ b/drivers/mmc/core/sd.c |
2091 | @@ -223,6 +223,7 @@ static int mmc_decode_scr(struct mmc_card *card) |
2092 | static int mmc_read_ssr(struct mmc_card *card) |
2093 | { |
2094 | unsigned int au, es, et, eo; |
2095 | + u32 *raw_ssr; |
2096 | int i; |
2097 | |
2098 | if (!(card->csd.cmdclass & CCC_APP_SPEC)) { |
2099 | @@ -231,14 +232,21 @@ static int mmc_read_ssr(struct mmc_card *card) |
2100 | return 0; |
2101 | } |
2102 | |
2103 | - if (mmc_app_sd_status(card, card->raw_ssr)) { |
2104 | + raw_ssr = kmalloc(sizeof(card->raw_ssr), GFP_KERNEL); |
2105 | + if (!raw_ssr) |
2106 | + return -ENOMEM; |
2107 | + |
2108 | + if (mmc_app_sd_status(card, raw_ssr)) { |
2109 | pr_warn("%s: problem reading SD Status register\n", |
2110 | mmc_hostname(card->host)); |
2111 | + kfree(raw_ssr); |
2112 | return 0; |
2113 | } |
2114 | |
2115 | for (i = 0; i < 16; i++) |
2116 | - card->raw_ssr[i] = be32_to_cpu(card->raw_ssr[i]); |
2117 | + card->raw_ssr[i] = be32_to_cpu(raw_ssr[i]); |
2118 | + |
2119 | + kfree(raw_ssr); |
2120 | |
2121 | /* |
2122 | * UNSTUFF_BITS only works with four u32s so we have to offset the |
2123 | diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c |
2124 | index 42ef3ebb1d8c..e1e274a0a34f 100644 |
2125 | --- a/drivers/mmc/host/sdhci.c |
2126 | +++ b/drivers/mmc/host/sdhci.c |
2127 | @@ -2086,16 +2086,32 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode) |
2128 | |
2129 | if (!host->tuning_done) { |
2130 | pr_info(DRIVER_NAME ": Timeout waiting for Buffer Read Ready interrupt during tuning procedure, falling back to fixed sampling clock\n"); |
2131 | - |
2132 | - sdhci_do_reset(host, SDHCI_RESET_CMD); |
2133 | - sdhci_do_reset(host, SDHCI_RESET_DATA); |
2134 | - |
2135 | ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); |
2136 | ctrl &= ~SDHCI_CTRL_TUNED_CLK; |
2137 | ctrl &= ~SDHCI_CTRL_EXEC_TUNING; |
2138 | sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2); |
2139 | |
2140 | + sdhci_do_reset(host, SDHCI_RESET_CMD); |
2141 | + sdhci_do_reset(host, SDHCI_RESET_DATA); |
2142 | + |
2143 | err = -EIO; |
2144 | + |
2145 | + if (cmd.opcode != MMC_SEND_TUNING_BLOCK_HS200) |
2146 | + goto out; |
2147 | + |
2148 | + sdhci_writel(host, host->ier, SDHCI_INT_ENABLE); |
2149 | + sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); |
2150 | + |
2151 | + spin_unlock_irqrestore(&host->lock, flags); |
2152 | + |
2153 | + memset(&cmd, 0, sizeof(cmd)); |
2154 | + cmd.opcode = MMC_STOP_TRANSMISSION; |
2155 | + cmd.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC; |
2156 | + cmd.busy_timeout = 50; |
2157 | + mmc_wait_for_cmd(mmc, &cmd, 0); |
2158 | + |
2159 | + spin_lock_irqsave(&host->lock, flags); |
2160 | + |
2161 | goto out; |
2162 | } |
2163 | |
2164 | diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c |
2165 | index 1026c452e39d..930c8165f2a8 100644 |
2166 | --- a/drivers/net/ethernet/marvell/mvpp2.c |
2167 | +++ b/drivers/net/ethernet/marvell/mvpp2.c |
2168 | @@ -770,6 +770,17 @@ struct mvpp2_rx_desc { |
2169 | u32 reserved8; |
2170 | }; |
2171 | |
2172 | +struct mvpp2_txq_pcpu_buf { |
2173 | + /* Transmitted SKB */ |
2174 | + struct sk_buff *skb; |
2175 | + |
2176 | + /* Physical address of transmitted buffer */ |
2177 | + dma_addr_t phys; |
2178 | + |
2179 | + /* Size transmitted */ |
2180 | + size_t size; |
2181 | +}; |
2182 | + |
2183 | /* Per-CPU Tx queue control */ |
2184 | struct mvpp2_txq_pcpu { |
2185 | int cpu; |
2186 | @@ -785,11 +796,8 @@ struct mvpp2_txq_pcpu { |
2187 | /* Number of Tx DMA descriptors reserved for each CPU */ |
2188 | int reserved_num; |
2189 | |
2190 | - /* Array of transmitted skb */ |
2191 | - struct sk_buff **tx_skb; |
2192 | - |
2193 | - /* Array of transmitted buffers' physical addresses */ |
2194 | - dma_addr_t *tx_buffs; |
2195 | + /* Infos about transmitted buffers */ |
2196 | + struct mvpp2_txq_pcpu_buf *buffs; |
2197 | |
2198 | /* Index of last TX DMA descriptor that was inserted */ |
2199 | int txq_put_index; |
2200 | @@ -979,10 +987,11 @@ static void mvpp2_txq_inc_put(struct mvpp2_txq_pcpu *txq_pcpu, |
2201 | struct sk_buff *skb, |
2202 | struct mvpp2_tx_desc *tx_desc) |
2203 | { |
2204 | - txq_pcpu->tx_skb[txq_pcpu->txq_put_index] = skb; |
2205 | - if (skb) |
2206 | - txq_pcpu->tx_buffs[txq_pcpu->txq_put_index] = |
2207 | - tx_desc->buf_phys_addr; |
2208 | + struct mvpp2_txq_pcpu_buf *tx_buf = |
2209 | + txq_pcpu->buffs + txq_pcpu->txq_put_index; |
2210 | + tx_buf->skb = skb; |
2211 | + tx_buf->size = tx_desc->data_size; |
2212 | + tx_buf->phys = tx_desc->buf_phys_addr; |
2213 | txq_pcpu->txq_put_index++; |
2214 | if (txq_pcpu->txq_put_index == txq_pcpu->size) |
2215 | txq_pcpu->txq_put_index = 0; |
2216 | @@ -4401,17 +4410,16 @@ static void mvpp2_txq_bufs_free(struct mvpp2_port *port, |
2217 | int i; |
2218 | |
2219 | for (i = 0; i < num; i++) { |
2220 | - dma_addr_t buf_phys_addr = |
2221 | - txq_pcpu->tx_buffs[txq_pcpu->txq_get_index]; |
2222 | - struct sk_buff *skb = txq_pcpu->tx_skb[txq_pcpu->txq_get_index]; |
2223 | + struct mvpp2_txq_pcpu_buf *tx_buf = |
2224 | + txq_pcpu->buffs + txq_pcpu->txq_get_index; |
2225 | |
2226 | mvpp2_txq_inc_get(txq_pcpu); |
2227 | |
2228 | - dma_unmap_single(port->dev->dev.parent, buf_phys_addr, |
2229 | - skb_headlen(skb), DMA_TO_DEVICE); |
2230 | - if (!skb) |
2231 | + dma_unmap_single(port->dev->dev.parent, tx_buf->phys, |
2232 | + tx_buf->size, DMA_TO_DEVICE); |
2233 | + if (!tx_buf->skb) |
2234 | continue; |
2235 | - dev_kfree_skb_any(skb); |
2236 | + dev_kfree_skb_any(tx_buf->skb); |
2237 | } |
2238 | } |
2239 | |
2240 | @@ -4651,15 +4659,10 @@ static int mvpp2_txq_init(struct mvpp2_port *port, |
2241 | for_each_present_cpu(cpu) { |
2242 | txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); |
2243 | txq_pcpu->size = txq->size; |
2244 | - txq_pcpu->tx_skb = kmalloc(txq_pcpu->size * |
2245 | - sizeof(*txq_pcpu->tx_skb), |
2246 | - GFP_KERNEL); |
2247 | - if (!txq_pcpu->tx_skb) |
2248 | - goto error; |
2249 | - |
2250 | - txq_pcpu->tx_buffs = kmalloc(txq_pcpu->size * |
2251 | - sizeof(dma_addr_t), GFP_KERNEL); |
2252 | - if (!txq_pcpu->tx_buffs) |
2253 | + txq_pcpu->buffs = kmalloc(txq_pcpu->size * |
2254 | + sizeof(struct mvpp2_txq_pcpu_buf), |
2255 | + GFP_KERNEL); |
2256 | + if (!txq_pcpu->buffs) |
2257 | goto error; |
2258 | |
2259 | txq_pcpu->count = 0; |
2260 | @@ -4673,8 +4676,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port, |
2261 | error: |
2262 | for_each_present_cpu(cpu) { |
2263 | txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); |
2264 | - kfree(txq_pcpu->tx_skb); |
2265 | - kfree(txq_pcpu->tx_buffs); |
2266 | + kfree(txq_pcpu->buffs); |
2267 | } |
2268 | |
2269 | dma_free_coherent(port->dev->dev.parent, |
2270 | @@ -4693,8 +4695,7 @@ static void mvpp2_txq_deinit(struct mvpp2_port *port, |
2271 | |
2272 | for_each_present_cpu(cpu) { |
2273 | txq_pcpu = per_cpu_ptr(txq->pcpu, cpu); |
2274 | - kfree(txq_pcpu->tx_skb); |
2275 | - kfree(txq_pcpu->tx_buffs); |
2276 | + kfree(txq_pcpu->buffs); |
2277 | } |
2278 | |
2279 | if (txq->descs) |
2280 | diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c |
2281 | index 21ae8d663e67..0c4532227f25 100644 |
2282 | --- a/drivers/net/wireless/ath/ath10k/core.c |
2283 | +++ b/drivers/net/wireless/ath/ath10k/core.c |
2284 | @@ -1534,7 +1534,7 @@ static void ath10k_core_restart(struct work_struct *work) |
2285 | switch (ar->state) { |
2286 | case ATH10K_STATE_ON: |
2287 | ar->state = ATH10K_STATE_RESTARTING; |
2288 | - ath10k_hif_stop(ar); |
2289 | + ath10k_halt(ar); |
2290 | ath10k_scan_finish(ar); |
2291 | ieee80211_restart_hw(ar->hw); |
2292 | break; |
2293 | diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c |
2294 | index 76297d69f1ed..90eeb1c82e8b 100644 |
2295 | --- a/drivers/net/wireless/ath/ath10k/mac.c |
2296 | +++ b/drivers/net/wireless/ath/ath10k/mac.c |
2297 | @@ -4449,7 +4449,6 @@ static int ath10k_start(struct ieee80211_hw *hw) |
2298 | ar->state = ATH10K_STATE_ON; |
2299 | break; |
2300 | case ATH10K_STATE_RESTARTING: |
2301 | - ath10k_halt(ar); |
2302 | ar->state = ATH10K_STATE_RESTARTED; |
2303 | break; |
2304 | case ATH10K_STATE_ON: |
2305 | diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c |
2306 | index 14b13f07cd1f..a35f78be8dec 100644 |
2307 | --- a/drivers/net/wireless/ath/ath9k/hw.c |
2308 | +++ b/drivers/net/wireless/ath/ath9k/hw.c |
2309 | @@ -2792,7 +2792,7 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah, u32 gpio) |
2310 | WARN_ON(1); |
2311 | } |
2312 | |
2313 | - return val; |
2314 | + return !!val; |
2315 | } |
2316 | EXPORT_SYMBOL(ath9k_hw_gpio_get); |
2317 | |
2318 | diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c |
2319 | index 0dd454acf22a..aff473dfa10d 100644 |
2320 | --- a/drivers/net/wireless/ath/ath9k/pci.c |
2321 | +++ b/drivers/net/wireless/ath/ath9k/pci.c |
2322 | @@ -26,7 +26,6 @@ static const struct pci_device_id ath_pci_id_table[] = { |
2323 | { PCI_VDEVICE(ATHEROS, 0x0023) }, /* PCI */ |
2324 | { PCI_VDEVICE(ATHEROS, 0x0024) }, /* PCI-E */ |
2325 | { PCI_VDEVICE(ATHEROS, 0x0027) }, /* PCI */ |
2326 | - { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */ |
2327 | |
2328 | #ifdef CONFIG_ATH9K_PCOEM |
2329 | /* Mini PCI AR9220 MB92 cards: Compex WLM200NX, Wistron DNMA-92 */ |
2330 | @@ -37,7 +36,7 @@ static const struct pci_device_id ath_pci_id_table[] = { |
2331 | .driver_data = ATH9K_PCI_LED_ACT_HI }, |
2332 | #endif |
2333 | |
2334 | - { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */ |
2335 | + { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */ |
2336 | |
2337 | #ifdef CONFIG_ATH9K_PCOEM |
2338 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
2339 | @@ -85,7 +84,11 @@ static const struct pci_device_id ath_pci_id_table[] = { |
2340 | 0x10CF, /* Fujitsu */ |
2341 | 0x1536), |
2342 | .driver_data = ATH9K_PCI_D3_L1_WAR }, |
2343 | +#endif |
2344 | |
2345 | + { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */ |
2346 | + |
2347 | +#ifdef CONFIG_ATH9K_PCOEM |
2348 | /* AR9285 card for Asus */ |
2349 | { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, |
2350 | 0x002B, |
2351 | diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c |
2352 | index 52bfbb988611..e47286bf378e 100644 |
2353 | --- a/drivers/net/wireless/ath/ath9k/xmit.c |
2354 | +++ b/drivers/net/wireless/ath/ath9k/xmit.c |
2355 | @@ -2787,7 +2787,7 @@ void ath_tx_edma_tasklet(struct ath_softc *sc) |
2356 | fifo_list = &txq->txq_fifo[txq->txq_tailidx]; |
2357 | if (list_empty(fifo_list)) { |
2358 | ath_txq_unlock(sc, txq); |
2359 | - return; |
2360 | + break; |
2361 | } |
2362 | |
2363 | bf = list_first_entry(fifo_list, struct ath_buf, list); |
2364 | diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c |
2365 | index a5e6ec2152bf..82d949ede294 100644 |
2366 | --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c |
2367 | +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c |
2368 | @@ -4372,6 +4372,13 @@ void rtl8xxxu_gen1_report_connect(struct rtl8xxxu_priv *priv, |
2369 | void rtl8xxxu_gen2_report_connect(struct rtl8xxxu_priv *priv, |
2370 | u8 macid, bool connect) |
2371 | { |
2372 | +#ifdef RTL8XXXU_GEN2_REPORT_CONNECT |
2373 | + /* |
2374 | + * Barry Day reports this causes issues with 8192eu and 8723bu |
2375 | + * devices reconnecting. The reason for this is unclear, but |
2376 | + * until it is better understood, leave the code in place but |
2377 | + * disabled, so it is not lost. |
2378 | + */ |
2379 | struct h2c_cmd h2c; |
2380 | |
2381 | memset(&h2c, 0, sizeof(struct h2c_cmd)); |
2382 | @@ -4383,6 +4390,7 @@ void rtl8xxxu_gen2_report_connect(struct rtl8xxxu_priv *priv, |
2383 | h2c.media_status_rpt.parm &= ~BIT(0); |
2384 | |
2385 | rtl8xxxu_gen2_h2c_cmd(priv, &h2c, sizeof(h2c.media_status_rpt)); |
2386 | +#endif |
2387 | } |
2388 | |
2389 | void rtl8xxxu_gen1_init_aggregation(struct rtl8xxxu_priv *priv) |
2390 | diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c |
2391 | index 264466f59c57..4ac928bf1f8e 100644 |
2392 | --- a/drivers/net/wireless/realtek/rtlwifi/base.c |
2393 | +++ b/drivers/net/wireless/realtek/rtlwifi/base.c |
2394 | @@ -1303,12 +1303,13 @@ EXPORT_SYMBOL_GPL(rtl_action_proc); |
2395 | |
2396 | static void setup_arp_tx(struct rtl_priv *rtlpriv, struct rtl_ps_ctl *ppsc) |
2397 | { |
2398 | + struct ieee80211_hw *hw = rtlpriv->hw; |
2399 | + |
2400 | rtlpriv->ra.is_special_data = true; |
2401 | if (rtlpriv->cfg->ops->get_btc_status()) |
2402 | rtlpriv->btcoexist.btc_ops->btc_special_packet_notify( |
2403 | rtlpriv, 1); |
2404 | - rtlpriv->enter_ps = false; |
2405 | - schedule_work(&rtlpriv->works.lps_change_work); |
2406 | + rtl_lps_leave(hw); |
2407 | ppsc->last_delaylps_stamp_jiffies = jiffies; |
2408 | } |
2409 | |
2410 | @@ -1381,8 +1382,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx, |
2411 | |
2412 | if (is_tx) { |
2413 | rtlpriv->ra.is_special_data = true; |
2414 | - rtlpriv->enter_ps = false; |
2415 | - schedule_work(&rtlpriv->works.lps_change_work); |
2416 | + rtl_lps_leave(hw); |
2417 | ppsc->last_delaylps_stamp_jiffies = jiffies; |
2418 | } |
2419 | |
2420 | diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c |
2421 | index 8e7f23c11680..4da4e458142c 100644 |
2422 | --- a/drivers/net/wireless/realtek/rtlwifi/core.c |
2423 | +++ b/drivers/net/wireless/realtek/rtlwifi/core.c |
2424 | @@ -1150,10 +1150,8 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw, |
2425 | } else { |
2426 | mstatus = RT_MEDIA_DISCONNECT; |
2427 | |
2428 | - if (mac->link_state == MAC80211_LINKED) { |
2429 | - rtlpriv->enter_ps = false; |
2430 | - schedule_work(&rtlpriv->works.lps_change_work); |
2431 | - } |
2432 | + if (mac->link_state == MAC80211_LINKED) |
2433 | + rtl_lps_leave(hw); |
2434 | if (ppsc->p2p_ps_info.p2p_ps_mode > P2P_PS_NONE) |
2435 | rtl_p2p_ps_cmd(hw, P2P_PS_DISABLE); |
2436 | mac->link_state = MAC80211_NOLINK; |
2437 | @@ -1431,8 +1429,7 @@ static void rtl_op_sw_scan_start(struct ieee80211_hw *hw, |
2438 | } |
2439 | |
2440 | if (mac->link_state == MAC80211_LINKED) { |
2441 | - rtlpriv->enter_ps = false; |
2442 | - schedule_work(&rtlpriv->works.lps_change_work); |
2443 | + rtl_lps_leave(hw); |
2444 | mac->link_state = MAC80211_LINKED_SCANNING; |
2445 | } else { |
2446 | rtl_ips_nic_on(hw); |
2447 | diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c |
2448 | index 0dfa9eac3926..5be4fc96002d 100644 |
2449 | --- a/drivers/net/wireless/realtek/rtlwifi/pci.c |
2450 | +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c |
2451 | @@ -663,11 +663,9 @@ static void _rtl_pci_tx_isr(struct ieee80211_hw *hw, int prio) |
2452 | } |
2453 | |
2454 | if (((rtlpriv->link_info.num_rx_inperiod + |
2455 | - rtlpriv->link_info.num_tx_inperiod) > 8) || |
2456 | - (rtlpriv->link_info.num_rx_inperiod > 2)) { |
2457 | - rtlpriv->enter_ps = false; |
2458 | - schedule_work(&rtlpriv->works.lps_change_work); |
2459 | - } |
2460 | + rtlpriv->link_info.num_tx_inperiod) > 8) || |
2461 | + (rtlpriv->link_info.num_rx_inperiod > 2)) |
2462 | + rtl_lps_leave(hw); |
2463 | } |
2464 | |
2465 | static int _rtl_pci_init_one_rxdesc(struct ieee80211_hw *hw, |
2466 | @@ -918,10 +916,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) |
2467 | } |
2468 | if (((rtlpriv->link_info.num_rx_inperiod + |
2469 | rtlpriv->link_info.num_tx_inperiod) > 8) || |
2470 | - (rtlpriv->link_info.num_rx_inperiod > 2)) { |
2471 | - rtlpriv->enter_ps = false; |
2472 | - schedule_work(&rtlpriv->works.lps_change_work); |
2473 | - } |
2474 | + (rtlpriv->link_info.num_rx_inperiod > 2)) |
2475 | + rtl_lps_leave(hw); |
2476 | skb = new_skb; |
2477 | no_new: |
2478 | if (rtlpriv->use_new_trx_flow) { |
2479 | diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c |
2480 | index 18d979affc18..d0ffc4d508cf 100644 |
2481 | --- a/drivers/net/wireless/realtek/rtlwifi/ps.c |
2482 | +++ b/drivers/net/wireless/realtek/rtlwifi/ps.c |
2483 | @@ -407,8 +407,8 @@ void rtl_lps_set_psmode(struct ieee80211_hw *hw, u8 rt_psmode) |
2484 | } |
2485 | } |
2486 | |
2487 | -/*Enter the leisure power save mode.*/ |
2488 | -void rtl_lps_enter(struct ieee80211_hw *hw) |
2489 | +/* Interrupt safe routine to enter the leisure power save mode.*/ |
2490 | +static void rtl_lps_enter_core(struct ieee80211_hw *hw) |
2491 | { |
2492 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); |
2493 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); |
2494 | @@ -444,10 +444,9 @@ void rtl_lps_enter(struct ieee80211_hw *hw) |
2495 | |
2496 | spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flag); |
2497 | } |
2498 | -EXPORT_SYMBOL(rtl_lps_enter); |
2499 | |
2500 | -/*Leave the leisure power save mode.*/ |
2501 | -void rtl_lps_leave(struct ieee80211_hw *hw) |
2502 | +/* Interrupt safe routine to leave the leisure power save mode.*/ |
2503 | +static void rtl_lps_leave_core(struct ieee80211_hw *hw) |
2504 | { |
2505 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
2506 | struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); |
2507 | @@ -477,7 +476,6 @@ void rtl_lps_leave(struct ieee80211_hw *hw) |
2508 | } |
2509 | spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flag); |
2510 | } |
2511 | -EXPORT_SYMBOL(rtl_lps_leave); |
2512 | |
2513 | /* For sw LPS*/ |
2514 | void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len) |
2515 | @@ -670,12 +668,34 @@ void rtl_lps_change_work_callback(struct work_struct *work) |
2516 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
2517 | |
2518 | if (rtlpriv->enter_ps) |
2519 | - rtl_lps_enter(hw); |
2520 | + rtl_lps_enter_core(hw); |
2521 | else |
2522 | - rtl_lps_leave(hw); |
2523 | + rtl_lps_leave_core(hw); |
2524 | } |
2525 | EXPORT_SYMBOL_GPL(rtl_lps_change_work_callback); |
2526 | |
2527 | +void rtl_lps_enter(struct ieee80211_hw *hw) |
2528 | +{ |
2529 | + struct rtl_priv *rtlpriv = rtl_priv(hw); |
2530 | + |
2531 | + if (!in_interrupt()) |
2532 | + return rtl_lps_enter_core(hw); |
2533 | + rtlpriv->enter_ps = true; |
2534 | + schedule_work(&rtlpriv->works.lps_change_work); |
2535 | +} |
2536 | +EXPORT_SYMBOL_GPL(rtl_lps_enter); |
2537 | + |
2538 | +void rtl_lps_leave(struct ieee80211_hw *hw) |
2539 | +{ |
2540 | + struct rtl_priv *rtlpriv = rtl_priv(hw); |
2541 | + |
2542 | + if (!in_interrupt()) |
2543 | + return rtl_lps_leave_core(hw); |
2544 | + rtlpriv->enter_ps = false; |
2545 | + schedule_work(&rtlpriv->works.lps_change_work); |
2546 | +} |
2547 | +EXPORT_SYMBOL_GPL(rtl_lps_leave); |
2548 | + |
2549 | void rtl_swlps_wq_callback(void *data) |
2550 | { |
2551 | struct rtl_works *rtlworks = container_of_dwork_rtl(data, |
2552 | diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c |
2553 | index cea8350fbc7e..a2ac9e641aa9 100644 |
2554 | --- a/drivers/nvdimm/pfn_devs.c |
2555 | +++ b/drivers/nvdimm/pfn_devs.c |
2556 | @@ -108,7 +108,7 @@ static ssize_t align_show(struct device *dev, |
2557 | { |
2558 | struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); |
2559 | |
2560 | - return sprintf(buf, "%lx\n", nd_pfn->align); |
2561 | + return sprintf(buf, "%ld\n", nd_pfn->align); |
2562 | } |
2563 | |
2564 | static ssize_t __align_store(struct nd_pfn *nd_pfn, const char *buf) |
2565 | diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c |
2566 | index f63d4b0deff0..a53982a330ea 100644 |
2567 | --- a/drivers/of/of_numa.c |
2568 | +++ b/drivers/of/of_numa.c |
2569 | @@ -176,7 +176,12 @@ int of_node_to_nid(struct device_node *device) |
2570 | np->name); |
2571 | of_node_put(np); |
2572 | |
2573 | - if (!r) |
2574 | + /* |
2575 | + * If numa=off passed on command line, or with a defective |
2576 | + * device tree, the nid may not be in the set of possible |
2577 | + * nodes. Check for this case and return NUMA_NO_NODE. |
2578 | + */ |
2579 | + if (!r && nid < MAX_NUMNODES && node_possible(nid)) |
2580 | return nid; |
2581 | |
2582 | return NUMA_NO_NODE; |
2583 | diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c |
2584 | index ba34907538f6..eda6a7cf0e54 100644 |
2585 | --- a/drivers/pci/pci.c |
2586 | +++ b/drivers/pci/pci.c |
2587 | @@ -2106,6 +2106,10 @@ bool pci_dev_run_wake(struct pci_dev *dev) |
2588 | if (!dev->pme_support) |
2589 | return false; |
2590 | |
2591 | + /* PME-capable in principle, but not from the intended sleep state */ |
2592 | + if (!pci_pme_capable(dev, pci_target_state(dev))) |
2593 | + return false; |
2594 | + |
2595 | while (bus->parent) { |
2596 | struct pci_dev *bridge = bus->self; |
2597 | |
2598 | diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c |
2599 | index 26e4cbc34db8..6032b7085582 100644 |
2600 | --- a/drivers/platform/x86/asus-nb-wmi.c |
2601 | +++ b/drivers/platform/x86/asus-nb-wmi.c |
2602 | @@ -175,6 +175,15 @@ static const struct dmi_system_id asus_quirks[] = { |
2603 | }, |
2604 | { |
2605 | .callback = dmi_matched, |
2606 | + .ident = "ASUSTeK COMPUTER INC. X45U", |
2607 | + .matches = { |
2608 | + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
2609 | + DMI_MATCH(DMI_PRODUCT_NAME, "X45U"), |
2610 | + }, |
2611 | + .driver_data = &quirk_asus_wapf4, |
2612 | + }, |
2613 | + { |
2614 | + .callback = dmi_matched, |
2615 | .ident = "ASUSTeK COMPUTER INC. X456UA", |
2616 | .matches = { |
2617 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
2618 | diff --git a/drivers/regulator/stw481x-vmmc.c b/drivers/regulator/stw481x-vmmc.c |
2619 | index 7d2ae3e9e942..342f5da79975 100644 |
2620 | --- a/drivers/regulator/stw481x-vmmc.c |
2621 | +++ b/drivers/regulator/stw481x-vmmc.c |
2622 | @@ -47,7 +47,8 @@ static struct regulator_desc vmmc_regulator = { |
2623 | .volt_table = stw481x_vmmc_voltages, |
2624 | .enable_time = 200, /* FIXME: look this up */ |
2625 | .enable_reg = STW_CONF1, |
2626 | - .enable_mask = STW_CONF1_PDN_VMMC, |
2627 | + .enable_mask = STW_CONF1_PDN_VMMC | STW_CONF1_MMC_LS_STATUS, |
2628 | + .enable_val = STW_CONF1_PDN_VMMC, |
2629 | .vsel_reg = STW_CONF1, |
2630 | .vsel_mask = STW_CONF1_VMMC_MASK, |
2631 | }; |
2632 | diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c |
2633 | index e883063c7258..3167e8581994 100644 |
2634 | --- a/drivers/s390/char/vmlogrdr.c |
2635 | +++ b/drivers/s390/char/vmlogrdr.c |
2636 | @@ -870,7 +870,7 @@ static int __init vmlogrdr_init(void) |
2637 | goto cleanup; |
2638 | |
2639 | for (i=0; i < MAXMINOR; ++i ) { |
2640 | - sys_ser[i].buffer = (char *) get_zeroed_page(GFP_KERNEL); |
2641 | + sys_ser[i].buffer = (char *) get_zeroed_page(GFP_KERNEL | GFP_DMA); |
2642 | if (!sys_ser[i].buffer) { |
2643 | rc = -ENOMEM; |
2644 | break; |
2645 | diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c |
2646 | index 581001989937..d5bf36ec8a75 100644 |
2647 | --- a/drivers/s390/scsi/zfcp_dbf.c |
2648 | +++ b/drivers/s390/scsi/zfcp_dbf.c |
2649 | @@ -289,11 +289,12 @@ void zfcp_dbf_rec_trig(char *tag, struct zfcp_adapter *adapter, |
2650 | |
2651 | |
2652 | /** |
2653 | - * zfcp_dbf_rec_run - trace event related to running recovery |
2654 | + * zfcp_dbf_rec_run_lvl - trace event related to running recovery |
2655 | + * @level: trace level to be used for event |
2656 | * @tag: identifier for event |
2657 | * @erp: erp_action running |
2658 | */ |
2659 | -void zfcp_dbf_rec_run(char *tag, struct zfcp_erp_action *erp) |
2660 | +void zfcp_dbf_rec_run_lvl(int level, char *tag, struct zfcp_erp_action *erp) |
2661 | { |
2662 | struct zfcp_dbf *dbf = erp->adapter->dbf; |
2663 | struct zfcp_dbf_rec *rec = &dbf->rec_buf; |
2664 | @@ -319,11 +320,21 @@ void zfcp_dbf_rec_run(char *tag, struct zfcp_erp_action *erp) |
2665 | else |
2666 | rec->u.run.rec_count = atomic_read(&erp->adapter->erp_counter); |
2667 | |
2668 | - debug_event(dbf->rec, 1, rec, sizeof(*rec)); |
2669 | + debug_event(dbf->rec, level, rec, sizeof(*rec)); |
2670 | spin_unlock_irqrestore(&dbf->rec_lock, flags); |
2671 | } |
2672 | |
2673 | /** |
2674 | + * zfcp_dbf_rec_run - trace event related to running recovery |
2675 | + * @tag: identifier for event |
2676 | + * @erp: erp_action running |
2677 | + */ |
2678 | +void zfcp_dbf_rec_run(char *tag, struct zfcp_erp_action *erp) |
2679 | +{ |
2680 | + zfcp_dbf_rec_run_lvl(1, tag, erp); |
2681 | +} |
2682 | + |
2683 | +/** |
2684 | * zfcp_dbf_rec_run_wka - trace wka port event with info like running recovery |
2685 | * @tag: identifier for event |
2686 | * @wka_port: well known address port |
2687 | diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h |
2688 | index 36d07584271d..db186d44cfaf 100644 |
2689 | --- a/drivers/s390/scsi/zfcp_dbf.h |
2690 | +++ b/drivers/s390/scsi/zfcp_dbf.h |
2691 | @@ -2,7 +2,7 @@ |
2692 | * zfcp device driver |
2693 | * debug feature declarations |
2694 | * |
2695 | - * Copyright IBM Corp. 2008, 2015 |
2696 | + * Copyright IBM Corp. 2008, 2016 |
2697 | */ |
2698 | |
2699 | #ifndef ZFCP_DBF_H |
2700 | @@ -283,6 +283,30 @@ struct zfcp_dbf { |
2701 | struct zfcp_dbf_scsi scsi_buf; |
2702 | }; |
2703 | |
2704 | +/** |
2705 | + * zfcp_dbf_hba_fsf_resp_suppress - true if we should not trace by default |
2706 | + * @req: request that has been completed |
2707 | + * |
2708 | + * Returns true if FCP response with only benign residual under count. |
2709 | + */ |
2710 | +static inline |
2711 | +bool zfcp_dbf_hba_fsf_resp_suppress(struct zfcp_fsf_req *req) |
2712 | +{ |
2713 | + struct fsf_qtcb *qtcb = req->qtcb; |
2714 | + u32 fsf_stat = qtcb->header.fsf_status; |
2715 | + struct fcp_resp *fcp_rsp; |
2716 | + u8 rsp_flags, fr_status; |
2717 | + |
2718 | + if (qtcb->prefix.qtcb_type != FSF_IO_COMMAND) |
2719 | + return false; /* not an FCP response */ |
2720 | + fcp_rsp = (struct fcp_resp *)&qtcb->bottom.io.fcp_rsp; |
2721 | + rsp_flags = fcp_rsp->fr_flags; |
2722 | + fr_status = fcp_rsp->fr_status; |
2723 | + return (fsf_stat == FSF_FCP_RSP_AVAILABLE) && |
2724 | + (rsp_flags == FCP_RESID_UNDER) && |
2725 | + (fr_status == SAM_STAT_GOOD); |
2726 | +} |
2727 | + |
2728 | static inline |
2729 | void zfcp_dbf_hba_fsf_resp(char *tag, int level, struct zfcp_fsf_req *req) |
2730 | { |
2731 | @@ -304,7 +328,9 @@ void zfcp_dbf_hba_fsf_response(struct zfcp_fsf_req *req) |
2732 | zfcp_dbf_hba_fsf_resp("fs_perr", 1, req); |
2733 | |
2734 | } else if (qtcb->header.fsf_status != FSF_GOOD) { |
2735 | - zfcp_dbf_hba_fsf_resp("fs_ferr", 1, req); |
2736 | + zfcp_dbf_hba_fsf_resp("fs_ferr", |
2737 | + zfcp_dbf_hba_fsf_resp_suppress(req) |
2738 | + ? 5 : 1, req); |
2739 | |
2740 | } else if ((req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) || |
2741 | (req->fsf_command == FSF_QTCB_OPEN_LUN)) { |
2742 | @@ -388,4 +414,15 @@ void zfcp_dbf_scsi_devreset(char *tag, struct scsi_cmnd *scmnd, u8 flag) |
2743 | _zfcp_dbf_scsi(tmp_tag, 1, scmnd, NULL); |
2744 | } |
2745 | |
2746 | +/** |
2747 | + * zfcp_dbf_scsi_nullcmnd() - trace NULLify of SCSI command in dev/tgt-reset. |
2748 | + * @scmnd: SCSI command that was NULLified. |
2749 | + * @fsf_req: request that owned @scmnd. |
2750 | + */ |
2751 | +static inline void zfcp_dbf_scsi_nullcmnd(struct scsi_cmnd *scmnd, |
2752 | + struct zfcp_fsf_req *fsf_req) |
2753 | +{ |
2754 | + _zfcp_dbf_scsi("scfc__1", 3, scmnd, fsf_req); |
2755 | +} |
2756 | + |
2757 | #endif /* ZFCP_DBF_H */ |
2758 | diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c |
2759 | index a59d678125bd..7ccfce559034 100644 |
2760 | --- a/drivers/s390/scsi/zfcp_erp.c |
2761 | +++ b/drivers/s390/scsi/zfcp_erp.c |
2762 | @@ -3,7 +3,7 @@ |
2763 | * |
2764 | * Error Recovery Procedures (ERP). |
2765 | * |
2766 | - * Copyright IBM Corp. 2002, 2015 |
2767 | + * Copyright IBM Corp. 2002, 2016 |
2768 | */ |
2769 | |
2770 | #define KMSG_COMPONENT "zfcp" |
2771 | @@ -1204,6 +1204,62 @@ static void zfcp_erp_action_dequeue(struct zfcp_erp_action *erp_action) |
2772 | } |
2773 | } |
2774 | |
2775 | +/** |
2776 | + * zfcp_erp_try_rport_unblock - unblock rport if no more/new recovery |
2777 | + * @port: zfcp_port whose fc_rport we should try to unblock |
2778 | + */ |
2779 | +static void zfcp_erp_try_rport_unblock(struct zfcp_port *port) |
2780 | +{ |
2781 | + unsigned long flags; |
2782 | + struct zfcp_adapter *adapter = port->adapter; |
2783 | + int port_status; |
2784 | + struct Scsi_Host *shost = adapter->scsi_host; |
2785 | + struct scsi_device *sdev; |
2786 | + |
2787 | + write_lock_irqsave(&adapter->erp_lock, flags); |
2788 | + port_status = atomic_read(&port->status); |
2789 | + if ((port_status & ZFCP_STATUS_COMMON_UNBLOCKED) == 0 || |
2790 | + (port_status & (ZFCP_STATUS_COMMON_ERP_INUSE | |
2791 | + ZFCP_STATUS_COMMON_ERP_FAILED)) != 0) { |
2792 | + /* new ERP of severity >= port triggered elsewhere meanwhile or |
2793 | + * local link down (adapter erp_failed but not clear unblock) |
2794 | + */ |
2795 | + zfcp_dbf_rec_run_lvl(4, "ertru_p", &port->erp_action); |
2796 | + write_unlock_irqrestore(&adapter->erp_lock, flags); |
2797 | + return; |
2798 | + } |
2799 | + spin_lock(shost->host_lock); |
2800 | + __shost_for_each_device(sdev, shost) { |
2801 | + struct zfcp_scsi_dev *zsdev = sdev_to_zfcp(sdev); |
2802 | + int lun_status; |
2803 | + |
2804 | + if (zsdev->port != port) |
2805 | + continue; |
2806 | + /* LUN under port of interest */ |
2807 | + lun_status = atomic_read(&zsdev->status); |
2808 | + if ((lun_status & ZFCP_STATUS_COMMON_ERP_FAILED) != 0) |
2809 | + continue; /* unblock rport despite failed LUNs */ |
2810 | + /* LUN recovery not given up yet [maybe follow-up pending] */ |
2811 | + if ((lun_status & ZFCP_STATUS_COMMON_UNBLOCKED) == 0 || |
2812 | + (lun_status & ZFCP_STATUS_COMMON_ERP_INUSE) != 0) { |
2813 | + /* LUN blocked: |
2814 | + * not yet unblocked [LUN recovery pending] |
2815 | + * or meanwhile blocked [new LUN recovery triggered] |
2816 | + */ |
2817 | + zfcp_dbf_rec_run_lvl(4, "ertru_l", &zsdev->erp_action); |
2818 | + spin_unlock(shost->host_lock); |
2819 | + write_unlock_irqrestore(&adapter->erp_lock, flags); |
2820 | + return; |
2821 | + } |
2822 | + } |
2823 | + /* now port has no child or all children have completed recovery, |
2824 | + * and no ERP of severity >= port was meanwhile triggered elsewhere |
2825 | + */ |
2826 | + zfcp_scsi_schedule_rport_register(port); |
2827 | + spin_unlock(shost->host_lock); |
2828 | + write_unlock_irqrestore(&adapter->erp_lock, flags); |
2829 | +} |
2830 | + |
2831 | static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) |
2832 | { |
2833 | struct zfcp_adapter *adapter = act->adapter; |
2834 | @@ -1214,6 +1270,7 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) |
2835 | case ZFCP_ERP_ACTION_REOPEN_LUN: |
2836 | if (!(act->status & ZFCP_STATUS_ERP_NO_REF)) |
2837 | scsi_device_put(sdev); |
2838 | + zfcp_erp_try_rport_unblock(port); |
2839 | break; |
2840 | |
2841 | case ZFCP_ERP_ACTION_REOPEN_PORT: |
2842 | @@ -1224,7 +1281,7 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) |
2843 | */ |
2844 | if (act->step != ZFCP_ERP_STEP_UNINITIALIZED) |
2845 | if (result == ZFCP_ERP_SUCCEEDED) |
2846 | - zfcp_scsi_schedule_rport_register(port); |
2847 | + zfcp_erp_try_rport_unblock(port); |
2848 | /* fall through */ |
2849 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: |
2850 | put_device(&port->dev); |
2851 | diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h |
2852 | index c8fed9fa1cca..21c8c689b02b 100644 |
2853 | --- a/drivers/s390/scsi/zfcp_ext.h |
2854 | +++ b/drivers/s390/scsi/zfcp_ext.h |
2855 | @@ -3,7 +3,7 @@ |
2856 | * |
2857 | * External function declarations. |
2858 | * |
2859 | - * Copyright IBM Corp. 2002, 2015 |
2860 | + * Copyright IBM Corp. 2002, 2016 |
2861 | */ |
2862 | |
2863 | #ifndef ZFCP_EXT_H |
2864 | @@ -35,6 +35,8 @@ extern void zfcp_dbf_adapter_unregister(struct zfcp_adapter *); |
2865 | extern void zfcp_dbf_rec_trig(char *, struct zfcp_adapter *, |
2866 | struct zfcp_port *, struct scsi_device *, u8, u8); |
2867 | extern void zfcp_dbf_rec_run(char *, struct zfcp_erp_action *); |
2868 | +extern void zfcp_dbf_rec_run_lvl(int level, char *tag, |
2869 | + struct zfcp_erp_action *erp); |
2870 | extern void zfcp_dbf_rec_run_wka(char *, struct zfcp_fc_wka_port *, u64); |
2871 | extern void zfcp_dbf_hba_fsf_uss(char *, struct zfcp_fsf_req *); |
2872 | extern void zfcp_dbf_hba_fsf_res(char *, int, struct zfcp_fsf_req *); |
2873 | diff --git a/drivers/s390/scsi/zfcp_fsf.h b/drivers/s390/scsi/zfcp_fsf.h |
2874 | index be1c04b334c5..ea3c76ac0de1 100644 |
2875 | --- a/drivers/s390/scsi/zfcp_fsf.h |
2876 | +++ b/drivers/s390/scsi/zfcp_fsf.h |
2877 | @@ -3,7 +3,7 @@ |
2878 | * |
2879 | * Interface to the FSF support functions. |
2880 | * |
2881 | - * Copyright IBM Corp. 2002, 2015 |
2882 | + * Copyright IBM Corp. 2002, 2016 |
2883 | */ |
2884 | |
2885 | #ifndef FSF_H |
2886 | @@ -78,6 +78,7 @@ |
2887 | #define FSF_APP_TAG_CHECK_FAILURE 0x00000082 |
2888 | #define FSF_REF_TAG_CHECK_FAILURE 0x00000083 |
2889 | #define FSF_ADAPTER_STATUS_AVAILABLE 0x000000AD |
2890 | +#define FSF_FCP_RSP_AVAILABLE 0x000000AF |
2891 | #define FSF_UNKNOWN_COMMAND 0x000000E2 |
2892 | #define FSF_UNKNOWN_OP_SUBTYPE 0x000000E3 |
2893 | #define FSF_INVALID_COMMAND_OPTION 0x000000E5 |
2894 | diff --git a/drivers/s390/scsi/zfcp_reqlist.h b/drivers/s390/scsi/zfcp_reqlist.h |
2895 | index 7c2c6194dfca..703fce59befe 100644 |
2896 | --- a/drivers/s390/scsi/zfcp_reqlist.h |
2897 | +++ b/drivers/s390/scsi/zfcp_reqlist.h |
2898 | @@ -4,7 +4,7 @@ |
2899 | * Data structure and helper functions for tracking pending FSF |
2900 | * requests. |
2901 | * |
2902 | - * Copyright IBM Corp. 2009 |
2903 | + * Copyright IBM Corp. 2009, 2016 |
2904 | */ |
2905 | |
2906 | #ifndef ZFCP_REQLIST_H |
2907 | @@ -180,4 +180,32 @@ static inline void zfcp_reqlist_move(struct zfcp_reqlist *rl, |
2908 | spin_unlock_irqrestore(&rl->lock, flags); |
2909 | } |
2910 | |
2911 | +/** |
2912 | + * zfcp_reqlist_apply_for_all() - apply a function to every request. |
2913 | + * @rl: the requestlist that contains the target requests. |
2914 | + * @f: the function to apply to each request; the first parameter of the |
2915 | + * function will be the target-request; the second parameter is the same |
2916 | + * pointer as given with the argument @data. |
2917 | + * @data: freely chosen argument; passed through to @f as second parameter. |
2918 | + * |
2919 | + * Uses :c:macro:`list_for_each_entry` to iterate over the lists in the hash- |
2920 | + * table (not a 'safe' variant, so don't modify the list). |
2921 | + * |
2922 | + * Holds @rl->lock over the entire request-iteration. |
2923 | + */ |
2924 | +static inline void |
2925 | +zfcp_reqlist_apply_for_all(struct zfcp_reqlist *rl, |
2926 | + void (*f)(struct zfcp_fsf_req *, void *), void *data) |
2927 | +{ |
2928 | + struct zfcp_fsf_req *req; |
2929 | + unsigned long flags; |
2930 | + unsigned int i; |
2931 | + |
2932 | + spin_lock_irqsave(&rl->lock, flags); |
2933 | + for (i = 0; i < ZFCP_REQ_LIST_BUCKETS; i++) |
2934 | + list_for_each_entry(req, &rl->buckets[i], list) |
2935 | + f(req, data); |
2936 | + spin_unlock_irqrestore(&rl->lock, flags); |
2937 | +} |
2938 | + |
2939 | #endif /* ZFCP_REQLIST_H */ |
2940 | diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c |
2941 | index 9069f98a1817..07ffdbb5107f 100644 |
2942 | --- a/drivers/s390/scsi/zfcp_scsi.c |
2943 | +++ b/drivers/s390/scsi/zfcp_scsi.c |
2944 | @@ -3,7 +3,7 @@ |
2945 | * |
2946 | * Interface to Linux SCSI midlayer. |
2947 | * |
2948 | - * Copyright IBM Corp. 2002, 2015 |
2949 | + * Copyright IBM Corp. 2002, 2016 |
2950 | */ |
2951 | |
2952 | #define KMSG_COMPONENT "zfcp" |
2953 | @@ -88,9 +88,7 @@ int zfcp_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scpnt) |
2954 | } |
2955 | |
2956 | if (unlikely(!(status & ZFCP_STATUS_COMMON_UNBLOCKED))) { |
2957 | - /* This could be either |
2958 | - * open LUN pending: this is temporary, will result in |
2959 | - * open LUN or ERP_FAILED, so retry command |
2960 | + /* This could be |
2961 | * call to rport_delete pending: mimic retry from |
2962 | * fc_remote_port_chkready until rport is BLOCKED |
2963 | */ |
2964 | @@ -209,6 +207,57 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) |
2965 | return retval; |
2966 | } |
2967 | |
2968 | +struct zfcp_scsi_req_filter { |
2969 | + u8 tmf_scope; |
2970 | + u32 lun_handle; |
2971 | + u32 port_handle; |
2972 | +}; |
2973 | + |
2974 | +static void zfcp_scsi_forget_cmnd(struct zfcp_fsf_req *old_req, void *data) |
2975 | +{ |
2976 | + struct zfcp_scsi_req_filter *filter = |
2977 | + (struct zfcp_scsi_req_filter *)data; |
2978 | + |
2979 | + /* already aborted - prevent side-effects - or not a SCSI command */ |
2980 | + if (old_req->data == NULL || old_req->fsf_command != FSF_QTCB_FCP_CMND) |
2981 | + return; |
2982 | + |
2983 | + /* (tmf_scope == FCP_TMF_TGT_RESET || tmf_scope == FCP_TMF_LUN_RESET) */ |
2984 | + if (old_req->qtcb->header.port_handle != filter->port_handle) |
2985 | + return; |
2986 | + |
2987 | + if (filter->tmf_scope == FCP_TMF_LUN_RESET && |
2988 | + old_req->qtcb->header.lun_handle != filter->lun_handle) |
2989 | + return; |
2990 | + |
2991 | + zfcp_dbf_scsi_nullcmnd((struct scsi_cmnd *)old_req->data, old_req); |
2992 | + old_req->data = NULL; |
2993 | +} |
2994 | + |
2995 | +static void zfcp_scsi_forget_cmnds(struct zfcp_scsi_dev *zsdev, u8 tm_flags) |
2996 | +{ |
2997 | + struct zfcp_adapter *adapter = zsdev->port->adapter; |
2998 | + struct zfcp_scsi_req_filter filter = { |
2999 | + .tmf_scope = FCP_TMF_TGT_RESET, |
3000 | + .port_handle = zsdev->port->handle, |
3001 | + }; |
3002 | + unsigned long flags; |
3003 | + |
3004 | + if (tm_flags == FCP_TMF_LUN_RESET) { |
3005 | + filter.tmf_scope = FCP_TMF_LUN_RESET; |
3006 | + filter.lun_handle = zsdev->lun_handle; |
3007 | + } |
3008 | + |
3009 | + /* |
3010 | + * abort_lock secures against other processings - in the abort-function |
3011 | + * and normal cmnd-handler - of (struct zfcp_fsf_req *)->data |
3012 | + */ |
3013 | + write_lock_irqsave(&adapter->abort_lock, flags); |
3014 | + zfcp_reqlist_apply_for_all(adapter->req_list, zfcp_scsi_forget_cmnd, |
3015 | + &filter); |
3016 | + write_unlock_irqrestore(&adapter->abort_lock, flags); |
3017 | +} |
3018 | + |
3019 | static int zfcp_task_mgmt_function(struct scsi_cmnd *scpnt, u8 tm_flags) |
3020 | { |
3021 | struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device); |
3022 | @@ -241,8 +290,10 @@ static int zfcp_task_mgmt_function(struct scsi_cmnd *scpnt, u8 tm_flags) |
3023 | if (fsf_req->status & ZFCP_STATUS_FSFREQ_TMFUNCFAILED) { |
3024 | zfcp_dbf_scsi_devreset("fail", scpnt, tm_flags); |
3025 | retval = FAILED; |
3026 | - } else |
3027 | + } else { |
3028 | zfcp_dbf_scsi_devreset("okay", scpnt, tm_flags); |
3029 | + zfcp_scsi_forget_cmnds(zfcp_sdev, tm_flags); |
3030 | + } |
3031 | |
3032 | zfcp_fsf_req_free(fsf_req); |
3033 | return retval; |
3034 | diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c |
3035 | index 79871f3519ff..d5b26fa541d3 100644 |
3036 | --- a/drivers/scsi/aacraid/linit.c |
3037 | +++ b/drivers/scsi/aacraid/linit.c |
3038 | @@ -160,7 +160,6 @@ static const struct pci_device_id aac_pci_tbl[] = { |
3039 | { 0x9005, 0x028b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 62 }, /* Adaptec PMC Series 6 (Tupelo) */ |
3040 | { 0x9005, 0x028c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 63 }, /* Adaptec PMC Series 7 (Denali) */ |
3041 | { 0x9005, 0x028d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 64 }, /* Adaptec PMC Series 8 */ |
3042 | - { 0x9005, 0x028f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 65 }, /* Adaptec PMC Series 9 */ |
3043 | { 0,} |
3044 | }; |
3045 | MODULE_DEVICE_TABLE(pci, aac_pci_tbl); |
3046 | @@ -239,7 +238,6 @@ static struct aac_driver_ident aac_drivers[] = { |
3047 | { aac_src_init, "aacraid", "ADAPTEC ", "RAID ", 2, AAC_QUIRK_SRC }, /* Adaptec PMC Series 6 (Tupelo) */ |
3048 | { aac_srcv_init, "aacraid", "ADAPTEC ", "RAID ", 2, AAC_QUIRK_SRC }, /* Adaptec PMC Series 7 (Denali) */ |
3049 | { aac_srcv_init, "aacraid", "ADAPTEC ", "RAID ", 2, AAC_QUIRK_SRC }, /* Adaptec PMC Series 8 */ |
3050 | - { aac_srcv_init, "aacraid", "ADAPTEC ", "RAID ", 2, AAC_QUIRK_SRC } /* Adaptec PMC Series 9 */ |
3051 | }; |
3052 | |
3053 | /** |
3054 | diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c |
3055 | index 52d8bbf7feb5..bd04bd01d34a 100644 |
3056 | --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c |
3057 | +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c |
3058 | @@ -2000,6 +2000,8 @@ megasas_build_syspd_fusion(struct megasas_instance *instance, |
3059 | io_request->DevHandle = pd_sync->seq[pd_index].devHandle; |
3060 | pRAID_Context->regLockFlags |= |
3061 | (MR_RL_FLAGS_SEQ_NUM_ENABLE|MR_RL_FLAGS_GRANT_DESTINATION_CUDA); |
3062 | + pRAID_Context->Type = MPI2_TYPE_CUDA; |
3063 | + pRAID_Context->nseg = 0x1; |
3064 | } else if (fusion->fast_path_io) { |
3065 | pRAID_Context->VirtualDiskTgtId = cpu_to_le16(device_id); |
3066 | pRAID_Context->configSeqNum = 0; |
3067 | @@ -2035,12 +2037,10 @@ megasas_build_syspd_fusion(struct megasas_instance *instance, |
3068 | pRAID_Context->timeoutValue = |
3069 | cpu_to_le16((os_timeout_value > timeout_limit) ? |
3070 | timeout_limit : os_timeout_value); |
3071 | - if (fusion->adapter_type == INVADER_SERIES) { |
3072 | - pRAID_Context->Type = MPI2_TYPE_CUDA; |
3073 | - pRAID_Context->nseg = 0x1; |
3074 | + if (fusion->adapter_type == INVADER_SERIES) |
3075 | io_request->IoFlags |= |
3076 | cpu_to_le16(MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH); |
3077 | - } |
3078 | + |
3079 | cmd->request_desc->SCSIIO.RequestFlags = |
3080 | (MPI2_REQ_DESCRIPT_FLAGS_FP_IO << |
3081 | MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); |
3082 | @@ -2823,6 +2823,7 @@ int megasas_wait_for_outstanding_fusion(struct megasas_instance *instance, |
3083 | dev_err(&instance->pdev->dev, "pending commands remain after waiting, " |
3084 | "will reset adapter scsi%d.\n", |
3085 | instance->host->host_no); |
3086 | + *convert = 1; |
3087 | retval = 1; |
3088 | } |
3089 | out: |
3090 | diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c |
3091 | index 07349270535d..82dfe07b1d47 100644 |
3092 | --- a/drivers/scsi/scsi_sysfs.c |
3093 | +++ b/drivers/scsi/scsi_sysfs.c |
3094 | @@ -1204,10 +1204,6 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev) |
3095 | struct request_queue *rq = sdev->request_queue; |
3096 | struct scsi_target *starget = sdev->sdev_target; |
3097 | |
3098 | - error = scsi_device_set_state(sdev, SDEV_RUNNING); |
3099 | - if (error) |
3100 | - return error; |
3101 | - |
3102 | error = scsi_target_add(starget); |
3103 | if (error) |
3104 | return error; |
3105 | diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c |
3106 | index 070332eb41f3..dbe5b4b95df0 100644 |
3107 | --- a/drivers/scsi/sg.c |
3108 | +++ b/drivers/scsi/sg.c |
3109 | @@ -581,6 +581,9 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) |
3110 | sg_io_hdr_t *hp; |
3111 | unsigned char cmnd[SG_MAX_CDB_SIZE]; |
3112 | |
3113 | + if (unlikely(segment_eq(get_fs(), KERNEL_DS))) |
3114 | + return -EINVAL; |
3115 | + |
3116 | if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) |
3117 | return -ENXIO; |
3118 | SCSI_LOG_TIMEOUT(3, sg_printk(KERN_INFO, sdp, |
3119 | diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c |
3120 | index 0f28c08fcb3c..77b551da5728 100644 |
3121 | --- a/drivers/ssb/pci.c |
3122 | +++ b/drivers/ssb/pci.c |
3123 | @@ -909,6 +909,7 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus, |
3124 | if (err) { |
3125 | ssb_warn("WARNING: Using fallback SPROM failed (err %d)\n", |
3126 | err); |
3127 | + goto out_free; |
3128 | } else { |
3129 | ssb_dbg("Using SPROM revision %d provided by platform\n", |
3130 | sprom->revision); |
3131 | diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c |
3132 | index 0f97d7b611d7..1c967c30e4ce 100644 |
3133 | --- a/drivers/staging/comedi/drivers/ni_mio_common.c |
3134 | +++ b/drivers/staging/comedi/drivers/ni_mio_common.c |
3135 | @@ -1832,7 +1832,7 @@ static int ni_ai_insn_read(struct comedi_device *dev, |
3136 | unsigned int *data) |
3137 | { |
3138 | struct ni_private *devpriv = dev->private; |
3139 | - unsigned int mask = (s->maxdata + 1) >> 1; |
3140 | + unsigned int mask = s->maxdata; |
3141 | int i, n; |
3142 | unsigned int signbits; |
3143 | unsigned int d; |
3144 | @@ -1875,7 +1875,7 @@ static int ni_ai_insn_read(struct comedi_device *dev, |
3145 | return -ETIME; |
3146 | } |
3147 | d += signbits; |
3148 | - data[n] = d; |
3149 | + data[n] = d & 0xffff; |
3150 | } |
3151 | } else if (devpriv->is_6143) { |
3152 | for (n = 0; n < insn->n; n++) { |
3153 | @@ -1924,9 +1924,8 @@ static int ni_ai_insn_read(struct comedi_device *dev, |
3154 | data[n] = dl; |
3155 | } else { |
3156 | d = ni_readw(dev, NI_E_AI_FIFO_DATA_REG); |
3157 | - /* subtle: needs to be short addition */ |
3158 | d += signbits; |
3159 | - data[n] = d; |
3160 | + data[n] = d & 0xffff; |
3161 | } |
3162 | } |
3163 | } |
3164 | diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c |
3165 | index 9a1136e32dfc..34efb499c00b 100644 |
3166 | --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c |
3167 | +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c |
3168 | @@ -356,10 +356,10 @@ static int ldlm_pool_recalc(struct ldlm_pool *pl) |
3169 | u32 recalc_interval_sec; |
3170 | int count; |
3171 | |
3172 | - recalc_interval_sec = ktime_get_seconds() - pl->pl_recalc_time; |
3173 | + recalc_interval_sec = ktime_get_real_seconds() - pl->pl_recalc_time; |
3174 | if (recalc_interval_sec > 0) { |
3175 | spin_lock(&pl->pl_lock); |
3176 | - recalc_interval_sec = ktime_get_seconds() - pl->pl_recalc_time; |
3177 | + recalc_interval_sec = ktime_get_real_seconds() - pl->pl_recalc_time; |
3178 | |
3179 | if (recalc_interval_sec > 0) { |
3180 | /* |
3181 | @@ -382,7 +382,7 @@ static int ldlm_pool_recalc(struct ldlm_pool *pl) |
3182 | count); |
3183 | } |
3184 | |
3185 | - recalc_interval_sec = pl->pl_recalc_time - ktime_get_seconds() + |
3186 | + recalc_interval_sec = pl->pl_recalc_time - ktime_get_real_seconds() + |
3187 | pl->pl_recalc_period; |
3188 | if (recalc_interval_sec <= 0) { |
3189 | /* DEBUG: should be re-removed after LU-4536 is fixed */ |
3190 | @@ -657,7 +657,7 @@ int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns, |
3191 | |
3192 | spin_lock_init(&pl->pl_lock); |
3193 | atomic_set(&pl->pl_granted, 0); |
3194 | - pl->pl_recalc_time = ktime_get_seconds(); |
3195 | + pl->pl_recalc_time = ktime_get_real_seconds(); |
3196 | atomic_set(&pl->pl_lock_volume_factor, 1); |
3197 | |
3198 | atomic_set(&pl->pl_grant_rate, 0); |
3199 | diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c b/drivers/staging/lustre/lustre/osc/osc_page.c |
3200 | index 2a7a70aa9e80..9168451d2f29 100644 |
3201 | --- a/drivers/staging/lustre/lustre/osc/osc_page.c |
3202 | +++ b/drivers/staging/lustre/lustre/osc/osc_page.c |
3203 | @@ -542,7 +542,6 @@ long osc_lru_shrink(const struct lu_env *env, struct client_obd *cli, |
3204 | struct cl_object *clobj = NULL; |
3205 | struct cl_page **pvec; |
3206 | struct osc_page *opg; |
3207 | - struct osc_page *temp; |
3208 | int maxscan = 0; |
3209 | long count = 0; |
3210 | int index = 0; |
3211 | @@ -569,13 +568,15 @@ long osc_lru_shrink(const struct lu_env *env, struct client_obd *cli, |
3212 | |
3213 | spin_lock(&cli->cl_lru_list_lock); |
3214 | maxscan = min(target << 1, atomic_long_read(&cli->cl_lru_in_list)); |
3215 | - list_for_each_entry_safe(opg, temp, &cli->cl_lru_list, ops_lru) { |
3216 | + while (!list_empty(&cli->cl_lru_list)) { |
3217 | struct cl_page *page; |
3218 | bool will_free = false; |
3219 | |
3220 | if (--maxscan < 0) |
3221 | break; |
3222 | |
3223 | + opg = list_entry(cli->cl_lru_list.next, struct osc_page, |
3224 | + ops_lru); |
3225 | page = opg->ops_cl.cpl_page; |
3226 | if (lru_page_busy(cli, page)) { |
3227 | list_move_tail(&opg->ops_lru, &cli->cl_lru_list); |
3228 | diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c |
3229 | index 923c032f0b95..e980e2d0c2db 100644 |
3230 | --- a/drivers/target/iscsi/iscsi_target_configfs.c |
3231 | +++ b/drivers/target/iscsi/iscsi_target_configfs.c |
3232 | @@ -100,8 +100,10 @@ static ssize_t lio_target_np_driver_store(struct config_item *item, |
3233 | |
3234 | tpg_np_new = iscsit_tpg_add_network_portal(tpg, |
3235 | &np->np_sockaddr, tpg_np, type); |
3236 | - if (IS_ERR(tpg_np_new)) |
3237 | + if (IS_ERR(tpg_np_new)) { |
3238 | + rc = PTR_ERR(tpg_np_new); |
3239 | goto out; |
3240 | + } |
3241 | } else { |
3242 | tpg_np_new = iscsit_tpg_locate_child_np(tpg_np, type); |
3243 | if (tpg_np_new) { |
3244 | diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c |
3245 | index 47562509b489..70c143a5c38c 100644 |
3246 | --- a/drivers/target/target_core_user.c |
3247 | +++ b/drivers/target/target_core_user.c |
3248 | @@ -685,8 +685,6 @@ static int tcmu_check_expired_cmd(int id, void *p, void *data) |
3249 | target_complete_cmd(cmd->se_cmd, SAM_STAT_CHECK_CONDITION); |
3250 | cmd->se_cmd = NULL; |
3251 | |
3252 | - kmem_cache_free(tcmu_cmd_cache, cmd); |
3253 | - |
3254 | return 0; |
3255 | } |
3256 | |
3257 | diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c |
3258 | index c41c7742903a..2dcd4194d103 100644 |
3259 | --- a/drivers/thermal/thermal_hwmon.c |
3260 | +++ b/drivers/thermal/thermal_hwmon.c |
3261 | @@ -98,7 +98,7 @@ temp_crit_show(struct device *dev, struct device_attribute *attr, char *buf) |
3262 | int temperature; |
3263 | int ret; |
3264 | |
3265 | - ret = tz->ops->get_trip_temp(tz, 0, &temperature); |
3266 | + ret = tz->ops->get_crit_temp(tz, &temperature); |
3267 | if (ret) |
3268 | return ret; |
3269 | |
3270 | diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c |
3271 | index fb0672554123..793395451982 100644 |
3272 | --- a/drivers/tty/serial/sc16is7xx.c |
3273 | +++ b/drivers/tty/serial/sc16is7xx.c |
3274 | @@ -1264,7 +1264,7 @@ static int sc16is7xx_probe(struct device *dev, |
3275 | |
3276 | /* Setup interrupt */ |
3277 | ret = devm_request_irq(dev, irq, sc16is7xx_irq, |
3278 | - IRQF_ONESHOT | flags, dev_name(dev), s); |
3279 | + flags, dev_name(dev), s); |
3280 | if (!ret) |
3281 | return 0; |
3282 | |
3283 | diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c |
3284 | index 0f8caae4267d..ece10e6b731b 100644 |
3285 | --- a/drivers/tty/vt/keyboard.c |
3286 | +++ b/drivers/tty/vt/keyboard.c |
3287 | @@ -982,7 +982,7 @@ static void kbd_led_trigger_activate(struct led_classdev *cdev) |
3288 | KBD_LED_TRIGGER((_led_bit) + 8, _name) |
3289 | |
3290 | static struct kbd_led_trigger kbd_led_triggers[] = { |
3291 | - KBD_LED_TRIGGER(VC_SCROLLOCK, "kbd-scrollock"), |
3292 | + KBD_LED_TRIGGER(VC_SCROLLOCK, "kbd-scrolllock"), |
3293 | KBD_LED_TRIGGER(VC_NUMLOCK, "kbd-numlock"), |
3294 | KBD_LED_TRIGGER(VC_CAPSLOCK, "kbd-capslock"), |
3295 | KBD_LED_TRIGGER(VC_KANALOCK, "kbd-kanalock"), |
3296 | diff --git a/fs/bad_inode.c b/fs/bad_inode.c |
3297 | index 8712062275b8..5f685c819298 100644 |
3298 | --- a/fs/bad_inode.c |
3299 | +++ b/fs/bad_inode.c |
3300 | @@ -106,6 +106,50 @@ static ssize_t bad_inode_listxattr(struct dentry *dentry, char *buffer, |
3301 | return -EIO; |
3302 | } |
3303 | |
3304 | +static const char *bad_inode_get_link(struct dentry *dentry, |
3305 | + struct inode *inode, |
3306 | + struct delayed_call *done) |
3307 | +{ |
3308 | + return ERR_PTR(-EIO); |
3309 | +} |
3310 | + |
3311 | +static struct posix_acl *bad_inode_get_acl(struct inode *inode, int type) |
3312 | +{ |
3313 | + return ERR_PTR(-EIO); |
3314 | +} |
3315 | + |
3316 | +static int bad_inode_fiemap(struct inode *inode, |
3317 | + struct fiemap_extent_info *fieinfo, u64 start, |
3318 | + u64 len) |
3319 | +{ |
3320 | + return -EIO; |
3321 | +} |
3322 | + |
3323 | +static int bad_inode_update_time(struct inode *inode, struct timespec *time, |
3324 | + int flags) |
3325 | +{ |
3326 | + return -EIO; |
3327 | +} |
3328 | + |
3329 | +static int bad_inode_atomic_open(struct inode *inode, struct dentry *dentry, |
3330 | + struct file *file, unsigned int open_flag, |
3331 | + umode_t create_mode, int *opened) |
3332 | +{ |
3333 | + return -EIO; |
3334 | +} |
3335 | + |
3336 | +static int bad_inode_tmpfile(struct inode *inode, struct dentry *dentry, |
3337 | + umode_t mode) |
3338 | +{ |
3339 | + return -EIO; |
3340 | +} |
3341 | + |
3342 | +static int bad_inode_set_acl(struct inode *inode, struct posix_acl *acl, |
3343 | + int type) |
3344 | +{ |
3345 | + return -EIO; |
3346 | +} |
3347 | + |
3348 | static const struct inode_operations bad_inode_ops = |
3349 | { |
3350 | .create = bad_inode_create, |
3351 | @@ -118,14 +162,17 @@ static const struct inode_operations bad_inode_ops = |
3352 | .mknod = bad_inode_mknod, |
3353 | .rename = bad_inode_rename2, |
3354 | .readlink = bad_inode_readlink, |
3355 | - /* follow_link must be no-op, otherwise unmounting this inode |
3356 | - won't work */ |
3357 | - /* put_link returns void */ |
3358 | - /* truncate returns void */ |
3359 | .permission = bad_inode_permission, |
3360 | .getattr = bad_inode_getattr, |
3361 | .setattr = bad_inode_setattr, |
3362 | .listxattr = bad_inode_listxattr, |
3363 | + .get_link = bad_inode_get_link, |
3364 | + .get_acl = bad_inode_get_acl, |
3365 | + .fiemap = bad_inode_fiemap, |
3366 | + .update_time = bad_inode_update_time, |
3367 | + .atomic_open = bad_inode_atomic_open, |
3368 | + .tmpfile = bad_inode_tmpfile, |
3369 | + .set_acl = bad_inode_set_acl, |
3370 | }; |
3371 | |
3372 | |
3373 | diff --git a/fs/block_dev.c b/fs/block_dev.c |
3374 | index 9166b9f63d33..092a2eed1628 100644 |
3375 | --- a/fs/block_dev.c |
3376 | +++ b/fs/block_dev.c |
3377 | @@ -1950,6 +1950,7 @@ void iterate_bdevs(void (*func)(struct block_device *, void *), void *arg) |
3378 | spin_lock(&blockdev_superblock->s_inode_list_lock); |
3379 | list_for_each_entry(inode, &blockdev_superblock->s_inodes, i_sb_list) { |
3380 | struct address_space *mapping = inode->i_mapping; |
3381 | + struct block_device *bdev; |
3382 | |
3383 | spin_lock(&inode->i_lock); |
3384 | if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW) || |
3385 | @@ -1970,8 +1971,12 @@ void iterate_bdevs(void (*func)(struct block_device *, void *), void *arg) |
3386 | */ |
3387 | iput(old_inode); |
3388 | old_inode = inode; |
3389 | + bdev = I_BDEV(inode); |
3390 | |
3391 | - func(I_BDEV(inode), arg); |
3392 | + mutex_lock(&bdev->bd_mutex); |
3393 | + if (bdev->bd_openers) |
3394 | + func(bdev, arg); |
3395 | + mutex_unlock(&bdev->bd_mutex); |
3396 | |
3397 | spin_lock(&blockdev_superblock->s_inode_list_lock); |
3398 | } |
3399 | diff --git a/fs/nfs/file.c b/fs/nfs/file.c |
3400 | index 9ea85ae23c32..a1de8ef63e56 100644 |
3401 | --- a/fs/nfs/file.c |
3402 | +++ b/fs/nfs/file.c |
3403 | @@ -374,7 +374,7 @@ static int nfs_write_end(struct file *file, struct address_space *mapping, |
3404 | */ |
3405 | if (!PageUptodate(page)) { |
3406 | unsigned pglen = nfs_page_length(page); |
3407 | - unsigned end = offset + len; |
3408 | + unsigned end = offset + copied; |
3409 | |
3410 | if (pglen == 0) { |
3411 | zero_user_segments(page, 0, offset, |
3412 | diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c |
3413 | index 98ace127bf86..a5c38889e7ae 100644 |
3414 | --- a/fs/nfs/flexfilelayout/flexfilelayout.c |
3415 | +++ b/fs/nfs/flexfilelayout/flexfilelayout.c |
3416 | @@ -28,6 +28,9 @@ |
3417 | |
3418 | static struct group_info *ff_zero_group; |
3419 | |
3420 | +static void ff_layout_read_record_layoutstats_done(struct rpc_task *task, |
3421 | + struct nfs_pgio_header *hdr); |
3422 | + |
3423 | static struct pnfs_layout_hdr * |
3424 | ff_layout_alloc_layout_hdr(struct inode *inode, gfp_t gfp_flags) |
3425 | { |
3426 | @@ -1293,6 +1296,7 @@ static int ff_layout_read_done_cb(struct rpc_task *task, |
3427 | hdr->pgio_mirror_idx + 1, |
3428 | &hdr->pgio_mirror_idx)) |
3429 | goto out_eagain; |
3430 | + ff_layout_read_record_layoutstats_done(task, hdr); |
3431 | pnfs_read_resend_pnfs(hdr); |
3432 | return task->tk_status; |
3433 | case -NFS4ERR_RESET_TO_MDS: |
3434 | diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c |
3435 | index 259ef85f435a..31b107e196fd 100644 |
3436 | --- a/fs/nfs/pnfs.c |
3437 | +++ b/fs/nfs/pnfs.c |
3438 | @@ -299,6 +299,14 @@ pnfs_put_layout_hdr(struct pnfs_layout_hdr *lo) |
3439 | } |
3440 | } |
3441 | |
3442 | +static void |
3443 | +pnfs_clear_layoutreturn_info(struct pnfs_layout_hdr *lo) |
3444 | +{ |
3445 | + lo->plh_return_iomode = 0; |
3446 | + lo->plh_return_seq = 0; |
3447 | + clear_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags); |
3448 | +} |
3449 | + |
3450 | /* |
3451 | * Mark a pnfs_layout_hdr and all associated layout segments as invalid |
3452 | * |
3453 | @@ -317,6 +325,7 @@ pnfs_mark_layout_stateid_invalid(struct pnfs_layout_hdr *lo, |
3454 | }; |
3455 | |
3456 | set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags); |
3457 | + pnfs_clear_layoutreturn_info(lo); |
3458 | return pnfs_mark_matching_lsegs_invalid(lo, lseg_list, &range, 0); |
3459 | } |
3460 | |
3461 | @@ -411,7 +420,9 @@ pnfs_layout_remove_lseg(struct pnfs_layout_hdr *lo, |
3462 | list_del_init(&lseg->pls_list); |
3463 | /* Matched by pnfs_get_layout_hdr in pnfs_layout_insert_lseg */ |
3464 | atomic_dec(&lo->plh_refcount); |
3465 | - if (list_empty(&lo->plh_segs)) { |
3466 | + if (list_empty(&lo->plh_segs) && |
3467 | + !test_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags) && |
3468 | + !test_bit(NFS_LAYOUT_RETURN, &lo->plh_flags)) { |
3469 | if (atomic_read(&lo->plh_outstanding) == 0) |
3470 | set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags); |
3471 | clear_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags); |
3472 | @@ -816,14 +827,6 @@ pnfs_destroy_all_layouts(struct nfs_client *clp) |
3473 | pnfs_destroy_layouts_byclid(clp, false); |
3474 | } |
3475 | |
3476 | -static void |
3477 | -pnfs_clear_layoutreturn_info(struct pnfs_layout_hdr *lo) |
3478 | -{ |
3479 | - lo->plh_return_iomode = 0; |
3480 | - lo->plh_return_seq = 0; |
3481 | - clear_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags); |
3482 | -} |
3483 | - |
3484 | /* update lo->plh_stateid with new if is more recent */ |
3485 | void |
3486 | pnfs_set_layout_stateid(struct pnfs_layout_hdr *lo, const nfs4_stateid *new, |
3487 | @@ -944,6 +947,7 @@ static void pnfs_clear_layoutcommit(struct inode *inode, |
3488 | void pnfs_clear_layoutreturn_waitbit(struct pnfs_layout_hdr *lo) |
3489 | { |
3490 | clear_bit_unlock(NFS_LAYOUT_RETURN, &lo->plh_flags); |
3491 | + clear_bit(NFS_LAYOUT_RETURN_LOCK, &lo->plh_flags); |
3492 | smp_mb__after_atomic(); |
3493 | wake_up_bit(&lo->plh_flags, NFS_LAYOUT_RETURN); |
3494 | rpc_wake_up(&NFS_SERVER(lo->plh_inode)->roc_rpcwaitq); |
3495 | @@ -957,8 +961,9 @@ pnfs_prepare_layoutreturn(struct pnfs_layout_hdr *lo, |
3496 | /* Serialise LAYOUTGET/LAYOUTRETURN */ |
3497 | if (atomic_read(&lo->plh_outstanding) != 0) |
3498 | return false; |
3499 | - if (test_and_set_bit(NFS_LAYOUT_RETURN, &lo->plh_flags)) |
3500 | + if (test_and_set_bit(NFS_LAYOUT_RETURN_LOCK, &lo->plh_flags)) |
3501 | return false; |
3502 | + set_bit(NFS_LAYOUT_RETURN, &lo->plh_flags); |
3503 | pnfs_get_layout_hdr(lo); |
3504 | if (test_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags)) { |
3505 | if (stateid != NULL) { |
3506 | @@ -1950,6 +1955,8 @@ void pnfs_error_mark_layout_for_return(struct inode *inode, |
3507 | |
3508 | spin_lock(&inode->i_lock); |
3509 | pnfs_set_plh_return_info(lo, range.iomode, 0); |
3510 | + /* Block LAYOUTGET */ |
3511 | + set_bit(NFS_LAYOUT_RETURN, &lo->plh_flags); |
3512 | /* |
3513 | * mark all matching lsegs so that we are sure to have no live |
3514 | * segments at hand when sending layoutreturn. See pnfs_put_lseg() |
3515 | @@ -2286,6 +2293,10 @@ void pnfs_read_resend_pnfs(struct nfs_pgio_header *hdr) |
3516 | struct nfs_pageio_descriptor pgio; |
3517 | |
3518 | if (!test_and_set_bit(NFS_IOHDR_REDO, &hdr->flags)) { |
3519 | + /* Prevent deadlocks with layoutreturn! */ |
3520 | + pnfs_put_lseg(hdr->lseg); |
3521 | + hdr->lseg = NULL; |
3522 | + |
3523 | nfs_pageio_init_read(&pgio, hdr->inode, false, |
3524 | hdr->completion_ops); |
3525 | hdr->task.tk_status = nfs_pageio_resend(&pgio, hdr); |
3526 | diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h |
3527 | index 5c295512c967..44cad8afda0e 100644 |
3528 | --- a/fs/nfs/pnfs.h |
3529 | +++ b/fs/nfs/pnfs.h |
3530 | @@ -96,6 +96,7 @@ enum { |
3531 | NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */ |
3532 | NFS_LAYOUT_BULK_RECALL, /* bulk recall affecting layout */ |
3533 | NFS_LAYOUT_RETURN, /* layoutreturn in progress */ |
3534 | + NFS_LAYOUT_RETURN_LOCK, /* Serialise layoutreturn */ |
3535 | NFS_LAYOUT_RETURN_REQUESTED, /* Return this layout ASAP */ |
3536 | NFS_LAYOUT_INVALID_STID, /* layout stateid id is invalid */ |
3537 | NFS_LAYOUT_FIRST_LAYOUTGET, /* Serialize first layoutget */ |
3538 | diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c |
3539 | index 741077deef3b..a3645249f7ec 100644 |
3540 | --- a/fs/notify/inode_mark.c |
3541 | +++ b/fs/notify/inode_mark.c |
3542 | @@ -150,12 +150,10 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark, |
3543 | */ |
3544 | void fsnotify_unmount_inodes(struct super_block *sb) |
3545 | { |
3546 | - struct inode *inode, *next_i, *need_iput = NULL; |
3547 | + struct inode *inode, *iput_inode = NULL; |
3548 | |
3549 | spin_lock(&sb->s_inode_list_lock); |
3550 | - list_for_each_entry_safe(inode, next_i, &sb->s_inodes, i_sb_list) { |
3551 | - struct inode *need_iput_tmp; |
3552 | - |
3553 | + list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { |
3554 | /* |
3555 | * We cannot __iget() an inode in state I_FREEING, |
3556 | * I_WILL_FREE, or I_NEW which is fine because by that point |
3557 | @@ -178,49 +176,24 @@ void fsnotify_unmount_inodes(struct super_block *sb) |
3558 | continue; |
3559 | } |
3560 | |
3561 | - need_iput_tmp = need_iput; |
3562 | - need_iput = NULL; |
3563 | - |
3564 | - /* In case fsnotify_inode_delete() drops a reference. */ |
3565 | - if (inode != need_iput_tmp) |
3566 | - __iget(inode); |
3567 | - else |
3568 | - need_iput_tmp = NULL; |
3569 | + __iget(inode); |
3570 | spin_unlock(&inode->i_lock); |
3571 | - |
3572 | - /* In case the dropping of a reference would nuke next_i. */ |
3573 | - while (&next_i->i_sb_list != &sb->s_inodes) { |
3574 | - spin_lock(&next_i->i_lock); |
3575 | - if (!(next_i->i_state & (I_FREEING | I_WILL_FREE)) && |
3576 | - atomic_read(&next_i->i_count)) { |
3577 | - __iget(next_i); |
3578 | - need_iput = next_i; |
3579 | - spin_unlock(&next_i->i_lock); |
3580 | - break; |
3581 | - } |
3582 | - spin_unlock(&next_i->i_lock); |
3583 | - next_i = list_next_entry(next_i, i_sb_list); |
3584 | - } |
3585 | - |
3586 | - /* |
3587 | - * We can safely drop s_inode_list_lock here because either |
3588 | - * we actually hold references on both inode and next_i or |
3589 | - * end of list. Also no new inodes will be added since the |
3590 | - * umount has begun. |
3591 | - */ |
3592 | spin_unlock(&sb->s_inode_list_lock); |
3593 | |
3594 | - if (need_iput_tmp) |
3595 | - iput(need_iput_tmp); |
3596 | + if (iput_inode) |
3597 | + iput(iput_inode); |
3598 | |
3599 | /* for each watch, send FS_UNMOUNT and then remove it */ |
3600 | fsnotify(inode, FS_UNMOUNT, inode, FSNOTIFY_EVENT_INODE, NULL, 0); |
3601 | |
3602 | fsnotify_inode_delete(inode); |
3603 | |
3604 | - iput(inode); |
3605 | + iput_inode = inode; |
3606 | |
3607 | spin_lock(&sb->s_inode_list_lock); |
3608 | } |
3609 | spin_unlock(&sb->s_inode_list_lock); |
3610 | + |
3611 | + if (iput_inode) |
3612 | + iput(iput_inode); |
3613 | } |
3614 | diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h |
3615 | index 14b51d739c3b..66167138120a 100644 |
3616 | --- a/include/net/cfg80211.h |
3617 | +++ b/include/net/cfg80211.h |
3618 | @@ -4584,6 +4584,17 @@ void cfg80211_rx_assoc_resp(struct net_device *dev, |
3619 | void cfg80211_assoc_timeout(struct net_device *dev, struct cfg80211_bss *bss); |
3620 | |
3621 | /** |
3622 | + * cfg80211_abandon_assoc - notify cfg80211 of abandoned association attempt |
3623 | + * @dev: network device |
3624 | + * @bss: The BSS entry with which association was abandoned. |
3625 | + * |
3626 | + * Call this whenever - for reasons reported through other API, like deauth RX, |
3627 | + * an association attempt was abandoned. |
3628 | + * This function may sleep. The caller must hold the corresponding wdev's mutex. |
3629 | + */ |
3630 | +void cfg80211_abandon_assoc(struct net_device *dev, struct cfg80211_bss *bss); |
3631 | + |
3632 | +/** |
3633 | * cfg80211_tx_mlme_mgmt - notification of transmitted deauth/disassoc frame |
3634 | * @dev: network device |
3635 | * @buf: 802.11 frame (header + body) |
3636 | diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h |
3637 | index 931a47ba4571..1beab5532035 100644 |
3638 | --- a/include/rdma/ib_addr.h |
3639 | +++ b/include/rdma/ib_addr.h |
3640 | @@ -205,10 +205,12 @@ static inline void iboe_addr_get_sgid(struct rdma_dev_addr *dev_addr, |
3641 | |
3642 | dev = dev_get_by_index(&init_net, dev_addr->bound_dev_if); |
3643 | if (dev) { |
3644 | - ip4 = (struct in_device *)dev->ip_ptr; |
3645 | - if (ip4 && ip4->ifa_list && ip4->ifa_list->ifa_address) |
3646 | + ip4 = in_dev_get(dev); |
3647 | + if (ip4 && ip4->ifa_list && ip4->ifa_list->ifa_address) { |
3648 | ipv6_addr_set_v4mapped(ip4->ifa_list->ifa_address, |
3649 | (struct in6_addr *)gid); |
3650 | + in_dev_put(ip4); |
3651 | + } |
3652 | dev_put(dev); |
3653 | } |
3654 | } |
3655 | diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c |
3656 | index 37dec7e3db43..46e312e9be38 100644 |
3657 | --- a/kernel/time/timekeeping.c |
3658 | +++ b/kernel/time/timekeeping.c |
3659 | @@ -299,10 +299,10 @@ u32 (*arch_gettimeoffset)(void) = default_arch_gettimeoffset; |
3660 | static inline u32 arch_gettimeoffset(void) { return 0; } |
3661 | #endif |
3662 | |
3663 | -static inline s64 timekeeping_delta_to_ns(struct tk_read_base *tkr, |
3664 | +static inline u64 timekeeping_delta_to_ns(struct tk_read_base *tkr, |
3665 | cycle_t delta) |
3666 | { |
3667 | - s64 nsec; |
3668 | + u64 nsec; |
3669 | |
3670 | nsec = delta * tkr->mult + tkr->xtime_nsec; |
3671 | nsec >>= tkr->shift; |
3672 | diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c |
3673 | index 4e480e870474..a17cb1d8415c 100644 |
3674 | --- a/kernel/trace/trace_functions_graph.c |
3675 | +++ b/kernel/trace/trace_functions_graph.c |
3676 | @@ -842,6 +842,10 @@ print_graph_entry_leaf(struct trace_iterator *iter, |
3677 | |
3678 | cpu_data = per_cpu_ptr(data->cpu_data, cpu); |
3679 | |
3680 | + /* If a graph tracer ignored set_graph_notrace */ |
3681 | + if (call->depth < -1) |
3682 | + call->depth += FTRACE_NOTRACE_DEPTH; |
3683 | + |
3684 | /* |
3685 | * Comments display at + 1 to depth. Since |
3686 | * this is a leaf function, keep the comments |
3687 | @@ -850,7 +854,8 @@ print_graph_entry_leaf(struct trace_iterator *iter, |
3688 | cpu_data->depth = call->depth - 1; |
3689 | |
3690 | /* No need to keep this function around for this depth */ |
3691 | - if (call->depth < FTRACE_RETFUNC_DEPTH) |
3692 | + if (call->depth < FTRACE_RETFUNC_DEPTH && |
3693 | + !WARN_ON_ONCE(call->depth < 0)) |
3694 | cpu_data->enter_funcs[call->depth] = 0; |
3695 | } |
3696 | |
3697 | @@ -880,11 +885,16 @@ print_graph_entry_nested(struct trace_iterator *iter, |
3698 | struct fgraph_cpu_data *cpu_data; |
3699 | int cpu = iter->cpu; |
3700 | |
3701 | + /* If a graph tracer ignored set_graph_notrace */ |
3702 | + if (call->depth < -1) |
3703 | + call->depth += FTRACE_NOTRACE_DEPTH; |
3704 | + |
3705 | cpu_data = per_cpu_ptr(data->cpu_data, cpu); |
3706 | cpu_data->depth = call->depth; |
3707 | |
3708 | /* Save this function pointer to see if the exit matches */ |
3709 | - if (call->depth < FTRACE_RETFUNC_DEPTH) |
3710 | + if (call->depth < FTRACE_RETFUNC_DEPTH && |
3711 | + !WARN_ON_ONCE(call->depth < 0)) |
3712 | cpu_data->enter_funcs[call->depth] = call->func; |
3713 | } |
3714 | |
3715 | @@ -1114,7 +1124,8 @@ print_graph_return(struct ftrace_graph_ret *trace, struct trace_seq *s, |
3716 | */ |
3717 | cpu_data->depth = trace->depth - 1; |
3718 | |
3719 | - if (trace->depth < FTRACE_RETFUNC_DEPTH) { |
3720 | + if (trace->depth < FTRACE_RETFUNC_DEPTH && |
3721 | + !WARN_ON_ONCE(trace->depth < 0)) { |
3722 | if (cpu_data->enter_funcs[trace->depth] != trace->func) |
3723 | func_match = 0; |
3724 | cpu_data->enter_funcs[trace->depth] = 0; |
3725 | diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c |
3726 | index a5502898ea33..2efb335deada 100644 |
3727 | --- a/net/ceph/messenger.c |
3728 | +++ b/net/ceph/messenger.c |
3729 | @@ -2027,6 +2027,19 @@ static int process_connect(struct ceph_connection *con) |
3730 | |
3731 | dout("process_connect on %p tag %d\n", con, (int)con->in_tag); |
3732 | |
3733 | + if (con->auth_reply_buf) { |
3734 | + /* |
3735 | + * Any connection that defines ->get_authorizer() |
3736 | + * should also define ->verify_authorizer_reply(). |
3737 | + * See get_connect_authorizer(). |
3738 | + */ |
3739 | + ret = con->ops->verify_authorizer_reply(con, 0); |
3740 | + if (ret < 0) { |
3741 | + con->error_msg = "bad authorize reply"; |
3742 | + return ret; |
3743 | + } |
3744 | + } |
3745 | + |
3746 | switch (con->in_reply.tag) { |
3747 | case CEPH_MSGR_TAG_FEATURES: |
3748 | pr_err("%s%lld %s feature set mismatch," |
3749 | diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c |
3750 | index 7486f2dab4ba..1118c61f835d 100644 |
3751 | --- a/net/mac80211/mlme.c |
3752 | +++ b/net/mac80211/mlme.c |
3753 | @@ -2510,7 +2510,7 @@ static void ieee80211_destroy_auth_data(struct ieee80211_sub_if_data *sdata, |
3754 | } |
3755 | |
3756 | static void ieee80211_destroy_assoc_data(struct ieee80211_sub_if_data *sdata, |
3757 | - bool assoc) |
3758 | + bool assoc, bool abandon) |
3759 | { |
3760 | struct ieee80211_mgd_assoc_data *assoc_data = sdata->u.mgd.assoc_data; |
3761 | |
3762 | @@ -2533,6 +2533,9 @@ static void ieee80211_destroy_assoc_data(struct ieee80211_sub_if_data *sdata, |
3763 | mutex_lock(&sdata->local->mtx); |
3764 | ieee80211_vif_release_channel(sdata); |
3765 | mutex_unlock(&sdata->local->mtx); |
3766 | + |
3767 | + if (abandon) |
3768 | + cfg80211_abandon_assoc(sdata->dev, assoc_data->bss); |
3769 | } |
3770 | |
3771 | kfree(assoc_data); |
3772 | @@ -2762,7 +2765,7 @@ static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata, |
3773 | bssid, reason_code, |
3774 | ieee80211_get_reason_code_string(reason_code)); |
3775 | |
3776 | - ieee80211_destroy_assoc_data(sdata, false); |
3777 | + ieee80211_destroy_assoc_data(sdata, false, true); |
3778 | |
3779 | cfg80211_rx_mlme_mgmt(sdata->dev, (u8 *)mgmt, len); |
3780 | return; |
3781 | @@ -3167,14 +3170,14 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, |
3782 | if (status_code != WLAN_STATUS_SUCCESS) { |
3783 | sdata_info(sdata, "%pM denied association (code=%d)\n", |
3784 | mgmt->sa, status_code); |
3785 | - ieee80211_destroy_assoc_data(sdata, false); |
3786 | + ieee80211_destroy_assoc_data(sdata, false, false); |
3787 | event.u.mlme.status = MLME_DENIED; |
3788 | event.u.mlme.reason = status_code; |
3789 | drv_event_callback(sdata->local, sdata, &event); |
3790 | } else { |
3791 | if (!ieee80211_assoc_success(sdata, bss, mgmt, len)) { |
3792 | /* oops -- internal error -- send timeout for now */ |
3793 | - ieee80211_destroy_assoc_data(sdata, false); |
3794 | + ieee80211_destroy_assoc_data(sdata, false, false); |
3795 | cfg80211_assoc_timeout(sdata->dev, bss); |
3796 | return; |
3797 | } |
3798 | @@ -3187,7 +3190,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, |
3799 | * recalc after assoc_data is NULL but before associated |
3800 | * is set can cause the interface to go idle |
3801 | */ |
3802 | - ieee80211_destroy_assoc_data(sdata, true); |
3803 | + ieee80211_destroy_assoc_data(sdata, true, false); |
3804 | |
3805 | /* get uapsd queues configuration */ |
3806 | uapsd_queues = 0; |
3807 | @@ -3886,7 +3889,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) |
3808 | .u.mlme.status = MLME_TIMEOUT, |
3809 | }; |
3810 | |
3811 | - ieee80211_destroy_assoc_data(sdata, false); |
3812 | + ieee80211_destroy_assoc_data(sdata, false, false); |
3813 | cfg80211_assoc_timeout(sdata->dev, bss); |
3814 | drv_event_callback(sdata->local, sdata, &event); |
3815 | } |
3816 | @@ -4025,7 +4028,7 @@ void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata) |
3817 | WLAN_REASON_DEAUTH_LEAVING, |
3818 | false, frame_buf); |
3819 | if (ifmgd->assoc_data) |
3820 | - ieee80211_destroy_assoc_data(sdata, false); |
3821 | + ieee80211_destroy_assoc_data(sdata, false, true); |
3822 | if (ifmgd->auth_data) |
3823 | ieee80211_destroy_auth_data(sdata, false); |
3824 | cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf, |
3825 | @@ -4907,7 +4910,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, |
3826 | IEEE80211_STYPE_DEAUTH, |
3827 | req->reason_code, tx, |
3828 | frame_buf); |
3829 | - ieee80211_destroy_assoc_data(sdata, false); |
3830 | + ieee80211_destroy_assoc_data(sdata, false, true); |
3831 | ieee80211_report_disconnect(sdata, frame_buf, |
3832 | sizeof(frame_buf), true, |
3833 | req->reason_code); |
3834 | @@ -4982,7 +4985,7 @@ void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata) |
3835 | sdata_lock(sdata); |
3836 | if (ifmgd->assoc_data) { |
3837 | struct cfg80211_bss *bss = ifmgd->assoc_data->bss; |
3838 | - ieee80211_destroy_assoc_data(sdata, false); |
3839 | + ieee80211_destroy_assoc_data(sdata, false, false); |
3840 | cfg80211_assoc_timeout(sdata->dev, bss); |
3841 | } |
3842 | if (ifmgd->auth_data) |
3843 | diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c |
3844 | index 3dfd769dc5b5..16cea00c959b 100644 |
3845 | --- a/net/sunrpc/auth_gss/auth_gss.c |
3846 | +++ b/net/sunrpc/auth_gss/auth_gss.c |
3847 | @@ -541,9 +541,13 @@ gss_setup_upcall(struct gss_auth *gss_auth, struct rpc_cred *cred) |
3848 | return gss_new; |
3849 | gss_msg = gss_add_msg(gss_new); |
3850 | if (gss_msg == gss_new) { |
3851 | - int res = rpc_queue_upcall(gss_new->pipe, &gss_new->msg); |
3852 | + int res; |
3853 | + atomic_inc(&gss_msg->count); |
3854 | + res = rpc_queue_upcall(gss_new->pipe, &gss_new->msg); |
3855 | if (res) { |
3856 | gss_unhash_msg(gss_new); |
3857 | + atomic_dec(&gss_msg->count); |
3858 | + gss_release_msg(gss_new); |
3859 | gss_msg = ERR_PTR(res); |
3860 | } |
3861 | } else |
3862 | @@ -836,6 +840,7 @@ gss_pipe_destroy_msg(struct rpc_pipe_msg *msg) |
3863 | warn_gssd(); |
3864 | gss_release_msg(gss_msg); |
3865 | } |
3866 | + gss_release_msg(gss_msg); |
3867 | } |
3868 | |
3869 | static void gss_pipe_dentry_destroy(struct dentry *dir, |
3870 | diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c |
3871 | index a53b3a16b4f1..62c056ea403b 100644 |
3872 | --- a/net/vmw_vsock/virtio_transport_common.c |
3873 | +++ b/net/vmw_vsock/virtio_transport_common.c |
3874 | @@ -606,9 +606,9 @@ static int virtio_transport_reset_no_sock(struct virtio_vsock_pkt *pkt) |
3875 | return 0; |
3876 | |
3877 | pkt = virtio_transport_alloc_pkt(&info, 0, |
3878 | - le32_to_cpu(pkt->hdr.dst_cid), |
3879 | + le64_to_cpu(pkt->hdr.dst_cid), |
3880 | le32_to_cpu(pkt->hdr.dst_port), |
3881 | - le32_to_cpu(pkt->hdr.src_cid), |
3882 | + le64_to_cpu(pkt->hdr.src_cid), |
3883 | le32_to_cpu(pkt->hdr.src_port)); |
3884 | if (!pkt) |
3885 | return -ENOMEM; |
3886 | @@ -823,7 +823,7 @@ virtio_transport_send_response(struct vsock_sock *vsk, |
3887 | struct virtio_vsock_pkt_info info = { |
3888 | .op = VIRTIO_VSOCK_OP_RESPONSE, |
3889 | .type = VIRTIO_VSOCK_TYPE_STREAM, |
3890 | - .remote_cid = le32_to_cpu(pkt->hdr.src_cid), |
3891 | + .remote_cid = le64_to_cpu(pkt->hdr.src_cid), |
3892 | .remote_port = le32_to_cpu(pkt->hdr.src_port), |
3893 | .reply = true, |
3894 | }; |
3895 | @@ -863,9 +863,9 @@ virtio_transport_recv_listen(struct sock *sk, struct virtio_vsock_pkt *pkt) |
3896 | child->sk_state = SS_CONNECTED; |
3897 | |
3898 | vchild = vsock_sk(child); |
3899 | - vsock_addr_init(&vchild->local_addr, le32_to_cpu(pkt->hdr.dst_cid), |
3900 | + vsock_addr_init(&vchild->local_addr, le64_to_cpu(pkt->hdr.dst_cid), |
3901 | le32_to_cpu(pkt->hdr.dst_port)); |
3902 | - vsock_addr_init(&vchild->remote_addr, le32_to_cpu(pkt->hdr.src_cid), |
3903 | + vsock_addr_init(&vchild->remote_addr, le64_to_cpu(pkt->hdr.src_cid), |
3904 | le32_to_cpu(pkt->hdr.src_port)); |
3905 | |
3906 | vsock_insert_connected(vchild); |
3907 | @@ -904,9 +904,9 @@ void virtio_transport_recv_pkt(struct virtio_vsock_pkt *pkt) |
3908 | struct sock *sk; |
3909 | bool space_available; |
3910 | |
3911 | - vsock_addr_init(&src, le32_to_cpu(pkt->hdr.src_cid), |
3912 | + vsock_addr_init(&src, le64_to_cpu(pkt->hdr.src_cid), |
3913 | le32_to_cpu(pkt->hdr.src_port)); |
3914 | - vsock_addr_init(&dst, le32_to_cpu(pkt->hdr.dst_cid), |
3915 | + vsock_addr_init(&dst, le64_to_cpu(pkt->hdr.dst_cid), |
3916 | le32_to_cpu(pkt->hdr.dst_port)); |
3917 | |
3918 | trace_virtio_transport_recv_pkt(src.svm_cid, src.svm_port, |
3919 | diff --git a/net/wireless/core.h b/net/wireless/core.h |
3920 | index f0c0c8a48c92..5f5867f90fed 100644 |
3921 | --- a/net/wireless/core.h |
3922 | +++ b/net/wireless/core.h |
3923 | @@ -410,6 +410,7 @@ void cfg80211_sme_disassoc(struct wireless_dev *wdev); |
3924 | void cfg80211_sme_deauth(struct wireless_dev *wdev); |
3925 | void cfg80211_sme_auth_timeout(struct wireless_dev *wdev); |
3926 | void cfg80211_sme_assoc_timeout(struct wireless_dev *wdev); |
3927 | +void cfg80211_sme_abandon_assoc(struct wireless_dev *wdev); |
3928 | |
3929 | /* internal helpers */ |
3930 | bool cfg80211_supported_cipher_suite(struct wiphy *wiphy, u32 cipher); |
3931 | diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c |
3932 | index cbb48e26a871..76775a2b421d 100644 |
3933 | --- a/net/wireless/mlme.c |
3934 | +++ b/net/wireless/mlme.c |
3935 | @@ -149,6 +149,18 @@ void cfg80211_assoc_timeout(struct net_device *dev, struct cfg80211_bss *bss) |
3936 | } |
3937 | EXPORT_SYMBOL(cfg80211_assoc_timeout); |
3938 | |
3939 | +void cfg80211_abandon_assoc(struct net_device *dev, struct cfg80211_bss *bss) |
3940 | +{ |
3941 | + struct wireless_dev *wdev = dev->ieee80211_ptr; |
3942 | + struct wiphy *wiphy = wdev->wiphy; |
3943 | + |
3944 | + cfg80211_sme_abandon_assoc(wdev); |
3945 | + |
3946 | + cfg80211_unhold_bss(bss_from_pub(bss)); |
3947 | + cfg80211_put_bss(wiphy, bss); |
3948 | +} |
3949 | +EXPORT_SYMBOL(cfg80211_abandon_assoc); |
3950 | + |
3951 | void cfg80211_tx_mlme_mgmt(struct net_device *dev, const u8 *buf, size_t len) |
3952 | { |
3953 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
3954 | diff --git a/net/wireless/sme.c b/net/wireless/sme.c |
3955 | index a77db333927e..35cc1de85dcc 100644 |
3956 | --- a/net/wireless/sme.c |
3957 | +++ b/net/wireless/sme.c |
3958 | @@ -39,6 +39,7 @@ struct cfg80211_conn { |
3959 | CFG80211_CONN_ASSOCIATING, |
3960 | CFG80211_CONN_ASSOC_FAILED, |
3961 | CFG80211_CONN_DEAUTH, |
3962 | + CFG80211_CONN_ABANDON, |
3963 | CFG80211_CONN_CONNECTED, |
3964 | } state; |
3965 | u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; |
3966 | @@ -206,6 +207,8 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev) |
3967 | cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid, |
3968 | NULL, 0, |
3969 | WLAN_REASON_DEAUTH_LEAVING, false); |
3970 | + /* fall through */ |
3971 | + case CFG80211_CONN_ABANDON: |
3972 | /* free directly, disconnected event already sent */ |
3973 | cfg80211_sme_free(wdev); |
3974 | return 0; |
3975 | @@ -423,6 +426,17 @@ void cfg80211_sme_assoc_timeout(struct wireless_dev *wdev) |
3976 | schedule_work(&rdev->conn_work); |
3977 | } |
3978 | |
3979 | +void cfg80211_sme_abandon_assoc(struct wireless_dev *wdev) |
3980 | +{ |
3981 | + struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); |
3982 | + |
3983 | + if (!wdev->conn) |
3984 | + return; |
3985 | + |
3986 | + wdev->conn->state = CFG80211_CONN_ABANDON; |
3987 | + schedule_work(&rdev->conn_work); |
3988 | +} |
3989 | + |
3990 | static int cfg80211_sme_get_conn_ies(struct wireless_dev *wdev, |
3991 | const u8 *ies, size_t ies_len, |
3992 | const u8 **out_ies, size_t *out_ies_len) |
3993 | diff --git a/scripts/gcc-plugins/latent_entropy_plugin.c b/scripts/gcc-plugins/latent_entropy_plugin.c |
3994 | index 8160f1c1b56e..dff390f692a2 100644 |
3995 | --- a/scripts/gcc-plugins/latent_entropy_plugin.c |
3996 | +++ b/scripts/gcc-plugins/latent_entropy_plugin.c |
3997 | @@ -328,9 +328,9 @@ static enum tree_code get_op(tree *rhs) |
3998 | op = LROTATE_EXPR; |
3999 | /* |
4000 | * This code limits the value of random_const to |
4001 | - * the size of a wide int for the rotation |
4002 | + * the size of a long for the rotation |
4003 | */ |
4004 | - random_const &= HOST_BITS_PER_WIDE_INT - 1; |
4005 | + random_const %= TYPE_PRECISION(long_unsigned_type_node); |
4006 | break; |
4007 | } |
4008 | |
4009 | diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c |
4010 | index 8275f0e55106..4b2f44c20caf 100644 |
4011 | --- a/scripts/kconfig/nconf.gui.c |
4012 | +++ b/scripts/kconfig/nconf.gui.c |
4013 | @@ -364,12 +364,14 @@ int dialog_inputbox(WINDOW *main_window, |
4014 | WINDOW *prompt_win; |
4015 | WINDOW *form_win; |
4016 | PANEL *panel; |
4017 | - int i, x, y; |
4018 | + int i, x, y, lines, columns, win_lines, win_cols; |
4019 | int res = -1; |
4020 | int cursor_position = strlen(init); |
4021 | int cursor_form_win; |
4022 | char *result = *resultp; |
4023 | |
4024 | + getmaxyx(stdscr, lines, columns); |
4025 | + |
4026 | if (strlen(init)+1 > *result_len) { |
4027 | *result_len = strlen(init)+1; |
4028 | *resultp = result = realloc(result, *result_len); |
4029 | @@ -386,14 +388,19 @@ int dialog_inputbox(WINDOW *main_window, |
4030 | if (title) |
4031 | prompt_width = max(prompt_width, strlen(title)); |
4032 | |
4033 | + win_lines = min(prompt_lines+6, lines-2); |
4034 | + win_cols = min(prompt_width+7, columns-2); |
4035 | + prompt_lines = max(win_lines-6, 0); |
4036 | + prompt_width = max(win_cols-7, 0); |
4037 | + |
4038 | /* place dialog in middle of screen */ |
4039 | - y = (getmaxy(stdscr)-(prompt_lines+4))/2; |
4040 | - x = (getmaxx(stdscr)-(prompt_width+4))/2; |
4041 | + y = (lines-win_lines)/2; |
4042 | + x = (columns-win_cols)/2; |
4043 | |
4044 | strncpy(result, init, *result_len); |
4045 | |
4046 | /* create the windows */ |
4047 | - win = newwin(prompt_lines+6, prompt_width+7, y, x); |
4048 | + win = newwin(win_lines, win_cols, y, x); |
4049 | prompt_win = derwin(win, prompt_lines+1, prompt_width, 2, 2); |
4050 | form_win = derwin(win, 1, prompt_width, prompt_lines+3, 2); |
4051 | keypad(form_win, TRUE); |
4052 | diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c |
4053 | index aeb5a441bd74..430d039d0079 100644 |
4054 | --- a/tools/perf/util/annotate.c |
4055 | +++ b/tools/perf/util/annotate.c |
4056 | @@ -593,7 +593,8 @@ static int __symbol__inc_addr_samples(struct symbol *sym, struct map *map, |
4057 | |
4058 | pr_debug3("%s: addr=%#" PRIx64 "\n", __func__, map->unmap_ip(map, addr)); |
4059 | |
4060 | - if (addr < sym->start || addr >= sym->end) { |
4061 | + if ((addr < sym->start || addr >= sym->end) && |
4062 | + (addr != sym->end || sym->start != sym->end)) { |
4063 | pr_debug("%s(%d): ERANGE! sym->name=%s, start=%#" PRIx64 ", addr=%#" PRIx64 ", end=%#" PRIx64 "\n", |
4064 | __func__, __LINE__, sym->name, sym->start, addr, sym->end); |
4065 | return -ERANGE; |