Contents of /trunk/kernel-alx-legacy/patches-4.9/0345-4.9.246-all-fixes.patch
Parent Directory | Revision Log
Revision 3647 -
(show annotations)
(download)
Mon Oct 24 14:07:27 2022 UTC (20 months ago) by niro
File size: 44233 byte(s)
Mon Oct 24 14:07:27 2022 UTC (20 months ago) by niro
File size: 44233 byte(s)
-linux-4.9.246
1 | diff --git a/Makefile b/Makefile |
2 | index b72f286d3bcdd..b9e2a97da5da7 100644 |
3 | --- a/Makefile |
4 | +++ b/Makefile |
5 | @@ -1,6 +1,6 @@ |
6 | VERSION = 4 |
7 | PATCHLEVEL = 9 |
8 | -SUBLEVEL = 245 |
9 | +SUBLEVEL = 246 |
10 | EXTRAVERSION = |
11 | NAME = Roaring Lionus |
12 | |
13 | diff --git a/arch/arm/boot/dts/imx50-evk.dts b/arch/arm/boot/dts/imx50-evk.dts |
14 | index 27d763c7a307d..4dbd180e72ba6 100644 |
15 | --- a/arch/arm/boot/dts/imx50-evk.dts |
16 | +++ b/arch/arm/boot/dts/imx50-evk.dts |
17 | @@ -66,7 +66,7 @@ |
18 | MX50_PAD_CSPI_MISO__CSPI_MISO 0x00 |
19 | MX50_PAD_CSPI_MOSI__CSPI_MOSI 0x00 |
20 | MX50_PAD_CSPI_SS0__GPIO4_11 0xc4 |
21 | - MX50_PAD_ECSPI1_MOSI__CSPI_SS1 0xf4 |
22 | + MX50_PAD_ECSPI1_MOSI__GPIO4_13 0x84 |
23 | >; |
24 | }; |
25 | |
26 | diff --git a/arch/arm/boot/dts/imx6qdl-udoo.dtsi b/arch/arm/boot/dts/imx6qdl-udoo.dtsi |
27 | index c96c91d836785..fc4ae2e423bd7 100644 |
28 | --- a/arch/arm/boot/dts/imx6qdl-udoo.dtsi |
29 | +++ b/arch/arm/boot/dts/imx6qdl-udoo.dtsi |
30 | @@ -94,7 +94,7 @@ |
31 | &fec { |
32 | pinctrl-names = "default"; |
33 | pinctrl-0 = <&pinctrl_enet>; |
34 | - phy-mode = "rgmii"; |
35 | + phy-mode = "rgmii-id"; |
36 | status = "okay"; |
37 | }; |
38 | |
39 | diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c |
40 | index e3713d6fb8e00..bf6142a80cf1a 100644 |
41 | --- a/arch/arm64/kernel/psci.c |
42 | +++ b/arch/arm64/kernel/psci.c |
43 | @@ -68,7 +68,6 @@ static int cpu_psci_cpu_disable(unsigned int cpu) |
44 | |
45 | static void cpu_psci_cpu_die(unsigned int cpu) |
46 | { |
47 | - int ret; |
48 | /* |
49 | * There are no known implementations of PSCI actually using the |
50 | * power state field, pass a sensible default for now. |
51 | @@ -76,9 +75,7 @@ static void cpu_psci_cpu_die(unsigned int cpu) |
52 | u32 state = PSCI_POWER_STATE_TYPE_POWER_DOWN << |
53 | PSCI_0_2_POWER_STATE_TYPE_SHIFT; |
54 | |
55 | - ret = psci_ops.cpu_off(state); |
56 | - |
57 | - pr_crit("unable to power off CPU%u (%d)\n", cpu, ret); |
58 | + psci_ops.cpu_off(state); |
59 | } |
60 | |
61 | static int cpu_psci_cpu_kill(unsigned int cpu) |
62 | diff --git a/arch/mips/alchemy/common/clock.c b/arch/mips/alchemy/common/clock.c |
63 | index 7ba7ea0a22f80..e6d0044393b08 100644 |
64 | --- a/arch/mips/alchemy/common/clock.c |
65 | +++ b/arch/mips/alchemy/common/clock.c |
66 | @@ -151,6 +151,7 @@ static struct clk __init *alchemy_clk_setup_cpu(const char *parent_name, |
67 | { |
68 | struct clk_init_data id; |
69 | struct clk_hw *h; |
70 | + struct clk *clk; |
71 | |
72 | h = kzalloc(sizeof(*h), GFP_KERNEL); |
73 | if (!h) |
74 | @@ -163,7 +164,13 @@ static struct clk __init *alchemy_clk_setup_cpu(const char *parent_name, |
75 | id.ops = &alchemy_clkops_cpu; |
76 | h->init = &id; |
77 | |
78 | - return clk_register(NULL, h); |
79 | + clk = clk_register(NULL, h); |
80 | + if (IS_ERR(clk)) { |
81 | + pr_err("failed to register clock\n"); |
82 | + kfree(h); |
83 | + } |
84 | + |
85 | + return clk; |
86 | } |
87 | |
88 | /* AUXPLLs ************************************************************/ |
89 | diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c |
90 | index 0596505770dba..11985399c4695 100644 |
91 | --- a/arch/mips/mm/tlb-r4k.c |
92 | +++ b/arch/mips/mm/tlb-r4k.c |
93 | @@ -424,6 +424,7 @@ int has_transparent_hugepage(void) |
94 | } |
95 | return mask == PM_HUGE_MASK; |
96 | } |
97 | +EXPORT_SYMBOL(has_transparent_hugepage); |
98 | |
99 | #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ |
100 | |
101 | diff --git a/arch/powerpc/include/asm/book3s/64/kup-radix.h b/arch/powerpc/include/asm/book3s/64/kup-radix.h |
102 | index aa54ac2e5659e..cce8e7497d72b 100644 |
103 | --- a/arch/powerpc/include/asm/book3s/64/kup-radix.h |
104 | +++ b/arch/powerpc/include/asm/book3s/64/kup-radix.h |
105 | @@ -1,6 +1,7 @@ |
106 | /* SPDX-License-Identifier: GPL-2.0 */ |
107 | #ifndef _ASM_POWERPC_BOOK3S_64_KUP_RADIX_H |
108 | #define _ASM_POWERPC_BOOK3S_64_KUP_RADIX_H |
109 | +#include <linux/jump_label.h> |
110 | |
111 | DECLARE_STATIC_KEY_FALSE(uaccess_flush_key); |
112 | |
113 | diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c |
114 | index c62eb09b2ba7b..427b70397fcd3 100644 |
115 | --- a/arch/s390/kernel/perf_cpum_sf.c |
116 | +++ b/arch/s390/kernel/perf_cpum_sf.c |
117 | @@ -1663,4 +1663,4 @@ out: |
118 | return err; |
119 | } |
120 | arch_initcall(init_cpum_sampling_pmu); |
121 | -core_param(cpum_sfb_size, CPUM_SF_MAX_SDB, sfb_size, 0640); |
122 | +core_param(cpum_sfb_size, CPUM_SF_MAX_SDB, sfb_size, 0644); |
123 | diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c |
124 | index 1308abfc47580..0939151a42a9d 100644 |
125 | --- a/arch/x86/kernel/cpu/microcode/intel.c |
126 | +++ b/arch/x86/kernel/cpu/microcode/intel.c |
127 | @@ -147,51 +147,6 @@ load_microcode(struct mc_saved_data *mcs, unsigned long *mc_ptrs, |
128 | } |
129 | } |
130 | |
131 | -/* |
132 | - * Given CPU signature and a microcode patch, this function finds if the |
133 | - * microcode patch has matching family and model with the CPU. |
134 | - */ |
135 | -static enum ucode_state |
136 | -matching_model_microcode(struct microcode_header_intel *mc_header, |
137 | - unsigned long sig) |
138 | -{ |
139 | - unsigned int fam, model; |
140 | - unsigned int fam_ucode, model_ucode; |
141 | - struct extended_sigtable *ext_header; |
142 | - unsigned long total_size = get_totalsize(mc_header); |
143 | - unsigned long data_size = get_datasize(mc_header); |
144 | - int ext_sigcount, i; |
145 | - struct extended_signature *ext_sig; |
146 | - |
147 | - fam = x86_family(sig); |
148 | - model = x86_model(sig); |
149 | - |
150 | - fam_ucode = x86_family(mc_header->sig); |
151 | - model_ucode = x86_model(mc_header->sig); |
152 | - |
153 | - if (fam == fam_ucode && model == model_ucode) |
154 | - return UCODE_OK; |
155 | - |
156 | - /* Look for ext. headers: */ |
157 | - if (total_size <= data_size + MC_HEADER_SIZE) |
158 | - return UCODE_NFOUND; |
159 | - |
160 | - ext_header = (void *) mc_header + data_size + MC_HEADER_SIZE; |
161 | - ext_sig = (void *)ext_header + EXT_HEADER_SIZE; |
162 | - ext_sigcount = ext_header->count; |
163 | - |
164 | - for (i = 0; i < ext_sigcount; i++) { |
165 | - fam_ucode = x86_family(ext_sig->sig); |
166 | - model_ucode = x86_model(ext_sig->sig); |
167 | - |
168 | - if (fam == fam_ucode && model == model_ucode) |
169 | - return UCODE_OK; |
170 | - |
171 | - ext_sig++; |
172 | - } |
173 | - return UCODE_NFOUND; |
174 | -} |
175 | - |
176 | static int |
177 | save_microcode(struct mc_saved_data *mcs, |
178 | struct microcode_intel **mc_saved_src, |
179 | @@ -332,7 +287,8 @@ get_matching_model_microcode(unsigned long start, void *data, size_t size, |
180 | * the platform, we need to find and save microcode patches |
181 | * with the same family and model as the BSP. |
182 | */ |
183 | - if (matching_model_microcode(mc_header, uci->cpu_sig.sig) != UCODE_OK) { |
184 | + if (!find_matching_signature(mc_header, uci->cpu_sig.sig, |
185 | + uci->cpu_sig.pf)) { |
186 | ucode_ptr += mc_size; |
187 | continue; |
188 | } |
189 | diff --git a/arch/xtensa/mm/cache.c b/arch/xtensa/mm/cache.c |
190 | index 3c75c4e597da8..7aaedeebb35dd 100644 |
191 | --- a/arch/xtensa/mm/cache.c |
192 | +++ b/arch/xtensa/mm/cache.c |
193 | @@ -74,8 +74,10 @@ static inline void kmap_invalidate_coherent(struct page *page, |
194 | kvaddr = TLBTEMP_BASE_1 + |
195 | (page_to_phys(page) & DCACHE_ALIAS_MASK); |
196 | |
197 | + preempt_disable(); |
198 | __invalidate_dcache_page_alias(kvaddr, |
199 | page_to_phys(page)); |
200 | + preempt_enable(); |
201 | } |
202 | } |
203 | } |
204 | @@ -160,6 +162,7 @@ void flush_dcache_page(struct page *page) |
205 | if (!alias && !mapping) |
206 | return; |
207 | |
208 | + preempt_disable(); |
209 | virt = TLBTEMP_BASE_1 + (phys & DCACHE_ALIAS_MASK); |
210 | __flush_invalidate_dcache_page_alias(virt, phys); |
211 | |
212 | @@ -170,6 +173,7 @@ void flush_dcache_page(struct page *page) |
213 | |
214 | if (mapping) |
215 | __invalidate_icache_page_alias(virt, phys); |
216 | + preempt_enable(); |
217 | } |
218 | |
219 | /* There shouldn't be an entry in the cache for this page anymore. */ |
220 | @@ -203,8 +207,10 @@ void local_flush_cache_page(struct vm_area_struct *vma, unsigned long address, |
221 | unsigned long phys = page_to_phys(pfn_to_page(pfn)); |
222 | unsigned long virt = TLBTEMP_BASE_1 + (address & DCACHE_ALIAS_MASK); |
223 | |
224 | + preempt_disable(); |
225 | __flush_invalidate_dcache_page_alias(virt, phys); |
226 | __invalidate_icache_page_alias(virt, phys); |
227 | + preempt_enable(); |
228 | } |
229 | EXPORT_SYMBOL(local_flush_cache_page); |
230 | |
231 | @@ -231,11 +237,13 @@ update_mmu_cache(struct vm_area_struct * vma, unsigned long addr, pte_t *ptep) |
232 | unsigned long phys = page_to_phys(page); |
233 | unsigned long tmp; |
234 | |
235 | + preempt_disable(); |
236 | tmp = TLBTEMP_BASE_1 + (phys & DCACHE_ALIAS_MASK); |
237 | __flush_invalidate_dcache_page_alias(tmp, phys); |
238 | tmp = TLBTEMP_BASE_1 + (addr & DCACHE_ALIAS_MASK); |
239 | __flush_invalidate_dcache_page_alias(tmp, phys); |
240 | __invalidate_icache_page_alias(tmp, phys); |
241 | + preempt_enable(); |
242 | |
243 | clear_bit(PG_arch_1, &page->flags); |
244 | } |
245 | @@ -269,7 +277,9 @@ void copy_to_user_page(struct vm_area_struct *vma, struct page *page, |
246 | |
247 | if (alias) { |
248 | unsigned long t = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK); |
249 | + preempt_disable(); |
250 | __flush_invalidate_dcache_page_alias(t, phys); |
251 | + preempt_enable(); |
252 | } |
253 | |
254 | /* Copy data */ |
255 | @@ -284,9 +294,11 @@ void copy_to_user_page(struct vm_area_struct *vma, struct page *page, |
256 | if (alias) { |
257 | unsigned long t = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK); |
258 | |
259 | + preempt_disable(); |
260 | __flush_invalidate_dcache_range((unsigned long) dst, len); |
261 | if ((vma->vm_flags & VM_EXEC) != 0) |
262 | __invalidate_icache_page_alias(t, phys); |
263 | + preempt_enable(); |
264 | |
265 | } else if ((vma->vm_flags & VM_EXEC) != 0) { |
266 | __flush_dcache_range((unsigned long)dst,len); |
267 | @@ -308,7 +320,9 @@ extern void copy_from_user_page(struct vm_area_struct *vma, struct page *page, |
268 | |
269 | if (alias) { |
270 | unsigned long t = TLBTEMP_BASE_1 + (vaddr & DCACHE_ALIAS_MASK); |
271 | + preempt_disable(); |
272 | __flush_invalidate_dcache_page_alias(t, phys); |
273 | + preempt_enable(); |
274 | } |
275 | |
276 | memcpy(dst, src, len); |
277 | diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c |
278 | index c7296b5837873..8bcd09fb0feb9 100644 |
279 | --- a/drivers/atm/nicstar.c |
280 | +++ b/drivers/atm/nicstar.c |
281 | @@ -1707,6 +1707,8 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb) |
282 | |
283 | if (push_scqe(card, vc, scq, &scqe, skb) != 0) { |
284 | atomic_inc(&vcc->stats->tx_err); |
285 | + dma_unmap_single(&card->pcidev->dev, NS_PRV_DMA(skb), skb->len, |
286 | + DMA_TO_DEVICE); |
287 | dev_kfree_skb_any(skb); |
288 | return -EIO; |
289 | } |
290 | diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c |
291 | index 780f886ccbfe9..261fbdb88fe15 100644 |
292 | --- a/drivers/iio/accel/kxcjk-1013.c |
293 | +++ b/drivers/iio/accel/kxcjk-1013.c |
294 | @@ -91,6 +91,11 @@ enum kx_chipset { |
295 | KX_MAX_CHIPS /* this must be last */ |
296 | }; |
297 | |
298 | +enum kx_acpi_type { |
299 | + ACPI_GENERIC, |
300 | + ACPI_SMO8500, |
301 | +}; |
302 | + |
303 | struct kxcjk1013_data { |
304 | struct i2c_client *client; |
305 | struct iio_trigger *dready_trig; |
306 | @@ -107,7 +112,7 @@ struct kxcjk1013_data { |
307 | bool motion_trigger_on; |
308 | int64_t timestamp; |
309 | enum kx_chipset chipset; |
310 | - bool is_smo8500_device; |
311 | + enum kx_acpi_type acpi_type; |
312 | }; |
313 | |
314 | enum kxcjk1013_axis { |
315 | @@ -1144,7 +1149,7 @@ static irqreturn_t kxcjk1013_data_rdy_trig_poll(int irq, void *private) |
316 | |
317 | static const char *kxcjk1013_match_acpi_device(struct device *dev, |
318 | enum kx_chipset *chipset, |
319 | - bool *is_smo8500_device) |
320 | + enum kx_acpi_type *acpi_type) |
321 | { |
322 | const struct acpi_device_id *id; |
323 | |
324 | @@ -1153,7 +1158,7 @@ static const char *kxcjk1013_match_acpi_device(struct device *dev, |
325 | return NULL; |
326 | |
327 | if (strcmp(id->id, "SMO8500") == 0) |
328 | - *is_smo8500_device = true; |
329 | + *acpi_type = ACPI_SMO8500; |
330 | |
331 | *chipset = (enum kx_chipset)id->driver_data; |
332 | |
333 | @@ -1189,7 +1194,7 @@ static int kxcjk1013_probe(struct i2c_client *client, |
334 | } else if (ACPI_HANDLE(&client->dev)) { |
335 | name = kxcjk1013_match_acpi_device(&client->dev, |
336 | &data->chipset, |
337 | - &data->is_smo8500_device); |
338 | + &data->acpi_type); |
339 | } else |
340 | return -ENODEV; |
341 | |
342 | @@ -1207,7 +1212,7 @@ static int kxcjk1013_probe(struct i2c_client *client, |
343 | indio_dev->modes = INDIO_DIRECT_MODE; |
344 | indio_dev->info = &kxcjk1013_info; |
345 | |
346 | - if (client->irq > 0 && !data->is_smo8500_device) { |
347 | + if (client->irq > 0 && data->acpi_type != ACPI_SMO8500) { |
348 | ret = devm_request_threaded_irq(&client->dev, client->irq, |
349 | kxcjk1013_data_rdy_trig_poll, |
350 | kxcjk1013_event_handler, |
351 | diff --git a/drivers/input/misc/adxl34x.c b/drivers/input/misc/adxl34x.c |
352 | index 2b2d02f408bbb..2e189646d8fe2 100644 |
353 | --- a/drivers/input/misc/adxl34x.c |
354 | +++ b/drivers/input/misc/adxl34x.c |
355 | @@ -696,7 +696,7 @@ struct adxl34x *adxl34x_probe(struct device *dev, int irq, |
356 | struct input_dev *input_dev; |
357 | const struct adxl34x_platform_data *pdata; |
358 | int err, range, i; |
359 | - unsigned char revid; |
360 | + int revid; |
361 | |
362 | if (!irq) { |
363 | dev_err(dev, "no IRQ?\n"); |
364 | diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c |
365 | index 617eb75c7c0ce..c7508d9a4c6fb 100644 |
366 | --- a/drivers/net/can/dev.c |
367 | +++ b/drivers/net/can/dev.c |
368 | @@ -555,7 +555,7 @@ static void can_restart(struct net_device *dev) |
369 | } |
370 | cf->can_id |= CAN_ERR_RESTARTED; |
371 | |
372 | - netif_rx(skb); |
373 | + netif_rx_ni(skb); |
374 | |
375 | stats->rx_packets++; |
376 | stats->rx_bytes += cf->can_dlc; |
377 | diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c |
378 | index 195f15edb32e3..0bd7e71647964 100644 |
379 | --- a/drivers/net/can/m_can/m_can.c |
380 | +++ b/drivers/net/can/m_can/m_can.c |
381 | @@ -572,7 +572,7 @@ static int m_can_handle_state_change(struct net_device *dev, |
382 | unsigned int ecr; |
383 | |
384 | switch (new_state) { |
385 | - case CAN_STATE_ERROR_ACTIVE: |
386 | + case CAN_STATE_ERROR_WARNING: |
387 | /* error warning state */ |
388 | priv->can.can_stats.error_warning++; |
389 | priv->can.state = CAN_STATE_ERROR_WARNING; |
390 | @@ -601,7 +601,7 @@ static int m_can_handle_state_change(struct net_device *dev, |
391 | __m_can_get_berr_counter(dev, &bec); |
392 | |
393 | switch (new_state) { |
394 | - case CAN_STATE_ERROR_ACTIVE: |
395 | + case CAN_STATE_ERROR_WARNING: |
396 | /* error warning state */ |
397 | cf->can_id |= CAN_ERR_CRTL; |
398 | cf->data[1] = (bec.txerr > bec.rxerr) ? |
399 | diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c |
400 | index 74b37309efab7..2e316228aa1e8 100644 |
401 | --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c |
402 | +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c |
403 | @@ -178,7 +178,7 @@ void peak_usb_get_ts_tv(struct peak_time_ref *time_ref, u32 ts, |
404 | if (time_ref->ts_dev_1 < time_ref->ts_dev_2) { |
405 | /* case when event time (tsw) wraps */ |
406 | if (ts < time_ref->ts_dev_1) |
407 | - delta_ts = 1 << time_ref->adapter->ts_used_bits; |
408 | + delta_ts = BIT_ULL(time_ref->adapter->ts_used_bits); |
409 | |
410 | /* Otherwise, sync time counter (ts_dev_2) has wrapped: |
411 | * handle case when event time (tsn) hasn't. |
412 | @@ -190,7 +190,7 @@ void peak_usb_get_ts_tv(struct peak_time_ref *time_ref, u32 ts, |
413 | * tsn ts |
414 | */ |
415 | } else if (time_ref->ts_dev_1 < ts) { |
416 | - delta_ts = -(1 << time_ref->adapter->ts_used_bits); |
417 | + delta_ts = -BIT_ULL(time_ref->adapter->ts_used_bits); |
418 | } |
419 | |
420 | /* add delay between last sync and event timestamps */ |
421 | diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c |
422 | index d95dec5957861..9a9f6c12f89ab 100644 |
423 | --- a/drivers/net/ethernet/broadcom/b44.c |
424 | +++ b/drivers/net/ethernet/broadcom/b44.c |
425 | @@ -2390,7 +2390,8 @@ static int b44_init_one(struct ssb_device *sdev, |
426 | goto err_out_free_dev; |
427 | } |
428 | |
429 | - if (dma_set_mask_and_coherent(sdev->dma_dev, DMA_BIT_MASK(30))) { |
430 | + err = dma_set_mask_and_coherent(sdev->dma_dev, DMA_BIT_MASK(30)); |
431 | + if (err) { |
432 | dev_err(sdev->dev, |
433 | "Required 30BIT DMA mask unsupported by the system\n"); |
434 | goto err_out_powerdown; |
435 | diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c |
436 | index 8634337e1a99d..9e5251c427a36 100644 |
437 | --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c |
438 | +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c |
439 | @@ -1862,7 +1862,7 @@ static int bnxt_get_module_eeprom(struct net_device *dev, |
440 | /* Read A2 portion of the EEPROM */ |
441 | if (length) { |
442 | start -= ETH_MODULE_SFF_8436_LEN; |
443 | - rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A2, 1, |
444 | + rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A2, 0, |
445 | start, length, data); |
446 | } |
447 | return rc; |
448 | diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c |
449 | index 0437149f59392..65859ecf5c328 100644 |
450 | --- a/drivers/net/ethernet/faraday/ftgmac100.c |
451 | +++ b/drivers/net/ethernet/faraday/ftgmac100.c |
452 | @@ -1444,6 +1444,8 @@ static int ftgmac100_probe(struct platform_device *pdev) |
453 | return 0; |
454 | |
455 | err_ncsi_dev: |
456 | + if (priv->ndev) |
457 | + ncsi_unregister_dev(priv->ndev); |
458 | err_register_netdev: |
459 | ftgmac100_destroy_mdio(netdev); |
460 | err_setup_mdio: |
461 | @@ -1465,6 +1467,8 @@ static int __exit ftgmac100_remove(struct platform_device *pdev) |
462 | netdev = platform_get_drvdata(pdev); |
463 | priv = netdev_priv(netdev); |
464 | |
465 | + if (priv->ndev) |
466 | + ncsi_unregister_dev(priv->ndev); |
467 | unregister_netdev(netdev); |
468 | ftgmac100_destroy_mdio(netdev); |
469 | |
470 | diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c |
471 | index fe9dc1b3078c5..7c3e505cf2557 100644 |
472 | --- a/drivers/net/ethernet/mellanox/mlx4/fw.c |
473 | +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c |
474 | @@ -1843,14 +1843,14 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) |
475 | #define INIT_HCA_LOG_RD_OFFSET (INIT_HCA_QPC_OFFSET + 0x77) |
476 | #define INIT_HCA_MCAST_OFFSET 0x0c0 |
477 | #define INIT_HCA_MC_BASE_OFFSET (INIT_HCA_MCAST_OFFSET + 0x00) |
478 | -#define INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x12) |
479 | -#define INIT_HCA_LOG_MC_HASH_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x16) |
480 | +#define INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x13) |
481 | +#define INIT_HCA_LOG_MC_HASH_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x17) |
482 | #define INIT_HCA_UC_STEERING_OFFSET (INIT_HCA_MCAST_OFFSET + 0x18) |
483 | #define INIT_HCA_LOG_MC_TABLE_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x1b) |
484 | #define INIT_HCA_DEVICE_MANAGED_FLOW_STEERING_EN 0x6 |
485 | #define INIT_HCA_FS_PARAM_OFFSET 0x1d0 |
486 | #define INIT_HCA_FS_BASE_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x00) |
487 | -#define INIT_HCA_FS_LOG_ENTRY_SZ_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x12) |
488 | +#define INIT_HCA_FS_LOG_ENTRY_SZ_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x13) |
489 | #define INIT_HCA_FS_A0_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x18) |
490 | #define INIT_HCA_FS_LOG_TABLE_SZ_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x1b) |
491 | #define INIT_HCA_FS_ETH_BITS_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x21) |
492 | diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.h b/drivers/net/ethernet/mellanox/mlx4/fw.h |
493 | index 5343a0599253b..b30a5a9b9777b 100644 |
494 | --- a/drivers/net/ethernet/mellanox/mlx4/fw.h |
495 | +++ b/drivers/net/ethernet/mellanox/mlx4/fw.h |
496 | @@ -184,8 +184,8 @@ struct mlx4_init_hca_param { |
497 | u64 cmpt_base; |
498 | u64 mtt_base; |
499 | u64 global_caps; |
500 | - u16 log_mc_entry_sz; |
501 | - u16 log_mc_hash_sz; |
502 | + u8 log_mc_entry_sz; |
503 | + u8 log_mc_hash_sz; |
504 | u16 hca_core_clock; /* Internal Clock Frequency (in MHz) */ |
505 | u8 log_num_qps; |
506 | u8 log_num_srqs; |
507 | diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c |
508 | index bdf29d0cf4d77..901835d70f734 100644 |
509 | --- a/drivers/net/ethernet/mellanox/mlxsw/core.c |
510 | +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c |
511 | @@ -436,7 +436,7 @@ static void mlxsw_emad_trans_timeout_schedule(struct mlxsw_reg_trans *trans) |
512 | { |
513 | unsigned long timeout = msecs_to_jiffies(MLXSW_EMAD_TIMEOUT_MS); |
514 | |
515 | - mlxsw_core_schedule_dw(&trans->timeout_dw, timeout); |
516 | + mlxsw_core_schedule_dw(&trans->timeout_dw, timeout << trans->retries); |
517 | } |
518 | |
519 | static int mlxsw_emad_transmit(struct mlxsw_core *mlxsw_core, |
520 | diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c |
521 | index cda5b0a9e9489..10286215092f6 100644 |
522 | --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c |
523 | +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c |
524 | @@ -2251,7 +2251,8 @@ static int qlcnic_83xx_restart_hw(struct qlcnic_adapter *adapter) |
525 | |
526 | /* Boot either flash image or firmware image from host file system */ |
527 | if (qlcnic_load_fw_file == 1) { |
528 | - if (qlcnic_83xx_load_fw_image_from_host(adapter)) |
529 | + err = qlcnic_83xx_load_fw_image_from_host(adapter); |
530 | + if (err) |
531 | return err; |
532 | } else { |
533 | QLC_SHARED_REG_WR32(adapter, QLCNIC_FW_IMG_VALID, |
534 | diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c |
535 | index 74c925cd19a93..a571024882d7c 100644 |
536 | --- a/drivers/net/usb/qmi_wwan.c |
537 | +++ b/drivers/net/usb/qmi_wwan.c |
538 | @@ -705,7 +705,7 @@ static const struct usb_device_id products[] = { |
539 | {QMI_FIXED_INTF(0x05c6, 0x9011, 4)}, |
540 | {QMI_FIXED_INTF(0x05c6, 0x9021, 1)}, |
541 | {QMI_FIXED_INTF(0x05c6, 0x9022, 2)}, |
542 | - {QMI_FIXED_INTF(0x05c6, 0x9025, 4)}, /* Alcatel-sbell ASB TL131 TDD LTE (China Mobile) */ |
543 | + {QMI_QUIRK_SET_DTR(0x05c6, 0x9025, 4)}, /* Alcatel-sbell ASB TL131 TDD LTE (China Mobile) */ |
544 | {QMI_FIXED_INTF(0x05c6, 0x9026, 3)}, |
545 | {QMI_FIXED_INTF(0x05c6, 0x902e, 5)}, |
546 | {QMI_FIXED_INTF(0x05c6, 0x9031, 5)}, |
547 | diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c |
548 | index 417cd3bd7e0c9..ee2dcea1e54b9 100644 |
549 | --- a/drivers/pinctrl/pinctrl-rockchip.c |
550 | +++ b/drivers/pinctrl/pinctrl-rockchip.c |
551 | @@ -1815,7 +1815,9 @@ static int rockchip_gpio_to_irq(struct gpio_chip *gc, unsigned offset) |
552 | if (!bank->domain) |
553 | return -ENXIO; |
554 | |
555 | + clk_enable(bank->clk); |
556 | virq = irq_create_mapping(bank->domain, offset); |
557 | + clk_disable(bank->clk); |
558 | |
559 | return (virq) ? : -ENXIO; |
560 | } |
561 | diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c |
562 | index 0caf751d85ded..0a0dd0aac047c 100644 |
563 | --- a/drivers/regulator/core.c |
564 | +++ b/drivers/regulator/core.c |
565 | @@ -1025,7 +1025,6 @@ static int _regulator_do_enable(struct regulator_dev *rdev); |
566 | /** |
567 | * set_machine_constraints - sets regulator constraints |
568 | * @rdev: regulator source |
569 | - * @constraints: constraints to apply |
570 | * |
571 | * Allows platform initialisation code to define and constrain |
572 | * regulator circuits e.g. valid voltage/current ranges, etc. NOTE: |
573 | @@ -1033,21 +1032,11 @@ static int _regulator_do_enable(struct regulator_dev *rdev); |
574 | * regulator operations to proceed i.e. set_voltage, set_current_limit, |
575 | * set_mode. |
576 | */ |
577 | -static int set_machine_constraints(struct regulator_dev *rdev, |
578 | - const struct regulation_constraints *constraints) |
579 | +static int set_machine_constraints(struct regulator_dev *rdev) |
580 | { |
581 | int ret = 0; |
582 | const struct regulator_ops *ops = rdev->desc->ops; |
583 | |
584 | - if (constraints) |
585 | - rdev->constraints = kmemdup(constraints, sizeof(*constraints), |
586 | - GFP_KERNEL); |
587 | - else |
588 | - rdev->constraints = kzalloc(sizeof(*constraints), |
589 | - GFP_KERNEL); |
590 | - if (!rdev->constraints) |
591 | - return -ENOMEM; |
592 | - |
593 | ret = machine_constraints_voltage(rdev, rdev->constraints); |
594 | if (ret != 0) |
595 | return ret; |
596 | @@ -3924,7 +3913,6 @@ struct regulator_dev * |
597 | regulator_register(const struct regulator_desc *regulator_desc, |
598 | const struct regulator_config *cfg) |
599 | { |
600 | - const struct regulation_constraints *constraints = NULL; |
601 | const struct regulator_init_data *init_data; |
602 | struct regulator_config *config = NULL; |
603 | static atomic_t regulator_no = ATOMIC_INIT(-1); |
604 | @@ -4024,14 +4012,23 @@ regulator_register(const struct regulator_desc *regulator_desc, |
605 | |
606 | /* set regulator constraints */ |
607 | if (init_data) |
608 | - constraints = &init_data->constraints; |
609 | + rdev->constraints = kmemdup(&init_data->constraints, |
610 | + sizeof(*rdev->constraints), |
611 | + GFP_KERNEL); |
612 | + else |
613 | + rdev->constraints = kzalloc(sizeof(*rdev->constraints), |
614 | + GFP_KERNEL); |
615 | + if (!rdev->constraints) { |
616 | + ret = -ENOMEM; |
617 | + goto wash; |
618 | + } |
619 | |
620 | if (init_data && init_data->supply_regulator) |
621 | rdev->supply_name = init_data->supply_regulator; |
622 | else if (regulator_desc->supply_name) |
623 | rdev->supply_name = regulator_desc->supply_name; |
624 | |
625 | - ret = set_machine_constraints(rdev, constraints); |
626 | + ret = set_machine_constraints(rdev); |
627 | if (ret == -EPROBE_DEFER) { |
628 | /* Regulator might be in bypass mode and so needs its supply |
629 | * to set the constraints */ |
630 | @@ -4040,7 +4037,7 @@ regulator_register(const struct regulator_desc *regulator_desc, |
631 | * that is just being created */ |
632 | ret = regulator_resolve_supply(rdev); |
633 | if (!ret) |
634 | - ret = set_machine_constraints(rdev, constraints); |
635 | + ret = set_machine_constraints(rdev); |
636 | else |
637 | rdev_dbg(rdev, "unable to resolve supply early: %pe\n", |
638 | ERR_PTR(ret)); |
639 | diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c |
640 | index 6d17357b3a248..5f5f63eb8c762 100644 |
641 | --- a/drivers/regulator/ti-abb-regulator.c |
642 | +++ b/drivers/regulator/ti-abb-regulator.c |
643 | @@ -342,8 +342,17 @@ static int ti_abb_set_voltage_sel(struct regulator_dev *rdev, unsigned sel) |
644 | return ret; |
645 | } |
646 | |
647 | - /* If data is exactly the same, then just update index, no change */ |
648 | info = &abb->info[sel]; |
649 | + /* |
650 | + * When Linux kernel is starting up, we are'nt sure of the |
651 | + * Bias configuration that bootloader has configured. |
652 | + * So, we get to know the actual setting the first time |
653 | + * we are asked to transition. |
654 | + */ |
655 | + if (abb->current_info_idx == -EINVAL) |
656 | + goto just_set_abb; |
657 | + |
658 | + /* If data is exactly the same, then just update index, no change */ |
659 | oinfo = &abb->info[abb->current_info_idx]; |
660 | if (!memcmp(info, oinfo, sizeof(*info))) { |
661 | dev_dbg(dev, "%s: Same data new idx=%d, old idx=%d\n", __func__, |
662 | @@ -351,6 +360,7 @@ static int ti_abb_set_voltage_sel(struct regulator_dev *rdev, unsigned sel) |
663 | goto out; |
664 | } |
665 | |
666 | +just_set_abb: |
667 | ret = ti_abb_set_opp(rdev, abb, info); |
668 | |
669 | out: |
670 | diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c |
671 | index 325c38c9b4516..a60376496b1a7 100644 |
672 | --- a/drivers/tty/serial/imx.c |
673 | +++ b/drivers/tty/serial/imx.c |
674 | @@ -1787,16 +1787,6 @@ imx_console_write(struct console *co, const char *s, unsigned int count) |
675 | unsigned int ucr1; |
676 | unsigned long flags = 0; |
677 | int locked = 1; |
678 | - int retval; |
679 | - |
680 | - retval = clk_enable(sport->clk_per); |
681 | - if (retval) |
682 | - return; |
683 | - retval = clk_enable(sport->clk_ipg); |
684 | - if (retval) { |
685 | - clk_disable(sport->clk_per); |
686 | - return; |
687 | - } |
688 | |
689 | if (sport->port.sysrq) |
690 | locked = 0; |
691 | @@ -1832,9 +1822,6 @@ imx_console_write(struct console *co, const char *s, unsigned int count) |
692 | |
693 | if (locked) |
694 | spin_unlock_irqrestore(&sport->port.lock, flags); |
695 | - |
696 | - clk_disable(sport->clk_ipg); |
697 | - clk_disable(sport->clk_per); |
698 | } |
699 | |
700 | /* |
701 | @@ -1935,15 +1922,14 @@ imx_console_setup(struct console *co, char *options) |
702 | |
703 | retval = uart_set_options(&sport->port, co, baud, parity, bits, flow); |
704 | |
705 | - clk_disable(sport->clk_ipg); |
706 | if (retval) { |
707 | - clk_unprepare(sport->clk_ipg); |
708 | + clk_disable_unprepare(sport->clk_ipg); |
709 | goto error_console; |
710 | } |
711 | |
712 | - retval = clk_prepare(sport->clk_per); |
713 | + retval = clk_prepare_enable(sport->clk_per); |
714 | if (retval) |
715 | - clk_unprepare(sport->clk_ipg); |
716 | + clk_disable_unprepare(sport->clk_ipg); |
717 | |
718 | error_console: |
719 | return retval; |
720 | diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c |
721 | index b1e6acec53041..bbf056191aaa4 100644 |
722 | --- a/fs/efivarfs/super.c |
723 | +++ b/fs/efivarfs/super.c |
724 | @@ -23,6 +23,7 @@ LIST_HEAD(efivarfs_list); |
725 | static void efivarfs_evict_inode(struct inode *inode) |
726 | { |
727 | clear_inode(inode); |
728 | + kfree(inode->i_private); |
729 | } |
730 | |
731 | static const struct super_operations efivarfs_ops = { |
732 | diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h |
733 | index 360954196e2f3..54a7f3b8b1bf3 100644 |
734 | --- a/fs/ext4/ext4.h |
735 | +++ b/fs/ext4/ext4.h |
736 | @@ -2395,7 +2395,8 @@ int ext4_insert_dentry(struct inode *dir, |
737 | struct ext4_filename *fname); |
738 | static inline void ext4_update_dx_flag(struct inode *inode) |
739 | { |
740 | - if (!ext4_has_feature_dir_index(inode->i_sb)) { |
741 | + if (!ext4_has_feature_dir_index(inode->i_sb) && |
742 | + ext4_test_inode_flag(inode, EXT4_INODE_INDEX)) { |
743 | /* ext4_iget() should have caught this... */ |
744 | WARN_ON_ONCE(ext4_has_feature_metadata_csum(inode->i_sb)); |
745 | ext4_clear_inode_flag(inode, EXT4_INODE_INDEX); |
746 | diff --git a/fs/libfs.c b/fs/libfs.c |
747 | index 278457f221482..835d25e335095 100644 |
748 | --- a/fs/libfs.c |
749 | +++ b/fs/libfs.c |
750 | @@ -865,7 +865,7 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf, |
751 | size_t len, loff_t *ppos) |
752 | { |
753 | struct simple_attr *attr; |
754 | - u64 val; |
755 | + unsigned long long val; |
756 | size_t size; |
757 | ssize_t ret; |
758 | |
759 | @@ -883,7 +883,9 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf, |
760 | goto out; |
761 | |
762 | attr->set_buf[size] = '\0'; |
763 | - val = simple_strtoll(attr->set_buf, NULL, 0); |
764 | + ret = kstrtoull(attr->set_buf, 0, &val); |
765 | + if (ret) |
766 | + goto out; |
767 | ret = attr->set(attr->data, val); |
768 | if (ret == 0) |
769 | ret = len; /* on success, claim we got the whole input */ |
770 | diff --git a/fs/super.c b/fs/super.c |
771 | index abe2541fb28c2..377c439477b74 100644 |
772 | --- a/fs/super.c |
773 | +++ b/fs/super.c |
774 | @@ -1254,36 +1254,11 @@ EXPORT_SYMBOL(__sb_end_write); |
775 | */ |
776 | int __sb_start_write(struct super_block *sb, int level, bool wait) |
777 | { |
778 | - bool force_trylock = false; |
779 | - int ret = 1; |
780 | + if (!wait) |
781 | + return percpu_down_read_trylock(sb->s_writers.rw_sem + level-1); |
782 | |
783 | -#ifdef CONFIG_LOCKDEP |
784 | - /* |
785 | - * We want lockdep to tell us about possible deadlocks with freezing |
786 | - * but it's it bit tricky to properly instrument it. Getting a freeze |
787 | - * protection works as getting a read lock but there are subtle |
788 | - * problems. XFS for example gets freeze protection on internal level |
789 | - * twice in some cases, which is OK only because we already hold a |
790 | - * freeze protection also on higher level. Due to these cases we have |
791 | - * to use wait == F (trylock mode) which must not fail. |
792 | - */ |
793 | - if (wait) { |
794 | - int i; |
795 | - |
796 | - for (i = 0; i < level - 1; i++) |
797 | - if (percpu_rwsem_is_held(sb->s_writers.rw_sem + i)) { |
798 | - force_trylock = true; |
799 | - break; |
800 | - } |
801 | - } |
802 | -#endif |
803 | - if (wait && !force_trylock) |
804 | - percpu_down_read(sb->s_writers.rw_sem + level-1); |
805 | - else |
806 | - ret = percpu_down_read_trylock(sb->s_writers.rw_sem + level-1); |
807 | - |
808 | - WARN_ON(force_trylock && !ret); |
809 | - return ret; |
810 | + percpu_down_read(sb->s_writers.rw_sem + level-1); |
811 | + return 1; |
812 | } |
813 | EXPORT_SYMBOL(__sb_start_write); |
814 | |
815 | diff --git a/fs/xfs/libxfs/xfs_rmap_btree.c b/fs/xfs/libxfs/xfs_rmap_btree.c |
816 | index c5a24b80c7f72..33a28efc3085b 100644 |
817 | --- a/fs/xfs/libxfs/xfs_rmap_btree.c |
818 | +++ b/fs/xfs/libxfs/xfs_rmap_btree.c |
819 | @@ -262,8 +262,8 @@ xfs_rmapbt_key_diff( |
820 | else if (y > x) |
821 | return -1; |
822 | |
823 | - x = be64_to_cpu(kp->rm_offset); |
824 | - y = xfs_rmap_irec_offset_pack(rec); |
825 | + x = XFS_RMAP_OFF(be64_to_cpu(kp->rm_offset)); |
826 | + y = rec->rm_offset; |
827 | if (x > y) |
828 | return 1; |
829 | else if (y > x) |
830 | @@ -294,8 +294,8 @@ xfs_rmapbt_diff_two_keys( |
831 | else if (y > x) |
832 | return -1; |
833 | |
834 | - x = be64_to_cpu(kp1->rm_offset); |
835 | - y = be64_to_cpu(kp2->rm_offset); |
836 | + x = XFS_RMAP_OFF(be64_to_cpu(kp1->rm_offset)); |
837 | + y = XFS_RMAP_OFF(be64_to_cpu(kp2->rm_offset)); |
838 | if (x > y) |
839 | return 1; |
840 | else if (y > x) |
841 | @@ -401,8 +401,8 @@ xfs_rmapbt_keys_inorder( |
842 | return 1; |
843 | else if (a > b) |
844 | return 0; |
845 | - a = be64_to_cpu(k1->rmap.rm_offset); |
846 | - b = be64_to_cpu(k2->rmap.rm_offset); |
847 | + a = XFS_RMAP_OFF(be64_to_cpu(k1->rmap.rm_offset)); |
848 | + b = XFS_RMAP_OFF(be64_to_cpu(k2->rmap.rm_offset)); |
849 | if (a <= b) |
850 | return 1; |
851 | return 0; |
852 | @@ -431,8 +431,8 @@ xfs_rmapbt_recs_inorder( |
853 | return 1; |
854 | else if (a > b) |
855 | return 0; |
856 | - a = be64_to_cpu(r1->rmap.rm_offset); |
857 | - b = be64_to_cpu(r2->rmap.rm_offset); |
858 | + a = XFS_RMAP_OFF(be64_to_cpu(r1->rmap.rm_offset)); |
859 | + b = XFS_RMAP_OFF(be64_to_cpu(r2->rmap.rm_offset)); |
860 | if (a <= b) |
861 | return 1; |
862 | return 0; |
863 | diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c |
864 | index 928bd5515f02f..495655bcee69e 100644 |
865 | --- a/net/bridge/br_device.c |
866 | +++ b/net/bridge/br_device.c |
867 | @@ -177,6 +177,7 @@ static struct rtnl_link_stats64 *br_get_stats64(struct net_device *dev, |
868 | sum.rx_packets += tmp.rx_packets; |
869 | } |
870 | |
871 | + netdev_stats_to_stats64(stats, &dev->stats); |
872 | stats->tx_bytes = sum.tx_bytes; |
873 | stats->tx_packets = sum.tx_packets; |
874 | stats->rx_bytes = sum.rx_bytes; |
875 | diff --git a/net/core/devlink.c b/net/core/devlink.c |
876 | index 1b5063088f1a7..785fbaac047ff 100644 |
877 | --- a/net/core/devlink.c |
878 | +++ b/net/core/devlink.c |
879 | @@ -986,7 +986,7 @@ static int devlink_nl_sb_port_pool_fill(struct sk_buff *msg, |
880 | err = ops->sb_occ_port_pool_get(devlink_port, devlink_sb->index, |
881 | pool_index, &cur, &max); |
882 | if (err && err != -EOPNOTSUPP) |
883 | - return err; |
884 | + goto sb_occ_get_failure; |
885 | if (!err) { |
886 | if (nla_put_u32(msg, DEVLINK_ATTR_SB_OCC_CUR, cur)) |
887 | goto nla_put_failure; |
888 | @@ -999,8 +999,10 @@ static int devlink_nl_sb_port_pool_fill(struct sk_buff *msg, |
889 | return 0; |
890 | |
891 | nla_put_failure: |
892 | + err = -EMSGSIZE; |
893 | +sb_occ_get_failure: |
894 | genlmsg_cancel(msg, hdr); |
895 | - return -EMSGSIZE; |
896 | + return err; |
897 | } |
898 | |
899 | static int devlink_nl_cmd_sb_port_pool_get_doit(struct sk_buff *skb, |
900 | diff --git a/net/core/netpoll.c b/net/core/netpoll.c |
901 | index 9c1bad3909bd7..0fa6269c3f20d 100644 |
902 | --- a/net/core/netpoll.c |
903 | +++ b/net/core/netpoll.c |
904 | @@ -28,6 +28,7 @@ |
905 | #include <linux/slab.h> |
906 | #include <linux/export.h> |
907 | #include <linux/if_vlan.h> |
908 | +#include <net/dsa.h> |
909 | #include <net/tcp.h> |
910 | #include <net/udp.h> |
911 | #include <net/addrconf.h> |
912 | @@ -661,15 +662,15 @@ EXPORT_SYMBOL_GPL(__netpoll_setup); |
913 | |
914 | int netpoll_setup(struct netpoll *np) |
915 | { |
916 | - struct net_device *ndev = NULL; |
917 | + struct net_device *ndev = NULL, *dev = NULL; |
918 | + struct net *net = current->nsproxy->net_ns; |
919 | struct in_device *in_dev; |
920 | int err; |
921 | |
922 | rtnl_lock(); |
923 | - if (np->dev_name[0]) { |
924 | - struct net *net = current->nsproxy->net_ns; |
925 | + if (np->dev_name[0]) |
926 | ndev = __dev_get_by_name(net, np->dev_name); |
927 | - } |
928 | + |
929 | if (!ndev) { |
930 | np_err(np, "%s doesn't exist, aborting\n", np->dev_name); |
931 | err = -ENODEV; |
932 | @@ -677,6 +678,19 @@ int netpoll_setup(struct netpoll *np) |
933 | } |
934 | dev_hold(ndev); |
935 | |
936 | + /* bring up DSA management network devices up first */ |
937 | + for_each_netdev(net, dev) { |
938 | + if (!netdev_uses_dsa(dev)) |
939 | + continue; |
940 | + |
941 | + err = dev_change_flags(dev, dev->flags | IFF_UP); |
942 | + if (err < 0) { |
943 | + np_err(np, "%s failed to open %s\n", |
944 | + np->dev_name, dev->name); |
945 | + goto put; |
946 | + } |
947 | + } |
948 | + |
949 | if (netdev_master_upper_dev_get(ndev)) { |
950 | np_err(np, "%s is a slave device, aborting\n", np->dev_name); |
951 | err = -EBUSY; |
952 | diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c |
953 | index 4273576e14754..9b25809b2d457 100644 |
954 | --- a/net/ipv4/inet_diag.c |
955 | +++ b/net/ipv4/inet_diag.c |
956 | @@ -355,8 +355,10 @@ static int inet_req_diag_fill(struct sock *sk, struct sk_buff *skb, |
957 | r->idiag_inode = 0; |
958 | |
959 | if (net_admin && nla_put_u32(skb, INET_DIAG_MARK, |
960 | - inet_rsk(reqsk)->ir_mark)) |
961 | + inet_rsk(reqsk)->ir_mark)) { |
962 | + nlmsg_cancel(skb, nlh); |
963 | return -EMSGSIZE; |
964 | + } |
965 | |
966 | nlmsg_end(skb, nlh); |
967 | return 0; |
968 | diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c |
969 | index 3bfab2d415749..c22da42376fe9 100644 |
970 | --- a/net/ipv4/tcp_bbr.c |
971 | +++ b/net/ipv4/tcp_bbr.c |
972 | @@ -740,7 +740,7 @@ static void bbr_update_min_rtt(struct sock *sk, const struct rate_sample *rs) |
973 | filter_expired = after(tcp_time_stamp, |
974 | bbr->min_rtt_stamp + bbr_min_rtt_win_sec * HZ); |
975 | if (rs->rtt_us >= 0 && |
976 | - (rs->rtt_us <= bbr->min_rtt_us || filter_expired)) { |
977 | + (rs->rtt_us < bbr->min_rtt_us || filter_expired)) { |
978 | bbr->min_rtt_us = rs->rtt_us; |
979 | bbr->min_rtt_stamp = tcp_time_stamp; |
980 | } |
981 | diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c |
982 | index 0edc44cb254e0..519e0730d9f62 100644 |
983 | --- a/net/ipv6/ah6.c |
984 | +++ b/net/ipv6/ah6.c |
985 | @@ -595,7 +595,8 @@ static int ah6_input(struct xfrm_state *x, struct sk_buff *skb) |
986 | memcpy(auth_data, ah->auth_data, ahp->icv_trunc_len); |
987 | memset(ah->auth_data, 0, ahp->icv_trunc_len); |
988 | |
989 | - if (ipv6_clear_mutable_options(ip6h, hdr_len, XFRM_POLICY_IN)) |
990 | + err = ipv6_clear_mutable_options(ip6h, hdr_len, XFRM_POLICY_IN); |
991 | + if (err) |
992 | goto out_free; |
993 | |
994 | ip6h->priority = 0; |
995 | diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c |
996 | index 14c5ba3a1b1c6..e913869193991 100644 |
997 | --- a/net/mac80211/rc80211_minstrel.c |
998 | +++ b/net/mac80211/rc80211_minstrel.c |
999 | @@ -274,7 +274,7 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband, |
1000 | success = !!(info->flags & IEEE80211_TX_STAT_ACK); |
1001 | |
1002 | for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { |
1003 | - if (ar[i].idx < 0) |
1004 | + if (ar[i].idx < 0 || !ar[i].count) |
1005 | break; |
1006 | |
1007 | ndx = rix_to_ndx(mi, ar[i].idx); |
1008 | @@ -287,12 +287,6 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband, |
1009 | mi->r[ndx].stats.success += success; |
1010 | } |
1011 | |
1012 | - if ((info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) && (i >= 0)) |
1013 | - mi->sample_packets++; |
1014 | - |
1015 | - if (mi->sample_deferred > 0) |
1016 | - mi->sample_deferred--; |
1017 | - |
1018 | if (time_after(jiffies, mi->last_stats_update + |
1019 | (mp->update_interval * HZ) / 1000)) |
1020 | minstrel_update_stats(mp, mi); |
1021 | @@ -366,7 +360,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta, |
1022 | #endif |
1023 | |
1024 | delta = (mi->total_packets * sampling_ratio / 100) - |
1025 | - (mi->sample_packets + mi->sample_deferred / 2); |
1026 | + mi->sample_packets; |
1027 | |
1028 | /* delta < 0: no sampling required */ |
1029 | prev_sample = mi->prev_sample; |
1030 | @@ -375,7 +369,6 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta, |
1031 | return; |
1032 | |
1033 | if (mi->total_packets >= 10000) { |
1034 | - mi->sample_deferred = 0; |
1035 | mi->sample_packets = 0; |
1036 | mi->total_packets = 0; |
1037 | } else if (delta > mi->n_rates * 2) { |
1038 | @@ -400,19 +393,8 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta, |
1039 | * rate sampling method should be used. |
1040 | * Respect such rates that are not sampled for 20 interations. |
1041 | */ |
1042 | - if (mrr_capable && |
1043 | - msr->perfect_tx_time > mr->perfect_tx_time && |
1044 | - msr->stats.sample_skipped < 20) { |
1045 | - /* Only use IEEE80211_TX_CTL_RATE_CTRL_PROBE to mark |
1046 | - * packets that have the sampling rate deferred to the |
1047 | - * second MRR stage. Increase the sample counter only |
1048 | - * if the deferred sample rate was actually used. |
1049 | - * Use the sample_deferred counter to make sure that |
1050 | - * the sampling is not done in large bursts */ |
1051 | - info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; |
1052 | - rate++; |
1053 | - mi->sample_deferred++; |
1054 | - } else { |
1055 | + if (msr->perfect_tx_time < mr->perfect_tx_time || |
1056 | + msr->stats.sample_skipped >= 20) { |
1057 | if (!msr->sample_limit) |
1058 | return; |
1059 | |
1060 | @@ -432,6 +414,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta, |
1061 | |
1062 | rate->idx = mi->r[ndx].rix; |
1063 | rate->count = minstrel_get_retry_count(&mi->r[ndx], info); |
1064 | + info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; |
1065 | } |
1066 | |
1067 | |
1068 | diff --git a/net/mac80211/rc80211_minstrel.h b/net/mac80211/rc80211_minstrel.h |
1069 | index c230bbe93262b..5a9e44f4fba49 100644 |
1070 | --- a/net/mac80211/rc80211_minstrel.h |
1071 | +++ b/net/mac80211/rc80211_minstrel.h |
1072 | @@ -105,7 +105,6 @@ struct minstrel_sta_info { |
1073 | u8 max_prob_rate; |
1074 | unsigned int total_packets; |
1075 | unsigned int sample_packets; |
1076 | - int sample_deferred; |
1077 | |
1078 | unsigned int sample_row; |
1079 | unsigned int sample_column; |
1080 | diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c |
1081 | index 8a9bbcfefbca6..bdcc6cb60b1c8 100644 |
1082 | --- a/net/mac80211/sta_info.c |
1083 | +++ b/net/mac80211/sta_info.c |
1084 | @@ -601,7 +601,7 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU) |
1085 | out_drop_sta: |
1086 | local->num_sta--; |
1087 | synchronize_net(); |
1088 | - __cleanup_single_sta(sta); |
1089 | + cleanup_single_sta(sta); |
1090 | out_err: |
1091 | mutex_unlock(&local->sta_mtx); |
1092 | kfree(sinfo); |
1093 | @@ -620,19 +620,13 @@ int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU) |
1094 | |
1095 | err = sta_info_insert_check(sta); |
1096 | if (err) { |
1097 | + sta_info_free(local, sta); |
1098 | mutex_unlock(&local->sta_mtx); |
1099 | rcu_read_lock(); |
1100 | - goto out_free; |
1101 | + return err; |
1102 | } |
1103 | |
1104 | - err = sta_info_insert_finish(sta); |
1105 | - if (err) |
1106 | - goto out_free; |
1107 | - |
1108 | - return 0; |
1109 | - out_free: |
1110 | - sta_info_free(local, sta); |
1111 | - return err; |
1112 | + return sta_info_insert_finish(sta); |
1113 | } |
1114 | |
1115 | int sta_info_insert(struct sta_info *sta) |
1116 | diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c |
1117 | index 053ba86461559..467e0d19cdfea 100644 |
1118 | --- a/net/netlabel/netlabel_unlabeled.c |
1119 | +++ b/net/netlabel/netlabel_unlabeled.c |
1120 | @@ -1185,12 +1185,13 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb, |
1121 | struct netlbl_unlhsh_walk_arg cb_arg; |
1122 | u32 skip_bkt = cb->args[0]; |
1123 | u32 skip_chain = cb->args[1]; |
1124 | - u32 iter_bkt; |
1125 | - u32 iter_chain = 0, iter_addr4 = 0, iter_addr6 = 0; |
1126 | + u32 skip_addr4 = cb->args[2]; |
1127 | + u32 iter_bkt, iter_chain = 0, iter_addr4 = 0, iter_addr6 = 0; |
1128 | struct netlbl_unlhsh_iface *iface; |
1129 | struct list_head *iter_list; |
1130 | struct netlbl_af4list *addr4; |
1131 | #if IS_ENABLED(CONFIG_IPV6) |
1132 | + u32 skip_addr6 = cb->args[3]; |
1133 | struct netlbl_af6list *addr6; |
1134 | #endif |
1135 | |
1136 | @@ -1201,7 +1202,7 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb, |
1137 | rcu_read_lock(); |
1138 | for (iter_bkt = skip_bkt; |
1139 | iter_bkt < rcu_dereference(netlbl_unlhsh)->size; |
1140 | - iter_bkt++, iter_chain = 0, iter_addr4 = 0, iter_addr6 = 0) { |
1141 | + iter_bkt++) { |
1142 | iter_list = &rcu_dereference(netlbl_unlhsh)->tbl[iter_bkt]; |
1143 | list_for_each_entry_rcu(iface, iter_list, list) { |
1144 | if (!iface->valid || |
1145 | @@ -1209,7 +1210,7 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb, |
1146 | continue; |
1147 | netlbl_af4list_foreach_rcu(addr4, |
1148 | &iface->addr4_list) { |
1149 | - if (iter_addr4++ < cb->args[2]) |
1150 | + if (iter_addr4++ < skip_addr4) |
1151 | continue; |
1152 | if (netlbl_unlabel_staticlist_gen( |
1153 | NLBL_UNLABEL_C_STATICLIST, |
1154 | @@ -1222,10 +1223,12 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb, |
1155 | goto unlabel_staticlist_return; |
1156 | } |
1157 | } |
1158 | + iter_addr4 = 0; |
1159 | + skip_addr4 = 0; |
1160 | #if IS_ENABLED(CONFIG_IPV6) |
1161 | netlbl_af6list_foreach_rcu(addr6, |
1162 | &iface->addr6_list) { |
1163 | - if (iter_addr6++ < cb->args[3]) |
1164 | + if (iter_addr6++ < skip_addr6) |
1165 | continue; |
1166 | if (netlbl_unlabel_staticlist_gen( |
1167 | NLBL_UNLABEL_C_STATICLIST, |
1168 | @@ -1238,8 +1241,12 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb, |
1169 | goto unlabel_staticlist_return; |
1170 | } |
1171 | } |
1172 | + iter_addr6 = 0; |
1173 | + skip_addr6 = 0; |
1174 | #endif /* IPv6 */ |
1175 | } |
1176 | + iter_chain = 0; |
1177 | + skip_chain = 0; |
1178 | } |
1179 | |
1180 | unlabel_staticlist_return: |
1181 | diff --git a/net/sctp/input.c b/net/sctp/input.c |
1182 | index 969fb1623e4ef..12d821ea8a1f6 100644 |
1183 | --- a/net/sctp/input.c |
1184 | +++ b/net/sctp/input.c |
1185 | @@ -449,7 +449,7 @@ void sctp_icmp_proto_unreachable(struct sock *sk, |
1186 | else { |
1187 | if (!mod_timer(&t->proto_unreach_timer, |
1188 | jiffies + (HZ/20))) |
1189 | - sctp_association_hold(asoc); |
1190 | + sctp_transport_hold(t); |
1191 | } |
1192 | } else { |
1193 | struct net *net = sock_net(sk); |
1194 | @@ -458,7 +458,7 @@ void sctp_icmp_proto_unreachable(struct sock *sk, |
1195 | "encountered!\n", __func__); |
1196 | |
1197 | if (del_timer(&t->proto_unreach_timer)) |
1198 | - sctp_association_put(asoc); |
1199 | + sctp_transport_put(t); |
1200 | |
1201 | sctp_do_sm(net, SCTP_EVENT_T_OTHER, |
1202 | SCTP_ST_OTHER(SCTP_EVENT_ICMP_PROTO_UNREACH), |
1203 | diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c |
1204 | index 1133fa0830f4e..26e2927e0c6e2 100644 |
1205 | --- a/net/sctp/sm_sideeffect.c |
1206 | +++ b/net/sctp/sm_sideeffect.c |
1207 | @@ -417,7 +417,7 @@ void sctp_generate_proto_unreach_event(unsigned long data) |
1208 | /* Try again later. */ |
1209 | if (!mod_timer(&transport->proto_unreach_timer, |
1210 | jiffies + (HZ/20))) |
1211 | - sctp_association_hold(asoc); |
1212 | + sctp_transport_hold(transport); |
1213 | goto out_unlock; |
1214 | } |
1215 | |
1216 | @@ -433,7 +433,7 @@ void sctp_generate_proto_unreach_event(unsigned long data) |
1217 | |
1218 | out_unlock: |
1219 | bh_unlock_sock(sk); |
1220 | - sctp_association_put(asoc); |
1221 | + sctp_transport_put(transport); |
1222 | } |
1223 | |
1224 | |
1225 | diff --git a/net/sctp/transport.c b/net/sctp/transport.c |
1226 | index 5c78942550e97..bace37b086e98 100644 |
1227 | --- a/net/sctp/transport.c |
1228 | +++ b/net/sctp/transport.c |
1229 | @@ -146,7 +146,7 @@ void sctp_transport_free(struct sctp_transport *transport) |
1230 | |
1231 | /* Delete the ICMP proto unreachable timer if it's active. */ |
1232 | if (del_timer(&transport->proto_unreach_timer)) |
1233 | - sctp_association_put(transport->asoc); |
1234 | + sctp_transport_put(transport); |
1235 | |
1236 | sctp_transport_put(transport); |
1237 | } |
1238 | diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c |
1239 | index 3bec5c59169b5..7bee5ca336fac 100644 |
1240 | --- a/net/x25/af_x25.c |
1241 | +++ b/net/x25/af_x25.c |
1242 | @@ -1047,6 +1047,7 @@ int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb, |
1243 | makex25->lci = lci; |
1244 | makex25->dest_addr = dest_addr; |
1245 | makex25->source_addr = source_addr; |
1246 | + x25_neigh_hold(nb); |
1247 | makex25->neighbour = nb; |
1248 | makex25->facilities = facilities; |
1249 | makex25->dte_facilities= dte_facilities; |
1250 | diff --git a/sound/core/control.c b/sound/core/control.c |
1251 | index 511368fe974ef..abda2c3fcd8ac 100644 |
1252 | --- a/sound/core/control.c |
1253 | +++ b/sound/core/control.c |
1254 | @@ -1381,7 +1381,7 @@ static int snd_ctl_elem_add(struct snd_ctl_file *file, |
1255 | |
1256 | unlock: |
1257 | up_write(&card->controls_rwsem); |
1258 | - return 0; |
1259 | + return err; |
1260 | } |
1261 | |
1262 | static int snd_ctl_elem_add_user(struct snd_ctl_file *file, |
1263 | diff --git a/sound/pci/mixart/mixart_core.c b/sound/pci/mixart/mixart_core.c |
1264 | index dccf3db48fe06..1381f4fa08565 100644 |
1265 | --- a/sound/pci/mixart/mixart_core.c |
1266 | +++ b/sound/pci/mixart/mixart_core.c |
1267 | @@ -83,7 +83,6 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp, |
1268 | unsigned int i; |
1269 | #endif |
1270 | |
1271 | - mutex_lock(&mgr->msg_lock); |
1272 | err = 0; |
1273 | |
1274 | /* copy message descriptor from miXart to driver */ |
1275 | @@ -132,8 +131,6 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp, |
1276 | writel_be(headptr, MIXART_MEM(mgr, MSG_OUTBOUND_FREE_HEAD)); |
1277 | |
1278 | _clean_exit: |
1279 | - mutex_unlock(&mgr->msg_lock); |
1280 | - |
1281 | return err; |
1282 | } |
1283 | |
1284 | @@ -271,7 +268,9 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int |
1285 | resp.data = resp_data; |
1286 | resp.size = max_resp_size; |
1287 | |
1288 | + mutex_lock(&mgr->msg_lock); |
1289 | err = get_msg(mgr, &resp, msg_frame); |
1290 | + mutex_unlock(&mgr->msg_lock); |
1291 | |
1292 | if( request->message_id != resp.message_id ) |
1293 | dev_err(&mgr->pci->dev, "RESPONSE ERROR!\n"); |
1294 | diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c |
1295 | index ce3bfb48b26f0..956b0aa916cfe 100644 |
1296 | --- a/tools/perf/builtin-lock.c |
1297 | +++ b/tools/perf/builtin-lock.c |
1298 | @@ -616,7 +616,7 @@ static int report_lock_release_event(struct perf_evsel *evsel, |
1299 | case SEQ_STATE_READ_ACQUIRED: |
1300 | seq->read_count--; |
1301 | BUG_ON(seq->read_count < 0); |
1302 | - if (!seq->read_count) { |
1303 | + if (seq->read_count) { |
1304 | ls->nr_release++; |
1305 | goto end; |
1306 | } |