1 |
commit: 6d61347248bb6c9d07ace97bef1e2f169b59e769 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Mar 30 18:15:23 2017 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Mar 30 18:15:23 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=6d613472 |
7 |
|
8 |
Linux patch 4.9.19 |
9 |
|
10 |
0000_README | 4 + |
11 |
1018_linux-4.9.19.patch | 3130 +++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 3134 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index ef96dc8..4eb0378 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -115,6 +115,10 @@ Patch: 1017_linux-4.9.18.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 4.9.18 |
21 |
|
22 |
+Patch: 1018_linux-4.9.19.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.9.19 |
25 |
+ |
26 |
Patch: 1500_XATTR_USER_PREFIX.patch |
27 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
28 |
Desc: Support for namespace user.pax.* on tmpfs. |
29 |
|
30 |
diff --git a/1018_linux-4.9.19.patch b/1018_linux-4.9.19.patch |
31 |
new file mode 100644 |
32 |
index 0000000..91975f4 |
33 |
--- /dev/null |
34 |
+++ b/1018_linux-4.9.19.patch |
35 |
@@ -0,0 +1,3130 @@ |
36 |
+diff --git a/Makefile b/Makefile |
37 |
+index c10d0e634e68..ba1c6a8e6a70 100644 |
38 |
+--- a/Makefile |
39 |
++++ b/Makefile |
40 |
+@@ -1,6 +1,6 @@ |
41 |
+ VERSION = 4 |
42 |
+ PATCHLEVEL = 9 |
43 |
+-SUBLEVEL = 18 |
44 |
++SUBLEVEL = 19 |
45 |
+ EXTRAVERSION = |
46 |
+ NAME = Roaring Lionus |
47 |
+ |
48 |
+diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi |
49 |
+index 7173ec9059a1..8158c873b455 100644 |
50 |
+--- a/arch/arm/boot/dts/sama5d2.dtsi |
51 |
++++ b/arch/arm/boot/dts/sama5d2.dtsi |
52 |
+@@ -266,7 +266,7 @@ |
53 |
+ }; |
54 |
+ |
55 |
+ usb1: ohci@00400000 { |
56 |
+- compatible = "atmel,sama5d2-ohci", "usb-ohci"; |
57 |
++ compatible = "atmel,at91rm9200-ohci", "usb-ohci"; |
58 |
+ reg = <0x00400000 0x100000>; |
59 |
+ interrupts = <41 IRQ_TYPE_LEVEL_HIGH 2>; |
60 |
+ clocks = <&uhphs_clk>, <&uhphs_clk>, <&uhpck>; |
61 |
+diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c |
62 |
+index b4332b727e9c..31dde8b6f2ea 100644 |
63 |
+--- a/arch/arm/mach-at91/pm.c |
64 |
++++ b/arch/arm/mach-at91/pm.c |
65 |
+@@ -289,6 +289,22 @@ static void at91_ddr_standby(void) |
66 |
+ at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1); |
67 |
+ } |
68 |
+ |
69 |
++static void sama5d3_ddr_standby(void) |
70 |
++{ |
71 |
++ u32 lpr0; |
72 |
++ u32 saved_lpr0; |
73 |
++ |
74 |
++ saved_lpr0 = at91_ramc_read(0, AT91_DDRSDRC_LPR); |
75 |
++ lpr0 = saved_lpr0 & ~AT91_DDRSDRC_LPCB; |
76 |
++ lpr0 |= AT91_DDRSDRC_LPCB_POWER_DOWN; |
77 |
++ |
78 |
++ at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr0); |
79 |
++ |
80 |
++ cpu_do_idle(); |
81 |
++ |
82 |
++ at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0); |
83 |
++} |
84 |
++ |
85 |
+ /* We manage both DDRAM/SDRAM controllers, we need more than one value to |
86 |
+ * remember. |
87 |
+ */ |
88 |
+@@ -323,7 +339,7 @@ static const struct of_device_id const ramc_ids[] __initconst = { |
89 |
+ { .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby }, |
90 |
+ { .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby }, |
91 |
+ { .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby }, |
92 |
+- { .compatible = "atmel,sama5d3-ddramc", .data = at91_ddr_standby }, |
93 |
++ { .compatible = "atmel,sama5d3-ddramc", .data = sama5d3_ddr_standby }, |
94 |
+ { /*sentinel*/ } |
95 |
+ }; |
96 |
+ |
97 |
+diff --git a/arch/arm64/kernel/kaslr.c b/arch/arm64/kernel/kaslr.c |
98 |
+index 769f24ef628c..d7e90d97f5c4 100644 |
99 |
+--- a/arch/arm64/kernel/kaslr.c |
100 |
++++ b/arch/arm64/kernel/kaslr.c |
101 |
+@@ -131,11 +131,15 @@ u64 __init kaslr_early_init(u64 dt_phys, u64 modulo_offset) |
102 |
+ /* |
103 |
+ * The kernel Image should not extend across a 1GB/32MB/512MB alignment |
104 |
+ * boundary (for 4KB/16KB/64KB granule kernels, respectively). If this |
105 |
+- * happens, increase the KASLR offset by the size of the kernel image. |
106 |
++ * happens, increase the KASLR offset by the size of the kernel image |
107 |
++ * rounded up by SWAPPER_BLOCK_SIZE. |
108 |
+ */ |
109 |
+ if ((((u64)_text + offset + modulo_offset) >> SWAPPER_TABLE_SHIFT) != |
110 |
+- (((u64)_end + offset + modulo_offset) >> SWAPPER_TABLE_SHIFT)) |
111 |
+- offset = (offset + (u64)(_end - _text)) & mask; |
112 |
++ (((u64)_end + offset + modulo_offset) >> SWAPPER_TABLE_SHIFT)) { |
113 |
++ u64 kimg_sz = _end - _text; |
114 |
++ offset = (offset + round_up(kimg_sz, SWAPPER_BLOCK_SIZE)) |
115 |
++ & mask; |
116 |
++ } |
117 |
+ |
118 |
+ if (IS_ENABLED(CONFIG_KASAN)) |
119 |
+ /* |
120 |
+diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S |
121 |
+index 72dac0b58061..b350ac5e3111 100644 |
122 |
+--- a/arch/powerpc/kernel/idle_book3s.S |
123 |
++++ b/arch/powerpc/kernel/idle_book3s.S |
124 |
+@@ -439,9 +439,23 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300) |
125 |
+ _GLOBAL(pnv_wakeup_tb_loss) |
126 |
+ ld r1,PACAR1(r13) |
127 |
+ /* |
128 |
+- * Before entering any idle state, the NVGPRs are saved in the stack |
129 |
+- * and they are restored before switching to the process context. Hence |
130 |
+- * until they are restored, they are free to be used. |
131 |
++ * Before entering any idle state, the NVGPRs are saved in the stack. |
132 |
++ * If there was a state loss, or PACA_NAPSTATELOST was set, then the |
133 |
++ * NVGPRs are restored. If we are here, it is likely that state is lost, |
134 |
++ * but not guaranteed -- neither ISA207 nor ISA300 tests to reach |
135 |
++ * here are the same as the test to restore NVGPRS: |
136 |
++ * PACA_THREAD_IDLE_STATE test for ISA207, PSSCR test for ISA300, |
137 |
++ * and SRR1 test for restoring NVGPRs. |
138 |
++ * |
139 |
++ * We are about to clobber NVGPRs now, so set NAPSTATELOST to |
140 |
++ * guarantee they will always be restored. This might be tightened |
141 |
++ * with careful reading of specs (particularly for ISA300) but this |
142 |
++ * is already a slow wakeup path and it's simpler to be safe. |
143 |
++ */ |
144 |
++ li r0,1 |
145 |
++ stb r0,PACA_NAPSTATELOST(r13) |
146 |
++ |
147 |
++ /* |
148 |
+ * |
149 |
+ * Save SRR1 and LR in NVGPRs as they might be clobbered in |
150 |
+ * opal_call() (called in CHECK_HMI_INTERRUPT). SRR1 is required |
151 |
+diff --git a/block/blk-mq.c b/block/blk-mq.c |
152 |
+index 81caceb96c3c..ee54ad01f7ac 100644 |
153 |
+--- a/block/blk-mq.c |
154 |
++++ b/block/blk-mq.c |
155 |
+@@ -629,17 +629,8 @@ static void blk_mq_check_expired(struct blk_mq_hw_ctx *hctx, |
156 |
+ { |
157 |
+ struct blk_mq_timeout_data *data = priv; |
158 |
+ |
159 |
+- if (!test_bit(REQ_ATOM_STARTED, &rq->atomic_flags)) { |
160 |
+- /* |
161 |
+- * If a request wasn't started before the queue was |
162 |
+- * marked dying, kill it here or it'll go unnoticed. |
163 |
+- */ |
164 |
+- if (unlikely(blk_queue_dying(rq->q))) { |
165 |
+- rq->errors = -EIO; |
166 |
+- blk_mq_end_request(rq, rq->errors); |
167 |
+- } |
168 |
++ if (!test_bit(REQ_ATOM_STARTED, &rq->atomic_flags)) |
169 |
+ return; |
170 |
+- } |
171 |
+ |
172 |
+ if (time_after_eq(jiffies, rq->deadline)) { |
173 |
+ if (!blk_mark_rq_complete(rq)) |
174 |
+diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c |
175 |
+index d19b09cdf284..54fc90e8339c 100644 |
176 |
+--- a/crypto/algif_hash.c |
177 |
++++ b/crypto/algif_hash.c |
178 |
+@@ -245,7 +245,7 @@ static int hash_accept(struct socket *sock, struct socket *newsock, int flags) |
179 |
+ struct alg_sock *ask = alg_sk(sk); |
180 |
+ struct hash_ctx *ctx = ask->private; |
181 |
+ struct ahash_request *req = &ctx->req; |
182 |
+- char state[crypto_ahash_statesize(crypto_ahash_reqtfm(req))]; |
183 |
++ char state[crypto_ahash_statesize(crypto_ahash_reqtfm(req)) ? : 1]; |
184 |
+ struct sock *sk2; |
185 |
+ struct alg_sock *ask2; |
186 |
+ struct hash_ctx *ctx2; |
187 |
+diff --git a/drivers/auxdisplay/img-ascii-lcd.c b/drivers/auxdisplay/img-ascii-lcd.c |
188 |
+index bf43b5d2aafc..83f1439e57fd 100644 |
189 |
+--- a/drivers/auxdisplay/img-ascii-lcd.c |
190 |
++++ b/drivers/auxdisplay/img-ascii-lcd.c |
191 |
+@@ -218,6 +218,7 @@ static const struct of_device_id img_ascii_lcd_matches[] = { |
192 |
+ { .compatible = "img,boston-lcd", .data = &boston_config }, |
193 |
+ { .compatible = "mti,malta-lcd", .data = &malta_config }, |
194 |
+ { .compatible = "mti,sead3-lcd", .data = &sead3_config }, |
195 |
++ { /* sentinel */ } |
196 |
+ }; |
197 |
+ |
198 |
+ /** |
199 |
+diff --git a/drivers/char/hw_random/amd-rng.c b/drivers/char/hw_random/amd-rng.c |
200 |
+index 4a99ac756f08..9959c762da2f 100644 |
201 |
+--- a/drivers/char/hw_random/amd-rng.c |
202 |
++++ b/drivers/char/hw_random/amd-rng.c |
203 |
+@@ -55,6 +55,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); |
204 |
+ struct amd768_priv { |
205 |
+ void __iomem *iobase; |
206 |
+ struct pci_dev *pcidev; |
207 |
++ u32 pmbase; |
208 |
+ }; |
209 |
+ |
210 |
+ static int amd_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) |
211 |
+@@ -148,33 +149,58 @@ static int __init mod_init(void) |
212 |
+ if (pmbase == 0) |
213 |
+ return -EIO; |
214 |
+ |
215 |
+- priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); |
216 |
++ priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
217 |
+ if (!priv) |
218 |
+ return -ENOMEM; |
219 |
+ |
220 |
+- if (!devm_request_region(&pdev->dev, pmbase + PMBASE_OFFSET, |
221 |
+- PMBASE_SIZE, DRV_NAME)) { |
222 |
++ if (!request_region(pmbase + PMBASE_OFFSET, PMBASE_SIZE, DRV_NAME)) { |
223 |
+ dev_err(&pdev->dev, DRV_NAME " region 0x%x already in use!\n", |
224 |
+ pmbase + 0xF0); |
225 |
+- return -EBUSY; |
226 |
++ err = -EBUSY; |
227 |
++ goto out; |
228 |
+ } |
229 |
+ |
230 |
+- priv->iobase = devm_ioport_map(&pdev->dev, pmbase + PMBASE_OFFSET, |
231 |
+- PMBASE_SIZE); |
232 |
++ priv->iobase = ioport_map(pmbase + PMBASE_OFFSET, PMBASE_SIZE); |
233 |
+ if (!priv->iobase) { |
234 |
+ pr_err(DRV_NAME "Cannot map ioport\n"); |
235 |
+- return -ENOMEM; |
236 |
++ err = -EINVAL; |
237 |
++ goto err_iomap; |
238 |
+ } |
239 |
+ |
240 |
+ amd_rng.priv = (unsigned long)priv; |
241 |
++ priv->pmbase = pmbase; |
242 |
+ priv->pcidev = pdev; |
243 |
+ |
244 |
+ pr_info(DRV_NAME " detected\n"); |
245 |
+- return devm_hwrng_register(&pdev->dev, &amd_rng); |
246 |
++ err = hwrng_register(&amd_rng); |
247 |
++ if (err) { |
248 |
++ pr_err(DRV_NAME " registering failed (%d)\n", err); |
249 |
++ goto err_hwrng; |
250 |
++ } |
251 |
++ return 0; |
252 |
++ |
253 |
++err_hwrng: |
254 |
++ ioport_unmap(priv->iobase); |
255 |
++err_iomap: |
256 |
++ release_region(pmbase + PMBASE_OFFSET, PMBASE_SIZE); |
257 |
++out: |
258 |
++ kfree(priv); |
259 |
++ return err; |
260 |
+ } |
261 |
+ |
262 |
+ static void __exit mod_exit(void) |
263 |
+ { |
264 |
++ struct amd768_priv *priv; |
265 |
++ |
266 |
++ priv = (struct amd768_priv *)amd_rng.priv; |
267 |
++ |
268 |
++ hwrng_unregister(&amd_rng); |
269 |
++ |
270 |
++ ioport_unmap(priv->iobase); |
271 |
++ |
272 |
++ release_region(priv->pmbase + PMBASE_OFFSET, PMBASE_SIZE); |
273 |
++ |
274 |
++ kfree(priv); |
275 |
+ } |
276 |
+ |
277 |
+ module_init(mod_init); |
278 |
+diff --git a/drivers/char/hw_random/geode-rng.c b/drivers/char/hw_random/geode-rng.c |
279 |
+index e7a245942029..e1d421a36a13 100644 |
280 |
+--- a/drivers/char/hw_random/geode-rng.c |
281 |
++++ b/drivers/char/hw_random/geode-rng.c |
282 |
+@@ -31,6 +31,9 @@ |
283 |
+ #include <linux/module.h> |
284 |
+ #include <linux/pci.h> |
285 |
+ |
286 |
++ |
287 |
++#define PFX KBUILD_MODNAME ": " |
288 |
++ |
289 |
+ #define GEODE_RNG_DATA_REG 0x50 |
290 |
+ #define GEODE_RNG_STATUS_REG 0x54 |
291 |
+ |
292 |
+@@ -82,6 +85,7 @@ static struct hwrng geode_rng = { |
293 |
+ |
294 |
+ static int __init mod_init(void) |
295 |
+ { |
296 |
++ int err = -ENODEV; |
297 |
+ struct pci_dev *pdev = NULL; |
298 |
+ const struct pci_device_id *ent; |
299 |
+ void __iomem *mem; |
300 |
+@@ -89,27 +93,43 @@ static int __init mod_init(void) |
301 |
+ |
302 |
+ for_each_pci_dev(pdev) { |
303 |
+ ent = pci_match_id(pci_tbl, pdev); |
304 |
+- if (ent) { |
305 |
+- rng_base = pci_resource_start(pdev, 0); |
306 |
+- if (rng_base == 0) |
307 |
+- return -ENODEV; |
308 |
+- |
309 |
+- mem = devm_ioremap(&pdev->dev, rng_base, 0x58); |
310 |
+- if (!mem) |
311 |
+- return -ENOMEM; |
312 |
+- geode_rng.priv = (unsigned long)mem; |
313 |
+- |
314 |
+- pr_info("AMD Geode RNG detected\n"); |
315 |
+- return devm_hwrng_register(&pdev->dev, &geode_rng); |
316 |
+- } |
317 |
++ if (ent) |
318 |
++ goto found; |
319 |
+ } |
320 |
+- |
321 |
+ /* Device not found. */ |
322 |
+- return -ENODEV; |
323 |
++ goto out; |
324 |
++ |
325 |
++found: |
326 |
++ rng_base = pci_resource_start(pdev, 0); |
327 |
++ if (rng_base == 0) |
328 |
++ goto out; |
329 |
++ err = -ENOMEM; |
330 |
++ mem = ioremap(rng_base, 0x58); |
331 |
++ if (!mem) |
332 |
++ goto out; |
333 |
++ geode_rng.priv = (unsigned long)mem; |
334 |
++ |
335 |
++ pr_info("AMD Geode RNG detected\n"); |
336 |
++ err = hwrng_register(&geode_rng); |
337 |
++ if (err) { |
338 |
++ pr_err(PFX "RNG registering failed (%d)\n", |
339 |
++ err); |
340 |
++ goto err_unmap; |
341 |
++ } |
342 |
++out: |
343 |
++ return err; |
344 |
++ |
345 |
++err_unmap: |
346 |
++ iounmap(mem); |
347 |
++ goto out; |
348 |
+ } |
349 |
+ |
350 |
+ static void __exit mod_exit(void) |
351 |
+ { |
352 |
++ void __iomem *mem = (void __iomem *)geode_rng.priv; |
353 |
++ |
354 |
++ hwrng_unregister(&geode_rng); |
355 |
++ iounmap(mem); |
356 |
+ } |
357 |
+ |
358 |
+ module_init(mod_init); |
359 |
+diff --git a/drivers/clk/sunxi-ng/ccu-sun6i-a31.c b/drivers/clk/sunxi-ng/ccu-sun6i-a31.c |
360 |
+index fc75a335a7ce..8ca07fe8d3f3 100644 |
361 |
+--- a/drivers/clk/sunxi-ng/ccu-sun6i-a31.c |
362 |
++++ b/drivers/clk/sunxi-ng/ccu-sun6i-a31.c |
363 |
+@@ -608,7 +608,7 @@ static SUNXI_CCU_M_WITH_MUX_GATE(hdmi_clk, "hdmi", lcd_ch1_parents, |
364 |
+ 0x150, 0, 4, 24, 2, BIT(31), |
365 |
+ CLK_SET_RATE_PARENT); |
366 |
+ |
367 |
+-static SUNXI_CCU_GATE(hdmi_ddc_clk, "hdmi-ddc", "osc24M", 0x150, BIT(31), 0); |
368 |
++static SUNXI_CCU_GATE(hdmi_ddc_clk, "hdmi-ddc", "osc24M", 0x150, BIT(30), 0); |
369 |
+ |
370 |
+ static SUNXI_CCU_GATE(ps_clk, "ps", "lcd1-ch1", 0x140, BIT(31), 0); |
371 |
+ |
372 |
+diff --git a/drivers/clk/sunxi-ng/ccu_mp.c b/drivers/clk/sunxi-ng/ccu_mp.c |
373 |
+index ebb1b31568a5..ee7810429c30 100644 |
374 |
+--- a/drivers/clk/sunxi-ng/ccu_mp.c |
375 |
++++ b/drivers/clk/sunxi-ng/ccu_mp.c |
376 |
+@@ -85,6 +85,10 @@ static unsigned long ccu_mp_recalc_rate(struct clk_hw *hw, |
377 |
+ unsigned int m, p; |
378 |
+ u32 reg; |
379 |
+ |
380 |
++ /* Adjust parent_rate according to pre-dividers */ |
381 |
++ ccu_mux_helper_adjust_parent_for_prediv(&cmp->common, &cmp->mux, |
382 |
++ -1, &parent_rate); |
383 |
++ |
384 |
+ reg = readl(cmp->common.base + cmp->common.reg); |
385 |
+ |
386 |
+ m = reg >> cmp->m.shift; |
387 |
+@@ -114,6 +118,10 @@ static int ccu_mp_set_rate(struct clk_hw *hw, unsigned long rate, |
388 |
+ unsigned int m, p; |
389 |
+ u32 reg; |
390 |
+ |
391 |
++ /* Adjust parent_rate according to pre-dividers */ |
392 |
++ ccu_mux_helper_adjust_parent_for_prediv(&cmp->common, &cmp->mux, |
393 |
++ -1, &parent_rate); |
394 |
++ |
395 |
+ max_m = cmp->m.max ?: 1 << cmp->m.width; |
396 |
+ max_p = cmp->p.max ?: 1 << ((1 << cmp->p.width) - 1); |
397 |
+ |
398 |
+diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c |
399 |
+index 272608f102fb..cac4a92259da 100644 |
400 |
+--- a/drivers/cpufreq/cpufreq.c |
401 |
++++ b/drivers/cpufreq/cpufreq.c |
402 |
+@@ -1190,6 +1190,9 @@ static int cpufreq_online(unsigned int cpu) |
403 |
+ for_each_cpu(j, policy->related_cpus) |
404 |
+ per_cpu(cpufreq_cpu_data, j) = policy; |
405 |
+ write_unlock_irqrestore(&cpufreq_driver_lock, flags); |
406 |
++ } else { |
407 |
++ policy->min = policy->user_policy.min; |
408 |
++ policy->max = policy->user_policy.max; |
409 |
+ } |
410 |
+ |
411 |
+ if (cpufreq_driver->get && !cpufreq_driver->setpolicy) { |
412 |
+diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c |
413 |
+index cafa633aae10..f796e36d7ec3 100644 |
414 |
+--- a/drivers/crypto/ccp/ccp-dev.c |
415 |
++++ b/drivers/crypto/ccp/ccp-dev.c |
416 |
+@@ -283,11 +283,14 @@ EXPORT_SYMBOL_GPL(ccp_version); |
417 |
+ */ |
418 |
+ int ccp_enqueue_cmd(struct ccp_cmd *cmd) |
419 |
+ { |
420 |
+- struct ccp_device *ccp = ccp_get_device(); |
421 |
++ struct ccp_device *ccp; |
422 |
+ unsigned long flags; |
423 |
+ unsigned int i; |
424 |
+ int ret; |
425 |
+ |
426 |
++ /* Some commands might need to be sent to a specific device */ |
427 |
++ ccp = cmd->ccp ? cmd->ccp : ccp_get_device(); |
428 |
++ |
429 |
+ if (!ccp) |
430 |
+ return -ENODEV; |
431 |
+ |
432 |
+diff --git a/drivers/crypto/ccp/ccp-dmaengine.c b/drivers/crypto/ccp/ccp-dmaengine.c |
433 |
+index e5d9278f4019..8d0eeb46d4a2 100644 |
434 |
+--- a/drivers/crypto/ccp/ccp-dmaengine.c |
435 |
++++ b/drivers/crypto/ccp/ccp-dmaengine.c |
436 |
+@@ -390,6 +390,7 @@ static struct ccp_dma_desc *ccp_create_desc(struct dma_chan *dma_chan, |
437 |
+ goto err; |
438 |
+ |
439 |
+ ccp_cmd = &cmd->ccp_cmd; |
440 |
++ ccp_cmd->ccp = chan->ccp; |
441 |
+ ccp_pt = &ccp_cmd->u.passthru_nomap; |
442 |
+ ccp_cmd->flags = CCP_CMD_MAY_BACKLOG; |
443 |
+ ccp_cmd->flags |= CCP_CMD_PASSTHRU_NO_DMA_MAP; |
444 |
+diff --git a/drivers/dax/dax.c b/drivers/dax/dax.c |
445 |
+index 286447a83dab..152552d2c306 100644 |
446 |
+--- a/drivers/dax/dax.c |
447 |
++++ b/drivers/dax/dax.c |
448 |
+@@ -334,6 +334,7 @@ static int __dax_dev_fault(struct dax_dev *dax_dev, struct vm_area_struct *vma, |
449 |
+ int rc = VM_FAULT_SIGBUS; |
450 |
+ phys_addr_t phys; |
451 |
+ pfn_t pfn; |
452 |
++ unsigned int fault_size = PAGE_SIZE; |
453 |
+ |
454 |
+ if (check_vma(dax_dev, vma, __func__)) |
455 |
+ return VM_FAULT_SIGBUS; |
456 |
+@@ -344,6 +345,9 @@ static int __dax_dev_fault(struct dax_dev *dax_dev, struct vm_area_struct *vma, |
457 |
+ return VM_FAULT_SIGBUS; |
458 |
+ } |
459 |
+ |
460 |
++ if (fault_size != dax_region->align) |
461 |
++ return VM_FAULT_SIGBUS; |
462 |
++ |
463 |
+ phys = pgoff_to_phys(dax_dev, vmf->pgoff, PAGE_SIZE); |
464 |
+ if (phys == -1) { |
465 |
+ dev_dbg(dev, "%s: phys_to_pgoff(%#lx) failed\n", __func__, |
466 |
+@@ -389,6 +393,7 @@ static int __dax_dev_pmd_fault(struct dax_dev *dax_dev, |
467 |
+ phys_addr_t phys; |
468 |
+ pgoff_t pgoff; |
469 |
+ pfn_t pfn; |
470 |
++ unsigned int fault_size = PMD_SIZE; |
471 |
+ |
472 |
+ if (check_vma(dax_dev, vma, __func__)) |
473 |
+ return VM_FAULT_SIGBUS; |
474 |
+@@ -405,6 +410,16 @@ static int __dax_dev_pmd_fault(struct dax_dev *dax_dev, |
475 |
+ return VM_FAULT_SIGBUS; |
476 |
+ } |
477 |
+ |
478 |
++ if (fault_size < dax_region->align) |
479 |
++ return VM_FAULT_SIGBUS; |
480 |
++ else if (fault_size > dax_region->align) |
481 |
++ return VM_FAULT_FALLBACK; |
482 |
++ |
483 |
++ /* if we are outside of the VMA */ |
484 |
++ if (pmd_addr < vma->vm_start || |
485 |
++ (pmd_addr + PMD_SIZE) > vma->vm_end) |
486 |
++ return VM_FAULT_SIGBUS; |
487 |
++ |
488 |
+ pgoff = linear_page_index(vma, pmd_addr); |
489 |
+ phys = pgoff_to_phys(dax_dev, pgoff, PMD_SIZE); |
490 |
+ if (phys == -1) { |
491 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/si_dpm.c b/drivers/gpu/drm/amd/amdgpu/si_dpm.c |
492 |
+index 09e6a7320bb2..6f3c89178b6a 100644 |
493 |
+--- a/drivers/gpu/drm/amd/amdgpu/si_dpm.c |
494 |
++++ b/drivers/gpu/drm/amd/amdgpu/si_dpm.c |
495 |
+@@ -3507,9 +3507,13 @@ static void si_apply_state_adjust_rules(struct amdgpu_device *adev, |
496 |
+ max_mclk = 80000; |
497 |
+ } |
498 |
+ } else if (adev->asic_type == CHIP_OLAND) { |
499 |
+- if ((adev->pdev->device == 0x6604) && |
500 |
+- (adev->pdev->subsystem_vendor == 0x1028) && |
501 |
+- (adev->pdev->subsystem_device == 0x066F)) { |
502 |
++ if ((adev->pdev->revision == 0xC7) || |
503 |
++ (adev->pdev->revision == 0x80) || |
504 |
++ (adev->pdev->revision == 0x81) || |
505 |
++ (adev->pdev->revision == 0x83) || |
506 |
++ (adev->pdev->revision == 0x87) || |
507 |
++ (adev->pdev->device == 0x6604) || |
508 |
++ (adev->pdev->device == 0x6605)) { |
509 |
+ max_sclk = 75000; |
510 |
+ } |
511 |
+ } |
512 |
+diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c |
513 |
+index 6e0447f329a2..72ec93de0e76 100644 |
514 |
+--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c |
515 |
++++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c |
516 |
+@@ -1382,6 +1382,7 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev, |
517 |
+ |
518 |
+ pm_runtime_enable(dev); |
519 |
+ |
520 |
++ pm_runtime_get_sync(dev); |
521 |
+ phy_power_on(dp->phy); |
522 |
+ |
523 |
+ analogix_dp_init_dp(dp); |
524 |
+@@ -1414,9 +1415,15 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev, |
525 |
+ goto err_disable_pm_runtime; |
526 |
+ } |
527 |
+ |
528 |
++ phy_power_off(dp->phy); |
529 |
++ pm_runtime_put(dev); |
530 |
++ |
531 |
+ return 0; |
532 |
+ |
533 |
+ err_disable_pm_runtime: |
534 |
++ |
535 |
++ phy_power_off(dp->phy); |
536 |
++ pm_runtime_put(dev); |
537 |
+ pm_runtime_disable(dev); |
538 |
+ |
539 |
+ return ret; |
540 |
+diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c |
541 |
+index 2e42a0584a84..50acd799babe 100644 |
542 |
+--- a/drivers/gpu/drm/drm_atomic_helper.c |
543 |
++++ b/drivers/gpu/drm/drm_atomic_helper.c |
544 |
+@@ -1382,6 +1382,15 @@ static int stall_checks(struct drm_crtc *crtc, bool nonblock) |
545 |
+ return ret < 0 ? ret : 0; |
546 |
+ } |
547 |
+ |
548 |
++void release_crtc_commit(struct completion *completion) |
549 |
++{ |
550 |
++ struct drm_crtc_commit *commit = container_of(completion, |
551 |
++ typeof(*commit), |
552 |
++ flip_done); |
553 |
++ |
554 |
++ drm_crtc_commit_put(commit); |
555 |
++} |
556 |
++ |
557 |
+ /** |
558 |
+ * drm_atomic_helper_setup_commit - setup possibly nonblocking commit |
559 |
+ * @state: new modeset state to be committed |
560 |
+@@ -1474,6 +1483,8 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, |
561 |
+ } |
562 |
+ |
563 |
+ crtc_state->event->base.completion = &commit->flip_done; |
564 |
++ crtc_state->event->base.completion_release = release_crtc_commit; |
565 |
++ drm_crtc_commit_get(commit); |
566 |
+ } |
567 |
+ |
568 |
+ return 0; |
569 |
+diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c |
570 |
+index e84faecf5225..f5815e1a4390 100644 |
571 |
+--- a/drivers/gpu/drm/drm_fops.c |
572 |
++++ b/drivers/gpu/drm/drm_fops.c |
573 |
+@@ -686,8 +686,8 @@ void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event *e) |
574 |
+ assert_spin_locked(&dev->event_lock); |
575 |
+ |
576 |
+ if (e->completion) { |
577 |
+- /* ->completion might disappear as soon as it signalled. */ |
578 |
+ complete_all(e->completion); |
579 |
++ e->completion_release(e->completion); |
580 |
+ e->completion = NULL; |
581 |
+ } |
582 |
+ |
583 |
+diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c |
584 |
+index be34547cdb68..1606e7f08f4b 100644 |
585 |
+--- a/drivers/hv/channel.c |
586 |
++++ b/drivers/hv/channel.c |
587 |
+@@ -506,12 +506,15 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle) |
588 |
+ |
589 |
+ wait_for_completion(&info->waitevent); |
590 |
+ |
591 |
+- if (channel->rescind) { |
592 |
+- ret = -ENODEV; |
593 |
+- goto post_msg_err; |
594 |
+- } |
595 |
+- |
596 |
+ post_msg_err: |
597 |
++ /* |
598 |
++ * If the channel has been rescinded; |
599 |
++ * we will be awakened by the rescind |
600 |
++ * handler; set the error code to zero so we don't leak memory. |
601 |
++ */ |
602 |
++ if (channel->rescind) |
603 |
++ ret = 0; |
604 |
++ |
605 |
+ spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); |
606 |
+ list_del(&info->msglistentry); |
607 |
+ spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags); |
608 |
+diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c |
609 |
+index cb9531541a12..d8bc4b910192 100644 |
610 |
+--- a/drivers/hv/channel_mgmt.c |
611 |
++++ b/drivers/hv/channel_mgmt.c |
612 |
+@@ -779,6 +779,7 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr) |
613 |
+ /* Allocate the channel object and save this offer. */ |
614 |
+ newchannel = alloc_channel(); |
615 |
+ if (!newchannel) { |
616 |
++ vmbus_release_relid(offer->child_relid); |
617 |
+ pr_err("Unable to allocate channel object\n"); |
618 |
+ return; |
619 |
+ } |
620 |
+diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c |
621 |
+index 6f0a51a2c6ec..d439736c789b 100644 |
622 |
+--- a/drivers/hwtracing/intel_th/core.c |
623 |
++++ b/drivers/hwtracing/intel_th/core.c |
624 |
+@@ -218,8 +218,10 @@ static int intel_th_output_activate(struct intel_th_device *thdev) |
625 |
+ else |
626 |
+ intel_th_trace_enable(thdev); |
627 |
+ |
628 |
+- if (ret) |
629 |
++ if (ret) { |
630 |
+ pm_runtime_put(&thdev->dev); |
631 |
++ module_put(thdrv->driver.owner); |
632 |
++ } |
633 |
+ |
634 |
+ return ret; |
635 |
+ } |
636 |
+diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c |
637 |
+index c3cfacca2541..2de1f52f1b19 100644 |
638 |
+--- a/drivers/iio/adc/ti_am335x_adc.c |
639 |
++++ b/drivers/iio/adc/ti_am335x_adc.c |
640 |
+@@ -151,7 +151,9 @@ static irqreturn_t tiadc_irq_h(int irq, void *private) |
641 |
+ { |
642 |
+ struct iio_dev *indio_dev = private; |
643 |
+ struct tiadc_device *adc_dev = iio_priv(indio_dev); |
644 |
+- unsigned int status, config; |
645 |
++ unsigned int status, config, adc_fsm; |
646 |
++ unsigned short count = 0; |
647 |
++ |
648 |
+ status = tiadc_readl(adc_dev, REG_IRQSTATUS); |
649 |
+ |
650 |
+ /* |
651 |
+@@ -165,6 +167,15 @@ static irqreturn_t tiadc_irq_h(int irq, void *private) |
652 |
+ tiadc_writel(adc_dev, REG_CTRL, config); |
653 |
+ tiadc_writel(adc_dev, REG_IRQSTATUS, IRQENB_FIFO1OVRRUN |
654 |
+ | IRQENB_FIFO1UNDRFLW | IRQENB_FIFO1THRES); |
655 |
++ |
656 |
++ /* wait for idle state. |
657 |
++ * ADC needs to finish the current conversion |
658 |
++ * before disabling the module |
659 |
++ */ |
660 |
++ do { |
661 |
++ adc_fsm = tiadc_readl(adc_dev, REG_ADCFSM); |
662 |
++ } while (adc_fsm != 0x10 && count++ < 100); |
663 |
++ |
664 |
+ tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_TSCSSENB)); |
665 |
+ return IRQ_HANDLED; |
666 |
+ } else if (status & IRQENB_FIFO1THRES) { |
667 |
+diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c |
668 |
+index a3cce3a38300..ecf592d69043 100644 |
669 |
+--- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c |
670 |
++++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c |
671 |
+@@ -51,8 +51,6 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) |
672 |
+ st->report_state.report_id, |
673 |
+ st->report_state.index, |
674 |
+ HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM); |
675 |
+- |
676 |
+- poll_value = hid_sensor_read_poll_value(st); |
677 |
+ } else { |
678 |
+ int val; |
679 |
+ |
680 |
+@@ -89,7 +87,9 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) |
681 |
+ sensor_hub_get_feature(st->hsdev, st->power_state.report_id, |
682 |
+ st->power_state.index, |
683 |
+ sizeof(state_val), &state_val); |
684 |
+- if (state && poll_value) |
685 |
++ if (state) |
686 |
++ poll_value = hid_sensor_read_poll_value(st); |
687 |
++ if (poll_value > 0) |
688 |
+ msleep_interruptible(poll_value * 2); |
689 |
+ |
690 |
+ return 0; |
691 |
+diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c |
692 |
+index 217353145676..dd3fcd1704f8 100644 |
693 |
+--- a/drivers/iio/magnetometer/ak8974.c |
694 |
++++ b/drivers/iio/magnetometer/ak8974.c |
695 |
+@@ -767,7 +767,7 @@ static int ak8974_probe(struct i2c_client *i2c, |
696 |
+ return ret; |
697 |
+ } |
698 |
+ |
699 |
+-static int __exit ak8974_remove(struct i2c_client *i2c) |
700 |
++static int ak8974_remove(struct i2c_client *i2c) |
701 |
+ { |
702 |
+ struct iio_dev *indio_dev = i2c_get_clientdata(i2c); |
703 |
+ struct ak8974 *ak8974 = iio_priv(indio_dev); |
704 |
+@@ -849,7 +849,7 @@ static struct i2c_driver ak8974_driver = { |
705 |
+ .of_match_table = of_match_ptr(ak8974_of_match), |
706 |
+ }, |
707 |
+ .probe = ak8974_probe, |
708 |
+- .remove = __exit_p(ak8974_remove), |
709 |
++ .remove = ak8974_remove, |
710 |
+ .id_table = ak8974_id, |
711 |
+ }; |
712 |
+ module_i2c_driver(ak8974_driver); |
713 |
+diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c |
714 |
+index d96aa27dfcdc..db64adfbe1af 100644 |
715 |
+--- a/drivers/input/joystick/iforce/iforce-usb.c |
716 |
++++ b/drivers/input/joystick/iforce/iforce-usb.c |
717 |
+@@ -141,6 +141,9 @@ static int iforce_usb_probe(struct usb_interface *intf, |
718 |
+ |
719 |
+ interface = intf->cur_altsetting; |
720 |
+ |
721 |
++ if (interface->desc.bNumEndpoints < 2) |
722 |
++ return -ENODEV; |
723 |
++ |
724 |
+ epirq = &interface->endpoint[0].desc; |
725 |
+ epout = &interface->endpoint[1].desc; |
726 |
+ |
727 |
+diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c |
728 |
+index 9cc6d057c302..23c191a2a071 100644 |
729 |
+--- a/drivers/input/misc/cm109.c |
730 |
++++ b/drivers/input/misc/cm109.c |
731 |
+@@ -700,6 +700,10 @@ static int cm109_usb_probe(struct usb_interface *intf, |
732 |
+ int error = -ENOMEM; |
733 |
+ |
734 |
+ interface = intf->cur_altsetting; |
735 |
++ |
736 |
++ if (interface->desc.bNumEndpoints < 1) |
737 |
++ return -ENODEV; |
738 |
++ |
739 |
+ endpoint = &interface->endpoint[0].desc; |
740 |
+ |
741 |
+ if (!usb_endpoint_is_int_in(endpoint)) |
742 |
+diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c |
743 |
+index 9c0ea36913b4..f4e8fbec6a94 100644 |
744 |
+--- a/drivers/input/misc/ims-pcu.c |
745 |
++++ b/drivers/input/misc/ims-pcu.c |
746 |
+@@ -1667,6 +1667,10 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc |
747 |
+ return -EINVAL; |
748 |
+ |
749 |
+ alt = pcu->ctrl_intf->cur_altsetting; |
750 |
++ |
751 |
++ if (alt->desc.bNumEndpoints < 1) |
752 |
++ return -ENODEV; |
753 |
++ |
754 |
+ pcu->ep_ctrl = &alt->endpoint[0].desc; |
755 |
+ pcu->max_ctrl_size = usb_endpoint_maxp(pcu->ep_ctrl); |
756 |
+ |
757 |
+diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c |
758 |
+index 79c964c075f1..6e7ff9561d92 100644 |
759 |
+--- a/drivers/input/misc/yealink.c |
760 |
++++ b/drivers/input/misc/yealink.c |
761 |
+@@ -875,6 +875,10 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) |
762 |
+ int ret, pipe, i; |
763 |
+ |
764 |
+ interface = intf->cur_altsetting; |
765 |
++ |
766 |
++ if (interface->desc.bNumEndpoints < 1) |
767 |
++ return -ENODEV; |
768 |
++ |
769 |
+ endpoint = &interface->endpoint[0].desc; |
770 |
+ if (!usb_endpoint_is_int_in(endpoint)) |
771 |
+ return -ENODEV; |
772 |
+diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c |
773 |
+index b93fe83a0b63..518e8a7bd5f9 100644 |
774 |
+--- a/drivers/input/mouse/alps.c |
775 |
++++ b/drivers/input/mouse/alps.c |
776 |
+@@ -1290,10 +1290,8 @@ static int alps_decode_ss4_v2(struct alps_fields *f, |
777 |
+ /* handle buttons */ |
778 |
+ if (pkt_id == SS4_PACKET_ID_STICK) { |
779 |
+ f->ts_left = !!(SS4_BTN_V2(p) & 0x01); |
780 |
+- if (!(priv->flags & ALPS_BUTTONPAD)) { |
781 |
+- f->ts_right = !!(SS4_BTN_V2(p) & 0x02); |
782 |
+- f->ts_middle = !!(SS4_BTN_V2(p) & 0x04); |
783 |
+- } |
784 |
++ f->ts_right = !!(SS4_BTN_V2(p) & 0x02); |
785 |
++ f->ts_middle = !!(SS4_BTN_V2(p) & 0x04); |
786 |
+ } else { |
787 |
+ f->left = !!(SS4_BTN_V2(p) & 0x01); |
788 |
+ if (!(priv->flags & ALPS_BUTTONPAD)) { |
789 |
+@@ -2461,14 +2459,34 @@ static int alps_update_device_area_ss4_v2(unsigned char otp[][4], |
790 |
+ int num_y_electrode; |
791 |
+ int x_pitch, y_pitch, x_phys, y_phys; |
792 |
+ |
793 |
+- num_x_electrode = SS4_NUMSENSOR_XOFFSET + (otp[1][0] & 0x0F); |
794 |
+- num_y_electrode = SS4_NUMSENSOR_YOFFSET + ((otp[1][0] >> 4) & 0x0F); |
795 |
++ if (IS_SS4PLUS_DEV(priv->dev_id)) { |
796 |
++ num_x_electrode = |
797 |
++ SS4PLUS_NUMSENSOR_XOFFSET + (otp[0][2] & 0x0F); |
798 |
++ num_y_electrode = |
799 |
++ SS4PLUS_NUMSENSOR_YOFFSET + ((otp[0][2] >> 4) & 0x0F); |
800 |
++ |
801 |
++ priv->x_max = |
802 |
++ (num_x_electrode - 1) * SS4PLUS_COUNT_PER_ELECTRODE; |
803 |
++ priv->y_max = |
804 |
++ (num_y_electrode - 1) * SS4PLUS_COUNT_PER_ELECTRODE; |
805 |
+ |
806 |
+- priv->x_max = (num_x_electrode - 1) * SS4_COUNT_PER_ELECTRODE; |
807 |
+- priv->y_max = (num_y_electrode - 1) * SS4_COUNT_PER_ELECTRODE; |
808 |
++ x_pitch = (otp[0][1] & 0x0F) + SS4PLUS_MIN_PITCH_MM; |
809 |
++ y_pitch = ((otp[0][1] >> 4) & 0x0F) + SS4PLUS_MIN_PITCH_MM; |
810 |
+ |
811 |
+- x_pitch = ((otp[1][2] >> 2) & 0x07) + SS4_MIN_PITCH_MM; |
812 |
+- y_pitch = ((otp[1][2] >> 5) & 0x07) + SS4_MIN_PITCH_MM; |
813 |
++ } else { |
814 |
++ num_x_electrode = |
815 |
++ SS4_NUMSENSOR_XOFFSET + (otp[1][0] & 0x0F); |
816 |
++ num_y_electrode = |
817 |
++ SS4_NUMSENSOR_YOFFSET + ((otp[1][0] >> 4) & 0x0F); |
818 |
++ |
819 |
++ priv->x_max = |
820 |
++ (num_x_electrode - 1) * SS4_COUNT_PER_ELECTRODE; |
821 |
++ priv->y_max = |
822 |
++ (num_y_electrode - 1) * SS4_COUNT_PER_ELECTRODE; |
823 |
++ |
824 |
++ x_pitch = ((otp[1][2] >> 2) & 0x07) + SS4_MIN_PITCH_MM; |
825 |
++ y_pitch = ((otp[1][2] >> 5) & 0x07) + SS4_MIN_PITCH_MM; |
826 |
++ } |
827 |
+ |
828 |
+ x_phys = x_pitch * (num_x_electrode - 1); /* In 0.1 mm units */ |
829 |
+ y_phys = y_pitch * (num_y_electrode - 1); /* In 0.1 mm units */ |
830 |
+@@ -2484,7 +2502,10 @@ static int alps_update_btn_info_ss4_v2(unsigned char otp[][4], |
831 |
+ { |
832 |
+ unsigned char is_btnless; |
833 |
+ |
834 |
+- is_btnless = (otp[1][1] >> 3) & 0x01; |
835 |
++ if (IS_SS4PLUS_DEV(priv->dev_id)) |
836 |
++ is_btnless = (otp[1][0] >> 1) & 0x01; |
837 |
++ else |
838 |
++ is_btnless = (otp[1][1] >> 3) & 0x01; |
839 |
+ |
840 |
+ if (is_btnless) |
841 |
+ priv->flags |= ALPS_BUTTONPAD; |
842 |
+@@ -2492,6 +2513,21 @@ static int alps_update_btn_info_ss4_v2(unsigned char otp[][4], |
843 |
+ return 0; |
844 |
+ } |
845 |
+ |
846 |
++static int alps_update_dual_info_ss4_v2(unsigned char otp[][4], |
847 |
++ struct alps_data *priv) |
848 |
++{ |
849 |
++ bool is_dual = false; |
850 |
++ |
851 |
++ if (IS_SS4PLUS_DEV(priv->dev_id)) |
852 |
++ is_dual = (otp[0][0] >> 4) & 0x01; |
853 |
++ |
854 |
++ if (is_dual) |
855 |
++ priv->flags |= ALPS_DUALPOINT | |
856 |
++ ALPS_DUALPOINT_WITH_PRESSURE; |
857 |
++ |
858 |
++ return 0; |
859 |
++} |
860 |
++ |
861 |
+ static int alps_set_defaults_ss4_v2(struct psmouse *psmouse, |
862 |
+ struct alps_data *priv) |
863 |
+ { |
864 |
+@@ -2507,6 +2543,8 @@ static int alps_set_defaults_ss4_v2(struct psmouse *psmouse, |
865 |
+ |
866 |
+ alps_update_btn_info_ss4_v2(otp, priv); |
867 |
+ |
868 |
++ alps_update_dual_info_ss4_v2(otp, priv); |
869 |
++ |
870 |
+ return 0; |
871 |
+ } |
872 |
+ |
873 |
+@@ -2752,10 +2790,6 @@ static int alps_set_protocol(struct psmouse *psmouse, |
874 |
+ if (alps_set_defaults_ss4_v2(psmouse, priv)) |
875 |
+ return -EIO; |
876 |
+ |
877 |
+- if (priv->fw_ver[1] == 0x1) |
878 |
+- priv->flags |= ALPS_DUALPOINT | |
879 |
+- ALPS_DUALPOINT_WITH_PRESSURE; |
880 |
+- |
881 |
+ break; |
882 |
+ } |
883 |
+ |
884 |
+@@ -2826,10 +2860,7 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv) |
885 |
+ ec[2] >= 0x90 && ec[2] <= 0x9d) { |
886 |
+ protocol = &alps_v3_protocol_data; |
887 |
+ } else if (e7[0] == 0x73 && e7[1] == 0x03 && |
888 |
+- e7[2] == 0x14 && ec[1] == 0x02) { |
889 |
+- protocol = &alps_v8_protocol_data; |
890 |
+- } else if (e7[0] == 0x73 && e7[1] == 0x03 && |
891 |
+- e7[2] == 0x28 && ec[1] == 0x01) { |
892 |
++ (e7[2] == 0x14 || e7[2] == 0x28)) { |
893 |
+ protocol = &alps_v8_protocol_data; |
894 |
+ } else { |
895 |
+ psmouse_dbg(psmouse, |
896 |
+@@ -2839,7 +2870,8 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv) |
897 |
+ } |
898 |
+ |
899 |
+ if (priv) { |
900 |
+- /* Save the Firmware version */ |
901 |
++ /* Save Device ID and Firmware version */ |
902 |
++ memcpy(priv->dev_id, e7, 3); |
903 |
+ memcpy(priv->fw_ver, ec, 3); |
904 |
+ error = alps_set_protocol(psmouse, priv, protocol); |
905 |
+ if (error) |
906 |
+diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h |
907 |
+index b9417e2d7ad3..dbfd26073e1a 100644 |
908 |
+--- a/drivers/input/mouse/alps.h |
909 |
++++ b/drivers/input/mouse/alps.h |
910 |
+@@ -54,6 +54,16 @@ enum SS4_PACKET_ID { |
911 |
+ |
912 |
+ #define SS4_MASK_NORMAL_BUTTONS 0x07 |
913 |
+ |
914 |
++#define SS4PLUS_COUNT_PER_ELECTRODE 128 |
915 |
++#define SS4PLUS_NUMSENSOR_XOFFSET 16 |
916 |
++#define SS4PLUS_NUMSENSOR_YOFFSET 5 |
917 |
++#define SS4PLUS_MIN_PITCH_MM 37 |
918 |
++ |
919 |
++#define IS_SS4PLUS_DEV(_b) (((_b[0]) == 0x73) && \ |
920 |
++ ((_b[1]) == 0x03) && \ |
921 |
++ ((_b[2]) == 0x28) \ |
922 |
++ ) |
923 |
++ |
924 |
+ #define SS4_1F_X_V2(_b) ((_b[0] & 0x0007) | \ |
925 |
+ ((_b[1] << 3) & 0x0078) | \ |
926 |
+ ((_b[1] << 2) & 0x0380) | \ |
927 |
+@@ -263,6 +273,7 @@ struct alps_data { |
928 |
+ int addr_command; |
929 |
+ u16 proto_version; |
930 |
+ u8 byte0, mask0; |
931 |
++ u8 dev_id[3]; |
932 |
+ u8 fw_ver[3]; |
933 |
+ int flags; |
934 |
+ int x_max; |
935 |
+diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c |
936 |
+index ed1935f300a7..da5458dfb1e3 100644 |
937 |
+--- a/drivers/input/mouse/elan_i2c_core.c |
938 |
++++ b/drivers/input/mouse/elan_i2c_core.c |
939 |
+@@ -218,17 +218,19 @@ static int elan_query_product(struct elan_tp_data *data) |
940 |
+ |
941 |
+ static int elan_check_ASUS_special_fw(struct elan_tp_data *data) |
942 |
+ { |
943 |
+- if (data->ic_type != 0x0E) |
944 |
+- return false; |
945 |
+- |
946 |
+- switch (data->product_id) { |
947 |
+- case 0x05 ... 0x07: |
948 |
+- case 0x09: |
949 |
+- case 0x13: |
950 |
++ if (data->ic_type == 0x0E) { |
951 |
++ switch (data->product_id) { |
952 |
++ case 0x05 ... 0x07: |
953 |
++ case 0x09: |
954 |
++ case 0x13: |
955 |
++ return true; |
956 |
++ } |
957 |
++ } else if (data->ic_type == 0x08 && data->product_id == 0x26) { |
958 |
++ /* ASUS EeeBook X205TA */ |
959 |
+ return true; |
960 |
+- default: |
961 |
+- return false; |
962 |
+ } |
963 |
++ |
964 |
++ return false; |
965 |
+ } |
966 |
+ |
967 |
+ static int __elan_initialize(struct elan_tp_data *data) |
968 |
+diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h |
969 |
+index 0cdd95801a25..25eab453f2b2 100644 |
970 |
+--- a/drivers/input/serio/i8042-x86ia64io.h |
971 |
++++ b/drivers/input/serio/i8042-x86ia64io.h |
972 |
+@@ -120,6 +120,13 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = { |
973 |
+ }, |
974 |
+ }, |
975 |
+ { |
976 |
++ /* Dell Embedded Box PC 3000 */ |
977 |
++ .matches = { |
978 |
++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), |
979 |
++ DMI_MATCH(DMI_PRODUCT_NAME, "Embedded Box PC 3000"), |
980 |
++ }, |
981 |
++ }, |
982 |
++ { |
983 |
+ /* OQO Model 01 */ |
984 |
+ .matches = { |
985 |
+ DMI_MATCH(DMI_SYS_VENDOR, "OQO"), |
986 |
+diff --git a/drivers/input/tablet/hanwang.c b/drivers/input/tablet/hanwang.c |
987 |
+index cd852059b99e..df4bea96d7ed 100644 |
988 |
+--- a/drivers/input/tablet/hanwang.c |
989 |
++++ b/drivers/input/tablet/hanwang.c |
990 |
+@@ -340,6 +340,9 @@ static int hanwang_probe(struct usb_interface *intf, const struct usb_device_id |
991 |
+ int error; |
992 |
+ int i; |
993 |
+ |
994 |
++ if (intf->cur_altsetting->desc.bNumEndpoints < 1) |
995 |
++ return -ENODEV; |
996 |
++ |
997 |
+ hanwang = kzalloc(sizeof(struct hanwang), GFP_KERNEL); |
998 |
+ input_dev = input_allocate_device(); |
999 |
+ if (!hanwang || !input_dev) { |
1000 |
+diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c |
1001 |
+index e850d7e8afbc..4d9d64908b59 100644 |
1002 |
+--- a/drivers/input/tablet/kbtab.c |
1003 |
++++ b/drivers/input/tablet/kbtab.c |
1004 |
+@@ -122,6 +122,9 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i |
1005 |
+ struct input_dev *input_dev; |
1006 |
+ int error = -ENOMEM; |
1007 |
+ |
1008 |
++ if (intf->cur_altsetting->desc.bNumEndpoints < 1) |
1009 |
++ return -ENODEV; |
1010 |
++ |
1011 |
+ kbtab = kzalloc(sizeof(struct kbtab), GFP_KERNEL); |
1012 |
+ input_dev = input_allocate_device(); |
1013 |
+ if (!kbtab || !input_dev) |
1014 |
+diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c |
1015 |
+index aefb6e11f88a..4c0eecae065c 100644 |
1016 |
+--- a/drivers/input/touchscreen/sur40.c |
1017 |
++++ b/drivers/input/touchscreen/sur40.c |
1018 |
+@@ -527,6 +527,9 @@ static int sur40_probe(struct usb_interface *interface, |
1019 |
+ if (iface_desc->desc.bInterfaceClass != 0xFF) |
1020 |
+ return -ENODEV; |
1021 |
+ |
1022 |
++ if (iface_desc->desc.bNumEndpoints < 5) |
1023 |
++ return -ENODEV; |
1024 |
++ |
1025 |
+ /* Use endpoint #4 (0x86). */ |
1026 |
+ endpoint = &iface_desc->endpoint[4].desc; |
1027 |
+ if (endpoint->bEndpointAddress != TOUCH_ENDPOINT) |
1028 |
+diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c |
1029 |
+index 34be95ee9038..b9e50c10213b 100644 |
1030 |
+--- a/drivers/iommu/intel-iommu.c |
1031 |
++++ b/drivers/iommu/intel-iommu.c |
1032 |
+@@ -915,7 +915,7 @@ static struct intel_iommu *device_to_iommu(struct device *dev, u8 *bus, u8 *devf |
1033 |
+ * which we used for the IOMMU lookup. Strictly speaking |
1034 |
+ * we could do this for all PCI devices; we only need to |
1035 |
+ * get the BDF# from the scope table for ACPI matches. */ |
1036 |
+- if (pdev->is_virtfn) |
1037 |
++ if (pdev && pdev->is_virtfn) |
1038 |
+ goto got_pdev; |
1039 |
+ |
1040 |
+ *bus = drhd->devices[i].bus; |
1041 |
+diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c |
1042 |
+index 410a55b1c25f..1cfd7f900339 100644 |
1043 |
+--- a/drivers/mmc/host/sdhci-of-arasan.c |
1044 |
++++ b/drivers/mmc/host/sdhci-of-arasan.c |
1045 |
+@@ -28,13 +28,9 @@ |
1046 |
+ #include "sdhci-pltfm.h" |
1047 |
+ #include <linux/of.h> |
1048 |
+ |
1049 |
+-#define SDHCI_ARASAN_CLK_CTRL_OFFSET 0x2c |
1050 |
+ #define SDHCI_ARASAN_VENDOR_REGISTER 0x78 |
1051 |
+ |
1052 |
+ #define VENDOR_ENHANCED_STROBE BIT(0) |
1053 |
+-#define CLK_CTRL_TIMEOUT_SHIFT 16 |
1054 |
+-#define CLK_CTRL_TIMEOUT_MASK (0xf << CLK_CTRL_TIMEOUT_SHIFT) |
1055 |
+-#define CLK_CTRL_TIMEOUT_MIN_EXP 13 |
1056 |
+ |
1057 |
+ #define PHY_CLK_TOO_SLOW_HZ 400000 |
1058 |
+ |
1059 |
+@@ -163,15 +159,15 @@ static int sdhci_arasan_syscon_write(struct sdhci_host *host, |
1060 |
+ |
1061 |
+ static unsigned int sdhci_arasan_get_timeout_clock(struct sdhci_host *host) |
1062 |
+ { |
1063 |
+- u32 div; |
1064 |
+ unsigned long freq; |
1065 |
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); |
1066 |
+ |
1067 |
+- div = readl(host->ioaddr + SDHCI_ARASAN_CLK_CTRL_OFFSET); |
1068 |
+- div = (div & CLK_CTRL_TIMEOUT_MASK) >> CLK_CTRL_TIMEOUT_SHIFT; |
1069 |
++ /* SDHCI timeout clock is in kHz */ |
1070 |
++ freq = DIV_ROUND_UP(clk_get_rate(pltfm_host->clk), 1000); |
1071 |
+ |
1072 |
+- freq = clk_get_rate(pltfm_host->clk); |
1073 |
+- freq /= 1 << (CLK_CTRL_TIMEOUT_MIN_EXP + div); |
1074 |
++ /* or in MHz */ |
1075 |
++ if (host->caps & SDHCI_TIMEOUT_CLK_UNIT) |
1076 |
++ freq = DIV_ROUND_UP(freq, 1000); |
1077 |
+ |
1078 |
+ return freq; |
1079 |
+ } |
1080 |
+diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c |
1081 |
+index a9b7fc06c434..387ae1cbf698 100644 |
1082 |
+--- a/drivers/mmc/host/sdhci-of-at91.c |
1083 |
++++ b/drivers/mmc/host/sdhci-of-at91.c |
1084 |
+@@ -85,11 +85,30 @@ static void sdhci_at91_set_clock(struct sdhci_host *host, unsigned int clock) |
1085 |
+ sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); |
1086 |
+ } |
1087 |
+ |
1088 |
++/* |
1089 |
++ * In this specific implementation of the SDHCI controller, the power register |
1090 |
++ * needs to have a valid voltage set even when the power supply is managed by |
1091 |
++ * an external regulator. |
1092 |
++ */ |
1093 |
++static void sdhci_at91_set_power(struct sdhci_host *host, unsigned char mode, |
1094 |
++ unsigned short vdd) |
1095 |
++{ |
1096 |
++ if (!IS_ERR(host->mmc->supply.vmmc)) { |
1097 |
++ struct mmc_host *mmc = host->mmc; |
1098 |
++ |
1099 |
++ spin_unlock_irq(&host->lock); |
1100 |
++ mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); |
1101 |
++ spin_lock_irq(&host->lock); |
1102 |
++ } |
1103 |
++ sdhci_set_power_noreg(host, mode, vdd); |
1104 |
++} |
1105 |
++ |
1106 |
+ static const struct sdhci_ops sdhci_at91_sama5d2_ops = { |
1107 |
+ .set_clock = sdhci_at91_set_clock, |
1108 |
+ .set_bus_width = sdhci_set_bus_width, |
1109 |
+ .reset = sdhci_reset, |
1110 |
+ .set_uhs_signaling = sdhci_set_uhs_signaling, |
1111 |
++ .set_power = sdhci_at91_set_power, |
1112 |
+ }; |
1113 |
+ |
1114 |
+ static const struct sdhci_pltfm_data soc_data_sama5d2 = { |
1115 |
+diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c |
1116 |
+index 1d9e00a00e9f..b0b9ceb0ab01 100644 |
1117 |
+--- a/drivers/mmc/host/sdhci-pci-core.c |
1118 |
++++ b/drivers/mmc/host/sdhci-pci-core.c |
1119 |
+@@ -412,6 +412,8 @@ static void sdhci_intel_set_power(struct sdhci_host *host, unsigned char mode, |
1120 |
+ if (mode == MMC_POWER_OFF) |
1121 |
+ return; |
1122 |
+ |
1123 |
++ spin_unlock_irq(&host->lock); |
1124 |
++ |
1125 |
+ /* |
1126 |
+ * Bus power might not enable after D3 -> D0 transition due to the |
1127 |
+ * present state not yet having propagated. Retry for up to 2ms. |
1128 |
+@@ -424,6 +426,8 @@ static void sdhci_intel_set_power(struct sdhci_host *host, unsigned char mode, |
1129 |
+ reg |= SDHCI_POWER_ON; |
1130 |
+ sdhci_writeb(host, reg, SDHCI_POWER_CONTROL); |
1131 |
+ } |
1132 |
++ |
1133 |
++ spin_lock_irq(&host->lock); |
1134 |
+ } |
1135 |
+ |
1136 |
+ static const struct sdhci_ops sdhci_intel_byt_ops = { |
1137 |
+diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c |
1138 |
+index ba637ff8aa7e..a983ba0349fb 100644 |
1139 |
+--- a/drivers/mmc/host/sdhci.c |
1140 |
++++ b/drivers/mmc/host/sdhci.c |
1141 |
+@@ -1371,7 +1371,9 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) |
1142 |
+ return; |
1143 |
+ } |
1144 |
+ timeout--; |
1145 |
+- mdelay(1); |
1146 |
++ spin_unlock_irq(&host->lock); |
1147 |
++ usleep_range(900, 1100); |
1148 |
++ spin_lock_irq(&host->lock); |
1149 |
+ } |
1150 |
+ |
1151 |
+ clk |= SDHCI_CLOCK_CARD_EN; |
1152 |
+diff --git a/drivers/mmc/host/ushc.c b/drivers/mmc/host/ushc.c |
1153 |
+index d2c386f09d69..1d843357422e 100644 |
1154 |
+--- a/drivers/mmc/host/ushc.c |
1155 |
++++ b/drivers/mmc/host/ushc.c |
1156 |
+@@ -426,6 +426,9 @@ static int ushc_probe(struct usb_interface *intf, const struct usb_device_id *id |
1157 |
+ struct ushc_data *ushc; |
1158 |
+ int ret; |
1159 |
+ |
1160 |
++ if (intf->cur_altsetting->desc.bNumEndpoints < 1) |
1161 |
++ return -ENODEV; |
1162 |
++ |
1163 |
+ mmc = mmc_alloc_host(sizeof(struct ushc_data), &intf->dev); |
1164 |
+ if (mmc == NULL) |
1165 |
+ return -ENOMEM; |
1166 |
+diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-common.h b/drivers/net/ethernet/amd/xgbe/xgbe-common.h |
1167 |
+index bbef95973c27..1592e1cc77ce 100644 |
1168 |
+--- a/drivers/net/ethernet/amd/xgbe/xgbe-common.h |
1169 |
++++ b/drivers/net/ethernet/amd/xgbe/xgbe-common.h |
1170 |
+@@ -917,8 +917,8 @@ |
1171 |
+ #define RX_PACKET_ATTRIBUTES_CSUM_DONE_WIDTH 1 |
1172 |
+ #define RX_PACKET_ATTRIBUTES_VLAN_CTAG_INDEX 1 |
1173 |
+ #define RX_PACKET_ATTRIBUTES_VLAN_CTAG_WIDTH 1 |
1174 |
+-#define RX_PACKET_ATTRIBUTES_INCOMPLETE_INDEX 2 |
1175 |
+-#define RX_PACKET_ATTRIBUTES_INCOMPLETE_WIDTH 1 |
1176 |
++#define RX_PACKET_ATTRIBUTES_LAST_INDEX 2 |
1177 |
++#define RX_PACKET_ATTRIBUTES_LAST_WIDTH 1 |
1178 |
+ #define RX_PACKET_ATTRIBUTES_CONTEXT_NEXT_INDEX 3 |
1179 |
+ #define RX_PACKET_ATTRIBUTES_CONTEXT_NEXT_WIDTH 1 |
1180 |
+ #define RX_PACKET_ATTRIBUTES_CONTEXT_INDEX 4 |
1181 |
+@@ -927,6 +927,8 @@ |
1182 |
+ #define RX_PACKET_ATTRIBUTES_RX_TSTAMP_WIDTH 1 |
1183 |
+ #define RX_PACKET_ATTRIBUTES_RSS_HASH_INDEX 6 |
1184 |
+ #define RX_PACKET_ATTRIBUTES_RSS_HASH_WIDTH 1 |
1185 |
++#define RX_PACKET_ATTRIBUTES_FIRST_INDEX 7 |
1186 |
++#define RX_PACKET_ATTRIBUTES_FIRST_WIDTH 1 |
1187 |
+ |
1188 |
+ #define RX_NORMAL_DESC0_OVT_INDEX 0 |
1189 |
+ #define RX_NORMAL_DESC0_OVT_WIDTH 16 |
1190 |
+diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c |
1191 |
+index 1babcc11a248..ca106d4275cc 100644 |
1192 |
+--- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c |
1193 |
++++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c |
1194 |
+@@ -1721,10 +1721,15 @@ static int xgbe_dev_read(struct xgbe_channel *channel) |
1195 |
+ |
1196 |
+ /* Get the header length */ |
1197 |
+ if (XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, FD)) { |
1198 |
++ XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, |
1199 |
++ FIRST, 1); |
1200 |
+ rdata->rx.hdr_len = XGMAC_GET_BITS_LE(rdesc->desc2, |
1201 |
+ RX_NORMAL_DESC2, HL); |
1202 |
+ if (rdata->rx.hdr_len) |
1203 |
+ pdata->ext_stats.rx_split_header_packets++; |
1204 |
++ } else { |
1205 |
++ XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, |
1206 |
++ FIRST, 0); |
1207 |
+ } |
1208 |
+ |
1209 |
+ /* Get the RSS hash */ |
1210 |
+@@ -1747,19 +1752,16 @@ static int xgbe_dev_read(struct xgbe_channel *channel) |
1211 |
+ } |
1212 |
+ } |
1213 |
+ |
1214 |
+- /* Get the packet length */ |
1215 |
+- rdata->rx.len = XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, PL); |
1216 |
+- |
1217 |
+- if (!XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, LD)) { |
1218 |
+- /* Not all the data has been transferred for this packet */ |
1219 |
+- XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, |
1220 |
+- INCOMPLETE, 1); |
1221 |
++ /* Not all the data has been transferred for this packet */ |
1222 |
++ if (!XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, LD)) |
1223 |
+ return 0; |
1224 |
+- } |
1225 |
+ |
1226 |
+ /* This is the last of the data for this packet */ |
1227 |
+ XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, |
1228 |
+- INCOMPLETE, 0); |
1229 |
++ LAST, 1); |
1230 |
++ |
1231 |
++ /* Get the packet length */ |
1232 |
++ rdata->rx.len = XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, PL); |
1233 |
+ |
1234 |
+ /* Set checksum done indicator as appropriate */ |
1235 |
+ if (netdev->features & NETIF_F_RXCSUM) |
1236 |
+diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c |
1237 |
+index 7f9216db026f..0f0f30149e5a 100644 |
1238 |
+--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c |
1239 |
++++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c |
1240 |
+@@ -1752,13 +1752,12 @@ static struct sk_buff *xgbe_create_skb(struct xgbe_prv_data *pdata, |
1241 |
+ { |
1242 |
+ struct sk_buff *skb; |
1243 |
+ u8 *packet; |
1244 |
+- unsigned int copy_len; |
1245 |
+ |
1246 |
+ skb = napi_alloc_skb(napi, rdata->rx.hdr.dma_len); |
1247 |
+ if (!skb) |
1248 |
+ return NULL; |
1249 |
+ |
1250 |
+- /* Start with the header buffer which may contain just the header |
1251 |
++ /* Pull in the header buffer which may contain just the header |
1252 |
+ * or the header plus data |
1253 |
+ */ |
1254 |
+ dma_sync_single_range_for_cpu(pdata->dev, rdata->rx.hdr.dma_base, |
1255 |
+@@ -1767,30 +1766,49 @@ static struct sk_buff *xgbe_create_skb(struct xgbe_prv_data *pdata, |
1256 |
+ |
1257 |
+ packet = page_address(rdata->rx.hdr.pa.pages) + |
1258 |
+ rdata->rx.hdr.pa.pages_offset; |
1259 |
+- copy_len = (rdata->rx.hdr_len) ? rdata->rx.hdr_len : len; |
1260 |
+- copy_len = min(rdata->rx.hdr.dma_len, copy_len); |
1261 |
+- skb_copy_to_linear_data(skb, packet, copy_len); |
1262 |
+- skb_put(skb, copy_len); |
1263 |
+- |
1264 |
+- len -= copy_len; |
1265 |
+- if (len) { |
1266 |
+- /* Add the remaining data as a frag */ |
1267 |
+- dma_sync_single_range_for_cpu(pdata->dev, |
1268 |
+- rdata->rx.buf.dma_base, |
1269 |
+- rdata->rx.buf.dma_off, |
1270 |
+- rdata->rx.buf.dma_len, |
1271 |
+- DMA_FROM_DEVICE); |
1272 |
+- |
1273 |
+- skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, |
1274 |
+- rdata->rx.buf.pa.pages, |
1275 |
+- rdata->rx.buf.pa.pages_offset, |
1276 |
+- len, rdata->rx.buf.dma_len); |
1277 |
+- rdata->rx.buf.pa.pages = NULL; |
1278 |
+- } |
1279 |
++ skb_copy_to_linear_data(skb, packet, len); |
1280 |
++ skb_put(skb, len); |
1281 |
+ |
1282 |
+ return skb; |
1283 |
+ } |
1284 |
+ |
1285 |
++static unsigned int xgbe_rx_buf1_len(struct xgbe_ring_data *rdata, |
1286 |
++ struct xgbe_packet_data *packet) |
1287 |
++{ |
1288 |
++ /* Always zero if not the first descriptor */ |
1289 |
++ if (!XGMAC_GET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, FIRST)) |
1290 |
++ return 0; |
1291 |
++ |
1292 |
++ /* First descriptor with split header, return header length */ |
1293 |
++ if (rdata->rx.hdr_len) |
1294 |
++ return rdata->rx.hdr_len; |
1295 |
++ |
1296 |
++ /* First descriptor but not the last descriptor and no split header, |
1297 |
++ * so the full buffer was used |
1298 |
++ */ |
1299 |
++ if (!XGMAC_GET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, LAST)) |
1300 |
++ return rdata->rx.hdr.dma_len; |
1301 |
++ |
1302 |
++ /* First descriptor and last descriptor and no split header, so |
1303 |
++ * calculate how much of the buffer was used |
1304 |
++ */ |
1305 |
++ return min_t(unsigned int, rdata->rx.hdr.dma_len, rdata->rx.len); |
1306 |
++} |
1307 |
++ |
1308 |
++static unsigned int xgbe_rx_buf2_len(struct xgbe_ring_data *rdata, |
1309 |
++ struct xgbe_packet_data *packet, |
1310 |
++ unsigned int len) |
1311 |
++{ |
1312 |
++ /* Always the full buffer if not the last descriptor */ |
1313 |
++ if (!XGMAC_GET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, LAST)) |
1314 |
++ return rdata->rx.buf.dma_len; |
1315 |
++ |
1316 |
++ /* Last descriptor so calculate how much of the buffer was used |
1317 |
++ * for the last bit of data |
1318 |
++ */ |
1319 |
++ return rdata->rx.len - len; |
1320 |
++} |
1321 |
++ |
1322 |
+ static int xgbe_tx_poll(struct xgbe_channel *channel) |
1323 |
+ { |
1324 |
+ struct xgbe_prv_data *pdata = channel->pdata; |
1325 |
+@@ -1873,8 +1891,8 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) |
1326 |
+ struct napi_struct *napi; |
1327 |
+ struct sk_buff *skb; |
1328 |
+ struct skb_shared_hwtstamps *hwtstamps; |
1329 |
+- unsigned int incomplete, error, context_next, context; |
1330 |
+- unsigned int len, rdesc_len, max_len; |
1331 |
++ unsigned int last, error, context_next, context; |
1332 |
++ unsigned int len, buf1_len, buf2_len, max_len; |
1333 |
+ unsigned int received = 0; |
1334 |
+ int packet_count = 0; |
1335 |
+ |
1336 |
+@@ -1884,7 +1902,7 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) |
1337 |
+ if (!ring) |
1338 |
+ return 0; |
1339 |
+ |
1340 |
+- incomplete = 0; |
1341 |
++ last = 0; |
1342 |
+ context_next = 0; |
1343 |
+ |
1344 |
+ napi = (pdata->per_channel_irq) ? &channel->napi : &pdata->napi; |
1345 |
+@@ -1918,9 +1936,8 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) |
1346 |
+ received++; |
1347 |
+ ring->cur++; |
1348 |
+ |
1349 |
+- incomplete = XGMAC_GET_BITS(packet->attributes, |
1350 |
+- RX_PACKET_ATTRIBUTES, |
1351 |
+- INCOMPLETE); |
1352 |
++ last = XGMAC_GET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, |
1353 |
++ LAST); |
1354 |
+ context_next = XGMAC_GET_BITS(packet->attributes, |
1355 |
+ RX_PACKET_ATTRIBUTES, |
1356 |
+ CONTEXT_NEXT); |
1357 |
+@@ -1929,7 +1946,7 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) |
1358 |
+ CONTEXT); |
1359 |
+ |
1360 |
+ /* Earlier error, just drain the remaining data */ |
1361 |
+- if ((incomplete || context_next) && error) |
1362 |
++ if ((!last || context_next) && error) |
1363 |
+ goto read_again; |
1364 |
+ |
1365 |
+ if (error || packet->errors) { |
1366 |
+@@ -1941,16 +1958,22 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) |
1367 |
+ } |
1368 |
+ |
1369 |
+ if (!context) { |
1370 |
+- /* Length is cumulative, get this descriptor's length */ |
1371 |
+- rdesc_len = rdata->rx.len - len; |
1372 |
+- len += rdesc_len; |
1373 |
++ /* Get the data length in the descriptor buffers */ |
1374 |
++ buf1_len = xgbe_rx_buf1_len(rdata, packet); |
1375 |
++ len += buf1_len; |
1376 |
++ buf2_len = xgbe_rx_buf2_len(rdata, packet, len); |
1377 |
++ len += buf2_len; |
1378 |
+ |
1379 |
+- if (rdesc_len && !skb) { |
1380 |
++ if (!skb) { |
1381 |
+ skb = xgbe_create_skb(pdata, napi, rdata, |
1382 |
+- rdesc_len); |
1383 |
+- if (!skb) |
1384 |
++ buf1_len); |
1385 |
++ if (!skb) { |
1386 |
+ error = 1; |
1387 |
+- } else if (rdesc_len) { |
1388 |
++ goto skip_data; |
1389 |
++ } |
1390 |
++ } |
1391 |
++ |
1392 |
++ if (buf2_len) { |
1393 |
+ dma_sync_single_range_for_cpu(pdata->dev, |
1394 |
+ rdata->rx.buf.dma_base, |
1395 |
+ rdata->rx.buf.dma_off, |
1396 |
+@@ -1960,13 +1983,14 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) |
1397 |
+ skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, |
1398 |
+ rdata->rx.buf.pa.pages, |
1399 |
+ rdata->rx.buf.pa.pages_offset, |
1400 |
+- rdesc_len, |
1401 |
++ buf2_len, |
1402 |
+ rdata->rx.buf.dma_len); |
1403 |
+ rdata->rx.buf.pa.pages = NULL; |
1404 |
+ } |
1405 |
+ } |
1406 |
+ |
1407 |
+- if (incomplete || context_next) |
1408 |
++skip_data: |
1409 |
++ if (!last || context_next) |
1410 |
+ goto read_again; |
1411 |
+ |
1412 |
+ if (!skb) |
1413 |
+@@ -2024,7 +2048,7 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) |
1414 |
+ } |
1415 |
+ |
1416 |
+ /* Check if we need to save state before leaving */ |
1417 |
+- if (received && (incomplete || context_next)) { |
1418 |
++ if (received && (!last || context_next)) { |
1419 |
+ rdata = XGBE_GET_DESC_DATA(ring, ring->cur); |
1420 |
+ rdata->state_saved = 1; |
1421 |
+ rdata->state.skb = skb; |
1422 |
+diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
1423 |
+index a4e60e56c14f..0975af2903ef 100644 |
1424 |
+--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
1425 |
++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
1426 |
+@@ -3402,7 +3402,8 @@ static int bcmgenet_suspend(struct device *d) |
1427 |
+ |
1428 |
+ bcmgenet_netif_stop(dev); |
1429 |
+ |
1430 |
+- phy_suspend(priv->phydev); |
1431 |
++ if (!device_may_wakeup(d)) |
1432 |
++ phy_suspend(priv->phydev); |
1433 |
+ |
1434 |
+ netif_device_detach(dev); |
1435 |
+ |
1436 |
+@@ -3499,7 +3500,8 @@ static int bcmgenet_resume(struct device *d) |
1437 |
+ |
1438 |
+ netif_device_attach(dev); |
1439 |
+ |
1440 |
+- phy_resume(priv->phydev); |
1441 |
++ if (!device_may_wakeup(d)) |
1442 |
++ phy_resume(priv->phydev); |
1443 |
+ |
1444 |
+ if (priv->eee.eee_enabled) |
1445 |
+ bcmgenet_eee_enable_set(dev, true); |
1446 |
+diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c |
1447 |
+index e87607621e62..2f9281936f0e 100644 |
1448 |
+--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c |
1449 |
++++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c |
1450 |
+@@ -220,20 +220,6 @@ void bcmgenet_phy_power_set(struct net_device *dev, bool enable) |
1451 |
+ udelay(60); |
1452 |
+ } |
1453 |
+ |
1454 |
+-static void bcmgenet_internal_phy_setup(struct net_device *dev) |
1455 |
+-{ |
1456 |
+- struct bcmgenet_priv *priv = netdev_priv(dev); |
1457 |
+- u32 reg; |
1458 |
+- |
1459 |
+- /* Power up PHY */ |
1460 |
+- bcmgenet_phy_power_set(dev, true); |
1461 |
+- /* enable APD */ |
1462 |
+- reg = bcmgenet_ext_readl(priv, EXT_EXT_PWR_MGMT); |
1463 |
+- reg |= EXT_PWR_DN_EN_LD; |
1464 |
+- bcmgenet_ext_writel(priv, reg, EXT_EXT_PWR_MGMT); |
1465 |
+- bcmgenet_mii_reset(dev); |
1466 |
+-} |
1467 |
+- |
1468 |
+ static void bcmgenet_moca_phy_setup(struct bcmgenet_priv *priv) |
1469 |
+ { |
1470 |
+ u32 reg; |
1471 |
+@@ -281,7 +267,6 @@ int bcmgenet_mii_config(struct net_device *dev) |
1472 |
+ |
1473 |
+ if (priv->internal_phy) { |
1474 |
+ phy_name = "internal PHY"; |
1475 |
+- bcmgenet_internal_phy_setup(dev); |
1476 |
+ } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) { |
1477 |
+ phy_name = "MoCA"; |
1478 |
+ bcmgenet_moca_phy_setup(priv); |
1479 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c |
1480 |
+index bfe410e8a469..3f51a44bde6b 100644 |
1481 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c |
1482 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c |
1483 |
+@@ -367,6 +367,8 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op, |
1484 |
+ case MLX5_CMD_OP_QUERY_VPORT_COUNTER: |
1485 |
+ case MLX5_CMD_OP_ALLOC_Q_COUNTER: |
1486 |
+ case MLX5_CMD_OP_QUERY_Q_COUNTER: |
1487 |
++ case MLX5_CMD_OP_SET_RATE_LIMIT: |
1488 |
++ case MLX5_CMD_OP_QUERY_RATE_LIMIT: |
1489 |
+ case MLX5_CMD_OP_ALLOC_PD: |
1490 |
+ case MLX5_CMD_OP_ALLOC_UAR: |
1491 |
+ case MLX5_CMD_OP_CONFIG_INT_MODERATION: |
1492 |
+@@ -500,6 +502,8 @@ const char *mlx5_command_str(int command) |
1493 |
+ MLX5_COMMAND_STR_CASE(ALLOC_Q_COUNTER); |
1494 |
+ MLX5_COMMAND_STR_CASE(DEALLOC_Q_COUNTER); |
1495 |
+ MLX5_COMMAND_STR_CASE(QUERY_Q_COUNTER); |
1496 |
++ MLX5_COMMAND_STR_CASE(SET_RATE_LIMIT); |
1497 |
++ MLX5_COMMAND_STR_CASE(QUERY_RATE_LIMIT); |
1498 |
+ MLX5_COMMAND_STR_CASE(ALLOC_PD); |
1499 |
+ MLX5_COMMAND_STR_CASE(DEALLOC_PD); |
1500 |
+ MLX5_COMMAND_STR_CASE(ALLOC_UAR); |
1501 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c |
1502 |
+index 796bdf06122c..7309ae3b8c7b 100644 |
1503 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c |
1504 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c |
1505 |
+@@ -602,6 +602,10 @@ static inline void mlx5e_build_rx_skb(struct mlx5_cqe64 *cqe, |
1506 |
+ if (lro_num_seg > 1) { |
1507 |
+ mlx5e_lro_update_hdr(skb, cqe, cqe_bcnt); |
1508 |
+ skb_shinfo(skb)->gso_size = DIV_ROUND_UP(cqe_bcnt, lro_num_seg); |
1509 |
++ /* Subtract one since we already counted this as one |
1510 |
++ * "regular" packet in mlx5e_complete_rx_cqe() |
1511 |
++ */ |
1512 |
++ rq->stats.packets += lro_num_seg - 1; |
1513 |
+ rq->stats.lro_packets++; |
1514 |
+ rq->stats.lro_bytes += cqe_bcnt; |
1515 |
+ } |
1516 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |
1517 |
+index a543ea676de3..3fd471a41895 100644 |
1518 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |
1519 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |
1520 |
+@@ -427,14 +427,16 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct tcf_exts *exts, |
1521 |
+ } |
1522 |
+ |
1523 |
+ if (is_tcf_vlan(a)) { |
1524 |
+- if (tcf_vlan_action(a) == VLAN_F_POP) { |
1525 |
++ if (tcf_vlan_action(a) == TCA_VLAN_ACT_POP) { |
1526 |
+ attr->action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_POP; |
1527 |
+- } else if (tcf_vlan_action(a) == VLAN_F_PUSH) { |
1528 |
++ } else if (tcf_vlan_action(a) == TCA_VLAN_ACT_PUSH) { |
1529 |
+ if (tcf_vlan_push_proto(a) != htons(ETH_P_8021Q)) |
1530 |
+ return -EOPNOTSUPP; |
1531 |
+ |
1532 |
+ attr->action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH; |
1533 |
+ attr->vlan = tcf_vlan_push_vid(a); |
1534 |
++ } else { /* action is TCA_VLAN_ACT_MODIFY */ |
1535 |
++ return -EOPNOTSUPP; |
1536 |
+ } |
1537 |
+ continue; |
1538 |
+ } |
1539 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c |
1540 |
+index cfb68371c397..574311018e6f 100644 |
1541 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c |
1542 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c |
1543 |
+@@ -272,15 +272,18 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb) |
1544 |
+ sq->stats.tso_bytes += skb->len - ihs; |
1545 |
+ } |
1546 |
+ |
1547 |
++ sq->stats.packets += skb_shinfo(skb)->gso_segs; |
1548 |
+ num_bytes = skb->len + (skb_shinfo(skb)->gso_segs - 1) * ihs; |
1549 |
+ } else { |
1550 |
+ bf = sq->bf_budget && |
1551 |
+ !skb->xmit_more && |
1552 |
+ !skb_shinfo(skb)->nr_frags; |
1553 |
+ ihs = mlx5e_get_inline_hdr_size(sq, skb, bf); |
1554 |
++ sq->stats.packets++; |
1555 |
+ num_bytes = max_t(unsigned int, skb->len, ETH_ZLEN); |
1556 |
+ } |
1557 |
+ |
1558 |
++ sq->stats.bytes += num_bytes; |
1559 |
+ wi->num_bytes = num_bytes; |
1560 |
+ |
1561 |
+ if (skb_vlan_tag_present(skb)) { |
1562 |
+@@ -377,8 +380,6 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb) |
1563 |
+ if (bf) |
1564 |
+ sq->bf_budget--; |
1565 |
+ |
1566 |
+- sq->stats.packets++; |
1567 |
+- sq->stats.bytes += num_bytes; |
1568 |
+ return NETDEV_TX_OK; |
1569 |
+ |
1570 |
+ dma_unmap_wqe_err: |
1571 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c |
1572 |
+index 0c9ef8729ca7..7a196a07fa51 100644 |
1573 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c |
1574 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c |
1575 |
+@@ -87,7 +87,7 @@ static struct mlx5_profile profile[] = { |
1576 |
+ [2] = { |
1577 |
+ .mask = MLX5_PROF_MASK_QP_SIZE | |
1578 |
+ MLX5_PROF_MASK_MR_CACHE, |
1579 |
+- .log_max_qp = 17, |
1580 |
++ .log_max_qp = 18, |
1581 |
+ .mr_cache[0] = { |
1582 |
+ .size = 500, |
1583 |
+ .limit = 250 |
1584 |
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c |
1585 |
+index 24d5272cdce5..0d519a9582ca 100644 |
1586 |
+--- a/drivers/net/usb/qmi_wwan.c |
1587 |
++++ b/drivers/net/usb/qmi_wwan.c |
1588 |
+@@ -924,6 +924,8 @@ static const struct usb_device_id products[] = { |
1589 |
+ {QMI_FIXED_INTF(0x413c, 0x81a9, 8)}, /* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card */ |
1590 |
+ {QMI_FIXED_INTF(0x413c, 0x81b1, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card */ |
1591 |
+ {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ |
1592 |
++ {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */ |
1593 |
++ {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */ |
1594 |
+ {QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */ |
1595 |
+ {QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */ |
1596 |
+ {QMI_FIXED_INTF(0x1e0e, 0x9001, 5)}, /* SIMCom 7230E */ |
1597 |
+diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c |
1598 |
+index bc744acabf98..a2afb8ecb5bc 100644 |
1599 |
+--- a/drivers/net/vrf.c |
1600 |
++++ b/drivers/net/vrf.c |
1601 |
+@@ -467,8 +467,10 @@ static void vrf_rt6_release(struct net_device *dev, struct net_vrf *vrf) |
1602 |
+ } |
1603 |
+ |
1604 |
+ if (rt6_local) { |
1605 |
+- if (rt6_local->rt6i_idev) |
1606 |
++ if (rt6_local->rt6i_idev) { |
1607 |
+ in6_dev_put(rt6_local->rt6i_idev); |
1608 |
++ rt6_local->rt6i_idev = NULL; |
1609 |
++ } |
1610 |
+ |
1611 |
+ dst = &rt6_local->dst; |
1612 |
+ dev_put(dst->dev); |
1613 |
+diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c |
1614 |
+index 3c3c4f197da8..7a310c491ea5 100644 |
1615 |
+--- a/drivers/net/wireless/marvell/mwifiex/pcie.c |
1616 |
++++ b/drivers/net/wireless/marvell/mwifiex/pcie.c |
1617 |
+@@ -2700,6 +2700,21 @@ static void mwifiex_pcie_device_dump(struct mwifiex_adapter *adapter) |
1618 |
+ schedule_work(&pcie_work); |
1619 |
+ } |
1620 |
+ |
1621 |
++static void mwifiex_pcie_free_buffers(struct mwifiex_adapter *adapter) |
1622 |
++{ |
1623 |
++ struct pcie_service_card *card = adapter->card; |
1624 |
++ const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; |
1625 |
++ |
1626 |
++ if (reg->sleep_cookie) |
1627 |
++ mwifiex_pcie_delete_sleep_cookie_buf(adapter); |
1628 |
++ |
1629 |
++ mwifiex_pcie_delete_cmdrsp_buf(adapter); |
1630 |
++ mwifiex_pcie_delete_evtbd_ring(adapter); |
1631 |
++ mwifiex_pcie_delete_rxbd_ring(adapter); |
1632 |
++ mwifiex_pcie_delete_txbd_ring(adapter); |
1633 |
++ card->cmdrsp_buf = NULL; |
1634 |
++} |
1635 |
++ |
1636 |
+ /* |
1637 |
+ * This function initializes the PCI-E host memory space, WCB rings, etc. |
1638 |
+ * |
1639 |
+@@ -2812,13 +2827,6 @@ static int mwifiex_pcie_init(struct mwifiex_adapter *adapter) |
1640 |
+ |
1641 |
+ /* |
1642 |
+ * This function cleans up the allocated card buffers. |
1643 |
+- * |
1644 |
+- * The following are freed by this function - |
1645 |
+- * - TXBD ring buffers |
1646 |
+- * - RXBD ring buffers |
1647 |
+- * - Event BD ring buffers |
1648 |
+- * - Command response ring buffer |
1649 |
+- * - Sleep cookie buffer |
1650 |
+ */ |
1651 |
+ static void mwifiex_pcie_cleanup(struct mwifiex_adapter *adapter) |
1652 |
+ { |
1653 |
+@@ -2834,6 +2842,8 @@ static void mwifiex_pcie_cleanup(struct mwifiex_adapter *adapter) |
1654 |
+ "Failed to write driver not-ready signature\n"); |
1655 |
+ } |
1656 |
+ |
1657 |
++ mwifiex_pcie_free_buffers(adapter); |
1658 |
++ |
1659 |
+ if (pdev) { |
1660 |
+ pci_iounmap(pdev, card->pci_mmap); |
1661 |
+ pci_iounmap(pdev, card->pci_mmap1); |
1662 |
+@@ -3080,10 +3090,7 @@ static void mwifiex_pcie_up_dev(struct mwifiex_adapter *adapter) |
1663 |
+ pci_iounmap(pdev, card->pci_mmap1); |
1664 |
+ } |
1665 |
+ |
1666 |
+-/* This function cleans up the PCI-E host memory space. |
1667 |
+- * Some code is extracted from mwifiex_unregister_dev() |
1668 |
+- * |
1669 |
+- */ |
1670 |
++/* This function cleans up the PCI-E host memory space. */ |
1671 |
+ static void mwifiex_pcie_down_dev(struct mwifiex_adapter *adapter) |
1672 |
+ { |
1673 |
+ struct pcie_service_card *card = adapter->card; |
1674 |
+@@ -3095,16 +3102,8 @@ static void mwifiex_pcie_down_dev(struct mwifiex_adapter *adapter) |
1675 |
+ adapter->seq_num = 0; |
1676 |
+ adapter->tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K; |
1677 |
+ |
1678 |
+- if (card) { |
1679 |
+- if (reg->sleep_cookie) |
1680 |
+- mwifiex_pcie_delete_sleep_cookie_buf(adapter); |
1681 |
+- |
1682 |
+- mwifiex_pcie_delete_cmdrsp_buf(adapter); |
1683 |
+- mwifiex_pcie_delete_evtbd_ring(adapter); |
1684 |
+- mwifiex_pcie_delete_rxbd_ring(adapter); |
1685 |
+- mwifiex_pcie_delete_txbd_ring(adapter); |
1686 |
+- card->cmdrsp_buf = NULL; |
1687 |
+- } |
1688 |
++ if (card) |
1689 |
++ mwifiex_pcie_free_buffers(adapter); |
1690 |
+ |
1691 |
+ return; |
1692 |
+ } |
1693 |
+diff --git a/drivers/parport/share.c b/drivers/parport/share.c |
1694 |
+index 3308427ed9f7..4399de34054a 100644 |
1695 |
+--- a/drivers/parport/share.c |
1696 |
++++ b/drivers/parport/share.c |
1697 |
+@@ -939,8 +939,10 @@ parport_register_dev_model(struct parport *port, const char *name, |
1698 |
+ * pardevice fields. -arca |
1699 |
+ */ |
1700 |
+ port->ops->init_state(par_dev, par_dev->state); |
1701 |
+- port->proc_device = par_dev; |
1702 |
+- parport_device_proc_register(par_dev); |
1703 |
++ if (!test_and_set_bit(PARPORT_DEVPROC_REGISTERED, &port->devflags)) { |
1704 |
++ port->proc_device = par_dev; |
1705 |
++ parport_device_proc_register(par_dev); |
1706 |
++ } |
1707 |
+ |
1708 |
+ return par_dev; |
1709 |
+ |
1710 |
+diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c |
1711 |
+index a6c1fae7d52a..a391b50fb32f 100644 |
1712 |
+--- a/drivers/usb/class/usbtmc.c |
1713 |
++++ b/drivers/usb/class/usbtmc.c |
1714 |
+@@ -1380,7 +1380,7 @@ static int usbtmc_probe(struct usb_interface *intf, |
1715 |
+ |
1716 |
+ dev_dbg(&intf->dev, "%s called\n", __func__); |
1717 |
+ |
1718 |
+- data = kmalloc(sizeof(*data), GFP_KERNEL); |
1719 |
++ data = kzalloc(sizeof(*data), GFP_KERNEL); |
1720 |
+ if (!data) |
1721 |
+ return -ENOMEM; |
1722 |
+ |
1723 |
+@@ -1443,6 +1443,13 @@ static int usbtmc_probe(struct usb_interface *intf, |
1724 |
+ break; |
1725 |
+ } |
1726 |
+ } |
1727 |
++ |
1728 |
++ if (!data->bulk_out || !data->bulk_in) { |
1729 |
++ dev_err(&intf->dev, "bulk endpoints not found\n"); |
1730 |
++ retcode = -ENODEV; |
1731 |
++ goto err_put; |
1732 |
++ } |
1733 |
++ |
1734 |
+ /* Find int endpoint */ |
1735 |
+ for (n = 0; n < iface_desc->desc.bNumEndpoints; n++) { |
1736 |
+ endpoint = &iface_desc->endpoint[n].desc; |
1737 |
+@@ -1468,8 +1475,10 @@ static int usbtmc_probe(struct usb_interface *intf, |
1738 |
+ if (data->iin_ep_present) { |
1739 |
+ /* allocate int urb */ |
1740 |
+ data->iin_urb = usb_alloc_urb(0, GFP_KERNEL); |
1741 |
+- if (!data->iin_urb) |
1742 |
++ if (!data->iin_urb) { |
1743 |
++ retcode = -ENOMEM; |
1744 |
+ goto error_register; |
1745 |
++ } |
1746 |
+ |
1747 |
+ /* will reference data in int urb */ |
1748 |
+ kref_get(&data->kref); |
1749 |
+@@ -1477,8 +1486,10 @@ static int usbtmc_probe(struct usb_interface *intf, |
1750 |
+ /* allocate buffer for interrupt in */ |
1751 |
+ data->iin_buffer = kmalloc(data->iin_wMaxPacketSize, |
1752 |
+ GFP_KERNEL); |
1753 |
+- if (!data->iin_buffer) |
1754 |
++ if (!data->iin_buffer) { |
1755 |
++ retcode = -ENOMEM; |
1756 |
+ goto error_register; |
1757 |
++ } |
1758 |
+ |
1759 |
+ /* fill interrupt urb */ |
1760 |
+ usb_fill_int_urb(data->iin_urb, data->usb_dev, |
1761 |
+@@ -1511,6 +1522,7 @@ static int usbtmc_probe(struct usb_interface *intf, |
1762 |
+ sysfs_remove_group(&intf->dev.kobj, &capability_attr_grp); |
1763 |
+ sysfs_remove_group(&intf->dev.kobj, &data_attr_grp); |
1764 |
+ usbtmc_free_int(data); |
1765 |
++err_put: |
1766 |
+ kref_put(&data->kref, usbtmc_delete); |
1767 |
+ return retcode; |
1768 |
+ } |
1769 |
+diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c |
1770 |
+index 1f7036c8f57b..eef716bdc259 100644 |
1771 |
+--- a/drivers/usb/core/config.c |
1772 |
++++ b/drivers/usb/core/config.c |
1773 |
+@@ -275,6 +275,16 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, |
1774 |
+ |
1775 |
+ /* |
1776 |
+ * Adjust bInterval for quirked devices. |
1777 |
++ */ |
1778 |
++ /* |
1779 |
++ * This quirk fixes bIntervals reported in ms. |
1780 |
++ */ |
1781 |
++ if (to_usb_device(ddev)->quirks & |
1782 |
++ USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL) { |
1783 |
++ n = clamp(fls(d->bInterval) + 3, i, j); |
1784 |
++ i = j = n; |
1785 |
++ } |
1786 |
++ /* |
1787 |
+ * This quirk fixes bIntervals reported in |
1788 |
+ * linear microframes. |
1789 |
+ */ |
1790 |
+diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c |
1791 |
+index aef81a16e2c8..c28ccf1b5a1f 100644 |
1792 |
+--- a/drivers/usb/core/hub.c |
1793 |
++++ b/drivers/usb/core/hub.c |
1794 |
+@@ -4266,7 +4266,7 @@ static void hub_set_initial_usb2_lpm_policy(struct usb_device *udev) |
1795 |
+ struct usb_hub *hub = usb_hub_to_struct_hub(udev->parent); |
1796 |
+ int connect_type = USB_PORT_CONNECT_TYPE_UNKNOWN; |
1797 |
+ |
1798 |
+- if (!udev->usb2_hw_lpm_capable) |
1799 |
++ if (!udev->usb2_hw_lpm_capable || !udev->bos) |
1800 |
+ return; |
1801 |
+ |
1802 |
+ if (hub) |
1803 |
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c |
1804 |
+index 24f9f98968a5..96b21b0dac1e 100644 |
1805 |
+--- a/drivers/usb/core/quirks.c |
1806 |
++++ b/drivers/usb/core/quirks.c |
1807 |
+@@ -170,6 +170,14 @@ static const struct usb_device_id usb_quirk_list[] = { |
1808 |
+ /* M-Systems Flash Disk Pioneers */ |
1809 |
+ { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME }, |
1810 |
+ |
1811 |
++ /* Baum Vario Ultra */ |
1812 |
++ { USB_DEVICE(0x0904, 0x6101), .driver_info = |
1813 |
++ USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL }, |
1814 |
++ { USB_DEVICE(0x0904, 0x6102), .driver_info = |
1815 |
++ USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL }, |
1816 |
++ { USB_DEVICE(0x0904, 0x6103), .driver_info = |
1817 |
++ USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL }, |
1818 |
++ |
1819 |
+ /* Keytouch QWERTY Panel keyboard */ |
1820 |
+ { USB_DEVICE(0x0926, 0x3333), .driver_info = |
1821 |
+ USB_QUIRK_CONFIG_INTF_STRINGS }, |
1822 |
+diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c |
1823 |
+index a30766ca4226..5e3828d9dac7 100644 |
1824 |
+--- a/drivers/usb/gadget/function/f_acm.c |
1825 |
++++ b/drivers/usb/gadget/function/f_acm.c |
1826 |
+@@ -535,13 +535,15 @@ static int acm_notify_serial_state(struct f_acm *acm) |
1827 |
+ { |
1828 |
+ struct usb_composite_dev *cdev = acm->port.func.config->cdev; |
1829 |
+ int status; |
1830 |
++ __le16 serial_state; |
1831 |
+ |
1832 |
+ spin_lock(&acm->lock); |
1833 |
+ if (acm->notify_req) { |
1834 |
+ dev_dbg(&cdev->gadget->dev, "acm ttyGS%d serial state %04x\n", |
1835 |
+ acm->port_num, acm->serial_state); |
1836 |
++ serial_state = cpu_to_le16(acm->serial_state); |
1837 |
+ status = acm_cdc_notify(acm, USB_CDC_NOTIFY_SERIAL_STATE, |
1838 |
+- 0, &acm->serial_state, sizeof(acm->serial_state)); |
1839 |
++ 0, &serial_state, sizeof(acm->serial_state)); |
1840 |
+ } else { |
1841 |
+ acm->pending = true; |
1842 |
+ status = 0; |
1843 |
+diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c |
1844 |
+index 29b41b5dee04..c7689d05356c 100644 |
1845 |
+--- a/drivers/usb/gadget/function/f_uvc.c |
1846 |
++++ b/drivers/usb/gadget/function/f_uvc.c |
1847 |
+@@ -625,7 +625,7 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f) |
1848 |
+ uvc_ss_streaming_comp.bMaxBurst = opts->streaming_maxburst; |
1849 |
+ uvc_ss_streaming_comp.wBytesPerInterval = |
1850 |
+ cpu_to_le16(max_packet_size * max_packet_mult * |
1851 |
+- opts->streaming_maxburst); |
1852 |
++ (opts->streaming_maxburst + 1)); |
1853 |
+ |
1854 |
+ /* Allocate endpoints. */ |
1855 |
+ ep = usb_ep_autoconfig(cdev->gadget, &uvc_control_ep); |
1856 |
+diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c |
1857 |
+index 2975e80b7a56..9a67ae39185b 100644 |
1858 |
+--- a/drivers/usb/misc/idmouse.c |
1859 |
++++ b/drivers/usb/misc/idmouse.c |
1860 |
+@@ -346,6 +346,9 @@ static int idmouse_probe(struct usb_interface *interface, |
1861 |
+ if (iface_desc->desc.bInterfaceClass != 0x0A) |
1862 |
+ return -ENODEV; |
1863 |
+ |
1864 |
++ if (iface_desc->desc.bNumEndpoints < 1) |
1865 |
++ return -ENODEV; |
1866 |
++ |
1867 |
+ /* allocate memory for our device state and initialize it */ |
1868 |
+ dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
1869 |
+ if (dev == NULL) |
1870 |
+diff --git a/drivers/usb/misc/lvstest.c b/drivers/usb/misc/lvstest.c |
1871 |
+index 77176511658f..d3d124753266 100644 |
1872 |
+--- a/drivers/usb/misc/lvstest.c |
1873 |
++++ b/drivers/usb/misc/lvstest.c |
1874 |
+@@ -366,6 +366,10 @@ static int lvs_rh_probe(struct usb_interface *intf, |
1875 |
+ |
1876 |
+ hdev = interface_to_usbdev(intf); |
1877 |
+ desc = intf->cur_altsetting; |
1878 |
++ |
1879 |
++ if (desc->desc.bNumEndpoints < 1) |
1880 |
++ return -ENODEV; |
1881 |
++ |
1882 |
+ endpoint = &desc->endpoint[0].desc; |
1883 |
+ |
1884 |
+ /* valid only for SS root hub */ |
1885 |
+diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c |
1886 |
+index 356d312add57..9ff66525924e 100644 |
1887 |
+--- a/drivers/usb/misc/uss720.c |
1888 |
++++ b/drivers/usb/misc/uss720.c |
1889 |
+@@ -708,6 +708,11 @@ static int uss720_probe(struct usb_interface *intf, |
1890 |
+ |
1891 |
+ interface = intf->cur_altsetting; |
1892 |
+ |
1893 |
++ if (interface->desc.bNumEndpoints < 3) { |
1894 |
++ usb_put_dev(usbdev); |
1895 |
++ return -ENODEV; |
1896 |
++ } |
1897 |
++ |
1898 |
+ /* |
1899 |
+ * Allocate parport interface |
1900 |
+ */ |
1901 |
+diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c |
1902 |
+index d4d7c56b48c7..cb443df1113e 100644 |
1903 |
+--- a/drivers/usb/musb/musb_cppi41.c |
1904 |
++++ b/drivers/usb/musb/musb_cppi41.c |
1905 |
+@@ -232,8 +232,27 @@ static void cppi41_dma_callback(void *private_data) |
1906 |
+ transferred < cppi41_channel->packet_sz) |
1907 |
+ cppi41_channel->prog_len = 0; |
1908 |
+ |
1909 |
+- if (cppi41_channel->is_tx) |
1910 |
+- empty = musb_is_tx_fifo_empty(hw_ep); |
1911 |
++ if (cppi41_channel->is_tx) { |
1912 |
++ u8 type; |
1913 |
++ |
1914 |
++ if (is_host_active(musb)) |
1915 |
++ type = hw_ep->out_qh->type; |
1916 |
++ else |
1917 |
++ type = hw_ep->ep_in.type; |
1918 |
++ |
1919 |
++ if (type == USB_ENDPOINT_XFER_ISOC) |
1920 |
++ /* |
1921 |
++ * Don't use the early-TX-interrupt workaround below |
1922 |
++ * for Isoch transfter. Since Isoch are periodic |
1923 |
++ * transfer, by the time the next transfer is |
1924 |
++ * scheduled, the current one should be done already. |
1925 |
++ * |
1926 |
++ * This avoids audio playback underrun issue. |
1927 |
++ */ |
1928 |
++ empty = true; |
1929 |
++ else |
1930 |
++ empty = musb_is_tx_fifo_empty(hw_ep); |
1931 |
++ } |
1932 |
+ |
1933 |
+ if (!cppi41_channel->is_tx || empty) { |
1934 |
+ cppi41_trans_done(cppi41_channel); |
1935 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
1936 |
+index 42cc72e54c05..af67a0de6b5d 100644 |
1937 |
+--- a/drivers/usb/serial/option.c |
1938 |
++++ b/drivers/usb/serial/option.c |
1939 |
+@@ -233,6 +233,14 @@ static void option_instat_callback(struct urb *urb); |
1940 |
+ #define BANDRICH_PRODUCT_1012 0x1012 |
1941 |
+ |
1942 |
+ #define QUALCOMM_VENDOR_ID 0x05C6 |
1943 |
++/* These Quectel products use Qualcomm's vendor ID */ |
1944 |
++#define QUECTEL_PRODUCT_UC20 0x9003 |
1945 |
++#define QUECTEL_PRODUCT_UC15 0x9090 |
1946 |
++ |
1947 |
++#define QUECTEL_VENDOR_ID 0x2c7c |
1948 |
++/* These Quectel products use Quectel's vendor ID */ |
1949 |
++#define QUECTEL_PRODUCT_EC21 0x0121 |
1950 |
++#define QUECTEL_PRODUCT_EC25 0x0125 |
1951 |
+ |
1952 |
+ #define CMOTECH_VENDOR_ID 0x16d8 |
1953 |
+ #define CMOTECH_PRODUCT_6001 0x6001 |
1954 |
+@@ -1161,7 +1169,14 @@ static const struct usb_device_id option_ids[] = { |
1955 |
+ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ |
1956 |
+ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */ |
1957 |
+ { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ |
1958 |
+- { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9003), /* Quectel UC20 */ |
1959 |
++ /* Quectel products using Qualcomm vendor ID */ |
1960 |
++ { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)}, |
1961 |
++ { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20), |
1962 |
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
1963 |
++ /* Quectel products using Quectel vendor ID */ |
1964 |
++ { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21), |
1965 |
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
1966 |
++ { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25), |
1967 |
+ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
1968 |
+ { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, |
1969 |
+ { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) }, |
1970 |
+diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c |
1971 |
+index 696458db7e3c..38b3f0d8cd58 100644 |
1972 |
+--- a/drivers/usb/serial/qcserial.c |
1973 |
++++ b/drivers/usb/serial/qcserial.c |
1974 |
+@@ -169,6 +169,8 @@ static const struct usb_device_id id_table[] = { |
1975 |
+ {DEVICE_SWI(0x413c, 0x81a9)}, /* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card */ |
1976 |
+ {DEVICE_SWI(0x413c, 0x81b1)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card */ |
1977 |
+ {DEVICE_SWI(0x413c, 0x81b3)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ |
1978 |
++ {DEVICE_SWI(0x413c, 0x81b5)}, /* Dell Wireless 5811e QDL */ |
1979 |
++ {DEVICE_SWI(0x413c, 0x81b6)}, /* Dell Wireless 5811e QDL */ |
1980 |
+ |
1981 |
+ /* Huawei devices */ |
1982 |
+ {DEVICE_HWI(0x03f0, 0x581d)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) */ |
1983 |
+diff --git a/drivers/usb/wusbcore/wa-hc.c b/drivers/usb/wusbcore/wa-hc.c |
1984 |
+index 252c7bd9218a..d01496fd27fe 100644 |
1985 |
+--- a/drivers/usb/wusbcore/wa-hc.c |
1986 |
++++ b/drivers/usb/wusbcore/wa-hc.c |
1987 |
+@@ -39,6 +39,9 @@ int wa_create(struct wahc *wa, struct usb_interface *iface, |
1988 |
+ int result; |
1989 |
+ struct device *dev = &iface->dev; |
1990 |
+ |
1991 |
++ if (iface->cur_altsetting->desc.bNumEndpoints < 3) |
1992 |
++ return -ENODEV; |
1993 |
++ |
1994 |
+ result = wa_rpipes_create(wa); |
1995 |
+ if (result < 0) |
1996 |
+ goto error_rpipes_create; |
1997 |
+diff --git a/drivers/uwb/hwa-rc.c b/drivers/uwb/hwa-rc.c |
1998 |
+index 0aa6c3c29d17..35a1e777b449 100644 |
1999 |
+--- a/drivers/uwb/hwa-rc.c |
2000 |
++++ b/drivers/uwb/hwa-rc.c |
2001 |
+@@ -823,6 +823,9 @@ static int hwarc_probe(struct usb_interface *iface, |
2002 |
+ struct hwarc *hwarc; |
2003 |
+ struct device *dev = &iface->dev; |
2004 |
+ |
2005 |
++ if (iface->cur_altsetting->desc.bNumEndpoints < 1) |
2006 |
++ return -ENODEV; |
2007 |
++ |
2008 |
+ result = -ENOMEM; |
2009 |
+ uwb_rc = uwb_rc_alloc(); |
2010 |
+ if (uwb_rc == NULL) { |
2011 |
+diff --git a/drivers/uwb/i1480/dfu/usb.c b/drivers/uwb/i1480/dfu/usb.c |
2012 |
+index 2bfc846ac071..6345e85822a4 100644 |
2013 |
+--- a/drivers/uwb/i1480/dfu/usb.c |
2014 |
++++ b/drivers/uwb/i1480/dfu/usb.c |
2015 |
+@@ -362,6 +362,9 @@ int i1480_usb_probe(struct usb_interface *iface, const struct usb_device_id *id) |
2016 |
+ result); |
2017 |
+ } |
2018 |
+ |
2019 |
++ if (iface->cur_altsetting->desc.bNumEndpoints < 1) |
2020 |
++ return -ENODEV; |
2021 |
++ |
2022 |
+ result = -ENOMEM; |
2023 |
+ i1480_usb = kzalloc(sizeof(*i1480_usb), GFP_KERNEL); |
2024 |
+ if (i1480_usb == NULL) { |
2025 |
+diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c |
2026 |
+index b87f5cfdaea5..4db10d7990c9 100644 |
2027 |
+--- a/drivers/video/console/fbcon.c |
2028 |
++++ b/drivers/video/console/fbcon.c |
2029 |
+@@ -1167,6 +1167,8 @@ static void fbcon_free_font(struct display *p, bool freefont) |
2030 |
+ p->userfont = 0; |
2031 |
+ } |
2032 |
+ |
2033 |
++static void set_vc_hi_font(struct vc_data *vc, bool set); |
2034 |
++ |
2035 |
+ static void fbcon_deinit(struct vc_data *vc) |
2036 |
+ { |
2037 |
+ struct display *p = &fb_display[vc->vc_num]; |
2038 |
+@@ -1202,6 +1204,9 @@ static void fbcon_deinit(struct vc_data *vc) |
2039 |
+ if (free_font) |
2040 |
+ vc->vc_font.data = NULL; |
2041 |
+ |
2042 |
++ if (vc->vc_hi_font_mask) |
2043 |
++ set_vc_hi_font(vc, false); |
2044 |
++ |
2045 |
+ if (!con_is_bound(&fb_con)) |
2046 |
+ fbcon_exit(); |
2047 |
+ |
2048 |
+@@ -2438,32 +2443,10 @@ static int fbcon_get_font(struct vc_data *vc, struct console_font *font) |
2049 |
+ return 0; |
2050 |
+ } |
2051 |
+ |
2052 |
+-static int fbcon_do_set_font(struct vc_data *vc, int w, int h, |
2053 |
+- const u8 * data, int userfont) |
2054 |
++/* set/clear vc_hi_font_mask and update vc attrs accordingly */ |
2055 |
++static void set_vc_hi_font(struct vc_data *vc, bool set) |
2056 |
+ { |
2057 |
+- struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
2058 |
+- struct fbcon_ops *ops = info->fbcon_par; |
2059 |
+- struct display *p = &fb_display[vc->vc_num]; |
2060 |
+- int resize; |
2061 |
+- int cnt; |
2062 |
+- char *old_data = NULL; |
2063 |
+- |
2064 |
+- if (con_is_visible(vc) && softback_lines) |
2065 |
+- fbcon_set_origin(vc); |
2066 |
+- |
2067 |
+- resize = (w != vc->vc_font.width) || (h != vc->vc_font.height); |
2068 |
+- if (p->userfont) |
2069 |
+- old_data = vc->vc_font.data; |
2070 |
+- if (userfont) |
2071 |
+- cnt = FNTCHARCNT(data); |
2072 |
+- else |
2073 |
+- cnt = 256; |
2074 |
+- vc->vc_font.data = (void *)(p->fontdata = data); |
2075 |
+- if ((p->userfont = userfont)) |
2076 |
+- REFCOUNT(data)++; |
2077 |
+- vc->vc_font.width = w; |
2078 |
+- vc->vc_font.height = h; |
2079 |
+- if (vc->vc_hi_font_mask && cnt == 256) { |
2080 |
++ if (!set) { |
2081 |
+ vc->vc_hi_font_mask = 0; |
2082 |
+ if (vc->vc_can_do_color) { |
2083 |
+ vc->vc_complement_mask >>= 1; |
2084 |
+@@ -2486,7 +2469,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, |
2085 |
+ ((c & 0xfe00) >> 1) | (c & 0xff); |
2086 |
+ vc->vc_attr >>= 1; |
2087 |
+ } |
2088 |
+- } else if (!vc->vc_hi_font_mask && cnt == 512) { |
2089 |
++ } else { |
2090 |
+ vc->vc_hi_font_mask = 0x100; |
2091 |
+ if (vc->vc_can_do_color) { |
2092 |
+ vc->vc_complement_mask <<= 1; |
2093 |
+@@ -2518,8 +2501,38 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, |
2094 |
+ } else |
2095 |
+ vc->vc_video_erase_char = c & ~0x100; |
2096 |
+ } |
2097 |
+- |
2098 |
+ } |
2099 |
++} |
2100 |
++ |
2101 |
++static int fbcon_do_set_font(struct vc_data *vc, int w, int h, |
2102 |
++ const u8 * data, int userfont) |
2103 |
++{ |
2104 |
++ struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
2105 |
++ struct fbcon_ops *ops = info->fbcon_par; |
2106 |
++ struct display *p = &fb_display[vc->vc_num]; |
2107 |
++ int resize; |
2108 |
++ int cnt; |
2109 |
++ char *old_data = NULL; |
2110 |
++ |
2111 |
++ if (con_is_visible(vc) && softback_lines) |
2112 |
++ fbcon_set_origin(vc); |
2113 |
++ |
2114 |
++ resize = (w != vc->vc_font.width) || (h != vc->vc_font.height); |
2115 |
++ if (p->userfont) |
2116 |
++ old_data = vc->vc_font.data; |
2117 |
++ if (userfont) |
2118 |
++ cnt = FNTCHARCNT(data); |
2119 |
++ else |
2120 |
++ cnt = 256; |
2121 |
++ vc->vc_font.data = (void *)(p->fontdata = data); |
2122 |
++ if ((p->userfont = userfont)) |
2123 |
++ REFCOUNT(data)++; |
2124 |
++ vc->vc_font.width = w; |
2125 |
++ vc->vc_font.height = h; |
2126 |
++ if (vc->vc_hi_font_mask && cnt == 256) |
2127 |
++ set_vc_hi_font(vc, false); |
2128 |
++ else if (!vc->vc_hi_font_mask && cnt == 512) |
2129 |
++ set_vc_hi_font(vc, true); |
2130 |
+ |
2131 |
+ if (resize) { |
2132 |
+ int cols, rows; |
2133 |
+diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c |
2134 |
+index 4ce10bcca18b..4b857463a2b4 100644 |
2135 |
+--- a/drivers/xen/xen-acpi-processor.c |
2136 |
++++ b/drivers/xen/xen-acpi-processor.c |
2137 |
+@@ -27,10 +27,10 @@ |
2138 |
+ #include <linux/init.h> |
2139 |
+ #include <linux/module.h> |
2140 |
+ #include <linux/types.h> |
2141 |
++#include <linux/syscore_ops.h> |
2142 |
+ #include <linux/acpi.h> |
2143 |
+ #include <acpi/processor.h> |
2144 |
+ #include <xen/xen.h> |
2145 |
+-#include <xen/xen-ops.h> |
2146 |
+ #include <xen/interface/platform.h> |
2147 |
+ #include <asm/xen/hypercall.h> |
2148 |
+ |
2149 |
+@@ -466,15 +466,33 @@ static int xen_upload_processor_pm_data(void) |
2150 |
+ return rc; |
2151 |
+ } |
2152 |
+ |
2153 |
+-static int xen_acpi_processor_resume(struct notifier_block *nb, |
2154 |
+- unsigned long action, void *data) |
2155 |
++static void xen_acpi_processor_resume_worker(struct work_struct *dummy) |
2156 |
+ { |
2157 |
++ int rc; |
2158 |
++ |
2159 |
+ bitmap_zero(acpi_ids_done, nr_acpi_bits); |
2160 |
+- return xen_upload_processor_pm_data(); |
2161 |
++ |
2162 |
++ rc = xen_upload_processor_pm_data(); |
2163 |
++ if (rc != 0) |
2164 |
++ pr_info("ACPI data upload failed, error = %d\n", rc); |
2165 |
++} |
2166 |
++ |
2167 |
++static void xen_acpi_processor_resume(void) |
2168 |
++{ |
2169 |
++ static DECLARE_WORK(wq, xen_acpi_processor_resume_worker); |
2170 |
++ |
2171 |
++ /* |
2172 |
++ * xen_upload_processor_pm_data() calls non-atomic code. |
2173 |
++ * However, the context for xen_acpi_processor_resume is syscore |
2174 |
++ * with only the boot CPU online and in an atomic context. |
2175 |
++ * |
2176 |
++ * So defer the upload for some point safer. |
2177 |
++ */ |
2178 |
++ schedule_work(&wq); |
2179 |
+ } |
2180 |
+ |
2181 |
+-struct notifier_block xen_acpi_processor_resume_nb = { |
2182 |
+- .notifier_call = xen_acpi_processor_resume, |
2183 |
++static struct syscore_ops xap_syscore_ops = { |
2184 |
++ .resume = xen_acpi_processor_resume, |
2185 |
+ }; |
2186 |
+ |
2187 |
+ static int __init xen_acpi_processor_init(void) |
2188 |
+@@ -527,7 +545,7 @@ static int __init xen_acpi_processor_init(void) |
2189 |
+ if (rc) |
2190 |
+ goto err_unregister; |
2191 |
+ |
2192 |
+- xen_resume_notifier_register(&xen_acpi_processor_resume_nb); |
2193 |
++ register_syscore_ops(&xap_syscore_ops); |
2194 |
+ |
2195 |
+ return 0; |
2196 |
+ err_unregister: |
2197 |
+@@ -544,7 +562,7 @@ static void __exit xen_acpi_processor_exit(void) |
2198 |
+ { |
2199 |
+ int i; |
2200 |
+ |
2201 |
+- xen_resume_notifier_unregister(&xen_acpi_processor_resume_nb); |
2202 |
++ unregister_syscore_ops(&xap_syscore_ops); |
2203 |
+ kfree(acpi_ids_done); |
2204 |
+ kfree(acpi_id_present); |
2205 |
+ kfree(acpi_id_cst_present); |
2206 |
+diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c |
2207 |
+index 37b521ed39df..73cbc01ef5ad 100644 |
2208 |
+--- a/fs/ext4/inline.c |
2209 |
++++ b/fs/ext4/inline.c |
2210 |
+@@ -1157,10 +1157,9 @@ static int ext4_finish_convert_inline_dir(handle_t *handle, |
2211 |
+ set_buffer_uptodate(dir_block); |
2212 |
+ err = ext4_handle_dirty_dirent_node(handle, inode, dir_block); |
2213 |
+ if (err) |
2214 |
+- goto out; |
2215 |
++ return err; |
2216 |
+ set_buffer_verified(dir_block); |
2217 |
+-out: |
2218 |
+- return err; |
2219 |
++ return ext4_mark_inode_dirty(handle, inode); |
2220 |
+ } |
2221 |
+ |
2222 |
+ static int ext4_convert_inline_data_nolock(handle_t *handle, |
2223 |
+diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c |
2224 |
+index 4448ed37181b..3eeed8f0aa06 100644 |
2225 |
+--- a/fs/ext4/xattr.c |
2226 |
++++ b/fs/ext4/xattr.c |
2227 |
+@@ -131,31 +131,26 @@ static __le32 ext4_xattr_block_csum(struct inode *inode, |
2228 |
+ } |
2229 |
+ |
2230 |
+ static int ext4_xattr_block_csum_verify(struct inode *inode, |
2231 |
+- sector_t block_nr, |
2232 |
+- struct ext4_xattr_header *hdr) |
2233 |
++ struct buffer_head *bh) |
2234 |
+ { |
2235 |
+- if (ext4_has_metadata_csum(inode->i_sb) && |
2236 |
+- (hdr->h_checksum != ext4_xattr_block_csum(inode, block_nr, hdr))) |
2237 |
+- return 0; |
2238 |
+- return 1; |
2239 |
+-} |
2240 |
+- |
2241 |
+-static void ext4_xattr_block_csum_set(struct inode *inode, |
2242 |
+- sector_t block_nr, |
2243 |
+- struct ext4_xattr_header *hdr) |
2244 |
+-{ |
2245 |
+- if (!ext4_has_metadata_csum(inode->i_sb)) |
2246 |
+- return; |
2247 |
++ struct ext4_xattr_header *hdr = BHDR(bh); |
2248 |
++ int ret = 1; |
2249 |
+ |
2250 |
+- hdr->h_checksum = ext4_xattr_block_csum(inode, block_nr, hdr); |
2251 |
++ if (ext4_has_metadata_csum(inode->i_sb)) { |
2252 |
++ lock_buffer(bh); |
2253 |
++ ret = (hdr->h_checksum == ext4_xattr_block_csum(inode, |
2254 |
++ bh->b_blocknr, hdr)); |
2255 |
++ unlock_buffer(bh); |
2256 |
++ } |
2257 |
++ return ret; |
2258 |
+ } |
2259 |
+ |
2260 |
+-static inline int ext4_handle_dirty_xattr_block(handle_t *handle, |
2261 |
+- struct inode *inode, |
2262 |
+- struct buffer_head *bh) |
2263 |
++static void ext4_xattr_block_csum_set(struct inode *inode, |
2264 |
++ struct buffer_head *bh) |
2265 |
+ { |
2266 |
+- ext4_xattr_block_csum_set(inode, bh->b_blocknr, BHDR(bh)); |
2267 |
+- return ext4_handle_dirty_metadata(handle, inode, bh); |
2268 |
++ if (ext4_has_metadata_csum(inode->i_sb)) |
2269 |
++ BHDR(bh)->h_checksum = ext4_xattr_block_csum(inode, |
2270 |
++ bh->b_blocknr, BHDR(bh)); |
2271 |
+ } |
2272 |
+ |
2273 |
+ static inline const struct xattr_handler * |
2274 |
+@@ -218,7 +213,7 @@ ext4_xattr_check_block(struct inode *inode, struct buffer_head *bh) |
2275 |
+ if (BHDR(bh)->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC) || |
2276 |
+ BHDR(bh)->h_blocks != cpu_to_le32(1)) |
2277 |
+ return -EFSCORRUPTED; |
2278 |
+- if (!ext4_xattr_block_csum_verify(inode, bh->b_blocknr, BHDR(bh))) |
2279 |
++ if (!ext4_xattr_block_csum_verify(inode, bh)) |
2280 |
+ return -EFSBADCRC; |
2281 |
+ error = ext4_xattr_check_names(BFIRST(bh), bh->b_data + bh->b_size, |
2282 |
+ bh->b_data); |
2283 |
+@@ -601,23 +596,22 @@ ext4_xattr_release_block(handle_t *handle, struct inode *inode, |
2284 |
+ } |
2285 |
+ } |
2286 |
+ |
2287 |
++ ext4_xattr_block_csum_set(inode, bh); |
2288 |
+ /* |
2289 |
+ * Beware of this ugliness: Releasing of xattr block references |
2290 |
+ * from different inodes can race and so we have to protect |
2291 |
+ * from a race where someone else frees the block (and releases |
2292 |
+ * its journal_head) before we are done dirtying the buffer. In |
2293 |
+ * nojournal mode this race is harmless and we actually cannot |
2294 |
+- * call ext4_handle_dirty_xattr_block() with locked buffer as |
2295 |
++ * call ext4_handle_dirty_metadata() with locked buffer as |
2296 |
+ * that function can call sync_dirty_buffer() so for that case |
2297 |
+ * we handle the dirtying after unlocking the buffer. |
2298 |
+ */ |
2299 |
+ if (ext4_handle_valid(handle)) |
2300 |
+- error = ext4_handle_dirty_xattr_block(handle, inode, |
2301 |
+- bh); |
2302 |
++ error = ext4_handle_dirty_metadata(handle, inode, bh); |
2303 |
+ unlock_buffer(bh); |
2304 |
+ if (!ext4_handle_valid(handle)) |
2305 |
+- error = ext4_handle_dirty_xattr_block(handle, inode, |
2306 |
+- bh); |
2307 |
++ error = ext4_handle_dirty_metadata(handle, inode, bh); |
2308 |
+ if (IS_SYNC(inode)) |
2309 |
+ ext4_handle_sync(handle); |
2310 |
+ dquot_free_block(inode, EXT4_C2B(EXT4_SB(inode->i_sb), 1)); |
2311 |
+@@ -846,13 +840,14 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode, |
2312 |
+ ext4_xattr_cache_insert(ext4_mb_cache, |
2313 |
+ bs->bh); |
2314 |
+ } |
2315 |
++ ext4_xattr_block_csum_set(inode, bs->bh); |
2316 |
+ unlock_buffer(bs->bh); |
2317 |
+ if (error == -EFSCORRUPTED) |
2318 |
+ goto bad_block; |
2319 |
+ if (!error) |
2320 |
+- error = ext4_handle_dirty_xattr_block(handle, |
2321 |
+- inode, |
2322 |
+- bs->bh); |
2323 |
++ error = ext4_handle_dirty_metadata(handle, |
2324 |
++ inode, |
2325 |
++ bs->bh); |
2326 |
+ if (error) |
2327 |
+ goto cleanup; |
2328 |
+ goto inserted; |
2329 |
+@@ -950,10 +945,11 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode, |
2330 |
+ ce->e_reusable = 0; |
2331 |
+ ea_bdebug(new_bh, "reusing; refcount now=%d", |
2332 |
+ ref); |
2333 |
++ ext4_xattr_block_csum_set(inode, new_bh); |
2334 |
+ unlock_buffer(new_bh); |
2335 |
+- error = ext4_handle_dirty_xattr_block(handle, |
2336 |
+- inode, |
2337 |
+- new_bh); |
2338 |
++ error = ext4_handle_dirty_metadata(handle, |
2339 |
++ inode, |
2340 |
++ new_bh); |
2341 |
+ if (error) |
2342 |
+ goto cleanup_dquot; |
2343 |
+ } |
2344 |
+@@ -1003,11 +999,12 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode, |
2345 |
+ goto getblk_failed; |
2346 |
+ } |
2347 |
+ memcpy(new_bh->b_data, s->base, new_bh->b_size); |
2348 |
++ ext4_xattr_block_csum_set(inode, new_bh); |
2349 |
+ set_buffer_uptodate(new_bh); |
2350 |
+ unlock_buffer(new_bh); |
2351 |
+ ext4_xattr_cache_insert(ext4_mb_cache, new_bh); |
2352 |
+- error = ext4_handle_dirty_xattr_block(handle, |
2353 |
+- inode, new_bh); |
2354 |
++ error = ext4_handle_dirty_metadata(handle, inode, |
2355 |
++ new_bh); |
2356 |
+ if (error) |
2357 |
+ goto cleanup; |
2358 |
+ } |
2359 |
+diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c |
2360 |
+index 927da4956a89..7d4b557f1962 100644 |
2361 |
+--- a/fs/jbd2/journal.c |
2362 |
++++ b/fs/jbd2/journal.c |
2363 |
+@@ -1125,10 +1125,8 @@ static journal_t *journal_init_common(struct block_device *bdev, |
2364 |
+ |
2365 |
+ /* Set up a default-sized revoke table for the new mount. */ |
2366 |
+ err = jbd2_journal_init_revoke(journal, JOURNAL_REVOKE_DEFAULT_HASH); |
2367 |
+- if (err) { |
2368 |
+- kfree(journal); |
2369 |
+- return NULL; |
2370 |
+- } |
2371 |
++ if (err) |
2372 |
++ goto err_cleanup; |
2373 |
+ |
2374 |
+ spin_lock_init(&journal->j_history_lock); |
2375 |
+ |
2376 |
+@@ -1145,23 +1143,25 @@ static journal_t *journal_init_common(struct block_device *bdev, |
2377 |
+ journal->j_wbufsize = n; |
2378 |
+ journal->j_wbuf = kmalloc_array(n, sizeof(struct buffer_head *), |
2379 |
+ GFP_KERNEL); |
2380 |
+- if (!journal->j_wbuf) { |
2381 |
+- kfree(journal); |
2382 |
+- return NULL; |
2383 |
+- } |
2384 |
++ if (!journal->j_wbuf) |
2385 |
++ goto err_cleanup; |
2386 |
+ |
2387 |
+ bh = getblk_unmovable(journal->j_dev, start, journal->j_blocksize); |
2388 |
+ if (!bh) { |
2389 |
+ pr_err("%s: Cannot get buffer for journal superblock\n", |
2390 |
+ __func__); |
2391 |
+- kfree(journal->j_wbuf); |
2392 |
+- kfree(journal); |
2393 |
+- return NULL; |
2394 |
++ goto err_cleanup; |
2395 |
+ } |
2396 |
+ journal->j_sb_buffer = bh; |
2397 |
+ journal->j_superblock = (journal_superblock_t *)bh->b_data; |
2398 |
+ |
2399 |
+ return journal; |
2400 |
++ |
2401 |
++err_cleanup: |
2402 |
++ kfree(journal->j_wbuf); |
2403 |
++ jbd2_journal_destroy_revoke(journal); |
2404 |
++ kfree(journal); |
2405 |
++ return NULL; |
2406 |
+ } |
2407 |
+ |
2408 |
+ /* jbd2_journal_init_dev and jbd2_journal_init_inode: |
2409 |
+diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c |
2410 |
+index 91171dc352cb..3cd73059da9a 100644 |
2411 |
+--- a/fs/jbd2/revoke.c |
2412 |
++++ b/fs/jbd2/revoke.c |
2413 |
+@@ -280,6 +280,7 @@ int jbd2_journal_init_revoke(journal_t *journal, int hash_size) |
2414 |
+ |
2415 |
+ fail1: |
2416 |
+ jbd2_journal_destroy_revoke_table(journal->j_revoke_table[0]); |
2417 |
++ journal->j_revoke_table[0] = NULL; |
2418 |
+ fail0: |
2419 |
+ return -ENOMEM; |
2420 |
+ } |
2421 |
+diff --git a/include/drm/drmP.h b/include/drm/drmP.h |
2422 |
+index 672644031bd5..e9fb2e802feb 100644 |
2423 |
+--- a/include/drm/drmP.h |
2424 |
++++ b/include/drm/drmP.h |
2425 |
+@@ -361,6 +361,7 @@ struct drm_ioctl_desc { |
2426 |
+ /* Event queued up for userspace to read */ |
2427 |
+ struct drm_pending_event { |
2428 |
+ struct completion *completion; |
2429 |
++ void (*completion_release)(struct completion *completion); |
2430 |
+ struct drm_event *event; |
2431 |
+ struct fence *fence; |
2432 |
+ struct list_head link; |
2433 |
+diff --git a/include/linux/ccp.h b/include/linux/ccp.h |
2434 |
+index a7653339fedb..edc5d04b9632 100644 |
2435 |
+--- a/include/linux/ccp.h |
2436 |
++++ b/include/linux/ccp.h |
2437 |
+@@ -556,7 +556,7 @@ enum ccp_engine { |
2438 |
+ * struct ccp_cmd - CPP operation request |
2439 |
+ * @entry: list element (ccp driver use only) |
2440 |
+ * @work: work element used for callbacks (ccp driver use only) |
2441 |
+- * @ccp: CCP device to be run on (ccp driver use only) |
2442 |
++ * @ccp: CCP device to be run on |
2443 |
+ * @ret: operation return code (ccp driver use only) |
2444 |
+ * @flags: cmd processing flags |
2445 |
+ * @engine: CCP operation to perform |
2446 |
+diff --git a/include/linux/iio/sw_device.h b/include/linux/iio/sw_device.h |
2447 |
+index 23ca41515527..fa7931933067 100644 |
2448 |
+--- a/include/linux/iio/sw_device.h |
2449 |
++++ b/include/linux/iio/sw_device.h |
2450 |
+@@ -62,7 +62,7 @@ void iio_swd_group_init_type_name(struct iio_sw_device *d, |
2451 |
+ const char *name, |
2452 |
+ struct config_item_type *type) |
2453 |
+ { |
2454 |
+-#ifdef CONFIG_CONFIGFS_FS |
2455 |
++#if IS_ENABLED(CONFIG_CONFIGFS_FS) |
2456 |
+ config_group_init_type_name(&d->group, name, type); |
2457 |
+ #endif |
2458 |
+ } |
2459 |
+diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h |
2460 |
+index 1d0043dc34e4..de2a722fe3cf 100644 |
2461 |
+--- a/include/linux/usb/quirks.h |
2462 |
++++ b/include/linux/usb/quirks.h |
2463 |
+@@ -50,4 +50,10 @@ |
2464 |
+ /* device can't handle Link Power Management */ |
2465 |
+ #define USB_QUIRK_NO_LPM BIT(10) |
2466 |
+ |
2467 |
++/* |
2468 |
++ * Device reports its bInterval as linear frames instead of the |
2469 |
++ * USB 2.0 calculation. |
2470 |
++ */ |
2471 |
++#define USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL BIT(11) |
2472 |
++ |
2473 |
+ #endif /* __LINUX_USB_QUIRKS_H */ |
2474 |
+diff --git a/net/ceph/osdmap.c b/net/ceph/osdmap.c |
2475 |
+index d2436880b305..d3f6c26425b3 100644 |
2476 |
+--- a/net/ceph/osdmap.c |
2477 |
++++ b/net/ceph/osdmap.c |
2478 |
+@@ -1334,7 +1334,6 @@ static int decode_new_up_state_weight(void **p, void *end, |
2479 |
+ if ((map->osd_state[osd] & CEPH_OSD_EXISTS) && |
2480 |
+ (xorstate & CEPH_OSD_EXISTS)) { |
2481 |
+ pr_info("osd%d does not exist\n", osd); |
2482 |
+- map->osd_weight[osd] = CEPH_OSD_IN; |
2483 |
+ ret = set_primary_affinity(map, osd, |
2484 |
+ CEPH_OSD_DEFAULT_PRIMARY_AFFINITY); |
2485 |
+ if (ret) |
2486 |
+diff --git a/net/core/netclassid_cgroup.c b/net/core/netclassid_cgroup.c |
2487 |
+index 11fce17274f6..46e8830c1979 100644 |
2488 |
+--- a/net/core/netclassid_cgroup.c |
2489 |
++++ b/net/core/netclassid_cgroup.c |
2490 |
+@@ -69,27 +69,17 @@ static int update_classid_sock(const void *v, struct file *file, unsigned n) |
2491 |
+ return 0; |
2492 |
+ } |
2493 |
+ |
2494 |
+-static void update_classid(struct cgroup_subsys_state *css, void *v) |
2495 |
++static void cgrp_attach(struct cgroup_taskset *tset) |
2496 |
+ { |
2497 |
+- struct css_task_iter it; |
2498 |
++ struct cgroup_subsys_state *css; |
2499 |
+ struct task_struct *p; |
2500 |
+ |
2501 |
+- css_task_iter_start(css, &it); |
2502 |
+- while ((p = css_task_iter_next(&it))) { |
2503 |
++ cgroup_taskset_for_each(p, css, tset) { |
2504 |
+ task_lock(p); |
2505 |
+- iterate_fd(p->files, 0, update_classid_sock, v); |
2506 |
++ iterate_fd(p->files, 0, update_classid_sock, |
2507 |
++ (void *)(unsigned long)css_cls_state(css)->classid); |
2508 |
+ task_unlock(p); |
2509 |
+ } |
2510 |
+- css_task_iter_end(&it); |
2511 |
+-} |
2512 |
+- |
2513 |
+-static void cgrp_attach(struct cgroup_taskset *tset) |
2514 |
+-{ |
2515 |
+- struct cgroup_subsys_state *css; |
2516 |
+- |
2517 |
+- cgroup_taskset_first(tset, &css); |
2518 |
+- update_classid(css, |
2519 |
+- (void *)(unsigned long)css_cls_state(css)->classid); |
2520 |
+ } |
2521 |
+ |
2522 |
+ static u64 read_classid(struct cgroup_subsys_state *css, struct cftype *cft) |
2523 |
+@@ -101,12 +91,22 @@ static int write_classid(struct cgroup_subsys_state *css, struct cftype *cft, |
2524 |
+ u64 value) |
2525 |
+ { |
2526 |
+ struct cgroup_cls_state *cs = css_cls_state(css); |
2527 |
++ struct css_task_iter it; |
2528 |
++ struct task_struct *p; |
2529 |
+ |
2530 |
+ cgroup_sk_alloc_disable(); |
2531 |
+ |
2532 |
+ cs->classid = (u32)value; |
2533 |
+ |
2534 |
+- update_classid(css, (void *)(unsigned long)cs->classid); |
2535 |
++ css_task_iter_start(css, &it); |
2536 |
++ while ((p = css_task_iter_next(&it))) { |
2537 |
++ task_lock(p); |
2538 |
++ iterate_fd(p->files, 0, update_classid_sock, |
2539 |
++ (void *)(unsigned long)cs->classid); |
2540 |
++ task_unlock(p); |
2541 |
++ } |
2542 |
++ css_task_iter_end(&it); |
2543 |
++ |
2544 |
+ return 0; |
2545 |
+ } |
2546 |
+ |
2547 |
+diff --git a/net/core/sock.c b/net/core/sock.c |
2548 |
+index bc6543f7de36..470a2043b846 100644 |
2549 |
+--- a/net/core/sock.c |
2550 |
++++ b/net/core/sock.c |
2551 |
+@@ -1437,6 +1437,11 @@ static void __sk_destruct(struct rcu_head *head) |
2552 |
+ pr_debug("%s: optmem leakage (%d bytes) detected\n", |
2553 |
+ __func__, atomic_read(&sk->sk_omem_alloc)); |
2554 |
+ |
2555 |
++ if (sk->sk_frag.page) { |
2556 |
++ put_page(sk->sk_frag.page); |
2557 |
++ sk->sk_frag.page = NULL; |
2558 |
++ } |
2559 |
++ |
2560 |
+ if (sk->sk_peer_cred) |
2561 |
+ put_cred(sk->sk_peer_cred); |
2562 |
+ put_pid(sk->sk_peer_pid); |
2563 |
+@@ -1533,6 +1538,12 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority) |
2564 |
+ is_charged = sk_filter_charge(newsk, filter); |
2565 |
+ |
2566 |
+ if (unlikely(!is_charged || xfrm_sk_clone_policy(newsk, sk))) { |
2567 |
++ /* We need to make sure that we don't uncharge the new |
2568 |
++ * socket if we couldn't charge it in the first place |
2569 |
++ * as otherwise we uncharge the parent's filter. |
2570 |
++ */ |
2571 |
++ if (!is_charged) |
2572 |
++ RCU_INIT_POINTER(newsk->sk_filter, NULL); |
2573 |
+ /* It is still raw copy of parent, so invalidate |
2574 |
+ * destructor and make plain sk_free() */ |
2575 |
+ newsk->sk_destruct = NULL; |
2576 |
+@@ -2738,11 +2749,6 @@ void sk_common_release(struct sock *sk) |
2577 |
+ |
2578 |
+ sk_refcnt_debug_release(sk); |
2579 |
+ |
2580 |
+- if (sk->sk_frag.page) { |
2581 |
+- put_page(sk->sk_frag.page); |
2582 |
+- sk->sk_frag.page = NULL; |
2583 |
+- } |
2584 |
+- |
2585 |
+ sock_put(sk); |
2586 |
+ } |
2587 |
+ EXPORT_SYMBOL(sk_common_release); |
2588 |
+diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c |
2589 |
+index 5b03d7f3b255..6789e48b7085 100644 |
2590 |
+--- a/net/ipv4/fib_frontend.c |
2591 |
++++ b/net/ipv4/fib_frontend.c |
2592 |
+@@ -1081,7 +1081,8 @@ static void nl_fib_input(struct sk_buff *skb) |
2593 |
+ |
2594 |
+ net = sock_net(skb->sk); |
2595 |
+ nlh = nlmsg_hdr(skb); |
2596 |
+- if (skb->len < NLMSG_HDRLEN || skb->len < nlh->nlmsg_len || |
2597 |
++ if (skb->len < nlmsg_total_size(sizeof(*frn)) || |
2598 |
++ skb->len < nlh->nlmsg_len || |
2599 |
+ nlmsg_len(nlh) < sizeof(*frn)) |
2600 |
+ return; |
2601 |
+ |
2602 |
+diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c |
2603 |
+index ce42ded59958..7727ffeaaf9d 100644 |
2604 |
+--- a/net/ipv4/tcp_input.c |
2605 |
++++ b/net/ipv4/tcp_input.c |
2606 |
+@@ -5571,6 +5571,7 @@ void tcp_finish_connect(struct sock *sk, struct sk_buff *skb) |
2607 |
+ struct inet_connection_sock *icsk = inet_csk(sk); |
2608 |
+ |
2609 |
+ tcp_set_state(sk, TCP_ESTABLISHED); |
2610 |
++ icsk->icsk_ack.lrcvtime = tcp_time_stamp; |
2611 |
+ |
2612 |
+ if (skb) { |
2613 |
+ icsk->icsk_af_ops->sk_rx_dst_set(sk, skb); |
2614 |
+@@ -5789,7 +5790,6 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, |
2615 |
+ * to stand against the temptation 8) --ANK |
2616 |
+ */ |
2617 |
+ inet_csk_schedule_ack(sk); |
2618 |
+- icsk->icsk_ack.lrcvtime = tcp_time_stamp; |
2619 |
+ tcp_enter_quickack_mode(sk); |
2620 |
+ inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK, |
2621 |
+ TCP_DELACK_MAX, TCP_RTO_MAX); |
2622 |
+diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c |
2623 |
+index 6234ebaa7db1..8615a6b8550f 100644 |
2624 |
+--- a/net/ipv4/tcp_minisocks.c |
2625 |
++++ b/net/ipv4/tcp_minisocks.c |
2626 |
+@@ -466,6 +466,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, |
2627 |
+ newtp->mdev_us = jiffies_to_usecs(TCP_TIMEOUT_INIT); |
2628 |
+ minmax_reset(&newtp->rtt_min, tcp_time_stamp, ~0U); |
2629 |
+ newicsk->icsk_rto = TCP_TIMEOUT_INIT; |
2630 |
++ newicsk->icsk_ack.lrcvtime = tcp_time_stamp; |
2631 |
+ |
2632 |
+ newtp->packets_out = 0; |
2633 |
+ newtp->retrans_out = 0; |
2634 |
+diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c |
2635 |
+index e4a8000d59ad..40a289f78d77 100644 |
2636 |
+--- a/net/ipv6/udp.c |
2637 |
++++ b/net/ipv6/udp.c |
2638 |
+@@ -1037,6 +1037,7 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) |
2639 |
+ ipc6.hlimit = -1; |
2640 |
+ ipc6.tclass = -1; |
2641 |
+ ipc6.dontfrag = -1; |
2642 |
++ sockc.tsflags = sk->sk_tsflags; |
2643 |
+ |
2644 |
+ /* destination address check */ |
2645 |
+ if (sin6) { |
2646 |
+@@ -1156,7 +1157,6 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) |
2647 |
+ fl6.flowi6_oif = np->sticky_pktinfo.ipi6_ifindex; |
2648 |
+ |
2649 |
+ fl6.flowi6_mark = sk->sk_mark; |
2650 |
+- sockc.tsflags = sk->sk_tsflags; |
2651 |
+ |
2652 |
+ if (msg->msg_controllen) { |
2653 |
+ opt = &opt_space; |
2654 |
+diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c |
2655 |
+index ae25ded82b3b..07925418c2a5 100644 |
2656 |
+--- a/net/openvswitch/flow_netlink.c |
2657 |
++++ b/net/openvswitch/flow_netlink.c |
2658 |
+@@ -588,7 +588,7 @@ static int ip_tun_from_nlattr(const struct nlattr *attr, |
2659 |
+ ipv4 = true; |
2660 |
+ break; |
2661 |
+ case OVS_TUNNEL_KEY_ATTR_IPV6_SRC: |
2662 |
+- SW_FLOW_KEY_PUT(match, tun_key.u.ipv6.dst, |
2663 |
++ SW_FLOW_KEY_PUT(match, tun_key.u.ipv6.src, |
2664 |
+ nla_get_in6_addr(a), is_mask); |
2665 |
+ ipv6 = true; |
2666 |
+ break; |
2667 |
+@@ -649,6 +649,8 @@ static int ip_tun_from_nlattr(const struct nlattr *attr, |
2668 |
+ tun_flags |= TUNNEL_VXLAN_OPT; |
2669 |
+ opts_type = type; |
2670 |
+ break; |
2671 |
++ case OVS_TUNNEL_KEY_ATTR_PAD: |
2672 |
++ break; |
2673 |
+ default: |
2674 |
+ OVS_NLERR(log, "Unknown IP tunnel attribute %d", |
2675 |
+ type); |
2676 |
+diff --git a/net/unix/garbage.c b/net/unix/garbage.c |
2677 |
+index 6a0d48525fcf..c36757e72844 100644 |
2678 |
+--- a/net/unix/garbage.c |
2679 |
++++ b/net/unix/garbage.c |
2680 |
+@@ -146,6 +146,7 @@ void unix_notinflight(struct user_struct *user, struct file *fp) |
2681 |
+ if (s) { |
2682 |
+ struct unix_sock *u = unix_sk(s); |
2683 |
+ |
2684 |
++ BUG_ON(!atomic_long_read(&u->inflight)); |
2685 |
+ BUG_ON(list_empty(&u->link)); |
2686 |
+ |
2687 |
+ if (atomic_long_dec_and_test(&u->inflight)) |
2688 |
+@@ -341,6 +342,14 @@ void unix_gc(void) |
2689 |
+ } |
2690 |
+ list_del(&cursor); |
2691 |
+ |
2692 |
++ /* Now gc_candidates contains only garbage. Restore original |
2693 |
++ * inflight counters for these as well, and remove the skbuffs |
2694 |
++ * which are creating the cycle(s). |
2695 |
++ */ |
2696 |
++ skb_queue_head_init(&hitlist); |
2697 |
++ list_for_each_entry(u, &gc_candidates, link) |
2698 |
++ scan_children(&u->sk, inc_inflight, &hitlist); |
2699 |
++ |
2700 |
+ /* not_cycle_list contains those sockets which do not make up a |
2701 |
+ * cycle. Restore these to the inflight list. |
2702 |
+ */ |
2703 |
+@@ -350,14 +359,6 @@ void unix_gc(void) |
2704 |
+ list_move_tail(&u->link, &gc_inflight_list); |
2705 |
+ } |
2706 |
+ |
2707 |
+- /* Now gc_candidates contains only garbage. Restore original |
2708 |
+- * inflight counters for these as well, and remove the skbuffs |
2709 |
+- * which are creating the cycle(s). |
2710 |
+- */ |
2711 |
+- skb_queue_head_init(&hitlist); |
2712 |
+- list_for_each_entry(u, &gc_candidates, link) |
2713 |
+- scan_children(&u->sk, inc_inflight, &hitlist); |
2714 |
+- |
2715 |
+ spin_unlock(&unix_gc_lock); |
2716 |
+ |
2717 |
+ /* Here we are. Hitlist is filled. Die. */ |
2718 |
+diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c |
2719 |
+index cd7a419faa21..e7a3068a1c3b 100644 |
2720 |
+--- a/net/wireless/nl80211.c |
2721 |
++++ b/net/wireless/nl80211.c |
2722 |
+@@ -548,21 +548,17 @@ static int nl80211_prepare_wdev_dump(struct sk_buff *skb, |
2723 |
+ { |
2724 |
+ int err; |
2725 |
+ |
2726 |
+- rtnl_lock(); |
2727 |
+- |
2728 |
+ if (!cb->args[0]) { |
2729 |
+ err = nlmsg_parse(cb->nlh, GENL_HDRLEN + nl80211_fam.hdrsize, |
2730 |
+ nl80211_fam.attrbuf, nl80211_fam.maxattr, |
2731 |
+ nl80211_policy); |
2732 |
+ if (err) |
2733 |
+- goto out_unlock; |
2734 |
++ return err; |
2735 |
+ |
2736 |
+ *wdev = __cfg80211_wdev_from_attrs(sock_net(skb->sk), |
2737 |
+ nl80211_fam.attrbuf); |
2738 |
+- if (IS_ERR(*wdev)) { |
2739 |
+- err = PTR_ERR(*wdev); |
2740 |
+- goto out_unlock; |
2741 |
+- } |
2742 |
++ if (IS_ERR(*wdev)) |
2743 |
++ return PTR_ERR(*wdev); |
2744 |
+ *rdev = wiphy_to_rdev((*wdev)->wiphy); |
2745 |
+ /* 0 is the first index - add 1 to parse only once */ |
2746 |
+ cb->args[0] = (*rdev)->wiphy_idx + 1; |
2747 |
+@@ -572,10 +568,8 @@ static int nl80211_prepare_wdev_dump(struct sk_buff *skb, |
2748 |
+ struct wiphy *wiphy = wiphy_idx_to_wiphy(cb->args[0] - 1); |
2749 |
+ struct wireless_dev *tmp; |
2750 |
+ |
2751 |
+- if (!wiphy) { |
2752 |
+- err = -ENODEV; |
2753 |
+- goto out_unlock; |
2754 |
+- } |
2755 |
++ if (!wiphy) |
2756 |
++ return -ENODEV; |
2757 |
+ *rdev = wiphy_to_rdev(wiphy); |
2758 |
+ *wdev = NULL; |
2759 |
+ |
2760 |
+@@ -586,21 +580,11 @@ static int nl80211_prepare_wdev_dump(struct sk_buff *skb, |
2761 |
+ } |
2762 |
+ } |
2763 |
+ |
2764 |
+- if (!*wdev) { |
2765 |
+- err = -ENODEV; |
2766 |
+- goto out_unlock; |
2767 |
+- } |
2768 |
++ if (!*wdev) |
2769 |
++ return -ENODEV; |
2770 |
+ } |
2771 |
+ |
2772 |
+ return 0; |
2773 |
+- out_unlock: |
2774 |
+- rtnl_unlock(); |
2775 |
+- return err; |
2776 |
+-} |
2777 |
+- |
2778 |
+-static void nl80211_finish_wdev_dump(struct cfg80211_registered_device *rdev) |
2779 |
+-{ |
2780 |
+- rtnl_unlock(); |
2781 |
+ } |
2782 |
+ |
2783 |
+ /* IE validation */ |
2784 |
+@@ -2584,17 +2568,17 @@ static int nl80211_dump_interface(struct sk_buff *skb, struct netlink_callback * |
2785 |
+ int filter_wiphy = -1; |
2786 |
+ struct cfg80211_registered_device *rdev; |
2787 |
+ struct wireless_dev *wdev; |
2788 |
++ int ret; |
2789 |
+ |
2790 |
+ rtnl_lock(); |
2791 |
+ if (!cb->args[2]) { |
2792 |
+ struct nl80211_dump_wiphy_state state = { |
2793 |
+ .filter_wiphy = -1, |
2794 |
+ }; |
2795 |
+- int ret; |
2796 |
+ |
2797 |
+ ret = nl80211_dump_wiphy_parse(skb, cb, &state); |
2798 |
+ if (ret) |
2799 |
+- return ret; |
2800 |
++ goto out_unlock; |
2801 |
+ |
2802 |
+ filter_wiphy = state.filter_wiphy; |
2803 |
+ |
2804 |
+@@ -2639,12 +2623,14 @@ static int nl80211_dump_interface(struct sk_buff *skb, struct netlink_callback * |
2805 |
+ wp_idx++; |
2806 |
+ } |
2807 |
+ out: |
2808 |
+- rtnl_unlock(); |
2809 |
+- |
2810 |
+ cb->args[0] = wp_idx; |
2811 |
+ cb->args[1] = if_idx; |
2812 |
+ |
2813 |
+- return skb->len; |
2814 |
++ ret = skb->len; |
2815 |
++ out_unlock: |
2816 |
++ rtnl_unlock(); |
2817 |
++ |
2818 |
++ return ret; |
2819 |
+ } |
2820 |
+ |
2821 |
+ static int nl80211_get_interface(struct sk_buff *skb, struct genl_info *info) |
2822 |
+@@ -4371,9 +4357,10 @@ static int nl80211_dump_station(struct sk_buff *skb, |
2823 |
+ int sta_idx = cb->args[2]; |
2824 |
+ int err; |
2825 |
+ |
2826 |
++ rtnl_lock(); |
2827 |
+ err = nl80211_prepare_wdev_dump(skb, cb, &rdev, &wdev); |
2828 |
+ if (err) |
2829 |
+- return err; |
2830 |
++ goto out_err; |
2831 |
+ |
2832 |
+ if (!wdev->netdev) { |
2833 |
+ err = -EINVAL; |
2834 |
+@@ -4408,7 +4395,7 @@ static int nl80211_dump_station(struct sk_buff *skb, |
2835 |
+ cb->args[2] = sta_idx; |
2836 |
+ err = skb->len; |
2837 |
+ out_err: |
2838 |
+- nl80211_finish_wdev_dump(rdev); |
2839 |
++ rtnl_unlock(); |
2840 |
+ |
2841 |
+ return err; |
2842 |
+ } |
2843 |
+@@ -5179,9 +5166,10 @@ static int nl80211_dump_mpath(struct sk_buff *skb, |
2844 |
+ int path_idx = cb->args[2]; |
2845 |
+ int err; |
2846 |
+ |
2847 |
++ rtnl_lock(); |
2848 |
+ err = nl80211_prepare_wdev_dump(skb, cb, &rdev, &wdev); |
2849 |
+ if (err) |
2850 |
+- return err; |
2851 |
++ goto out_err; |
2852 |
+ |
2853 |
+ if (!rdev->ops->dump_mpath) { |
2854 |
+ err = -EOPNOTSUPP; |
2855 |
+@@ -5214,7 +5202,7 @@ static int nl80211_dump_mpath(struct sk_buff *skb, |
2856 |
+ cb->args[2] = path_idx; |
2857 |
+ err = skb->len; |
2858 |
+ out_err: |
2859 |
+- nl80211_finish_wdev_dump(rdev); |
2860 |
++ rtnl_unlock(); |
2861 |
+ return err; |
2862 |
+ } |
2863 |
+ |
2864 |
+@@ -5374,9 +5362,10 @@ static int nl80211_dump_mpp(struct sk_buff *skb, |
2865 |
+ int path_idx = cb->args[2]; |
2866 |
+ int err; |
2867 |
+ |
2868 |
++ rtnl_lock(); |
2869 |
+ err = nl80211_prepare_wdev_dump(skb, cb, &rdev, &wdev); |
2870 |
+ if (err) |
2871 |
+- return err; |
2872 |
++ goto out_err; |
2873 |
+ |
2874 |
+ if (!rdev->ops->dump_mpp) { |
2875 |
+ err = -EOPNOTSUPP; |
2876 |
+@@ -5409,7 +5398,7 @@ static int nl80211_dump_mpp(struct sk_buff *skb, |
2877 |
+ cb->args[2] = path_idx; |
2878 |
+ err = skb->len; |
2879 |
+ out_err: |
2880 |
+- nl80211_finish_wdev_dump(rdev); |
2881 |
++ rtnl_unlock(); |
2882 |
+ return err; |
2883 |
+ } |
2884 |
+ |
2885 |
+@@ -7556,9 +7545,12 @@ static int nl80211_dump_scan(struct sk_buff *skb, struct netlink_callback *cb) |
2886 |
+ int start = cb->args[2], idx = 0; |
2887 |
+ int err; |
2888 |
+ |
2889 |
++ rtnl_lock(); |
2890 |
+ err = nl80211_prepare_wdev_dump(skb, cb, &rdev, &wdev); |
2891 |
+- if (err) |
2892 |
++ if (err) { |
2893 |
++ rtnl_unlock(); |
2894 |
+ return err; |
2895 |
++ } |
2896 |
+ |
2897 |
+ wdev_lock(wdev); |
2898 |
+ spin_lock_bh(&rdev->bss_lock); |
2899 |
+@@ -7581,7 +7573,7 @@ static int nl80211_dump_scan(struct sk_buff *skb, struct netlink_callback *cb) |
2900 |
+ wdev_unlock(wdev); |
2901 |
+ |
2902 |
+ cb->args[2] = idx; |
2903 |
+- nl80211_finish_wdev_dump(rdev); |
2904 |
++ rtnl_unlock(); |
2905 |
+ |
2906 |
+ return skb->len; |
2907 |
+ } |
2908 |
+@@ -7665,9 +7657,10 @@ static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb) |
2909 |
+ int res; |
2910 |
+ bool radio_stats; |
2911 |
+ |
2912 |
++ rtnl_lock(); |
2913 |
+ res = nl80211_prepare_wdev_dump(skb, cb, &rdev, &wdev); |
2914 |
+ if (res) |
2915 |
+- return res; |
2916 |
++ goto out_err; |
2917 |
+ |
2918 |
+ /* prepare_wdev_dump parsed the attributes */ |
2919 |
+ radio_stats = nl80211_fam.attrbuf[NL80211_ATTR_SURVEY_RADIO_STATS]; |
2920 |
+@@ -7708,7 +7701,7 @@ static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb) |
2921 |
+ cb->args[2] = survey_idx; |
2922 |
+ res = skb->len; |
2923 |
+ out_err: |
2924 |
+- nl80211_finish_wdev_dump(rdev); |
2925 |
++ rtnl_unlock(); |
2926 |
+ return res; |
2927 |
+ } |
2928 |
+ |
2929 |
+@@ -11299,17 +11292,13 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb, |
2930 |
+ void *data = NULL; |
2931 |
+ unsigned int data_len = 0; |
2932 |
+ |
2933 |
+- rtnl_lock(); |
2934 |
+- |
2935 |
+ if (cb->args[0]) { |
2936 |
+ /* subtract the 1 again here */ |
2937 |
+ struct wiphy *wiphy = wiphy_idx_to_wiphy(cb->args[0] - 1); |
2938 |
+ struct wireless_dev *tmp; |
2939 |
+ |
2940 |
+- if (!wiphy) { |
2941 |
+- err = -ENODEV; |
2942 |
+- goto out_unlock; |
2943 |
+- } |
2944 |
++ if (!wiphy) |
2945 |
++ return -ENODEV; |
2946 |
+ *rdev = wiphy_to_rdev(wiphy); |
2947 |
+ *wdev = NULL; |
2948 |
+ |
2949 |
+@@ -11330,13 +11319,11 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb, |
2950 |
+ nl80211_fam.attrbuf, nl80211_fam.maxattr, |
2951 |
+ nl80211_policy); |
2952 |
+ if (err) |
2953 |
+- goto out_unlock; |
2954 |
++ return err; |
2955 |
+ |
2956 |
+ if (!nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_ID] || |
2957 |
+- !nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_SUBCMD]) { |
2958 |
+- err = -EINVAL; |
2959 |
+- goto out_unlock; |
2960 |
+- } |
2961 |
++ !nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_SUBCMD]) |
2962 |
++ return -EINVAL; |
2963 |
+ |
2964 |
+ *wdev = __cfg80211_wdev_from_attrs(sock_net(skb->sk), |
2965 |
+ nl80211_fam.attrbuf); |
2966 |
+@@ -11345,10 +11332,8 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb, |
2967 |
+ |
2968 |
+ *rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), |
2969 |
+ nl80211_fam.attrbuf); |
2970 |
+- if (IS_ERR(*rdev)) { |
2971 |
+- err = PTR_ERR(*rdev); |
2972 |
+- goto out_unlock; |
2973 |
+- } |
2974 |
++ if (IS_ERR(*rdev)) |
2975 |
++ return PTR_ERR(*rdev); |
2976 |
+ |
2977 |
+ vid = nla_get_u32(nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_ID]); |
2978 |
+ subcmd = nla_get_u32(nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_SUBCMD]); |
2979 |
+@@ -11361,19 +11346,15 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb, |
2980 |
+ if (vcmd->info.vendor_id != vid || vcmd->info.subcmd != subcmd) |
2981 |
+ continue; |
2982 |
+ |
2983 |
+- if (!vcmd->dumpit) { |
2984 |
+- err = -EOPNOTSUPP; |
2985 |
+- goto out_unlock; |
2986 |
+- } |
2987 |
++ if (!vcmd->dumpit) |
2988 |
++ return -EOPNOTSUPP; |
2989 |
+ |
2990 |
+ vcmd_idx = i; |
2991 |
+ break; |
2992 |
+ } |
2993 |
+ |
2994 |
+- if (vcmd_idx < 0) { |
2995 |
+- err = -EOPNOTSUPP; |
2996 |
+- goto out_unlock; |
2997 |
+- } |
2998 |
++ if (vcmd_idx < 0) |
2999 |
++ return -EOPNOTSUPP; |
3000 |
+ |
3001 |
+ if (nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_DATA]) { |
3002 |
+ data = nla_data(nl80211_fam.attrbuf[NL80211_ATTR_VENDOR_DATA]); |
3003 |
+@@ -11390,9 +11371,6 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb, |
3004 |
+ |
3005 |
+ /* keep rtnl locked in successful case */ |
3006 |
+ return 0; |
3007 |
+- out_unlock: |
3008 |
+- rtnl_unlock(); |
3009 |
+- return err; |
3010 |
+ } |
3011 |
+ |
3012 |
+ static int nl80211_vendor_cmd_dump(struct sk_buff *skb, |
3013 |
+@@ -11407,9 +11385,10 @@ static int nl80211_vendor_cmd_dump(struct sk_buff *skb, |
3014 |
+ int err; |
3015 |
+ struct nlattr *vendor_data; |
3016 |
+ |
3017 |
++ rtnl_lock(); |
3018 |
+ err = nl80211_prepare_vendor_dump(skb, cb, &rdev, &wdev); |
3019 |
+ if (err) |
3020 |
+- return err; |
3021 |
++ goto out; |
3022 |
+ |
3023 |
+ vcmd_idx = cb->args[2]; |
3024 |
+ data = (void *)cb->args[3]; |
3025 |
+@@ -11418,18 +11397,26 @@ static int nl80211_vendor_cmd_dump(struct sk_buff *skb, |
3026 |
+ |
3027 |
+ if (vcmd->flags & (WIPHY_VENDOR_CMD_NEED_WDEV | |
3028 |
+ WIPHY_VENDOR_CMD_NEED_NETDEV)) { |
3029 |
+- if (!wdev) |
3030 |
+- return -EINVAL; |
3031 |
++ if (!wdev) { |
3032 |
++ err = -EINVAL; |
3033 |
++ goto out; |
3034 |
++ } |
3035 |
+ if (vcmd->flags & WIPHY_VENDOR_CMD_NEED_NETDEV && |
3036 |
+- !wdev->netdev) |
3037 |
+- return -EINVAL; |
3038 |
++ !wdev->netdev) { |
3039 |
++ err = -EINVAL; |
3040 |
++ goto out; |
3041 |
++ } |
3042 |
+ |
3043 |
+ if (vcmd->flags & WIPHY_VENDOR_CMD_NEED_RUNNING) { |
3044 |
+ if (wdev->netdev && |
3045 |
+- !netif_running(wdev->netdev)) |
3046 |
+- return -ENETDOWN; |
3047 |
+- if (!wdev->netdev && !wdev->p2p_started) |
3048 |
+- return -ENETDOWN; |
3049 |
++ !netif_running(wdev->netdev)) { |
3050 |
++ err = -ENETDOWN; |
3051 |
++ goto out; |
3052 |
++ } |
3053 |
++ if (!wdev->netdev && !wdev->p2p_started) { |
3054 |
++ err = -ENETDOWN; |
3055 |
++ goto out; |
3056 |
++ } |
3057 |
+ } |
3058 |
+ } |
3059 |
+ |
3060 |
+diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c |
3061 |
+index 4c935202ce23..f3b1d7f50b81 100644 |
3062 |
+--- a/sound/core/seq/seq_clientmgr.c |
3063 |
++++ b/sound/core/seq/seq_clientmgr.c |
3064 |
+@@ -1832,6 +1832,7 @@ static int snd_seq_ioctl_set_client_pool(struct snd_seq_client *client, |
3065 |
+ info->output_pool != client->pool->size)) { |
3066 |
+ if (snd_seq_write_pool_allocated(client)) { |
3067 |
+ /* remove all existing cells */ |
3068 |
++ snd_seq_pool_mark_closing(client->pool); |
3069 |
+ snd_seq_queue_client_leave_cells(client->number); |
3070 |
+ snd_seq_pool_done(client->pool); |
3071 |
+ } |
3072 |
+diff --git a/sound/core/seq/seq_fifo.c b/sound/core/seq/seq_fifo.c |
3073 |
+index 86240d02b530..3f4efcb85df5 100644 |
3074 |
+--- a/sound/core/seq/seq_fifo.c |
3075 |
++++ b/sound/core/seq/seq_fifo.c |
3076 |
+@@ -70,6 +70,9 @@ void snd_seq_fifo_delete(struct snd_seq_fifo **fifo) |
3077 |
+ return; |
3078 |
+ *fifo = NULL; |
3079 |
+ |
3080 |
++ if (f->pool) |
3081 |
++ snd_seq_pool_mark_closing(f->pool); |
3082 |
++ |
3083 |
+ snd_seq_fifo_clear(f); |
3084 |
+ |
3085 |
+ /* wake up clients if any */ |
3086 |
+diff --git a/sound/core/seq/seq_memory.c b/sound/core/seq/seq_memory.c |
3087 |
+index dfa5156f3585..5847c4475bf3 100644 |
3088 |
+--- a/sound/core/seq/seq_memory.c |
3089 |
++++ b/sound/core/seq/seq_memory.c |
3090 |
+@@ -414,6 +414,18 @@ int snd_seq_pool_init(struct snd_seq_pool *pool) |
3091 |
+ return 0; |
3092 |
+ } |
3093 |
+ |
3094 |
++/* refuse the further insertion to the pool */ |
3095 |
++void snd_seq_pool_mark_closing(struct snd_seq_pool *pool) |
3096 |
++{ |
3097 |
++ unsigned long flags; |
3098 |
++ |
3099 |
++ if (snd_BUG_ON(!pool)) |
3100 |
++ return; |
3101 |
++ spin_lock_irqsave(&pool->lock, flags); |
3102 |
++ pool->closing = 1; |
3103 |
++ spin_unlock_irqrestore(&pool->lock, flags); |
3104 |
++} |
3105 |
++ |
3106 |
+ /* remove events */ |
3107 |
+ int snd_seq_pool_done(struct snd_seq_pool *pool) |
3108 |
+ { |
3109 |
+@@ -424,10 +436,6 @@ int snd_seq_pool_done(struct snd_seq_pool *pool) |
3110 |
+ return -EINVAL; |
3111 |
+ |
3112 |
+ /* wait for closing all threads */ |
3113 |
+- spin_lock_irqsave(&pool->lock, flags); |
3114 |
+- pool->closing = 1; |
3115 |
+- spin_unlock_irqrestore(&pool->lock, flags); |
3116 |
+- |
3117 |
+ if (waitqueue_active(&pool->output_sleep)) |
3118 |
+ wake_up(&pool->output_sleep); |
3119 |
+ |
3120 |
+@@ -484,6 +492,7 @@ int snd_seq_pool_delete(struct snd_seq_pool **ppool) |
3121 |
+ *ppool = NULL; |
3122 |
+ if (pool == NULL) |
3123 |
+ return 0; |
3124 |
++ snd_seq_pool_mark_closing(pool); |
3125 |
+ snd_seq_pool_done(pool); |
3126 |
+ kfree(pool); |
3127 |
+ return 0; |
3128 |
+diff --git a/sound/core/seq/seq_memory.h b/sound/core/seq/seq_memory.h |
3129 |
+index 4a2ec779b8a7..32f959c17786 100644 |
3130 |
+--- a/sound/core/seq/seq_memory.h |
3131 |
++++ b/sound/core/seq/seq_memory.h |
3132 |
+@@ -84,6 +84,7 @@ static inline int snd_seq_total_cells(struct snd_seq_pool *pool) |
3133 |
+ int snd_seq_pool_init(struct snd_seq_pool *pool); |
3134 |
+ |
3135 |
+ /* done pool - free events */ |
3136 |
++void snd_seq_pool_mark_closing(struct snd_seq_pool *pool); |
3137 |
+ int snd_seq_pool_done(struct snd_seq_pool *pool); |
3138 |
+ |
3139 |
+ /* create pool */ |
3140 |
+diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c |
3141 |
+index ab4cdab5cfa5..79edd88d5cd0 100644 |
3142 |
+--- a/sound/pci/ctxfi/cthw20k1.c |
3143 |
++++ b/sound/pci/ctxfi/cthw20k1.c |
3144 |
+@@ -1905,7 +1905,7 @@ static int hw_card_start(struct hw *hw) |
3145 |
+ return err; |
3146 |
+ |
3147 |
+ /* Set DMA transfer mask */ |
3148 |
+- if (dma_set_mask(&pci->dev, DMA_BIT_MASK(dma_bits))) { |
3149 |
++ if (!dma_set_mask(&pci->dev, DMA_BIT_MASK(dma_bits))) { |
3150 |
+ dma_set_coherent_mask(&pci->dev, DMA_BIT_MASK(dma_bits)); |
3151 |
+ } else { |
3152 |
+ dma_set_mask(&pci->dev, DMA_BIT_MASK(32)); |
3153 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
3154 |
+index 0c62b1d8c11b..112caa2d3c14 100644 |
3155 |
+--- a/sound/pci/hda/patch_realtek.c |
3156 |
++++ b/sound/pci/hda/patch_realtek.c |
3157 |
+@@ -6058,6 +6058,8 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
3158 |
+ ALC295_STANDARD_PINS, |
3159 |
+ {0x17, 0x21014040}, |
3160 |
+ {0x18, 0x21a19050}), |
3161 |
++ SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, |
3162 |
++ ALC295_STANDARD_PINS), |
3163 |
+ SND_HDA_PIN_QUIRK(0x10ec0298, 0x1028, "Dell", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE, |
3164 |
+ ALC298_STANDARD_PINS, |
3165 |
+ {0x17, 0x90170110}), |