Magellan Linux

Annotation of /trunk/kernel-alx-legacy/patches-4.9/0336-4.9.237-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3638 - (hide annotations) (download)
Mon Oct 24 14:07:18 2022 UTC (18 months, 2 weeks ago) by niro
File size: 102722 byte(s)
-linux-4.9.237
1 niro 3638 diff --git a/Makefile b/Makefile
2     index a454c9cd126e0..3c78b28c6a0da 100644
3     --- a/Makefile
4     +++ b/Makefile
5     @@ -1,6 +1,6 @@
6     VERSION = 4
7     PATCHLEVEL = 9
8     -SUBLEVEL = 236
9     +SUBLEVEL = 237
10     EXTRAVERSION =
11     NAME = Roaring Lionus
12    
13     diff --git a/arch/arc/plat-eznps/include/plat/ctop.h b/arch/arc/plat-eznps/include/plat/ctop.h
14     index 3c401ce0351ef..fb959828630ce 100644
15     --- a/arch/arc/plat-eznps/include/plat/ctop.h
16     +++ b/arch/arc/plat-eznps/include/plat/ctop.h
17     @@ -42,7 +42,6 @@
18     #define CTOP_AUX_HW_COMPLY (CTOP_AUX_BASE + 0x024)
19     #define CTOP_AUX_LPC (CTOP_AUX_BASE + 0x030)
20     #define CTOP_AUX_EFLAGS (CTOP_AUX_BASE + 0x080)
21     -#define CTOP_AUX_IACK (CTOP_AUX_BASE + 0x088)
22     #define CTOP_AUX_GPA1 (CTOP_AUX_BASE + 0x08C)
23     #define CTOP_AUX_UDMC (CTOP_AUX_BASE + 0x300)
24    
25     diff --git a/arch/arm/boot/dts/socfpga_arria10.dtsi b/arch/arm/boot/dts/socfpga_arria10.dtsi
26     index 4d496479e1353..342ae7ef9f08c 100644
27     --- a/arch/arm/boot/dts/socfpga_arria10.dtsi
28     +++ b/arch/arm/boot/dts/socfpga_arria10.dtsi
29     @@ -710,7 +710,7 @@
30     timer3: timer3@ffd00100 {
31     compatible = "snps,dw-apb-timer";
32     interrupts = <0 118 IRQ_TYPE_LEVEL_HIGH>;
33     - reg = <0xffd01000 0x100>;
34     + reg = <0xffd00100 0x100>;
35     clocks = <&l4_sys_free_clk>;
36     clock-names = "timer";
37     };
38     diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
39     index f8a529c852795..24eb7fe7922e6 100644
40     --- a/arch/mips/Kconfig
41     +++ b/arch/mips/Kconfig
42     @@ -848,6 +848,7 @@ config SNI_RM
43     select I8253
44     select I8259
45     select ISA
46     + select MIPS_L1_CACHE_SHIFT_6
47     select SWAP_IO_SPACE if CPU_BIG_ENDIAN
48     select SYS_HAS_CPU_R4X00
49     select SYS_HAS_CPU_R5000
50     diff --git a/arch/mips/sni/a20r.c b/arch/mips/sni/a20r.c
51     index f9407e1704762..c6af7047eb0d2 100644
52     --- a/arch/mips/sni/a20r.c
53     +++ b/arch/mips/sni/a20r.c
54     @@ -143,7 +143,10 @@ static struct platform_device sc26xx_pdev = {
55     },
56     };
57    
58     -static u32 a20r_ack_hwint(void)
59     +/*
60     + * Trigger chipset to update CPU's CAUSE IP field
61     + */
62     +static u32 a20r_update_cause_ip(void)
63     {
64     u32 status = read_c0_status();
65    
66     @@ -205,12 +208,14 @@ static void a20r_hwint(void)
67     int irq;
68    
69     clear_c0_status(IE_IRQ0);
70     - status = a20r_ack_hwint();
71     + status = a20r_update_cause_ip();
72     cause = read_c0_cause();
73    
74     irq = ffs(((cause & status) >> 8) & 0xf8);
75     if (likely(irq > 0))
76     do_IRQ(SNI_A20R_IRQ_BASE + irq - 1);
77     +
78     + a20r_update_cause_ip();
79     set_c0_status(IE_IRQ0);
80     }
81    
82     diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig
83     index 76f4edd441d30..07bc4f0382499 100644
84     --- a/arch/powerpc/configs/pasemi_defconfig
85     +++ b/arch/powerpc/configs/pasemi_defconfig
86     @@ -115,7 +115,6 @@ CONFIG_FB_NVIDIA=y
87     CONFIG_FB_NVIDIA_I2C=y
88     CONFIG_FB_RADEON=y
89     # CONFIG_LCD_CLASS_DEVICE is not set
90     -CONFIG_VGACON_SOFT_SCROLLBACK=y
91     CONFIG_LOGO=y
92     CONFIG_SOUND=y
93     CONFIG_SND=y
94     diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig
95     index 8fbf498012337..1c6815bcc6162 100644
96     --- a/arch/powerpc/configs/ppc6xx_defconfig
97     +++ b/arch/powerpc/configs/ppc6xx_defconfig
98     @@ -796,7 +796,6 @@ CONFIG_FB_TRIDENT=m
99     CONFIG_FB_SM501=m
100     CONFIG_FB_IBM_GXT4500=y
101     CONFIG_LCD_PLATFORM=m
102     -CONFIG_VGACON_SOFT_SCROLLBACK=y
103     CONFIG_FRAMEBUFFER_CONSOLE=y
104     CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
105     CONFIG_LOGO=y
106     diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c
107     index fb7cbaa376582..611e09add911c 100644
108     --- a/arch/powerpc/kernel/dma-iommu.c
109     +++ b/arch/powerpc/kernel/dma-iommu.c
110     @@ -99,7 +99,8 @@ static u64 dma_iommu_get_required_mask(struct device *dev)
111     if (!tbl)
112     return 0;
113    
114     - mask = 1ULL < (fls_long(tbl->it_offset + tbl->it_size) - 1);
115     + mask = 1ULL << (fls_long(tbl->it_offset + tbl->it_size) +
116     + tbl->it_page_shift - 1);
117     mask += mask - 1;
118    
119     return mask;
120     diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
121     index 5fa6ee2c2dde0..8b5d3580ae726 100644
122     --- a/arch/x86/configs/i386_defconfig
123     +++ b/arch/x86/configs/i386_defconfig
124     @@ -217,7 +217,6 @@ CONFIG_FB_MODE_HELPERS=y
125     CONFIG_FB_TILEBLITTING=y
126     CONFIG_FB_EFI=y
127     # CONFIG_LCD_CLASS_DEVICE is not set
128     -CONFIG_VGACON_SOFT_SCROLLBACK=y
129     CONFIG_LOGO=y
130     # CONFIG_LOGO_LINUX_MONO is not set
131     # CONFIG_LOGO_LINUX_VGA16 is not set
132     @@ -247,6 +246,7 @@ CONFIG_USB_HIDDEV=y
133     CONFIG_USB=y
134     CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
135     CONFIG_USB_MON=y
136     +CONFIG_USB_XHCI_HCD=y
137     CONFIG_USB_EHCI_HCD=y
138     CONFIG_USB_EHCI_TT_NEWSCHED=y
139     CONFIG_USB_OHCI_HCD=y
140     diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
141     index 7ef4a099defcd..ef835d41cdf0f 100644
142     --- a/arch/x86/configs/x86_64_defconfig
143     +++ b/arch/x86/configs/x86_64_defconfig
144     @@ -212,7 +212,6 @@ CONFIG_FB_MODE_HELPERS=y
145     CONFIG_FB_TILEBLITTING=y
146     CONFIG_FB_EFI=y
147     # CONFIG_LCD_CLASS_DEVICE is not set
148     -CONFIG_VGACON_SOFT_SCROLLBACK=y
149     CONFIG_LOGO=y
150     # CONFIG_LOGO_LINUX_MONO is not set
151     # CONFIG_LOGO_LINUX_VGA16 is not set
152     @@ -242,6 +241,7 @@ CONFIG_USB_HIDDEV=y
153     CONFIG_USB=y
154     CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
155     CONFIG_USB_MON=y
156     +CONFIG_USB_XHCI_HCD=y
157     CONFIG_USB_EHCI_HCD=y
158     CONFIG_USB_EHCI_TT_NEWSCHED=y
159     CONFIG_USB_OHCI_HCD=y
160     diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
161     index e7fe5974c81c1..622e5a7eb7db5 100644
162     --- a/arch/x86/kvm/vmx.c
163     +++ b/arch/x86/kvm/vmx.c
164     @@ -8606,6 +8606,7 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu)
165     (exit_reason != EXIT_REASON_EXCEPTION_NMI &&
166     exit_reason != EXIT_REASON_EPT_VIOLATION &&
167     exit_reason != EXIT_REASON_PML_FULL &&
168     + exit_reason != EXIT_REASON_APIC_ACCESS &&
169     exit_reason != EXIT_REASON_TASK_SWITCH)) {
170     vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
171     vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_DELIVERY_EV;
172     diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
173     index 82296fe2ba3bd..7cb2b863e653e 100644
174     --- a/drivers/atm/firestream.c
175     +++ b/drivers/atm/firestream.c
176     @@ -1013,6 +1013,7 @@ static int fs_open(struct atm_vcc *atm_vcc)
177     error = make_rate (pcr, r, &tmc0, NULL);
178     if (error) {
179     kfree(tc);
180     + kfree(vcc);
181     return error;
182     }
183     }
184     diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
185     index 19f336752ad75..c16be18fddef1 100644
186     --- a/drivers/block/rbd.c
187     +++ b/drivers/block/rbd.c
188     @@ -4614,6 +4614,9 @@ static ssize_t rbd_config_info_show(struct device *dev,
189     {
190     struct rbd_device *rbd_dev = dev_to_rbd_dev(dev);
191    
192     + if (!capable(CAP_SYS_ADMIN))
193     + return -EPERM;
194     +
195     return sprintf(buf, "%s\n", rbd_dev->config_info);
196     }
197    
198     @@ -4715,6 +4718,9 @@ static ssize_t rbd_image_refresh(struct device *dev,
199     struct rbd_device *rbd_dev = dev_to_rbd_dev(dev);
200     int ret;
201    
202     + if (!capable(CAP_SYS_ADMIN))
203     + return -EPERM;
204     +
205     ret = rbd_dev_refresh(rbd_dev);
206     if (ret)
207     return ret;
208     @@ -6192,6 +6198,9 @@ static ssize_t do_rbd_add(struct bus_type *bus,
209     bool read_only;
210     int rc;
211    
212     + if (!capable(CAP_SYS_ADMIN))
213     + return -EPERM;
214     +
215     if (!try_module_get(THIS_MODULE))
216     return -ENODEV;
217    
218     @@ -6340,6 +6349,9 @@ static ssize_t do_rbd_remove(struct bus_type *bus,
219     bool force = false;
220     int ret;
221    
222     + if (!capable(CAP_SYS_ADMIN))
223     + return -EPERM;
224     +
225     dev_id = -1;
226     opt_buf[0] = '\0';
227     sscanf(buf, "%d %5s", &dev_id, opt_buf);
228     diff --git a/drivers/clk/rockchip/clk-rk3228.c b/drivers/clk/rockchip/clk-rk3228.c
229     index 53f16efbb8f4f..31785b3abac50 100644
230     --- a/drivers/clk/rockchip/clk-rk3228.c
231     +++ b/drivers/clk/rockchip/clk-rk3228.c
232     @@ -126,7 +126,7 @@ PNAME(mux_usb480m_p) = { "usb480m_phy", "xin24m" };
233     PNAME(mux_hdmiphy_p) = { "hdmiphy_phy", "xin24m" };
234     PNAME(mux_aclk_cpu_src_p) = { "cpll_aclk_cpu", "gpll_aclk_cpu", "hdmiphy_aclk_cpu" };
235    
236     -PNAME(mux_pll_src_4plls_p) = { "cpll", "gpll", "hdmiphy" "usb480m" };
237     +PNAME(mux_pll_src_4plls_p) = { "cpll", "gpll", "hdmiphy", "usb480m" };
238     PNAME(mux_pll_src_3plls_p) = { "cpll", "gpll", "hdmiphy" };
239     PNAME(mux_pll_src_2plls_p) = { "cpll", "gpll" };
240     PNAME(mux_sclk_hdmi_cec_p) = { "cpll", "gpll", "xin24m" };
241     diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
242     index 2865876079315..0f8f9a784b1be 100644
243     --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
244     +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
245     @@ -457,8 +457,13 @@ err_pm:
246     pm_runtime_disable(dev);
247     err_node:
248     of_node_put(private->mutex_node);
249     - for (i = 0; i < DDP_COMPONENT_ID_MAX; i++)
250     + for (i = 0; i < DDP_COMPONENT_ID_MAX; i++) {
251     of_node_put(private->comp_node[i]);
252     + if (private->ddp_comp[i]) {
253     + put_device(private->ddp_comp[i]->larb_dev);
254     + private->ddp_comp[i] = NULL;
255     + }
256     + }
257     return ret;
258     }
259    
260     diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
261     index 9360cdce740e8..7bf5e2fe17516 100644
262     --- a/drivers/hv/channel_mgmt.c
263     +++ b/drivers/hv/channel_mgmt.c
264     @@ -681,7 +681,7 @@ static void vmbus_wait_for_unload(void)
265     void *page_addr;
266     struct hv_message *msg;
267     struct vmbus_channel_message_header *hdr;
268     - u32 message_type;
269     + u32 message_type, i;
270    
271     /*
272     * CHANNELMSG_UNLOAD_RESPONSE is always delivered to the CPU which was
273     @@ -691,8 +691,11 @@ static void vmbus_wait_for_unload(void)
274     * functional and vmbus_unload_response() will complete
275     * vmbus_connection.unload_event. If not, the last thing we can do is
276     * read message pages for all CPUs directly.
277     + *
278     + * Wait no more than 10 seconds so that the panic path can't get
279     + * hung forever in case the response message isn't seen.
280     */
281     - while (1) {
282     + for (i = 0; i < 1000; i++) {
283     if (completion_done(&vmbus_connection.unload_event))
284     break;
285    
286     diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
287     index 3a9db4626cb60..1886588b9ea3e 100644
288     --- a/drivers/i2c/algos/i2c-algo-pca.c
289     +++ b/drivers/i2c/algos/i2c-algo-pca.c
290     @@ -50,8 +50,22 @@ static void pca_reset(struct i2c_algo_pca_data *adap)
291     pca_outw(adap, I2C_PCA_INDPTR, I2C_PCA_IPRESET);
292     pca_outw(adap, I2C_PCA_IND, 0xA5);
293     pca_outw(adap, I2C_PCA_IND, 0x5A);
294     +
295     + /*
296     + * After a reset we need to re-apply any configuration
297     + * (calculated in pca_init) to get the bus in a working state.
298     + */
299     + pca_outw(adap, I2C_PCA_INDPTR, I2C_PCA_IMODE);
300     + pca_outw(adap, I2C_PCA_IND, adap->bus_settings.mode);
301     + pca_outw(adap, I2C_PCA_INDPTR, I2C_PCA_ISCLL);
302     + pca_outw(adap, I2C_PCA_IND, adap->bus_settings.tlow);
303     + pca_outw(adap, I2C_PCA_INDPTR, I2C_PCA_ISCLH);
304     + pca_outw(adap, I2C_PCA_IND, adap->bus_settings.thi);
305     +
306     + pca_set_con(adap, I2C_PCA_CON_ENSIO);
307     } else {
308     adap->reset_chip(adap->data);
309     + pca_set_con(adap, I2C_PCA_CON_ENSIO | adap->bus_settings.clock_freq);
310     }
311     }
312    
313     @@ -435,13 +449,14 @@ static int pca_init(struct i2c_adapter *adap)
314     " Use the nominal frequency.\n", adap->name);
315     }
316    
317     - pca_reset(pca_data);
318     -
319     clock = pca_clock(pca_data);
320     printk(KERN_INFO "%s: Clock frequency is %dkHz\n",
321     adap->name, freqs[clock]);
322    
323     - pca_set_con(pca_data, I2C_PCA_CON_ENSIO | clock);
324     + /* Store settings as these will be needed when the PCA chip is reset */
325     + pca_data->bus_settings.clock_freq = clock;
326     +
327     + pca_reset(pca_data);
328     } else {
329     int clock;
330     int mode;
331     @@ -508,19 +523,15 @@ static int pca_init(struct i2c_adapter *adap)
332     thi = tlow * min_thi / min_tlow;
333     }
334    
335     + /* Store settings as these will be needed when the PCA chip is reset */
336     + pca_data->bus_settings.mode = mode;
337     + pca_data->bus_settings.tlow = tlow;
338     + pca_data->bus_settings.thi = thi;
339     +
340     pca_reset(pca_data);
341    
342     printk(KERN_INFO
343     "%s: Clock frequency is %dHz\n", adap->name, clock * 100);
344     -
345     - pca_outw(pca_data, I2C_PCA_INDPTR, I2C_PCA_IMODE);
346     - pca_outw(pca_data, I2C_PCA_IND, mode);
347     - pca_outw(pca_data, I2C_PCA_INDPTR, I2C_PCA_ISCLL);
348     - pca_outw(pca_data, I2C_PCA_IND, tlow);
349     - pca_outw(pca_data, I2C_PCA_INDPTR, I2C_PCA_ISCLH);
350     - pca_outw(pca_data, I2C_PCA_IND, thi);
351     -
352     - pca_set_con(pca_data, I2C_PCA_CON_ENSIO);
353     }
354     udelay(500); /* 500 us for oscillator to stabilise */
355    
356     diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c
357     index b6254ce9ab3b3..86fe94f9511f4 100644
358     --- a/drivers/iio/accel/bmc150-accel-core.c
359     +++ b/drivers/iio/accel/bmc150-accel-core.c
360     @@ -197,6 +197,14 @@ struct bmc150_accel_data {
361     struct mutex mutex;
362     u8 fifo_mode, watermark;
363     s16 buffer[8];
364     + /*
365     + * Ensure there is sufficient space and correct alignment for
366     + * the timestamp if enabled
367     + */
368     + struct {
369     + __le16 channels[3];
370     + s64 ts __aligned(8);
371     + } scan;
372     u8 bw_bits;
373     u32 slope_dur;
374     u32 slope_thres;
375     @@ -933,15 +941,16 @@ static int __bmc150_accel_fifo_flush(struct iio_dev *indio_dev,
376     * now.
377     */
378     for (i = 0; i < count; i++) {
379     - u16 sample[8];
380     int j, bit;
381    
382     j = 0;
383     for_each_set_bit(bit, indio_dev->active_scan_mask,
384     indio_dev->masklength)
385     - memcpy(&sample[j++], &buffer[i * 3 + bit], 2);
386     + memcpy(&data->scan.channels[j++], &buffer[i * 3 + bit],
387     + sizeof(data->scan.channels[0]));
388    
389     - iio_push_to_buffers_with_timestamp(indio_dev, sample, tstamp);
390     + iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
391     + tstamp);
392    
393     tstamp += sample_period;
394     }
395     diff --git a/drivers/iio/accel/kxsd9.c b/drivers/iio/accel/kxsd9.c
396     index 9af60ac707382..1bda730a71c0b 100644
397     --- a/drivers/iio/accel/kxsd9.c
398     +++ b/drivers/iio/accel/kxsd9.c
399     @@ -212,14 +212,20 @@ static irqreturn_t kxsd9_trigger_handler(int irq, void *p)
400     const struct iio_poll_func *pf = p;
401     struct iio_dev *indio_dev = pf->indio_dev;
402     struct kxsd9_state *st = iio_priv(indio_dev);
403     + /*
404     + * Ensure correct positioning and alignment of timestamp.
405     + * No need to zero initialize as all elements written.
406     + */
407     + struct {
408     + __be16 chan[4];
409     + s64 ts __aligned(8);
410     + } hw_values;
411     int ret;
412     - /* 4 * 16bit values AND timestamp */
413     - __be16 hw_values[8];
414    
415     ret = regmap_bulk_read(st->map,
416     KXSD9_REG_X,
417     - &hw_values,
418     - 8);
419     + hw_values.chan,
420     + sizeof(hw_values.chan));
421     if (ret) {
422     dev_err(st->dev,
423     "error reading data\n");
424     @@ -227,7 +233,7 @@ static irqreturn_t kxsd9_trigger_handler(int irq, void *p)
425     }
426    
427     iio_push_to_buffers_with_timestamp(indio_dev,
428     - hw_values,
429     + &hw_values,
430     iio_get_time_ns(indio_dev));
431     iio_trigger_notify_done(indio_dev->trig);
432    
433     diff --git a/drivers/iio/accel/mma7455_core.c b/drivers/iio/accel/mma7455_core.c
434     index 6551085bedd75..f7804e56cc272 100644
435     --- a/drivers/iio/accel/mma7455_core.c
436     +++ b/drivers/iio/accel/mma7455_core.c
437     @@ -55,6 +55,14 @@
438    
439     struct mma7455_data {
440     struct regmap *regmap;
441     + /*
442     + * Used to reorganize data. Will ensure correct alignment of
443     + * the timestamp if present
444     + */
445     + struct {
446     + __le16 channels[3];
447     + s64 ts __aligned(8);
448     + } scan;
449     };
450    
451     static int mma7455_drdy(struct mma7455_data *mma7455)
452     @@ -85,19 +93,19 @@ static irqreturn_t mma7455_trigger_handler(int irq, void *p)
453     struct iio_poll_func *pf = p;
454     struct iio_dev *indio_dev = pf->indio_dev;
455     struct mma7455_data *mma7455 = iio_priv(indio_dev);
456     - u8 buf[16]; /* 3 x 16-bit channels + padding + ts */
457     int ret;
458    
459     ret = mma7455_drdy(mma7455);
460     if (ret)
461     goto done;
462    
463     - ret = regmap_bulk_read(mma7455->regmap, MMA7455_REG_XOUTL, buf,
464     - sizeof(__le16) * 3);
465     + ret = regmap_bulk_read(mma7455->regmap, MMA7455_REG_XOUTL,
466     + mma7455->scan.channels,
467     + sizeof(mma7455->scan.channels));
468     if (ret)
469     goto done;
470    
471     - iio_push_to_buffers_with_timestamp(indio_dev, buf,
472     + iio_push_to_buffers_with_timestamp(indio_dev, &mma7455->scan,
473     iio_get_time_ns(indio_dev));
474    
475     done:
476     diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
477     index 08cb814c36da5..90d4179e8c3de 100644
478     --- a/drivers/iio/accel/mma8452.c
479     +++ b/drivers/iio/accel/mma8452.c
480     @@ -105,6 +105,12 @@ struct mma8452_data {
481     u8 ctrl_reg1;
482     u8 data_cfg;
483     const struct mma_chip_info *chip_info;
484     +
485     + /* Ensure correct alignment of time stamp when present */
486     + struct {
487     + __be16 channels[3];
488     + s64 ts __aligned(8);
489     + } buffer;
490     };
491    
492     /**
493     @@ -985,14 +991,13 @@ static irqreturn_t mma8452_trigger_handler(int irq, void *p)
494     struct iio_poll_func *pf = p;
495     struct iio_dev *indio_dev = pf->indio_dev;
496     struct mma8452_data *data = iio_priv(indio_dev);
497     - u8 buffer[16]; /* 3 16-bit channels + padding + ts */
498     int ret;
499    
500     - ret = mma8452_read(data, (__be16 *)buffer);
501     + ret = mma8452_read(data, data->buffer.channels);
502     if (ret < 0)
503     goto done;
504    
505     - iio_push_to_buffers_with_timestamp(indio_dev, buffer,
506     + iio_push_to_buffers_with_timestamp(indio_dev, &data->buffer,
507     iio_get_time_ns(indio_dev));
508    
509     done:
510     diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c
511     index 59b7d76e1ad21..ce7e9a2383afb 100644
512     --- a/drivers/iio/adc/ina2xx-adc.c
513     +++ b/drivers/iio/adc/ina2xx-adc.c
514     @@ -117,6 +117,11 @@ struct ina2xx_chip_info {
515     int int_time_vbus; /* Bus voltage integration time uS */
516     int int_time_vshunt; /* Shunt voltage integration time uS */
517     bool allow_async_readout;
518     + /* data buffer needs space for channel data and timestamp */
519     + struct {
520     + u16 chan[4];
521     + u64 ts __aligned(8);
522     + } scan;
523     };
524    
525     static const struct ina2xx_config ina2xx_config[] = {
526     @@ -459,7 +464,6 @@ static const struct iio_chan_spec ina2xx_channels[] = {
527     static int ina2xx_work_buffer(struct iio_dev *indio_dev)
528     {
529     struct ina2xx_chip_info *chip = iio_priv(indio_dev);
530     - unsigned short data[8];
531     int bit, ret, i = 0;
532     s64 time_a, time_b;
533     unsigned int alert;
534     @@ -500,13 +504,12 @@ static int ina2xx_work_buffer(struct iio_dev *indio_dev)
535     if (ret < 0)
536     return ret;
537    
538     - data[i++] = val;
539     + chip->scan.chan[i++] = val;
540     }
541    
542     time_b = iio_get_time_ns(indio_dev);
543    
544     - iio_push_to_buffers_with_timestamp(indio_dev,
545     - (unsigned int *)data, time_a);
546     + iio_push_to_buffers_with_timestamp(indio_dev, &chip->scan, time_a);
547    
548     return (unsigned long)(time_b - time_a) / 1000;
549     };
550     diff --git a/drivers/iio/adc/mcp3422.c b/drivers/iio/adc/mcp3422.c
551     index 254135e077922..6cc6666180eb5 100644
552     --- a/drivers/iio/adc/mcp3422.c
553     +++ b/drivers/iio/adc/mcp3422.c
554     @@ -99,16 +99,12 @@ static int mcp3422_update_config(struct mcp3422 *adc, u8 newconfig)
555     {
556     int ret;
557    
558     - mutex_lock(&adc->lock);
559     -
560     ret = i2c_master_send(adc->i2c, &newconfig, 1);
561     if (ret > 0) {
562     adc->config = newconfig;
563     ret = 0;
564     }
565    
566     - mutex_unlock(&adc->lock);
567     -
568     return ret;
569     }
570    
571     @@ -141,6 +137,8 @@ static int mcp3422_read_channel(struct mcp3422 *adc,
572     u8 config;
573     u8 req_channel = channel->channel;
574    
575     + mutex_lock(&adc->lock);
576     +
577     if (req_channel != MCP3422_CHANNEL(adc->config)) {
578     config = adc->config;
579     config &= ~MCP3422_CHANNEL_MASK;
580     @@ -148,12 +146,18 @@ static int mcp3422_read_channel(struct mcp3422 *adc,
581     config &= ~MCP3422_PGA_MASK;
582     config |= MCP3422_PGA_VALUE(adc->pga[req_channel]);
583     ret = mcp3422_update_config(adc, config);
584     - if (ret < 0)
585     + if (ret < 0) {
586     + mutex_unlock(&adc->lock);
587     return ret;
588     + }
589     msleep(mcp3422_read_times[MCP3422_SAMPLE_RATE(adc->config)]);
590     }
591    
592     - return mcp3422_read(adc, value, &config);
593     + ret = mcp3422_read(adc, value, &config);
594     +
595     + mutex_unlock(&adc->lock);
596     +
597     + return ret;
598     }
599    
600     static int mcp3422_read_raw(struct iio_dev *iio,
601     diff --git a/drivers/iio/adc/ti-adc081c.c b/drivers/iio/adc/ti-adc081c.c
602     index 319172cf7da80..d9bfe79c17475 100644
603     --- a/drivers/iio/adc/ti-adc081c.c
604     +++ b/drivers/iio/adc/ti-adc081c.c
605     @@ -36,6 +36,12 @@ struct adc081c {
606    
607     /* 8, 10 or 12 */
608     int bits;
609     +
610     + /* Ensure natural alignment of buffer elements */
611     + struct {
612     + u16 channel;
613     + s64 ts __aligned(8);
614     + } scan;
615     };
616    
617     #define REG_CONV_RES 0x00
618     @@ -132,14 +138,13 @@ static irqreturn_t adc081c_trigger_handler(int irq, void *p)
619     struct iio_poll_func *pf = p;
620     struct iio_dev *indio_dev = pf->indio_dev;
621     struct adc081c *data = iio_priv(indio_dev);
622     - u16 buf[8]; /* 2 bytes data + 6 bytes padding + 8 bytes timestamp */
623     int ret;
624    
625     ret = i2c_smbus_read_word_swapped(data->i2c, REG_CONV_RES);
626     if (ret < 0)
627     goto out;
628     - buf[0] = ret;
629     - iio_push_to_buffers_with_timestamp(indio_dev, buf,
630     + data->scan.channel = ret;
631     + iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
632     iio_get_time_ns(indio_dev));
633     out:
634     iio_trigger_notify_done(indio_dev->trig);
635     diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
636     index af05e20c986b5..5afe32f6587bb 100644
637     --- a/drivers/iio/adc/ti-ads1015.c
638     +++ b/drivers/iio/adc/ti-ads1015.c
639     @@ -220,6 +220,7 @@ static const struct iio_chan_spec ads1115_channels[] = {
640     IIO_CHAN_SOFT_TIMESTAMP(ADS1015_TIMESTAMP),
641     };
642    
643     +#ifdef CONFIG_PM
644     static int ads1015_set_power_state(struct ads1015_data *data, bool on)
645     {
646     int ret;
647     @@ -237,6 +238,15 @@ static int ads1015_set_power_state(struct ads1015_data *data, bool on)
648     return ret < 0 ? ret : 0;
649     }
650    
651     +#else /* !CONFIG_PM */
652     +
653     +static int ads1015_set_power_state(struct ads1015_data *data, bool on)
654     +{
655     + return 0;
656     +}
657     +
658     +#endif /* !CONFIG_PM */
659     +
660     static
661     int ads1015_get_adc_result(struct ads1015_data *data, int chan, int *val)
662     {
663     diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
664     index c298fd86ed86b..a8f9bc12ee23a 100644
665     --- a/drivers/iio/light/ltr501.c
666     +++ b/drivers/iio/light/ltr501.c
667     @@ -1218,13 +1218,16 @@ static irqreturn_t ltr501_trigger_handler(int irq, void *p)
668     struct iio_poll_func *pf = p;
669     struct iio_dev *indio_dev = pf->indio_dev;
670     struct ltr501_data *data = iio_priv(indio_dev);
671     - u16 buf[8];
672     + struct {
673     + u16 channels[3];
674     + s64 ts __aligned(8);
675     + } scan;
676     __le16 als_buf[2];
677     u8 mask = 0;
678     int j = 0;
679     int ret, psdata;
680    
681     - memset(buf, 0, sizeof(buf));
682     + memset(&scan, 0, sizeof(scan));
683    
684     /* figure out which data needs to be ready */
685     if (test_bit(0, indio_dev->active_scan_mask) ||
686     @@ -1243,9 +1246,9 @@ static irqreturn_t ltr501_trigger_handler(int irq, void *p)
687     if (ret < 0)
688     return ret;
689     if (test_bit(0, indio_dev->active_scan_mask))
690     - buf[j++] = le16_to_cpu(als_buf[1]);
691     + scan.channels[j++] = le16_to_cpu(als_buf[1]);
692     if (test_bit(1, indio_dev->active_scan_mask))
693     - buf[j++] = le16_to_cpu(als_buf[0]);
694     + scan.channels[j++] = le16_to_cpu(als_buf[0]);
695     }
696    
697     if (mask & LTR501_STATUS_PS_RDY) {
698     @@ -1253,10 +1256,10 @@ static irqreturn_t ltr501_trigger_handler(int irq, void *p)
699     &psdata, 2);
700     if (ret < 0)
701     goto done;
702     - buf[j++] = psdata & LTR501_PS_DATA_MASK;
703     + scan.channels[j++] = psdata & LTR501_PS_DATA_MASK;
704     }
705    
706     - iio_push_to_buffers_with_timestamp(indio_dev, buf,
707     + iio_push_to_buffers_with_timestamp(indio_dev, &scan,
708     iio_get_time_ns(indio_dev));
709    
710     done:
711     diff --git a/drivers/iio/light/max44000.c b/drivers/iio/light/max44000.c
712     index a8ffa432bf0de..87662c88fbebb 100644
713     --- a/drivers/iio/light/max44000.c
714     +++ b/drivers/iio/light/max44000.c
715     @@ -78,6 +78,11 @@
716     struct max44000_data {
717     struct mutex lock;
718     struct regmap *regmap;
719     + /* Ensure naturally aligned timestamp */
720     + struct {
721     + u16 channels[2];
722     + s64 ts __aligned(8);
723     + } scan;
724     };
725    
726     /* Default scale is set to the minimum of 0.03125 or 1 / (1 << 5) lux */
727     @@ -491,7 +496,6 @@ static irqreturn_t max44000_trigger_handler(int irq, void *p)
728     struct iio_poll_func *pf = p;
729     struct iio_dev *indio_dev = pf->indio_dev;
730     struct max44000_data *data = iio_priv(indio_dev);
731     - u16 buf[8]; /* 2x u16 + padding + 8 bytes timestamp */
732     int index = 0;
733     unsigned int regval;
734     int ret;
735     @@ -501,17 +505,17 @@ static irqreturn_t max44000_trigger_handler(int irq, void *p)
736     ret = max44000_read_alsval(data);
737     if (ret < 0)
738     goto out_unlock;
739     - buf[index++] = ret;
740     + data->scan.channels[index++] = ret;
741     }
742     if (test_bit(MAX44000_SCAN_INDEX_PRX, indio_dev->active_scan_mask)) {
743     ret = regmap_read(data->regmap, MAX44000_REG_PRX_DATA, &regval);
744     if (ret < 0)
745     goto out_unlock;
746     - buf[index] = regval;
747     + data->scan.channels[index] = regval;
748     }
749     mutex_unlock(&data->lock);
750    
751     - iio_push_to_buffers_with_timestamp(indio_dev, buf,
752     + iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
753     iio_get_time_ns(indio_dev));
754     iio_trigger_notify_done(indio_dev->trig);
755     return IRQ_HANDLED;
756     diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
757     index af8606cc78123..2a4e23e20ebc6 100644
758     --- a/drivers/iio/magnetometer/ak8975.c
759     +++ b/drivers/iio/magnetometer/ak8975.c
760     @@ -381,6 +381,12 @@ struct ak8975_data {
761     struct iio_mount_matrix orientation;
762     struct regulator *vdd;
763     struct regulator *vid;
764     +
765     + /* Ensure natural alignment of timestamp */
766     + struct {
767     + s16 channels[3];
768     + s64 ts __aligned(8);
769     + } scan;
770     };
771    
772     /* Enable attached power regulator if any. */
773     @@ -690,6 +696,7 @@ static int ak8975_read_axis(struct iio_dev *indio_dev, int index, int *val)
774     struct ak8975_data *data = iio_priv(indio_dev);
775     const struct i2c_client *client = data->client;
776     const struct ak_def *def = data->def;
777     + __le16 rval;
778     u16 buff;
779     int ret;
780    
781     @@ -703,7 +710,7 @@ static int ak8975_read_axis(struct iio_dev *indio_dev, int index, int *val)
782    
783     ret = i2c_smbus_read_i2c_block_data_or_emulated(
784     client, def->data_regs[index],
785     - sizeof(buff), (u8*)&buff);
786     + sizeof(rval), (u8*)&rval);
787     if (ret < 0)
788     goto exit;
789    
790     @@ -713,7 +720,7 @@ static int ak8975_read_axis(struct iio_dev *indio_dev, int index, int *val)
791     pm_runtime_put_autosuspend(&data->client->dev);
792    
793     /* Swap bytes and convert to valid range. */
794     - buff = le16_to_cpu(buff);
795     + buff = le16_to_cpu(rval);
796     *val = clamp_t(s16, buff, -def->range, def->range);
797     return IIO_VAL_INT;
798    
799     @@ -812,7 +819,7 @@ static void ak8975_fill_buffer(struct iio_dev *indio_dev)
800     const struct i2c_client *client = data->client;
801     const struct ak_def *def = data->def;
802     int ret;
803     - s16 buff[8]; /* 3 x 16 bits axis values + 1 aligned 64 bits timestamp */
804     + __le16 fval[3];
805    
806     mutex_lock(&data->lock);
807    
808     @@ -826,20 +833,21 @@ static void ak8975_fill_buffer(struct iio_dev *indio_dev)
809     */
810     ret = i2c_smbus_read_i2c_block_data_or_emulated(client,
811     def->data_regs[0],
812     - 3 * sizeof(buff[0]),
813     - (u8 *)buff);
814     + 3 * sizeof(fval[0]),
815     + (u8 *)fval);
816     if (ret < 0)
817     goto unlock;
818    
819     mutex_unlock(&data->lock);
820    
821     /* Clamp to valid range. */
822     - buff[0] = clamp_t(s16, le16_to_cpu(buff[0]), -def->range, def->range);
823     - buff[1] = clamp_t(s16, le16_to_cpu(buff[1]), -def->range, def->range);
824     - buff[2] = clamp_t(s16, le16_to_cpu(buff[2]), -def->range, def->range);
825     + data->scan.channels[0] = clamp_t(s16, le16_to_cpu(fval[0]), -def->range, def->range);
826     + data->scan.channels[1] = clamp_t(s16, le16_to_cpu(fval[1]), -def->range, def->range);
827     + data->scan.channels[2] = clamp_t(s16, le16_to_cpu(fval[2]), -def->range, def->range);
828    
829     - iio_push_to_buffers_with_timestamp(indio_dev, buff,
830     + iio_push_to_buffers_with_timestamp(indio_dev, &data->scan,
831     iio_get_time_ns(indio_dev));
832     +
833     return;
834    
835     unlock:
836     diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c
837     index ab6c3c25d7ff9..9f62345855321 100644
838     --- a/drivers/infiniband/sw/rxe/rxe.c
839     +++ b/drivers/infiniband/sw/rxe/rxe.c
840     @@ -168,9 +168,6 @@ static int rxe_init_ports(struct rxe_dev *rxe)
841    
842     rxe_init_port_param(port);
843    
844     - if (!port->attr.pkey_tbl_len || !port->attr.gid_tbl_len)
845     - return -EINVAL;
846     -
847     port->pkey_tbl = kcalloc(port->attr.pkey_tbl_len,
848     sizeof(*port->pkey_tbl), GFP_KERNEL);
849    
850     @@ -178,7 +175,7 @@ static int rxe_init_ports(struct rxe_dev *rxe)
851     return -ENOMEM;
852    
853     port->pkey_tbl[0] = 0xffff;
854     - port->port_guid = rxe->ifc_ops->port_guid(rxe);
855     + port->port_guid = rxe_port_guid(rxe);
856    
857     spin_lock_init(&port->port_lock);
858    
859     diff --git a/drivers/infiniband/sw/rxe/rxe_loc.h b/drivers/infiniband/sw/rxe/rxe_loc.h
860     index 73849a5a91b3a..cd7663062d015 100644
861     --- a/drivers/infiniband/sw/rxe/rxe_loc.h
862     +++ b/drivers/infiniband/sw/rxe/rxe_loc.h
863     @@ -141,6 +141,22 @@ void rxe_mem_cleanup(void *arg);
864    
865     int advance_dma_data(struct rxe_dma_info *dma, unsigned int length);
866    
867     +/* rxe_net.c */
868     +int rxe_loopback(struct sk_buff *skb);
869     +int rxe_send(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
870     + struct sk_buff *skb);
871     +__be64 rxe_port_guid(struct rxe_dev *rxe);
872     +struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
873     + int paylen, struct rxe_pkt_info *pkt);
874     +int rxe_prepare(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
875     + struct sk_buff *skb, u32 *crc);
876     +enum rdma_link_layer rxe_link_layer(struct rxe_dev *rxe, unsigned int port_num);
877     +const char *rxe_parent_name(struct rxe_dev *rxe, unsigned int port_num);
878     +struct device *rxe_dma_device(struct rxe_dev *rxe);
879     +__be64 rxe_node_guid(struct rxe_dev *rxe);
880     +int rxe_mcast_add(struct rxe_dev *rxe, union ib_gid *mgid);
881     +int rxe_mcast_delete(struct rxe_dev *rxe, union ib_gid *mgid);
882     +
883     /* rxe_qp.c */
884     int rxe_qp_chk_init(struct rxe_dev *rxe, struct ib_qp_init_attr *init);
885    
886     @@ -256,9 +272,9 @@ static inline int rxe_xmit_packet(struct rxe_dev *rxe, struct rxe_qp *qp,
887    
888     if (pkt->mask & RXE_LOOPBACK_MASK) {
889     memcpy(SKB_TO_PKT(skb), pkt, sizeof(*pkt));
890     - err = rxe->ifc_ops->loopback(skb);
891     + err = rxe_loopback(skb);
892     } else {
893     - err = rxe->ifc_ops->send(rxe, pkt, skb);
894     + err = rxe_send(rxe, pkt, skb);
895     }
896    
897     if (err) {
898     diff --git a/drivers/infiniband/sw/rxe/rxe_mcast.c b/drivers/infiniband/sw/rxe/rxe_mcast.c
899     index fa95544ca7e01..890eb6d5c471e 100644
900     --- a/drivers/infiniband/sw/rxe/rxe_mcast.c
901     +++ b/drivers/infiniband/sw/rxe/rxe_mcast.c
902     @@ -61,7 +61,7 @@ int rxe_mcast_get_grp(struct rxe_dev *rxe, union ib_gid *mgid,
903    
904     rxe_add_key(grp, mgid);
905    
906     - err = rxe->ifc_ops->mcast_add(rxe, mgid);
907     + err = rxe_mcast_add(rxe, mgid);
908     if (err)
909     goto err2;
910    
911     @@ -186,5 +186,5 @@ void rxe_mc_cleanup(void *arg)
912     struct rxe_dev *rxe = grp->rxe;
913    
914     rxe_drop_key(grp);
915     - rxe->ifc_ops->mcast_delete(rxe, &grp->mgid);
916     + rxe_mcast_delete(rxe, &grp->mgid);
917     }
918     diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
919     index 9b732c5f89e16..6d1ba75398a1a 100644
920     --- a/drivers/infiniband/sw/rxe/rxe_mr.c
921     +++ b/drivers/infiniband/sw/rxe/rxe_mr.c
922     @@ -205,6 +205,7 @@ int rxe_mem_init_user(struct rxe_dev *rxe, struct rxe_pd *pd, u64 start,
923     vaddr = page_address(sg_page(sg));
924     if (!vaddr) {
925     pr_warn("null vaddr\n");
926     + ib_umem_release(umem);
927     err = -ENOMEM;
928     goto err1;
929     }
930     diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
931     index d19e003e8381e..e392612345282 100644
932     --- a/drivers/infiniband/sw/rxe/rxe_net.c
933     +++ b/drivers/infiniband/sw/rxe/rxe_net.c
934     @@ -102,17 +102,17 @@ static __be64 rxe_mac_to_eui64(struct net_device *ndev)
935     return eui64;
936     }
937    
938     -static __be64 node_guid(struct rxe_dev *rxe)
939     +__be64 rxe_node_guid(struct rxe_dev *rxe)
940     {
941     return rxe_mac_to_eui64(rxe->ndev);
942     }
943    
944     -static __be64 port_guid(struct rxe_dev *rxe)
945     +__be64 rxe_port_guid(struct rxe_dev *rxe)
946     {
947     return rxe_mac_to_eui64(rxe->ndev);
948     }
949    
950     -static struct device *dma_device(struct rxe_dev *rxe)
951     +struct device *rxe_dma_device(struct rxe_dev *rxe)
952     {
953     struct net_device *ndev;
954    
955     @@ -124,7 +124,7 @@ static struct device *dma_device(struct rxe_dev *rxe)
956     return ndev->dev.parent;
957     }
958    
959     -static int mcast_add(struct rxe_dev *rxe, union ib_gid *mgid)
960     +int rxe_mcast_add(struct rxe_dev *rxe, union ib_gid *mgid)
961     {
962     int err;
963     unsigned char ll_addr[ETH_ALEN];
964     @@ -135,7 +135,7 @@ static int mcast_add(struct rxe_dev *rxe, union ib_gid *mgid)
965     return err;
966     }
967    
968     -static int mcast_delete(struct rxe_dev *rxe, union ib_gid *mgid)
969     +int rxe_mcast_delete(struct rxe_dev *rxe, union ib_gid *mgid)
970     {
971     int err;
972     unsigned char ll_addr[ETH_ALEN];
973     @@ -399,8 +399,8 @@ static int prepare6(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
974     return 0;
975     }
976    
977     -static int prepare(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
978     - struct sk_buff *skb, u32 *crc)
979     +int rxe_prepare(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
980     + struct sk_buff *skb, u32 *crc)
981     {
982     int err = 0;
983     struct rxe_av *av = rxe_get_av(pkt);
984     @@ -426,8 +426,7 @@ static void rxe_skb_tx_dtor(struct sk_buff *skb)
985     rxe_run_task(&qp->req.task, 1);
986     }
987    
988     -static int send(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
989     - struct sk_buff *skb)
990     +int rxe_send(struct rxe_dev *rxe, struct rxe_pkt_info *pkt, struct sk_buff *skb)
991     {
992     struct sk_buff *nskb;
993     struct rxe_av *av;
994     @@ -462,7 +461,7 @@ static int send(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
995     return 0;
996     }
997    
998     -static int loopback(struct sk_buff *skb)
999     +int rxe_loopback(struct sk_buff *skb)
1000     {
1001     return rxe_rcv(skb);
1002     }
1003     @@ -472,8 +471,8 @@ static inline int addr_same(struct rxe_dev *rxe, struct rxe_av *av)
1004     return rxe->port.port_guid == av->grh.dgid.global.interface_id;
1005     }
1006    
1007     -static struct sk_buff *init_packet(struct rxe_dev *rxe, struct rxe_av *av,
1008     - int paylen, struct rxe_pkt_info *pkt)
1009     +struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
1010     + int paylen, struct rxe_pkt_info *pkt)
1011     {
1012     unsigned int hdr_len;
1013     struct sk_buff *skb;
1014     @@ -512,31 +511,16 @@ static struct sk_buff *init_packet(struct rxe_dev *rxe, struct rxe_av *av,
1015     * this is required by rxe_cfg to match rxe devices in
1016     * /sys/class/infiniband up with their underlying ethernet devices
1017     */
1018     -static char *parent_name(struct rxe_dev *rxe, unsigned int port_num)
1019     +const char *rxe_parent_name(struct rxe_dev *rxe, unsigned int port_num)
1020     {
1021     return rxe->ndev->name;
1022     }
1023    
1024     -static enum rdma_link_layer link_layer(struct rxe_dev *rxe,
1025     - unsigned int port_num)
1026     +enum rdma_link_layer rxe_link_layer(struct rxe_dev *rxe, unsigned int port_num)
1027     {
1028     return IB_LINK_LAYER_ETHERNET;
1029     }
1030    
1031     -static struct rxe_ifc_ops ifc_ops = {
1032     - .node_guid = node_guid,
1033     - .port_guid = port_guid,
1034     - .dma_device = dma_device,
1035     - .mcast_add = mcast_add,
1036     - .mcast_delete = mcast_delete,
1037     - .prepare = prepare,
1038     - .send = send,
1039     - .loopback = loopback,
1040     - .init_packet = init_packet,
1041     - .parent_name = parent_name,
1042     - .link_layer = link_layer,
1043     -};
1044     -
1045     struct rxe_dev *rxe_net_add(struct net_device *ndev)
1046     {
1047     int err;
1048     @@ -546,7 +530,6 @@ struct rxe_dev *rxe_net_add(struct net_device *ndev)
1049     if (!rxe)
1050     return NULL;
1051    
1052     - rxe->ifc_ops = &ifc_ops;
1053     rxe->ndev = ndev;
1054    
1055     err = rxe_add(rxe, ndev->mtu);
1056     diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
1057     index 6fb771290c566..5a2d7b0050f4c 100644
1058     --- a/drivers/infiniband/sw/rxe/rxe_req.c
1059     +++ b/drivers/infiniband/sw/rxe/rxe_req.c
1060     @@ -412,7 +412,7 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp,
1061    
1062     /* init skb */
1063     av = rxe_get_av(pkt);
1064     - skb = rxe->ifc_ops->init_packet(rxe, av, paylen, pkt);
1065     + skb = rxe_init_packet(rxe, av, paylen, pkt);
1066     if (unlikely(!skb))
1067     return NULL;
1068    
1069     @@ -483,7 +483,7 @@ static int fill_packet(struct rxe_qp *qp, struct rxe_send_wqe *wqe,
1070     u32 *p;
1071     int err;
1072    
1073     - err = rxe->ifc_ops->prepare(rxe, pkt, skb, &crc);
1074     + err = rxe_prepare(rxe, pkt, skb, &crc);
1075     if (err)
1076     return err;
1077    
1078     diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
1079     index 5bfea23f3b60c..5733d9d2fcdcc 100644
1080     --- a/drivers/infiniband/sw/rxe/rxe_resp.c
1081     +++ b/drivers/infiniband/sw/rxe/rxe_resp.c
1082     @@ -600,7 +600,7 @@ static struct sk_buff *prepare_ack_packet(struct rxe_qp *qp,
1083     pad = (-payload) & 0x3;
1084     paylen = rxe_opcode[opcode].length + payload + pad + RXE_ICRC_SIZE;
1085    
1086     - skb = rxe->ifc_ops->init_packet(rxe, &qp->pri_av, paylen, ack);
1087     + skb = rxe_init_packet(rxe, &qp->pri_av, paylen, ack);
1088     if (!skb)
1089     return NULL;
1090    
1091     @@ -629,7 +629,7 @@ static struct sk_buff *prepare_ack_packet(struct rxe_qp *qp,
1092     if (ack->mask & RXE_ATMACK_MASK)
1093     atmack_set_orig(ack, qp->resp.atomic_orig);
1094    
1095     - err = rxe->ifc_ops->prepare(rxe, ack, skb, &crc);
1096     + err = rxe_prepare(rxe, ack, skb, &crc);
1097     if (err) {
1098     kfree_skb(skb);
1099     return NULL;
1100     diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
1101     index ef13082d6ca1a..3b24ce8e3b3cb 100644
1102     --- a/drivers/infiniband/sw/rxe/rxe_verbs.c
1103     +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
1104     @@ -234,7 +234,7 @@ static enum rdma_link_layer rxe_get_link_layer(struct ib_device *dev,
1105     {
1106     struct rxe_dev *rxe = to_rdev(dev);
1107    
1108     - return rxe->ifc_ops->link_layer(rxe, port_num);
1109     + return rxe_link_layer(rxe, port_num);
1110     }
1111    
1112     static struct ib_ucontext *rxe_alloc_ucontext(struct ib_device *dev,
1113     @@ -1194,10 +1194,8 @@ static ssize_t rxe_show_parent(struct device *device,
1114     {
1115     struct rxe_dev *rxe = container_of(device, struct rxe_dev,
1116     ib_dev.dev);
1117     - char *name;
1118    
1119     - name = rxe->ifc_ops->parent_name(rxe, 1);
1120     - return snprintf(buf, 16, "%s\n", name);
1121     + return scnprintf(buf, PAGE_SIZE, "%s\n", rxe_parent_name(rxe, 1));
1122     }
1123    
1124     static DEVICE_ATTR(parent, S_IRUGO, rxe_show_parent, NULL);
1125     @@ -1219,9 +1217,9 @@ int rxe_register_device(struct rxe_dev *rxe)
1126     dev->node_type = RDMA_NODE_IB_CA;
1127     dev->phys_port_cnt = 1;
1128     dev->num_comp_vectors = RXE_NUM_COMP_VECTORS;
1129     - dev->dma_device = rxe->ifc_ops->dma_device(rxe);
1130     + dev->dma_device = rxe_dma_device(rxe);
1131     dev->local_dma_lkey = 0;
1132     - dev->node_guid = rxe->ifc_ops->node_guid(rxe);
1133     + dev->node_guid = rxe_node_guid(rxe);
1134     dev->dma_ops = &rxe_dma_mapping_ops;
1135    
1136     dev->uverbs_abi_ver = RXE_UVERBS_ABI_VERSION;
1137     diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.h b/drivers/infiniband/sw/rxe/rxe_verbs.h
1138     index dee3853163b60..d4a84f49dfd80 100644
1139     --- a/drivers/infiniband/sw/rxe/rxe_verbs.h
1140     +++ b/drivers/infiniband/sw/rxe/rxe_verbs.h
1141     @@ -373,26 +373,6 @@ struct rxe_port {
1142     u32 qp_gsi_index;
1143     };
1144    
1145     -/* callbacks from rdma_rxe to network interface layer */
1146     -struct rxe_ifc_ops {
1147     - void (*release)(struct rxe_dev *rxe);
1148     - __be64 (*node_guid)(struct rxe_dev *rxe);
1149     - __be64 (*port_guid)(struct rxe_dev *rxe);
1150     - struct device *(*dma_device)(struct rxe_dev *rxe);
1151     - int (*mcast_add)(struct rxe_dev *rxe, union ib_gid *mgid);
1152     - int (*mcast_delete)(struct rxe_dev *rxe, union ib_gid *mgid);
1153     - int (*prepare)(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
1154     - struct sk_buff *skb, u32 *crc);
1155     - int (*send)(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
1156     - struct sk_buff *skb);
1157     - int (*loopback)(struct sk_buff *skb);
1158     - struct sk_buff *(*init_packet)(struct rxe_dev *rxe, struct rxe_av *av,
1159     - int paylen, struct rxe_pkt_info *pkt);
1160     - char *(*parent_name)(struct rxe_dev *rxe, unsigned int port_num);
1161     - enum rdma_link_layer (*link_layer)(struct rxe_dev *rxe,
1162     - unsigned int port_num);
1163     -};
1164     -
1165     struct rxe_dev {
1166     struct ib_device ib_dev;
1167     struct ib_device_attr attr;
1168     @@ -401,8 +381,6 @@ struct rxe_dev {
1169     struct kref ref_cnt;
1170     struct mutex usdev_lock;
1171    
1172     - struct rxe_ifc_ops *ifc_ops;
1173     -
1174     struct net_device *ndev;
1175    
1176     int xmit_errors;
1177     diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
1178     index bdc42923523e8..e5799639fb544 100644
1179     --- a/drivers/input/serio/i8042-x86ia64io.h
1180     +++ b/drivers/input/serio/i8042-x86ia64io.h
1181     @@ -552,6 +552,14 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
1182     DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"),
1183     },
1184     },
1185     + {
1186     + /* Entroware Proteus */
1187     + .matches = {
1188     + DMI_MATCH(DMI_SYS_VENDOR, "Entroware"),
1189     + DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"),
1190     + DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"),
1191     + },
1192     + },
1193     { }
1194     };
1195    
1196     @@ -752,6 +760,14 @@ static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
1197     DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"),
1198     },
1199     },
1200     + {
1201     + /* Entroware Proteus */
1202     + .matches = {
1203     + DMI_MATCH(DMI_SYS_VENDOR, "Entroware"),
1204     + DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"),
1205     + DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"),
1206     + },
1207     + },
1208     { }
1209     };
1210    
1211     diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c
1212     index a408abc25512a..7f99fb666f196 100644
1213     --- a/drivers/net/wan/hdlc_cisco.c
1214     +++ b/drivers/net/wan/hdlc_cisco.c
1215     @@ -377,6 +377,7 @@ static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr)
1216     memcpy(&state(hdlc)->settings, &new_settings, size);
1217     spin_lock_init(&state(hdlc)->lock);
1218     dev->header_ops = &cisco_header_ops;
1219     + dev->hard_header_len = sizeof(struct hdlc_header);
1220     dev->type = ARPHRD_CISCO;
1221     call_netdevice_notifiers(NETDEV_POST_TYPE_CHANGE, dev);
1222     netif_dormant_on(dev);
1223     diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
1224     index 6eb0f7a85e531..c6db9a4e7c457 100644
1225     --- a/drivers/net/wan/lapbether.c
1226     +++ b/drivers/net/wan/lapbether.c
1227     @@ -213,6 +213,8 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb)
1228    
1229     skb->dev = dev = lapbeth->ethdev;
1230    
1231     + skb_reset_network_header(skb);
1232     +
1233     dev_hard_header(skb, dev, ETH_P_DEC, bcast_addr, NULL, 0);
1234    
1235     dev_queue_xmit(skb);
1236     @@ -343,6 +345,7 @@ static int lapbeth_new_device(struct net_device *dev)
1237     */
1238     ndev->needed_headroom = -1 + 3 + 2 + dev->hard_header_len
1239     + dev->needed_headroom;
1240     + ndev->needed_tailroom = dev->needed_tailroom;
1241    
1242     lapbeth = netdev_priv(ndev);
1243     lapbeth->axdev = ndev;
1244     diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
1245     index 850e75571c8ee..bb1e878913f3a 100644
1246     --- a/drivers/nfc/st95hf/core.c
1247     +++ b/drivers/nfc/st95hf/core.c
1248     @@ -981,7 +981,7 @@ static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev,
1249     rc = down_killable(&stcontext->exchange_lock);
1250     if (rc) {
1251     WARN(1, "Semaphore is not found up in st95hf_in_send_cmd\n");
1252     - return rc;
1253     + goto free_skb_resp;
1254     }
1255    
1256     rc = st95hf_spi_send(&stcontext->spicontext, skb->data,
1257     diff --git a/drivers/rapidio/Kconfig b/drivers/rapidio/Kconfig
1258     index d6d2f20c45977..21df2816def76 100644
1259     --- a/drivers/rapidio/Kconfig
1260     +++ b/drivers/rapidio/Kconfig
1261     @@ -25,7 +25,7 @@ config RAPIDIO_ENABLE_RX_TX_PORTS
1262     config RAPIDIO_DMA_ENGINE
1263     bool "DMA Engine support for RapidIO"
1264     depends on RAPIDIO
1265     - select DMADEVICES
1266     + depends on DMADEVICES
1267     select DMA_ENGINE
1268     help
1269     Say Y here if you want to use DMA Engine frameork for RapidIO data
1270     diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
1271     index 18d57c0efe9fc..9355b65920ab4 100644
1272     --- a/drivers/regulator/core.c
1273     +++ b/drivers/regulator/core.c
1274     @@ -1191,7 +1191,7 @@ static int set_consumer_device_supply(struct regulator_dev *rdev,
1275     const char *consumer_dev_name,
1276     const char *supply)
1277     {
1278     - struct regulator_map *node;
1279     + struct regulator_map *node, *new_node;
1280     int has_dev;
1281    
1282     if (supply == NULL)
1283     @@ -1202,6 +1202,22 @@ static int set_consumer_device_supply(struct regulator_dev *rdev,
1284     else
1285     has_dev = 0;
1286    
1287     + new_node = kzalloc(sizeof(struct regulator_map), GFP_KERNEL);
1288     + if (new_node == NULL)
1289     + return -ENOMEM;
1290     +
1291     + new_node->regulator = rdev;
1292     + new_node->supply = supply;
1293     +
1294     + if (has_dev) {
1295     + new_node->dev_name = kstrdup(consumer_dev_name, GFP_KERNEL);
1296     + if (new_node->dev_name == NULL) {
1297     + kfree(new_node);
1298     + return -ENOMEM;
1299     + }
1300     + }
1301     +
1302     + mutex_lock(&regulator_list_mutex);
1303     list_for_each_entry(node, &regulator_map_list, list) {
1304     if (node->dev_name && consumer_dev_name) {
1305     if (strcmp(node->dev_name, consumer_dev_name) != 0)
1306     @@ -1219,26 +1235,19 @@ static int set_consumer_device_supply(struct regulator_dev *rdev,
1307     node->regulator->desc->name,
1308     supply,
1309     dev_name(&rdev->dev), rdev_get_name(rdev));
1310     - return -EBUSY;
1311     + goto fail;
1312     }
1313    
1314     - node = kzalloc(sizeof(struct regulator_map), GFP_KERNEL);
1315     - if (node == NULL)
1316     - return -ENOMEM;
1317     -
1318     - node->regulator = rdev;
1319     - node->supply = supply;
1320     -
1321     - if (has_dev) {
1322     - node->dev_name = kstrdup(consumer_dev_name, GFP_KERNEL);
1323     - if (node->dev_name == NULL) {
1324     - kfree(node);
1325     - return -ENOMEM;
1326     - }
1327     - }
1328     + list_add(&new_node->list, &regulator_map_list);
1329     + mutex_unlock(&regulator_list_mutex);
1330    
1331     - list_add(&node->list, &regulator_map_list);
1332     return 0;
1333     +
1334     +fail:
1335     + mutex_unlock(&regulator_list_mutex);
1336     + kfree(new_node->dev_name);
1337     + kfree(new_node);
1338     + return -EBUSY;
1339     }
1340    
1341     static void unset_regulator_supplies(struct regulator_dev *rdev)
1342     @@ -4034,19 +4043,16 @@ regulator_register(const struct regulator_desc *regulator_desc,
1343    
1344     /* add consumers devices */
1345     if (init_data) {
1346     - mutex_lock(&regulator_list_mutex);
1347     for (i = 0; i < init_data->num_consumer_supplies; i++) {
1348     ret = set_consumer_device_supply(rdev,
1349     init_data->consumer_supplies[i].dev_name,
1350     init_data->consumer_supplies[i].supply);
1351     if (ret < 0) {
1352     - mutex_unlock(&regulator_list_mutex);
1353     dev_err(dev, "Failed to set supply %s\n",
1354     init_data->consumer_supplies[i].supply);
1355     goto unset_supplies;
1356     }
1357     }
1358     - mutex_unlock(&regulator_list_mutex);
1359     }
1360    
1361     if (!rdev->desc->ops->get_voltage &&
1362     diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
1363     index 87f5e694dbedd..b820c3a022eac 100644
1364     --- a/drivers/scsi/libsas/sas_ata.c
1365     +++ b/drivers/scsi/libsas/sas_ata.c
1366     @@ -227,7 +227,10 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
1367     task->num_scatter = si;
1368     }
1369    
1370     - task->data_dir = qc->dma_dir;
1371     + if (qc->tf.protocol == ATA_PROT_NODATA)
1372     + task->data_dir = DMA_NONE;
1373     + else
1374     + task->data_dir = qc->dma_dir;
1375     task->scatter = qc->sg;
1376     task->ata_task.retry_count = 1;
1377     task->task_state_flags = SAS_TASK_STATE_PENDING;
1378     diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
1379     index 09dbf3021bb0b..7d4a5bb916062 100644
1380     --- a/drivers/scsi/lpfc/lpfc_els.c
1381     +++ b/drivers/scsi/lpfc/lpfc_els.c
1382     @@ -3865,7 +3865,9 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1383     out:
1384     if (ndlp && NLP_CHK_NODE_ACT(ndlp) && shost) {
1385     spin_lock_irq(shost->host_lock);
1386     - ndlp->nlp_flag &= ~(NLP_ACC_REGLOGIN | NLP_RM_DFLT_RPI);
1387     + if (mbox)
1388     + ndlp->nlp_flag &= ~NLP_ACC_REGLOGIN;
1389     + ndlp->nlp_flag &= ~NLP_RM_DFLT_RPI;
1390     spin_unlock_irq(shost->host_lock);
1391    
1392     /* If the node is not being used by another discovery thread,
1393     diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
1394     index e64a13f0bce17..61a2da30f94b7 100644
1395     --- a/drivers/scsi/pm8001/pm8001_sas.c
1396     +++ b/drivers/scsi/pm8001/pm8001_sas.c
1397     @@ -795,7 +795,7 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha,
1398    
1399     res = pm8001_tag_alloc(pm8001_ha, &ccb_tag);
1400     if (res)
1401     - return res;
1402     + goto ex_err;
1403     ccb = &pm8001_ha->ccb_info[ccb_tag];
1404     ccb->device = pm8001_dev;
1405     ccb->ccb_tag = ccb_tag;
1406     diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c
1407     index 50e620f4e8fe2..7120083fe7610 100644
1408     --- a/drivers/spi/spi-loopback-test.c
1409     +++ b/drivers/spi/spi-loopback-test.c
1410     @@ -74,7 +74,7 @@ static struct spi_test spi_tests[] = {
1411     {
1412     .description = "tx/rx-transfer - crossing PAGE_SIZE",
1413     .fill_option = FILL_COUNT_8,
1414     - .iterate_len = { ITERATE_MAX_LEN },
1415     + .iterate_len = { ITERATE_LEN },
1416     .iterate_tx_align = ITERATE_ALIGN,
1417     .iterate_rx_align = ITERATE_ALIGN,
1418     .transfers = {
1419     diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c
1420     index b6251691a33d4..2bc415a19cedb 100644
1421     --- a/drivers/staging/greybus/audio_topology.c
1422     +++ b/drivers/staging/greybus/audio_topology.c
1423     @@ -462,6 +462,15 @@ static int gbcodec_mixer_dapm_ctl_put(struct snd_kcontrol *kcontrol,
1424     val = ucontrol->value.integer.value[0] & mask;
1425     connect = !!val;
1426    
1427     + ret = gb_pm_runtime_get_sync(bundle);
1428     + if (ret)
1429     + return ret;
1430     +
1431     + ret = gb_audio_gb_get_control(module->mgmt_connection, data->ctl_id,
1432     + GB_AUDIO_INVALID_INDEX, &gbvalue);
1433     + if (ret)
1434     + goto exit;
1435     +
1436     /* update ucontrol */
1437     if (gbvalue.value.integer_value[0] != val) {
1438     for (wi = 0; wi < wlist->num_widgets; wi++) {
1439     @@ -475,25 +484,17 @@ static int gbcodec_mixer_dapm_ctl_put(struct snd_kcontrol *kcontrol,
1440     gbvalue.value.integer_value[0] =
1441     ucontrol->value.integer.value[0];
1442    
1443     - ret = gb_pm_runtime_get_sync(bundle);
1444     - if (ret)
1445     - return ret;
1446     -
1447     ret = gb_audio_gb_set_control(module->mgmt_connection,
1448     data->ctl_id,
1449     GB_AUDIO_INVALID_INDEX, &gbvalue);
1450     -
1451     - gb_pm_runtime_put_autosuspend(bundle);
1452     -
1453     - if (ret) {
1454     - dev_err_ratelimited(codec->dev,
1455     - "%d:Error in %s for %s\n", ret,
1456     - __func__, kcontrol->id.name);
1457     - return ret;
1458     - }
1459     }
1460    
1461     - return 0;
1462     +exit:
1463     + gb_pm_runtime_put_autosuspend(bundle);
1464     + if (ret)
1465     + dev_err_ratelimited(codec_dev, "%d:Error in %s for %s\n", ret,
1466     + __func__, kcontrol->id.name);
1467     + return ret;
1468     }
1469    
1470     #define SOC_DAPM_MIXER_GB(xname, kcount, data) \
1471     diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
1472     index 52ad5c137d9fc..9d4e3b0d366f4 100644
1473     --- a/drivers/staging/wlan-ng/hfa384x_usb.c
1474     +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
1475     @@ -523,13 +523,8 @@ static void hfa384x_usb_defer(struct work_struct *data)
1476     ----------------------------------------------------------------*/
1477     void hfa384x_create(struct hfa384x *hw, struct usb_device *usb)
1478     {
1479     - memset(hw, 0, sizeof(struct hfa384x));
1480     hw->usb = usb;
1481    
1482     - /* set up the endpoints */
1483     - hw->endp_in = usb_rcvbulkpipe(usb, 1);
1484     - hw->endp_out = usb_sndbulkpipe(usb, 2);
1485     -
1486     /* Set up the waitq */
1487     init_waitqueue_head(&hw->cmdq);
1488    
1489     diff --git a/drivers/staging/wlan-ng/prism2usb.c b/drivers/staging/wlan-ng/prism2usb.c
1490     index 5297e7d1c6635..bf617620e17ba 100644
1491     --- a/drivers/staging/wlan-ng/prism2usb.c
1492     +++ b/drivers/staging/wlan-ng/prism2usb.c
1493     @@ -60,23 +60,14 @@ static int prism2sta_probe_usb(struct usb_interface *interface,
1494     const struct usb_device_id *id)
1495     {
1496     struct usb_device *dev;
1497     - const struct usb_endpoint_descriptor *epd;
1498     - const struct usb_host_interface *iface_desc = interface->cur_altsetting;
1499     + struct usb_endpoint_descriptor *bulk_in, *bulk_out;
1500     + struct usb_host_interface *iface_desc = interface->cur_altsetting;
1501     struct wlandevice *wlandev = NULL;
1502     struct hfa384x *hw = NULL;
1503     int result = 0;
1504    
1505     - if (iface_desc->desc.bNumEndpoints != 2) {
1506     - result = -ENODEV;
1507     - goto failed;
1508     - }
1509     -
1510     - result = -EINVAL;
1511     - epd = &iface_desc->endpoint[1].desc;
1512     - if (!usb_endpoint_is_bulk_in(epd))
1513     - goto failed;
1514     - epd = &iface_desc->endpoint[2].desc;
1515     - if (!usb_endpoint_is_bulk_out(epd))
1516     + result = usb_find_common_endpoints(iface_desc, &bulk_in, &bulk_out, NULL, NULL);
1517     + if (result)
1518     goto failed;
1519    
1520     dev = interface_to_usbdev(interface);
1521     @@ -95,6 +86,8 @@ static int prism2sta_probe_usb(struct usb_interface *interface,
1522     }
1523    
1524     /* Initialize the hw data */
1525     + hw->endp_in = usb_rcvbulkpipe(dev, bulk_in->bEndpointAddress);
1526     + hw->endp_out = usb_sndbulkpipe(dev, bulk_out->bEndpointAddress);
1527     hfa384x_create(hw, dev);
1528     hw->wlandev = wlandev;
1529    
1530     diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
1531     index 2b8fbcd8dde24..7c0f4b96816a8 100644
1532     --- a/drivers/target/iscsi/iscsi_target.c
1533     +++ b/drivers/target/iscsi/iscsi_target.c
1534     @@ -1396,14 +1396,27 @@ static u32 iscsit_do_crypto_hash_sg(
1535     sg = cmd->first_data_sg;
1536     page_off = cmd->first_data_sg_off;
1537    
1538     + if (data_length && page_off) {
1539     + struct scatterlist first_sg;
1540     + u32 len = min_t(u32, data_length, sg->length - page_off);
1541     +
1542     + sg_init_table(&first_sg, 1);
1543     + sg_set_page(&first_sg, sg_page(sg), len, sg->offset + page_off);
1544     +
1545     + ahash_request_set_crypt(hash, &first_sg, NULL, len);
1546     + crypto_ahash_update(hash);
1547     +
1548     + data_length -= len;
1549     + sg = sg_next(sg);
1550     + }
1551     +
1552     while (data_length) {
1553     - u32 cur_len = min_t(u32, data_length, (sg->length - page_off));
1554     + u32 cur_len = min_t(u32, data_length, sg->length);
1555    
1556     ahash_request_set_crypt(hash, sg, NULL, cur_len);
1557     crypto_ahash_update(hash);
1558    
1559     data_length -= cur_len;
1560     - page_off = 0;
1561     /* iscsit_map_iovec has already checked for invalid sg pointers */
1562     sg = sg_next(sg);
1563     }
1564     diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c
1565     index 985e600908e0e..82a414432fd49 100644
1566     --- a/drivers/target/iscsi/iscsi_target_login.c
1567     +++ b/drivers/target/iscsi/iscsi_target_login.c
1568     @@ -1150,7 +1150,7 @@ iscsit_conn_set_transport(struct iscsi_conn *conn, struct iscsit_transport *t)
1569     }
1570    
1571     void iscsi_target_login_sess_out(struct iscsi_conn *conn,
1572     - struct iscsi_np *np, bool zero_tsih, bool new_sess)
1573     + bool zero_tsih, bool new_sess)
1574     {
1575     if (!new_sess)
1576     goto old_sess_out;
1577     @@ -1172,7 +1172,6 @@ void iscsi_target_login_sess_out(struct iscsi_conn *conn,
1578     conn->sess = NULL;
1579    
1580     old_sess_out:
1581     - iscsi_stop_login_thread_timer(np);
1582     /*
1583     * If login negotiation fails check if the Time2Retain timer
1584     * needs to be restarted.
1585     @@ -1432,8 +1431,9 @@ static int __iscsi_target_login_thread(struct iscsi_np *np)
1586     new_sess_out:
1587     new_sess = true;
1588     old_sess_out:
1589     + iscsi_stop_login_thread_timer(np);
1590     tpg_np = conn->tpg_np;
1591     - iscsi_target_login_sess_out(conn, np, zero_tsih, new_sess);
1592     + iscsi_target_login_sess_out(conn, zero_tsih, new_sess);
1593     new_sess = false;
1594    
1595     if (tpg) {
1596     diff --git a/drivers/target/iscsi/iscsi_target_login.h b/drivers/target/iscsi/iscsi_target_login.h
1597     index b597aa2c61a1c..e9daabbb4f545 100644
1598     --- a/drivers/target/iscsi/iscsi_target_login.h
1599     +++ b/drivers/target/iscsi/iscsi_target_login.h
1600     @@ -14,8 +14,7 @@ extern int iscsit_put_login_tx(struct iscsi_conn *, struct iscsi_login *, u32);
1601     extern void iscsit_free_conn(struct iscsi_np *, struct iscsi_conn *);
1602     extern int iscsit_start_kthreads(struct iscsi_conn *);
1603     extern void iscsi_post_login_handler(struct iscsi_np *, struct iscsi_conn *, u8);
1604     -extern void iscsi_target_login_sess_out(struct iscsi_conn *, struct iscsi_np *,
1605     - bool, bool);
1606     +extern void iscsi_target_login_sess_out(struct iscsi_conn *, bool, bool);
1607     extern int iscsi_target_login_thread(void *);
1608    
1609     #endif /*** ISCSI_TARGET_LOGIN_H ***/
1610     diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c
1611     index e8efb4299a950..26b8828101ea5 100644
1612     --- a/drivers/target/iscsi/iscsi_target_nego.c
1613     +++ b/drivers/target/iscsi/iscsi_target_nego.c
1614     @@ -548,12 +548,11 @@ static bool iscsi_target_sk_check_and_clear(struct iscsi_conn *conn, unsigned in
1615    
1616     static void iscsi_target_login_drop(struct iscsi_conn *conn, struct iscsi_login *login)
1617     {
1618     - struct iscsi_np *np = login->np;
1619     bool zero_tsih = login->zero_tsih;
1620    
1621     iscsi_remove_failed_auth_entry(conn);
1622     iscsi_target_nego_release(conn);
1623     - iscsi_target_login_sess_out(conn, np, zero_tsih, true);
1624     + iscsi_target_login_sess_out(conn, zero_tsih, true);
1625     }
1626    
1627     static void iscsi_target_login_timeout(unsigned long data)
1628     diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
1629     index 2c38b3a1d5187..a9c46e10d204c 100644
1630     --- a/drivers/tty/serial/8250/8250_pci.c
1631     +++ b/drivers/tty/serial/8250/8250_pci.c
1632     @@ -5709,6 +5709,17 @@ static struct pci_device_id serial_pci_tbl[] = {
1633     0,
1634     0, pbn_exar_XR17V358 },
1635    
1636     + /*
1637     + * Realtek RealManage
1638     + */
1639     + { PCI_VENDOR_ID_REALTEK, 0x816a,
1640     + PCI_ANY_ID, PCI_ANY_ID,
1641     + 0, 0, pbn_b0_1_115200 },
1642     +
1643     + { PCI_VENDOR_ID_REALTEK, 0x816b,
1644     + PCI_ANY_ID, PCI_ANY_ID,
1645     + 0, 0, pbn_b0_1_115200 },
1646     +
1647     /* Fintek PCI serial cards */
1648     { PCI_DEVICE(0x1c29, 0x1104), .driver_data = pbn_fintek_4 },
1649     { PCI_DEVICE(0x1c29, 0x1108), .driver_data = pbn_fintek_8 },
1650     diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
1651     index c578d64edc153..71c2ae4b81067 100644
1652     --- a/drivers/usb/class/usblp.c
1653     +++ b/drivers/usb/class/usblp.c
1654     @@ -840,6 +840,11 @@ static ssize_t usblp_read(struct file *file, char __user *buffer, size_t len, lo
1655     if (rv < 0)
1656     return rv;
1657    
1658     + if (!usblp->present) {
1659     + count = -ENODEV;
1660     + goto done;
1661     + }
1662     +
1663     if ((avail = usblp->rstatus) < 0) {
1664     printk(KERN_ERR "usblp%d: error %d reading from printer\n",
1665     usblp->minor, (int)avail);
1666     diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
1667     index e33d23c2f6eab..7c49370134294 100644
1668     --- a/drivers/usb/core/message.c
1669     +++ b/drivers/usb/core/message.c
1670     @@ -1142,6 +1142,34 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf,
1671     }
1672     }
1673    
1674     +/*
1675     + * usb_disable_device_endpoints -- Disable all endpoints for a device
1676     + * @dev: the device whose endpoints are being disabled
1677     + * @skip_ep0: 0 to disable endpoint 0, 1 to skip it.
1678     + */
1679     +static void usb_disable_device_endpoints(struct usb_device *dev, int skip_ep0)
1680     +{
1681     + struct usb_hcd *hcd = bus_to_hcd(dev->bus);
1682     + int i;
1683     +
1684     + if (hcd->driver->check_bandwidth) {
1685     + /* First pass: Cancel URBs, leave endpoint pointers intact. */
1686     + for (i = skip_ep0; i < 16; ++i) {
1687     + usb_disable_endpoint(dev, i, false);
1688     + usb_disable_endpoint(dev, i + USB_DIR_IN, false);
1689     + }
1690     + /* Remove endpoints from the host controller internal state */
1691     + mutex_lock(hcd->bandwidth_mutex);
1692     + usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
1693     + mutex_unlock(hcd->bandwidth_mutex);
1694     + }
1695     + /* Second pass: remove endpoint pointers */
1696     + for (i = skip_ep0; i < 16; ++i) {
1697     + usb_disable_endpoint(dev, i, true);
1698     + usb_disable_endpoint(dev, i + USB_DIR_IN, true);
1699     + }
1700     +}
1701     +
1702     /**
1703     * usb_disable_device - Disable all the endpoints for a USB device
1704     * @dev: the device whose endpoints are being disabled
1705     @@ -1155,7 +1183,6 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf,
1706     void usb_disable_device(struct usb_device *dev, int skip_ep0)
1707     {
1708     int i;
1709     - struct usb_hcd *hcd = bus_to_hcd(dev->bus);
1710    
1711     /* getting rid of interfaces will disconnect
1712     * any drivers bound to them (a key side effect)
1713     @@ -1201,22 +1228,8 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
1714    
1715     dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__,
1716     skip_ep0 ? "non-ep0" : "all");
1717     - if (hcd->driver->check_bandwidth) {
1718     - /* First pass: Cancel URBs, leave endpoint pointers intact. */
1719     - for (i = skip_ep0; i < 16; ++i) {
1720     - usb_disable_endpoint(dev, i, false);
1721     - usb_disable_endpoint(dev, i + USB_DIR_IN, false);
1722     - }
1723     - /* Remove endpoints from the host controller internal state */
1724     - mutex_lock(hcd->bandwidth_mutex);
1725     - usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
1726     - mutex_unlock(hcd->bandwidth_mutex);
1727     - /* Second pass: remove endpoint pointers */
1728     - }
1729     - for (i = skip_ep0; i < 16; ++i) {
1730     - usb_disable_endpoint(dev, i, true);
1731     - usb_disable_endpoint(dev, i + USB_DIR_IN, true);
1732     - }
1733     +
1734     + usb_disable_device_endpoints(dev, skip_ep0);
1735     }
1736    
1737     /**
1738     @@ -1459,6 +1472,9 @@ EXPORT_SYMBOL_GPL(usb_set_interface);
1739     * The caller must own the device lock.
1740     *
1741     * Return: Zero on success, else a negative error code.
1742     + *
1743     + * If this routine fails the device will probably be in an unusable state
1744     + * with endpoints disabled, and interfaces only partially enabled.
1745     */
1746     int usb_reset_configuration(struct usb_device *dev)
1747     {
1748     @@ -1474,10 +1490,7 @@ int usb_reset_configuration(struct usb_device *dev)
1749     * calls during probe() are fine
1750     */
1751    
1752     - for (i = 1; i < 16; ++i) {
1753     - usb_disable_endpoint(dev, i, true);
1754     - usb_disable_endpoint(dev, i + USB_DIR_IN, true);
1755     - }
1756     + usb_disable_device_endpoints(dev, 1); /* skip ep0*/
1757    
1758     config = dev->actconfig;
1759     retval = 0;
1760     @@ -1490,34 +1503,10 @@ int usb_reset_configuration(struct usb_device *dev)
1761     mutex_unlock(hcd->bandwidth_mutex);
1762     return -ENOMEM;
1763     }
1764     - /* Make sure we have enough bandwidth for each alternate setting 0 */
1765     - for (i = 0; i < config->desc.bNumInterfaces; i++) {
1766     - struct usb_interface *intf = config->interface[i];
1767     - struct usb_host_interface *alt;
1768    
1769     - alt = usb_altnum_to_altsetting(intf, 0);
1770     - if (!alt)
1771     - alt = &intf->altsetting[0];
1772     - if (alt != intf->cur_altsetting)
1773     - retval = usb_hcd_alloc_bandwidth(dev, NULL,
1774     - intf->cur_altsetting, alt);
1775     - if (retval < 0)
1776     - break;
1777     - }
1778     - /* If not, reinstate the old alternate settings */
1779     + /* xHCI adds all endpoints in usb_hcd_alloc_bandwidth */
1780     + retval = usb_hcd_alloc_bandwidth(dev, config, NULL, NULL);
1781     if (retval < 0) {
1782     -reset_old_alts:
1783     - for (i--; i >= 0; i--) {
1784     - struct usb_interface *intf = config->interface[i];
1785     - struct usb_host_interface *alt;
1786     -
1787     - alt = usb_altnum_to_altsetting(intf, 0);
1788     - if (!alt)
1789     - alt = &intf->altsetting[0];
1790     - if (alt != intf->cur_altsetting)
1791     - usb_hcd_alloc_bandwidth(dev, NULL,
1792     - alt, intf->cur_altsetting);
1793     - }
1794     usb_enable_lpm(dev);
1795     mutex_unlock(hcd->bandwidth_mutex);
1796     return retval;
1797     @@ -1526,8 +1515,12 @@ reset_old_alts:
1798     USB_REQ_SET_CONFIGURATION, 0,
1799     config->desc.bConfigurationValue, 0,
1800     NULL, 0, USB_CTRL_SET_TIMEOUT);
1801     - if (retval < 0)
1802     - goto reset_old_alts;
1803     + if (retval < 0) {
1804     + usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
1805     + usb_enable_lpm(dev);
1806     + mutex_unlock(hcd->bandwidth_mutex);
1807     + return retval;
1808     + }
1809     mutex_unlock(hcd->bandwidth_mutex);
1810    
1811     /* re-init hc/hcd interface/endpoint state */
1812     diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
1813     index eed7c8d8e3d4f..dd72e85f2e176 100644
1814     --- a/drivers/usb/core/quirks.c
1815     +++ b/drivers/usb/core/quirks.c
1816     @@ -236,6 +236,10 @@ static const struct usb_device_id usb_quirk_list[] = {
1817     /* Generic RTL8153 based ethernet adapters */
1818     { USB_DEVICE(0x0bda, 0x8153), .driver_info = USB_QUIRK_NO_LPM },
1819    
1820     + /* SONiX USB DEVICE Touchpad */
1821     + { USB_DEVICE(0x0c45, 0x7056), .driver_info =
1822     + USB_QUIRK_IGNORE_REMOTE_WAKEUP },
1823     +
1824     /* Action Semiconductor flash disk */
1825     { USB_DEVICE(0x10d6, 0x2200), .driver_info =
1826     USB_QUIRK_STRING_FETCH_255 },
1827     diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
1828     index 1a232b4ffe71f..f6c6d99eb3884 100644
1829     --- a/drivers/usb/core/sysfs.c
1830     +++ b/drivers/usb/core/sysfs.c
1831     @@ -848,7 +848,11 @@ read_descriptors(struct file *filp, struct kobject *kobj,
1832     size_t srclen, n;
1833     int cfgno;
1834     void *src;
1835     + int retval;
1836    
1837     + retval = usb_lock_device_interruptible(udev);
1838     + if (retval < 0)
1839     + return -EINTR;
1840     /* The binary attribute begins with the device descriptor.
1841     * Following that are the raw descriptor entries for all the
1842     * configurations (config plus subsidiary descriptors).
1843     @@ -873,6 +877,7 @@ read_descriptors(struct file *filp, struct kobject *kobj,
1844     off -= srclen;
1845     }
1846     }
1847     + usb_unlock_device(udev);
1848     return count - nleft;
1849     }
1850    
1851     diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
1852     index f3996ba71a594..beebf02130d7e 100644
1853     --- a/drivers/usb/core/usb.c
1854     +++ b/drivers/usb/core/usb.c
1855     @@ -72,6 +72,89 @@ MODULE_PARM_DESC(autosuspend, "default autosuspend delay");
1856     #endif
1857    
1858    
1859     +/**
1860     + * usb_find_common_endpoints() -- look up common endpoint descriptors
1861     + * @alt: alternate setting to search
1862     + * @bulk_in: pointer to descriptor pointer, or NULL
1863     + * @bulk_out: pointer to descriptor pointer, or NULL
1864     + * @int_in: pointer to descriptor pointer, or NULL
1865     + * @int_out: pointer to descriptor pointer, or NULL
1866     + *
1867     + * Search the alternate setting's endpoint descriptors for the first bulk-in,
1868     + * bulk-out, interrupt-in and interrupt-out endpoints and return them in the
1869     + * provided pointers (unless they are NULL).
1870     + *
1871     + * If a requested endpoint is not found, the corresponding pointer is set to
1872     + * NULL.
1873     + *
1874     + * Return: Zero if all requested descriptors were found, or -ENXIO otherwise.
1875     + */
1876     +int usb_find_common_endpoints(struct usb_host_interface *alt,
1877     + struct usb_endpoint_descriptor **bulk_in,
1878     + struct usb_endpoint_descriptor **bulk_out,
1879     + struct usb_endpoint_descriptor **int_in,
1880     + struct usb_endpoint_descriptor **int_out)
1881     +{
1882     + struct usb_endpoint_descriptor *epd;
1883     + int i;
1884     +
1885     + if (bulk_in)
1886     + *bulk_in = NULL;
1887     + if (bulk_out)
1888     + *bulk_out = NULL;
1889     + if (int_in)
1890     + *int_in = NULL;
1891     + if (int_out)
1892     + *int_out = NULL;
1893     +
1894     + for (i = 0; i < alt->desc.bNumEndpoints; ++i) {
1895     + epd = &alt->endpoint[i].desc;
1896     +
1897     + switch (usb_endpoint_type(epd)) {
1898     + case USB_ENDPOINT_XFER_BULK:
1899     + if (usb_endpoint_dir_in(epd)) {
1900     + if (bulk_in && !*bulk_in) {
1901     + *bulk_in = epd;
1902     + break;
1903     + }
1904     + } else {
1905     + if (bulk_out && !*bulk_out) {
1906     + *bulk_out = epd;
1907     + break;
1908     + }
1909     + }
1910     +
1911     + continue;
1912     + case USB_ENDPOINT_XFER_INT:
1913     + if (usb_endpoint_dir_in(epd)) {
1914     + if (int_in && !*int_in) {
1915     + *int_in = epd;
1916     + break;
1917     + }
1918     + } else {
1919     + if (int_out && !*int_out) {
1920     + *int_out = epd;
1921     + break;
1922     + }
1923     + }
1924     +
1925     + continue;
1926     + default:
1927     + continue;
1928     + }
1929     +
1930     + if ((!bulk_in || *bulk_in) &&
1931     + (!bulk_out || *bulk_out) &&
1932     + (!int_in || *int_in) &&
1933     + (!int_out || *int_out)) {
1934     + return 0;
1935     + }
1936     + }
1937     +
1938     + return -ENXIO;
1939     +}
1940     +EXPORT_SYMBOL_GPL(usb_find_common_endpoints);
1941     +
1942     /**
1943     * usb_find_alt_setting() - Given a configuration, find the alternate setting
1944     * for the given interface.
1945     diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
1946     index 063064801ceb0..b3d6cc1a8021b 100644
1947     --- a/drivers/usb/host/ehci-hcd.c
1948     +++ b/drivers/usb/host/ehci-hcd.c
1949     @@ -35,6 +35,7 @@
1950     #include <linux/interrupt.h>
1951     #include <linux/usb.h>
1952     #include <linux/usb/hcd.h>
1953     +#include <linux/usb/otg.h>
1954     #include <linux/moduleparam.h>
1955     #include <linux/dma-mapping.h>
1956     #include <linux/debugfs.h>
1957     diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
1958     index 74f62d68f0136..3a3926ff7b857 100644
1959     --- a/drivers/usb/host/ehci-hub.c
1960     +++ b/drivers/usb/host/ehci-hub.c
1961     @@ -27,7 +27,6 @@
1962     */
1963    
1964     /*-------------------------------------------------------------------------*/
1965     -#include <linux/usb/otg.h>
1966    
1967     #define PORT_WAKE_BITS (PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E)
1968    
1969     diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
1970     index 0c8b24ff44a05..838123dc390ca 100644
1971     --- a/drivers/usb/serial/ftdi_sio.c
1972     +++ b/drivers/usb/serial/ftdi_sio.c
1973     @@ -708,6 +708,7 @@ static const struct usb_device_id id_table_combined[] = {
1974     { USB_DEVICE(XSENS_VID, XSENS_AWINDA_STATION_PID) },
1975     { USB_DEVICE(XSENS_VID, XSENS_CONVERTER_PID) },
1976     { USB_DEVICE(XSENS_VID, XSENS_MTDEVBOARD_PID) },
1977     + { USB_DEVICE(XSENS_VID, XSENS_MTIUSBCONVERTER_PID) },
1978     { USB_DEVICE(XSENS_VID, XSENS_MTW_PID) },
1979     { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) },
1980     { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) },
1981     diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
1982     index 32a40ab9a3852..c33e06752b5f0 100644
1983     --- a/drivers/usb/serial/ftdi_sio_ids.h
1984     +++ b/drivers/usb/serial/ftdi_sio_ids.h
1985     @@ -159,6 +159,7 @@
1986     #define XSENS_AWINDA_DONGLE_PID 0x0102
1987     #define XSENS_MTW_PID 0x0200 /* Xsens MTw */
1988     #define XSENS_MTDEVBOARD_PID 0x0300 /* Motion Tracker Development Board */
1989     +#define XSENS_MTIUSBCONVERTER_PID 0x0301 /* MTi USB converter */
1990     #define XSENS_CONVERTER_PID 0xD00D /* Xsens USB-serial converter */
1991    
1992     /* Xsens devices using FTDI VID */
1993     diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1994     index 52b1092ed57ed..8cff50ef4fd14 100644
1995     --- a/drivers/usb/serial/option.c
1996     +++ b/drivers/usb/serial/option.c
1997     @@ -1808,6 +1808,8 @@ static const struct usb_device_id option_ids[] = {
1998     { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9003, 0xff) }, /* Simcom SIM7500/SIM7600 MBIM mode */
1999     { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9011, 0xff), /* Simcom SIM7500/SIM7600 RNDIS mode */
2000     .driver_info = RSVD(7) },
2001     + { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9205, 0xff) }, /* Simcom SIM7070/SIM7080/SIM7090 AT+ECM mode */
2002     + { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9206, 0xff) }, /* Simcom SIM7070/SIM7080/SIM7090 AT-only mode */
2003     { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200),
2004     .driver_info = NCTRL(0) | NCTRL(1) | RSVD(4) },
2005     { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D),
2006     diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
2007     index bb7556952a184..8378e92f7c045 100644
2008     --- a/drivers/usb/storage/uas.c
2009     +++ b/drivers/usb/storage/uas.c
2010     @@ -670,8 +670,7 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,
2011     if (devinfo->resetting) {
2012     cmnd->result = DID_ERROR << 16;
2013     cmnd->scsi_done(cmnd);
2014     - spin_unlock_irqrestore(&devinfo->lock, flags);
2015     - return 0;
2016     + goto zombie;
2017     }
2018    
2019     /* Find a free uas-tag */
2020     @@ -706,6 +705,16 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,
2021     cmdinfo->state &= ~(SUBMIT_DATA_IN_URB | SUBMIT_DATA_OUT_URB);
2022    
2023     err = uas_submit_urbs(cmnd, devinfo);
2024     + /*
2025     + * in case of fatal errors the SCSI layer is peculiar
2026     + * a command that has finished is a success for the purpose
2027     + * of queueing, no matter how fatal the error
2028     + */
2029     + if (err == -ENODEV) {
2030     + cmnd->result = DID_ERROR << 16;
2031     + cmnd->scsi_done(cmnd);
2032     + goto zombie;
2033     + }
2034     if (err) {
2035     /* If we did nothing, give up now */
2036     if (cmdinfo->state & SUBMIT_STATUS_URB) {
2037     @@ -716,6 +725,7 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,
2038     }
2039    
2040     devinfo->cmnd[idx] = cmnd;
2041     +zombie:
2042     spin_unlock_irqrestore(&devinfo->lock, flags);
2043     return 0;
2044     }
2045     diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
2046     index 38da6e2991491..c31715019cb43 100644
2047     --- a/drivers/video/console/Kconfig
2048     +++ b/drivers/video/console/Kconfig
2049     @@ -22,31 +22,6 @@ config VGA_CONSOLE
2050    
2051     Say Y.
2052    
2053     -config VGACON_SOFT_SCROLLBACK
2054     - bool "Enable Scrollback Buffer in System RAM"
2055     - depends on VGA_CONSOLE
2056     - default n
2057     - help
2058     - The scrollback buffer of the standard VGA console is located in
2059     - the VGA RAM. The size of this RAM is fixed and is quite small.
2060     - If you require a larger scrollback buffer, this can be placed in
2061     - System RAM which is dynamically allocated during initialization.
2062     - Placing the scrollback buffer in System RAM will slightly slow
2063     - down the console.
2064     -
2065     - If you want this feature, say 'Y' here and enter the amount of
2066     - RAM to allocate for this buffer. If unsure, say 'N'.
2067     -
2068     -config VGACON_SOFT_SCROLLBACK_SIZE
2069     - int "Scrollback Buffer Size (in KB)"
2070     - depends on VGACON_SOFT_SCROLLBACK
2071     - range 1 1024
2072     - default "64"
2073     - help
2074     - Enter the amount of System RAM to allocate for the scrollback
2075     - buffer. Each 64KB will give you approximately 16 80x25
2076     - screenfuls of scrollback buffer
2077     -
2078     config MDA_CONSOLE
2079     depends on !M68K && !PARISC && ISA
2080     tristate "MDA text console (dual-headed)"
2081     diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c
2082     index 05d1d36a56654..a7ab8323304da 100644
2083     --- a/drivers/video/console/bitblit.c
2084     +++ b/drivers/video/console/bitblit.c
2085     @@ -234,7 +234,7 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
2086     }
2087    
2088     static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode,
2089     - int softback_lines, int fg, int bg)
2090     + int fg, int bg)
2091     {
2092     struct fb_cursor cursor;
2093     struct fbcon_ops *ops = info->fbcon_par;
2094     @@ -247,15 +247,6 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode,
2095    
2096     cursor.set = 0;
2097    
2098     - if (softback_lines) {
2099     - if (y + softback_lines >= vc->vc_rows) {
2100     - mode = CM_ERASE;
2101     - ops->cursor_flash = 0;
2102     - return;
2103     - } else
2104     - y += softback_lines;
2105     - }
2106     -
2107     c = scr_readw((u16 *) vc->vc_pos);
2108     attribute = get_attribute(info, c);
2109     src = vc->vc_font.data + ((c & charmask) * (w * vc->vc_font.height));
2110     diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
2111     index dd6797e54e8ab..4b7d0f9a820aa 100644
2112     --- a/drivers/video/console/fbcon.c
2113     +++ b/drivers/video/console/fbcon.c
2114     @@ -101,12 +101,6 @@ static int logo_lines;
2115     /* logo_shown is an index to vc_cons when >= 0; otherwise follows FBCON_LOGO
2116     enums. */
2117     static int logo_shown = FBCON_LOGO_CANSHOW;
2118     -/* Software scrollback */
2119     -static int fbcon_softback_size = 32768;
2120     -static unsigned long softback_buf, softback_curr;
2121     -static unsigned long softback_in;
2122     -static unsigned long softback_top, softback_end;
2123     -static int softback_lines;
2124     /* console mappings */
2125     static int first_fb_vc;
2126     static int last_fb_vc = MAX_NR_CONSOLES - 1;
2127     @@ -140,8 +134,6 @@ static int fbcon_has_sysfs;
2128    
2129     static const struct consw fb_con;
2130    
2131     -#define CM_SOFTBACK (8)
2132     -
2133     #define advance_row(p, delta) (unsigned short *)((unsigned long)(p) + (delta) * vc->vc_size_row)
2134    
2135     static int fbcon_set_origin(struct vc_data *);
2136     @@ -349,18 +341,6 @@ static int get_color(struct vc_data *vc, struct fb_info *info,
2137     return color;
2138     }
2139    
2140     -static void fbcon_update_softback(struct vc_data *vc)
2141     -{
2142     - int l = fbcon_softback_size / vc->vc_size_row;
2143     -
2144     - if (l > 5)
2145     - softback_end = softback_buf + l * vc->vc_size_row;
2146     - else
2147     - /* Smaller scrollback makes no sense, and 0 would screw
2148     - the operation totally */
2149     - softback_top = 0;
2150     -}
2151     -
2152     static void fb_flashcursor(struct work_struct *work)
2153     {
2154     struct fb_info *info = container_of(work, struct fb_info, queue);
2155     @@ -390,7 +370,7 @@ static void fb_flashcursor(struct work_struct *work)
2156     c = scr_readw((u16 *) vc->vc_pos);
2157     mode = (!ops->cursor_flash || ops->cursor_state.enable) ?
2158     CM_ERASE : CM_DRAW;
2159     - ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1),
2160     + ops->cursor(vc, info, mode, get_color(vc, info, c, 1),
2161     get_color(vc, info, c, 0));
2162     console_unlock();
2163     }
2164     @@ -450,13 +430,7 @@ static int __init fb_console_setup(char *this_opt)
2165     }
2166    
2167     if (!strncmp(options, "scrollback:", 11)) {
2168     - options += 11;
2169     - if (*options) {
2170     - fbcon_softback_size = simple_strtoul(options, &options, 0);
2171     - if (*options == 'k' || *options == 'K') {
2172     - fbcon_softback_size *= 1024;
2173     - }
2174     - }
2175     + pr_warn("Ignoring scrollback size option\n");
2176     continue;
2177     }
2178    
2179     @@ -961,31 +935,6 @@ static const char *fbcon_startup(void)
2180     p->con_rotate = initial_rotation;
2181     set_blitting_type(vc, info);
2182    
2183     - if (info->fix.type != FB_TYPE_TEXT) {
2184     - if (fbcon_softback_size) {
2185     - if (!softback_buf) {
2186     - softback_buf =
2187     - (unsigned long)
2188     - kmalloc(fbcon_softback_size,
2189     - GFP_KERNEL);
2190     - if (!softback_buf) {
2191     - fbcon_softback_size = 0;
2192     - softback_top = 0;
2193     - }
2194     - }
2195     - } else {
2196     - if (softback_buf) {
2197     - kfree((void *) softback_buf);
2198     - softback_buf = 0;
2199     - softback_top = 0;
2200     - }
2201     - }
2202     - if (softback_buf)
2203     - softback_in = softback_top = softback_curr =
2204     - softback_buf;
2205     - softback_lines = 0;
2206     - }
2207     -
2208     /* Setup default font */
2209     if (!p->fontdata && !vc->vc_font.data) {
2210     if (!fontname[0] || !(font = find_font(fontname)))
2211     @@ -1148,9 +1097,6 @@ static void fbcon_init(struct vc_data *vc, int init)
2212     if (logo)
2213     fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
2214    
2215     - if (vc == svc && softback_buf)
2216     - fbcon_update_softback(vc);
2217     -
2218     if (ops->rotate_font && ops->rotate_font(info, vc)) {
2219     ops->rotate = FB_ROTATE_UR;
2220     set_blitting_type(vc, info);
2221     @@ -1310,7 +1256,6 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
2222     {
2223     struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
2224     struct fbcon_ops *ops = info->fbcon_par;
2225     - int y;
2226     int c = scr_readw((u16 *) vc->vc_pos);
2227    
2228     ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
2229     @@ -1324,16 +1269,8 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
2230     fbcon_add_cursor_timer(info);
2231    
2232     ops->cursor_flash = (mode == CM_ERASE) ? 0 : 1;
2233     - if (mode & CM_SOFTBACK) {
2234     - mode &= ~CM_SOFTBACK;
2235     - y = softback_lines;
2236     - } else {
2237     - if (softback_lines)
2238     - fbcon_set_origin(vc);
2239     - y = 0;
2240     - }
2241    
2242     - ops->cursor(vc, info, mode, y, get_color(vc, info, c, 1),
2243     + ops->cursor(vc, info, mode, get_color(vc, info, c, 1),
2244     get_color(vc, info, c, 0));
2245     }
2246    
2247     @@ -1404,8 +1341,6 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var,
2248    
2249     if (con_is_visible(vc)) {
2250     update_screen(vc);
2251     - if (softback_buf)
2252     - fbcon_update_softback(vc);
2253     }
2254     }
2255    
2256     @@ -1543,99 +1478,6 @@ static __inline__ void ypan_down_redraw(struct vc_data *vc, int t, int count)
2257     scrollback_current = 0;
2258     }
2259    
2260     -static void fbcon_redraw_softback(struct vc_data *vc, struct display *p,
2261     - long delta)
2262     -{
2263     - int count = vc->vc_rows;
2264     - unsigned short *d, *s;
2265     - unsigned long n;
2266     - int line = 0;
2267     -
2268     - d = (u16 *) softback_curr;
2269     - if (d == (u16 *) softback_in)
2270     - d = (u16 *) vc->vc_origin;
2271     - n = softback_curr + delta * vc->vc_size_row;
2272     - softback_lines -= delta;
2273     - if (delta < 0) {
2274     - if (softback_curr < softback_top && n < softback_buf) {
2275     - n += softback_end - softback_buf;
2276     - if (n < softback_top) {
2277     - softback_lines -=
2278     - (softback_top - n) / vc->vc_size_row;
2279     - n = softback_top;
2280     - }
2281     - } else if (softback_curr >= softback_top
2282     - && n < softback_top) {
2283     - softback_lines -=
2284     - (softback_top - n) / vc->vc_size_row;
2285     - n = softback_top;
2286     - }
2287     - } else {
2288     - if (softback_curr > softback_in && n >= softback_end) {
2289     - n += softback_buf - softback_end;
2290     - if (n > softback_in) {
2291     - n = softback_in;
2292     - softback_lines = 0;
2293     - }
2294     - } else if (softback_curr <= softback_in && n > softback_in) {
2295     - n = softback_in;
2296     - softback_lines = 0;
2297     - }
2298     - }
2299     - if (n == softback_curr)
2300     - return;
2301     - softback_curr = n;
2302     - s = (u16 *) softback_curr;
2303     - if (s == (u16 *) softback_in)
2304     - s = (u16 *) vc->vc_origin;
2305     - while (count--) {
2306     - unsigned short *start;
2307     - unsigned short *le;
2308     - unsigned short c;
2309     - int x = 0;
2310     - unsigned short attr = 1;
2311     -
2312     - start = s;
2313     - le = advance_row(s, 1);
2314     - do {
2315     - c = scr_readw(s);
2316     - if (attr != (c & 0xff00)) {
2317     - attr = c & 0xff00;
2318     - if (s > start) {
2319     - fbcon_putcs(vc, start, s - start,
2320     - line, x);
2321     - x += s - start;
2322     - start = s;
2323     - }
2324     - }
2325     - if (c == scr_readw(d)) {
2326     - if (s > start) {
2327     - fbcon_putcs(vc, start, s - start,
2328     - line, x);
2329     - x += s - start + 1;
2330     - start = s + 1;
2331     - } else {
2332     - x++;
2333     - start++;
2334     - }
2335     - }
2336     - s++;
2337     - d++;
2338     - } while (s < le);
2339     - if (s > start)
2340     - fbcon_putcs(vc, start, s - start, line, x);
2341     - line++;
2342     - if (d == (u16 *) softback_end)
2343     - d = (u16 *) softback_buf;
2344     - if (d == (u16 *) softback_in)
2345     - d = (u16 *) vc->vc_origin;
2346     - if (s == (u16 *) softback_end)
2347     - s = (u16 *) softback_buf;
2348     - if (s == (u16 *) softback_in)
2349     - s = (u16 *) vc->vc_origin;
2350     - }
2351     -}
2352     -
2353     static void fbcon_redraw_move(struct vc_data *vc, struct display *p,
2354     int line, int count, int dy)
2355     {
2356     @@ -1775,31 +1617,6 @@ static void fbcon_redraw(struct vc_data *vc, struct display *p,
2357     }
2358     }
2359    
2360     -static inline void fbcon_softback_note(struct vc_data *vc, int t,
2361     - int count)
2362     -{
2363     - unsigned short *p;
2364     -
2365     - if (vc->vc_num != fg_console)
2366     - return;
2367     - p = (unsigned short *) (vc->vc_origin + t * vc->vc_size_row);
2368     -
2369     - while (count) {
2370     - scr_memcpyw((u16 *) softback_in, p, vc->vc_size_row);
2371     - count--;
2372     - p = advance_row(p, 1);
2373     - softback_in += vc->vc_size_row;
2374     - if (softback_in == softback_end)
2375     - softback_in = softback_buf;
2376     - if (softback_in == softback_top) {
2377     - softback_top += vc->vc_size_row;
2378     - if (softback_top == softback_end)
2379     - softback_top = softback_buf;
2380     - }
2381     - }
2382     - softback_curr = softback_in;
2383     -}
2384     -
2385     static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
2386     int count)
2387     {
2388     @@ -1822,8 +1639,6 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
2389     case SM_UP:
2390     if (count > vc->vc_rows) /* Maximum realistic size */
2391     count = vc->vc_rows;
2392     - if (softback_top)
2393     - fbcon_softback_note(vc, t, count);
2394     if (logo_shown >= 0)
2395     goto redraw_up;
2396     switch (p->scrollmode) {
2397     @@ -2128,7 +1943,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width,
2398     struct fb_var_screeninfo var = info->var;
2399     int x_diff, y_diff, virt_w, virt_h, virt_fw, virt_fh;
2400    
2401     - if (ops->p && ops->p->userfont && FNTSIZE(vc->vc_font.data)) {
2402     + if (p->userfont && FNTSIZE(vc->vc_font.data)) {
2403     int size;
2404     int pitch = PITCH(vc->vc_font.width);
2405    
2406     @@ -2194,14 +2009,6 @@ static int fbcon_switch(struct vc_data *vc)
2407     info = registered_fb[con2fb_map[vc->vc_num]];
2408     ops = info->fbcon_par;
2409    
2410     - if (softback_top) {
2411     - if (softback_lines)
2412     - fbcon_set_origin(vc);
2413     - softback_top = softback_curr = softback_in = softback_buf;
2414     - softback_lines = 0;
2415     - fbcon_update_softback(vc);
2416     - }
2417     -
2418     if (logo_shown >= 0) {
2419     struct vc_data *conp2 = vc_cons[logo_shown].d;
2420    
2421     @@ -2535,9 +2342,6 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
2422     int cnt;
2423     char *old_data = NULL;
2424    
2425     - if (con_is_visible(vc) && softback_lines)
2426     - fbcon_set_origin(vc);
2427     -
2428     resize = (w != vc->vc_font.width) || (h != vc->vc_font.height);
2429     if (p->userfont)
2430     old_data = vc->vc_font.data;
2431     @@ -2563,8 +2367,6 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
2432     cols /= w;
2433     rows /= h;
2434     vc_resize(vc, cols, rows);
2435     - if (con_is_visible(vc) && softback_buf)
2436     - fbcon_update_softback(vc);
2437     } else if (con_is_visible(vc)
2438     && vc->vc_mode == KD_TEXT) {
2439     fbcon_clear_margins(vc, 0);
2440     @@ -2722,19 +2524,7 @@ static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table)
2441    
2442     static u16 *fbcon_screen_pos(struct vc_data *vc, int offset)
2443     {
2444     - unsigned long p;
2445     - int line;
2446     -
2447     - if (vc->vc_num != fg_console || !softback_lines)
2448     - return (u16 *) (vc->vc_origin + offset);
2449     - line = offset / vc->vc_size_row;
2450     - if (line >= softback_lines)
2451     - return (u16 *) (vc->vc_origin + offset -
2452     - softback_lines * vc->vc_size_row);
2453     - p = softback_curr + offset;
2454     - if (p >= softback_end)
2455     - p += softback_buf - softback_end;
2456     - return (u16 *) p;
2457     + return (u16 *) (vc->vc_origin + offset);
2458     }
2459    
2460     static unsigned long fbcon_getxy(struct vc_data *vc, unsigned long pos,
2461     @@ -2748,22 +2538,7 @@ static unsigned long fbcon_getxy(struct vc_data *vc, unsigned long pos,
2462    
2463     x = offset % vc->vc_cols;
2464     y = offset / vc->vc_cols;
2465     - if (vc->vc_num == fg_console)
2466     - y += softback_lines;
2467     ret = pos + (vc->vc_cols - x) * 2;
2468     - } else if (vc->vc_num == fg_console && softback_lines) {
2469     - unsigned long offset = pos - softback_curr;
2470     -
2471     - if (pos < softback_curr)
2472     - offset += softback_end - softback_buf;
2473     - offset /= 2;
2474     - x = offset % vc->vc_cols;
2475     - y = offset / vc->vc_cols;
2476     - ret = pos + (vc->vc_cols - x) * 2;
2477     - if (ret == softback_end)
2478     - ret = softback_buf;
2479     - if (ret == softback_in)
2480     - ret = vc->vc_origin;
2481     } else {
2482     /* Should not happen */
2483     x = y = 0;
2484     @@ -2791,106 +2566,11 @@ static void fbcon_invert_region(struct vc_data *vc, u16 * p, int cnt)
2485     a = ((a) & 0x88ff) | (((a) & 0x7000) >> 4) |
2486     (((a) & 0x0700) << 4);
2487     scr_writew(a, p++);
2488     - if (p == (u16 *) softback_end)
2489     - p = (u16 *) softback_buf;
2490     - if (p == (u16 *) softback_in)
2491     - p = (u16 *) vc->vc_origin;
2492     }
2493     }
2494    
2495     -static void fbcon_scrolldelta(struct vc_data *vc, int lines)
2496     -{
2497     - struct fb_info *info = registered_fb[con2fb_map[fg_console]];
2498     - struct fbcon_ops *ops = info->fbcon_par;
2499     - struct display *disp = &fb_display[fg_console];
2500     - int offset, limit, scrollback_old;
2501     -
2502     - if (softback_top) {
2503     - if (vc->vc_num != fg_console)
2504     - return;
2505     - if (vc->vc_mode != KD_TEXT || !lines)
2506     - return;
2507     - if (logo_shown >= 0) {
2508     - struct vc_data *conp2 = vc_cons[logo_shown].d;
2509     -
2510     - if (conp2->vc_top == logo_lines
2511     - && conp2->vc_bottom == conp2->vc_rows)
2512     - conp2->vc_top = 0;
2513     - if (logo_shown == vc->vc_num) {
2514     - unsigned long p, q;
2515     - int i;
2516     -
2517     - p = softback_in;
2518     - q = vc->vc_origin +
2519     - logo_lines * vc->vc_size_row;
2520     - for (i = 0; i < logo_lines; i++) {
2521     - if (p == softback_top)
2522     - break;
2523     - if (p == softback_buf)
2524     - p = softback_end;
2525     - p -= vc->vc_size_row;
2526     - q -= vc->vc_size_row;
2527     - scr_memcpyw((u16 *) q, (u16 *) p,
2528     - vc->vc_size_row);
2529     - }
2530     - softback_in = softback_curr = p;
2531     - update_region(vc, vc->vc_origin,
2532     - logo_lines * vc->vc_cols);
2533     - }
2534     - logo_shown = FBCON_LOGO_CANSHOW;
2535     - }
2536     - fbcon_cursor(vc, CM_ERASE | CM_SOFTBACK);
2537     - fbcon_redraw_softback(vc, disp, lines);
2538     - fbcon_cursor(vc, CM_DRAW | CM_SOFTBACK);
2539     - return;
2540     - }
2541     -
2542     - if (!scrollback_phys_max)
2543     - return;
2544     -
2545     - scrollback_old = scrollback_current;
2546     - scrollback_current -= lines;
2547     - if (scrollback_current < 0)
2548     - scrollback_current = 0;
2549     - else if (scrollback_current > scrollback_max)
2550     - scrollback_current = scrollback_max;
2551     - if (scrollback_current == scrollback_old)
2552     - return;
2553     -
2554     - if (fbcon_is_inactive(vc, info))
2555     - return;
2556     -
2557     - fbcon_cursor(vc, CM_ERASE);
2558     -
2559     - offset = disp->yscroll - scrollback_current;
2560     - limit = disp->vrows;
2561     - switch (disp->scrollmode) {
2562     - case SCROLL_WRAP_MOVE:
2563     - info->var.vmode |= FB_VMODE_YWRAP;
2564     - break;
2565     - case SCROLL_PAN_MOVE:
2566     - case SCROLL_PAN_REDRAW:
2567     - limit -= vc->vc_rows;
2568     - info->var.vmode &= ~FB_VMODE_YWRAP;
2569     - break;
2570     - }
2571     - if (offset < 0)
2572     - offset += limit;
2573     - else if (offset >= limit)
2574     - offset -= limit;
2575     -
2576     - ops->var.xoffset = 0;
2577     - ops->var.yoffset = offset * vc->vc_font.height;
2578     - ops->update_start(info);
2579     -
2580     - if (!scrollback_current)
2581     - fbcon_cursor(vc, CM_DRAW);
2582     -}
2583     -
2584     static int fbcon_set_origin(struct vc_data *vc)
2585     {
2586     - if (softback_lines)
2587     - fbcon_scrolldelta(vc, softback_lines);
2588     return 0;
2589     }
2590    
2591     @@ -2954,8 +2634,6 @@ static void fbcon_modechanged(struct fb_info *info)
2592    
2593     fbcon_set_palette(vc, color_table);
2594     update_screen(vc);
2595     - if (softback_buf)
2596     - fbcon_update_softback(vc);
2597     }
2598     }
2599    
2600     @@ -3375,7 +3053,6 @@ static const struct consw fb_con = {
2601     .con_font_default = fbcon_set_def_font,
2602     .con_font_copy = fbcon_copy_font,
2603     .con_set_palette = fbcon_set_palette,
2604     - .con_scrolldelta = fbcon_scrolldelta,
2605     .con_set_origin = fbcon_set_origin,
2606     .con_invert_region = fbcon_invert_region,
2607     .con_screen_pos = fbcon_screen_pos,
2608     @@ -3584,9 +3261,6 @@ static void fbcon_exit(void)
2609     if (fbcon_has_exited)
2610     return;
2611    
2612     - kfree((void *)softback_buf);
2613     - softback_buf = 0UL;
2614     -
2615     for (i = 0; i < FB_MAX; i++) {
2616     int pending = 0;
2617    
2618     diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
2619     index 7aaa4eabbba05..5ebdccd070eb8 100644
2620     --- a/drivers/video/console/fbcon.h
2621     +++ b/drivers/video/console/fbcon.h
2622     @@ -62,7 +62,7 @@ struct fbcon_ops {
2623     void (*clear_margins)(struct vc_data *vc, struct fb_info *info,
2624     int bottom_only);
2625     void (*cursor)(struct vc_data *vc, struct fb_info *info, int mode,
2626     - int softback_lines, int fg, int bg);
2627     + int fg, int bg);
2628     int (*update_start)(struct fb_info *info);
2629     int (*rotate_font)(struct fb_info *info, struct vc_data *vc);
2630     struct fb_var_screeninfo var; /* copy of the current fb_var_screeninfo */
2631     diff --git a/drivers/video/console/fbcon_ccw.c b/drivers/video/console/fbcon_ccw.c
2632     index 34da8bba9273a..5867027520058 100644
2633     --- a/drivers/video/console/fbcon_ccw.c
2634     +++ b/drivers/video/console/fbcon_ccw.c
2635     @@ -219,7 +219,7 @@ static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info,
2636     }
2637    
2638     static void ccw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
2639     - int softback_lines, int fg, int bg)
2640     + int fg, int bg)
2641     {
2642     struct fb_cursor cursor;
2643     struct fbcon_ops *ops = info->fbcon_par;
2644     @@ -236,15 +236,6 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
2645    
2646     cursor.set = 0;
2647    
2648     - if (softback_lines) {
2649     - if (y + softback_lines >= vc->vc_rows) {
2650     - mode = CM_ERASE;
2651     - ops->cursor_flash = 0;
2652     - return;
2653     - } else
2654     - y += softback_lines;
2655     - }
2656     -
2657     c = scr_readw((u16 *) vc->vc_pos);
2658     attribute = get_attribute(info, c);
2659     src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.width));
2660     diff --git a/drivers/video/console/fbcon_cw.c b/drivers/video/console/fbcon_cw.c
2661     index 0b552b3fc22ab..f5a1134049f83 100644
2662     --- a/drivers/video/console/fbcon_cw.c
2663     +++ b/drivers/video/console/fbcon_cw.c
2664     @@ -202,7 +202,7 @@ static void cw_clear_margins(struct vc_data *vc, struct fb_info *info,
2665     }
2666    
2667     static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
2668     - int softback_lines, int fg, int bg)
2669     + int fg, int bg)
2670     {
2671     struct fb_cursor cursor;
2672     struct fbcon_ops *ops = info->fbcon_par;
2673     @@ -219,15 +219,6 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode,
2674    
2675     cursor.set = 0;
2676    
2677     - if (softback_lines) {
2678     - if (y + softback_lines >= vc->vc_rows) {
2679     - mode = CM_ERASE;
2680     - ops->cursor_flash = 0;
2681     - return;
2682     - } else
2683     - y += softback_lines;
2684     - }
2685     -
2686     c = scr_readw((u16 *) vc->vc_pos);
2687     attribute = get_attribute(info, c);
2688     src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.width));
2689     diff --git a/drivers/video/console/fbcon_ud.c b/drivers/video/console/fbcon_ud.c
2690     index 7f62efe2da526..cf8dac9ca2bbf 100644
2691     --- a/drivers/video/console/fbcon_ud.c
2692     +++ b/drivers/video/console/fbcon_ud.c
2693     @@ -249,7 +249,7 @@ static void ud_clear_margins(struct vc_data *vc, struct fb_info *info,
2694     }
2695    
2696     static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode,
2697     - int softback_lines, int fg, int bg)
2698     + int fg, int bg)
2699     {
2700     struct fb_cursor cursor;
2701     struct fbcon_ops *ops = info->fbcon_par;
2702     @@ -267,15 +267,6 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode,
2703    
2704     cursor.set = 0;
2705    
2706     - if (softback_lines) {
2707     - if (y + softback_lines >= vc->vc_rows) {
2708     - mode = CM_ERASE;
2709     - ops->cursor_flash = 0;
2710     - return;
2711     - } else
2712     - y += softback_lines;
2713     - }
2714     -
2715     c = scr_readw((u16 *) vc->vc_pos);
2716     attribute = get_attribute(info, c);
2717     src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.height));
2718     diff --git a/drivers/video/console/tileblit.c b/drivers/video/console/tileblit.c
2719     index 15e8e1a89c45d..3c0b242dba5f0 100644
2720     --- a/drivers/video/console/tileblit.c
2721     +++ b/drivers/video/console/tileblit.c
2722     @@ -80,7 +80,7 @@ static void tile_clear_margins(struct vc_data *vc, struct fb_info *info,
2723     }
2724    
2725     static void tile_cursor(struct vc_data *vc, struct fb_info *info, int mode,
2726     - int softback_lines, int fg, int bg)
2727     + int fg, int bg)
2728     {
2729     struct fb_tilecursor cursor;
2730     int use_sw = (vc->vc_cursor_type & 0x10);
2731     diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
2732     index d45ba7317b225..b38ee2354cbfa 100644
2733     --- a/drivers/video/console/vgacon.c
2734     +++ b/drivers/video/console/vgacon.c
2735     @@ -179,157 +179,6 @@ static inline void vga_set_mem_top(struct vc_data *c)
2736     write_vga(12, (c->vc_visible_origin - vga_vram_base) / 2);
2737     }
2738    
2739     -#ifdef CONFIG_VGACON_SOFT_SCROLLBACK
2740     -/* software scrollback */
2741     -static void *vgacon_scrollback;
2742     -static int vgacon_scrollback_tail;
2743     -static int vgacon_scrollback_size;
2744     -static int vgacon_scrollback_rows;
2745     -static int vgacon_scrollback_cnt;
2746     -static int vgacon_scrollback_cur;
2747     -static int vgacon_scrollback_save;
2748     -static int vgacon_scrollback_restore;
2749     -
2750     -static void vgacon_scrollback_init(int pitch)
2751     -{
2752     - int rows = CONFIG_VGACON_SOFT_SCROLLBACK_SIZE * 1024/pitch;
2753     -
2754     - if (vgacon_scrollback) {
2755     - vgacon_scrollback_cnt = 0;
2756     - vgacon_scrollback_tail = 0;
2757     - vgacon_scrollback_cur = 0;
2758     - vgacon_scrollback_rows = rows - 1;
2759     - vgacon_scrollback_size = rows * pitch;
2760     - }
2761     -}
2762     -
2763     -static void vgacon_scrollback_startup(void)
2764     -{
2765     - vgacon_scrollback = kcalloc(CONFIG_VGACON_SOFT_SCROLLBACK_SIZE, 1024, GFP_NOWAIT);
2766     - vgacon_scrollback_init(vga_video_num_columns * 2);
2767     -}
2768     -
2769     -static void vgacon_scrollback_update(struct vc_data *c, int t, int count)
2770     -{
2771     - void *p;
2772     -
2773     - if (!vgacon_scrollback_size || c->vc_num != fg_console)
2774     - return;
2775     -
2776     - p = (void *) (c->vc_origin + t * c->vc_size_row);
2777     -
2778     - while (count--) {
2779     - if ((vgacon_scrollback_tail + c->vc_size_row) >
2780     - vgacon_scrollback_size)
2781     - vgacon_scrollback_tail = 0;
2782     -
2783     - scr_memcpyw(vgacon_scrollback + vgacon_scrollback_tail,
2784     - p, c->vc_size_row);
2785     - vgacon_scrollback_cnt++;
2786     - p += c->vc_size_row;
2787     - vgacon_scrollback_tail += c->vc_size_row;
2788     -
2789     - if (vgacon_scrollback_tail >= vgacon_scrollback_size)
2790     - vgacon_scrollback_tail = 0;
2791     -
2792     - if (vgacon_scrollback_cnt > vgacon_scrollback_rows)
2793     - vgacon_scrollback_cnt = vgacon_scrollback_rows;
2794     -
2795     - vgacon_scrollback_cur = vgacon_scrollback_cnt;
2796     - }
2797     -}
2798     -
2799     -static void vgacon_restore_screen(struct vc_data *c)
2800     -{
2801     - vgacon_scrollback_save = 0;
2802     -
2803     - if (!vga_is_gfx && !vgacon_scrollback_restore) {
2804     - scr_memcpyw((u16 *) c->vc_origin, (u16 *) c->vc_screenbuf,
2805     - c->vc_screenbuf_size > vga_vram_size ?
2806     - vga_vram_size : c->vc_screenbuf_size);
2807     - vgacon_scrollback_restore = 1;
2808     - vgacon_scrollback_cur = vgacon_scrollback_cnt;
2809     - }
2810     -}
2811     -
2812     -static void vgacon_scrolldelta(struct vc_data *c, int lines)
2813     -{
2814     - int start, end, count, soff;
2815     -
2816     - if (!lines) {
2817     - c->vc_visible_origin = c->vc_origin;
2818     - vga_set_mem_top(c);
2819     - return;
2820     - }
2821     -
2822     - if (!vgacon_scrollback)
2823     - return;
2824     -
2825     - if (!vgacon_scrollback_save) {
2826     - vgacon_cursor(c, CM_ERASE);
2827     - vgacon_save_screen(c);
2828     - vgacon_scrollback_save = 1;
2829     - }
2830     -
2831     - vgacon_scrollback_restore = 0;
2832     - start = vgacon_scrollback_cur + lines;
2833     - end = start + abs(lines);
2834     -
2835     - if (start < 0)
2836     - start = 0;
2837     -
2838     - if (start > vgacon_scrollback_cnt)
2839     - start = vgacon_scrollback_cnt;
2840     -
2841     - if (end < 0)
2842     - end = 0;
2843     -
2844     - if (end > vgacon_scrollback_cnt)
2845     - end = vgacon_scrollback_cnt;
2846     -
2847     - vgacon_scrollback_cur = start;
2848     - count = end - start;
2849     - soff = vgacon_scrollback_tail - ((vgacon_scrollback_cnt - end) *
2850     - c->vc_size_row);
2851     - soff -= count * c->vc_size_row;
2852     -
2853     - if (soff < 0)
2854     - soff += vgacon_scrollback_size;
2855     -
2856     - count = vgacon_scrollback_cnt - start;
2857     -
2858     - if (count > c->vc_rows)
2859     - count = c->vc_rows;
2860     -
2861     - if (count) {
2862     - int copysize;
2863     -
2864     - int diff = c->vc_rows - count;
2865     - void *d = (void *) c->vc_origin;
2866     - void *s = (void *) c->vc_screenbuf;
2867     -
2868     - count *= c->vc_size_row;
2869     - /* how much memory to end of buffer left? */
2870     - copysize = min(count, vgacon_scrollback_size - soff);
2871     - scr_memcpyw(d, vgacon_scrollback + soff, copysize);
2872     - d += copysize;
2873     - count -= copysize;
2874     -
2875     - if (count) {
2876     - scr_memcpyw(d, vgacon_scrollback, count);
2877     - d += count;
2878     - }
2879     -
2880     - if (diff)
2881     - scr_memcpyw(d, s, diff * c->vc_size_row);
2882     - } else
2883     - vgacon_cursor(c, CM_MOVE);
2884     -}
2885     -#else
2886     -#define vgacon_scrollback_startup(...) do { } while (0)
2887     -#define vgacon_scrollback_init(...) do { } while (0)
2888     -#define vgacon_scrollback_update(...) do { } while (0)
2889     -
2890     static void vgacon_restore_screen(struct vc_data *c)
2891     {
2892     if (c->vc_origin != c->vc_visible_origin)
2893     @@ -365,7 +214,6 @@ static void vgacon_scrolldelta(struct vc_data *c, int lines)
2894     }
2895     vga_set_mem_top(c);
2896     }
2897     -#endif /* CONFIG_VGACON_SOFT_SCROLLBACK */
2898    
2899     static const char *vgacon_startup(void)
2900     {
2901     @@ -562,10 +410,7 @@ static const char *vgacon_startup(void)
2902     vgacon_xres = screen_info.orig_video_cols * VGA_FONTWIDTH;
2903     vgacon_yres = vga_scan_lines;
2904    
2905     - if (!vga_init_done) {
2906     - vgacon_scrollback_startup();
2907     - vga_init_done = 1;
2908     - }
2909     + vga_init_done = 1;
2910    
2911     return display_desc;
2912     }
2913     @@ -861,7 +706,6 @@ static int vgacon_switch(struct vc_data *c)
2914     vgacon_doresize(c, c->vc_cols, c->vc_rows);
2915     }
2916    
2917     - vgacon_scrollback_init(c->vc_size_row);
2918     return 0; /* Redrawing not needed */
2919     }
2920    
2921     @@ -1391,7 +1235,6 @@ static int vgacon_scroll(struct vc_data *c, int t, int b, int dir,
2922     oldo = c->vc_origin;
2923     delta = lines * c->vc_size_row;
2924     if (dir == SM_UP) {
2925     - vgacon_scrollback_update(c, t, lines);
2926     if (c->vc_scr_end + delta >= vga_vram_end) {
2927     scr_memcpyw((u16 *) vga_vram_base,
2928     (u16 *) (oldo + delta),
2929     diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c
2930     index 5f0690c8fc936..ee6957a799bb6 100644
2931     --- a/drivers/video/fbdev/vga16fb.c
2932     +++ b/drivers/video/fbdev/vga16fb.c
2933     @@ -1122,7 +1122,7 @@ static void vga_8planes_imageblit(struct fb_info *info, const struct fb_image *i
2934     char oldop = setop(0);
2935     char oldsr = setsr(0);
2936     char oldmask = selectmask();
2937     - const char *cdat = image->data;
2938     + const unsigned char *cdat = image->data;
2939     u32 dx = image->dx;
2940     char __iomem *where;
2941     int y;
2942     diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
2943     index 6db46daeed16b..981091bd6c3c4 100644
2944     --- a/fs/btrfs/ioctl.c
2945     +++ b/fs/btrfs/ioctl.c
2946     @@ -2151,7 +2151,8 @@ static noinline int search_ioctl(struct inode *inode,
2947     key.offset = sk->min_offset;
2948    
2949     while (1) {
2950     - ret = fault_in_pages_writeable(ubuf, *buf_size - sk_offset);
2951     + ret = fault_in_pages_writeable(ubuf + sk_offset,
2952     + *buf_size - sk_offset);
2953     if (ret)
2954     break;
2955    
2956     diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
2957     index 714457bb1440a..4e2f18c26535d 100644
2958     --- a/fs/nfs/nfs4proc.c
2959     +++ b/fs/nfs/nfs4proc.c
2960     @@ -6527,7 +6527,12 @@ int nfs4_lock_delegation_recall(struct file_lock *fl, struct nfs4_state *state,
2961     err = nfs4_set_lock_state(state, fl);
2962     if (err != 0)
2963     return err;
2964     - err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW);
2965     + do {
2966     + err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW);
2967     + if (err != -NFS4ERR_DELAY)
2968     + break;
2969     + ssleep(1);
2970     + } while (err == -NFS4ERR_DELAY);
2971     return nfs4_handle_delegation_recall_error(server, state, stateid, fl, err);
2972     }
2973    
2974     diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
2975     index 70da4113c2baf..7b9dd76403bfd 100644
2976     --- a/fs/xfs/libxfs/xfs_attr_leaf.c
2977     +++ b/fs/xfs/libxfs/xfs_attr_leaf.c
2978     @@ -520,8 +520,8 @@ xfs_attr_shortform_create(xfs_da_args_t *args)
2979     ASSERT(ifp->if_flags & XFS_IFINLINE);
2980     }
2981     xfs_idata_realloc(dp, sizeof(*hdr), XFS_ATTR_FORK);
2982     - hdr = (xfs_attr_sf_hdr_t *)ifp->if_u1.if_data;
2983     - hdr->count = 0;
2984     + hdr = (struct xfs_attr_sf_hdr *)ifp->if_u1.if_data;
2985     + memset(hdr, 0, sizeof(*hdr));
2986     hdr->totsize = cpu_to_be16(sizeof(*hdr));
2987     xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_ADATA);
2988     }
2989     diff --git a/include/linux/i2c-algo-pca.h b/include/linux/i2c-algo-pca.h
2990     index a3c3ecd59f08c..7a43afd273655 100644
2991     --- a/include/linux/i2c-algo-pca.h
2992     +++ b/include/linux/i2c-algo-pca.h
2993     @@ -52,6 +52,20 @@
2994     #define I2C_PCA_CON_SI 0x08 /* Serial Interrupt */
2995     #define I2C_PCA_CON_CR 0x07 /* Clock Rate (MASK) */
2996    
2997     +/**
2998     + * struct pca_i2c_bus_settings - The configured PCA i2c bus settings
2999     + * @mode: Configured i2c bus mode
3000     + * @tlow: Configured SCL LOW period
3001     + * @thi: Configured SCL HIGH period
3002     + * @clock_freq: The configured clock frequency
3003     + */
3004     +struct pca_i2c_bus_settings {
3005     + int mode;
3006     + int tlow;
3007     + int thi;
3008     + int clock_freq;
3009     +};
3010     +
3011     struct i2c_algo_pca_data {
3012     void *data; /* private low level data */
3013     void (*write_byte) (void *data, int reg, int val);
3014     @@ -63,6 +77,7 @@ struct i2c_algo_pca_data {
3015     * For PCA9665, use the frequency you want here. */
3016     unsigned int i2c_clock;
3017     unsigned int chip;
3018     + struct pca_i2c_bus_settings bus_settings;
3019     };
3020    
3021     int i2c_pca_add_bus(struct i2c_adapter *);
3022     diff --git a/include/linux/usb.h b/include/linux/usb.h
3023     index ddbd9c8d3df65..9dd98dcdb080f 100644
3024     --- a/include/linux/usb.h
3025     +++ b/include/linux/usb.h
3026     @@ -99,6 +99,41 @@ enum usb_interface_condition {
3027     USB_INTERFACE_UNBINDING,
3028     };
3029    
3030     +int __must_check
3031     +usb_find_common_endpoints(struct usb_host_interface *alt,
3032     + struct usb_endpoint_descriptor **bulk_in,
3033     + struct usb_endpoint_descriptor **bulk_out,
3034     + struct usb_endpoint_descriptor **int_in,
3035     + struct usb_endpoint_descriptor **int_out);
3036     +
3037     +static inline int __must_check
3038     +usb_find_bulk_in_endpoint(struct usb_host_interface *alt,
3039     + struct usb_endpoint_descriptor **bulk_in)
3040     +{
3041     + return usb_find_common_endpoints(alt, bulk_in, NULL, NULL, NULL);
3042     +}
3043     +
3044     +static inline int __must_check
3045     +usb_find_bulk_out_endpoint(struct usb_host_interface *alt,
3046     + struct usb_endpoint_descriptor **bulk_out)
3047     +{
3048     + return usb_find_common_endpoints(alt, NULL, bulk_out, NULL, NULL);
3049     +}
3050     +
3051     +static inline int __must_check
3052     +usb_find_int_in_endpoint(struct usb_host_interface *alt,
3053     + struct usb_endpoint_descriptor **int_in)
3054     +{
3055     + return usb_find_common_endpoints(alt, NULL, NULL, int_in, NULL);
3056     +}
3057     +
3058     +static inline int __must_check
3059     +usb_find_int_out_endpoint(struct usb_host_interface *alt,
3060     + struct usb_endpoint_descriptor **int_out)
3061     +{
3062     + return usb_find_common_endpoints(alt, NULL, NULL, NULL, int_out);
3063     +}
3064     +
3065     /**
3066     * struct usb_interface - what usb device drivers talk to
3067     * @altsetting: array of interface structures, one for each alternate
3068     diff --git a/include/soc/nps/common.h b/include/soc/nps/common.h
3069     index 9b1d43d671a3f..8c18dc6d3fde5 100644
3070     --- a/include/soc/nps/common.h
3071     +++ b/include/soc/nps/common.h
3072     @@ -45,6 +45,12 @@
3073     #define CTOP_INST_MOV2B_FLIP_R3_B1_B2_INST 0x5B60
3074     #define CTOP_INST_MOV2B_FLIP_R3_B1_B2_LIMM 0x00010422
3075    
3076     +#ifndef AUX_IENABLE
3077     +#define AUX_IENABLE 0x40c
3078     +#endif
3079     +
3080     +#define CTOP_AUX_IACK (0xFFFFF800 + 0x088)
3081     +
3082     #ifndef __ASSEMBLY__
3083    
3084     /* In order to increase compilation test coverage */
3085     diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c
3086     index 46a18e72bce61..6d5ef6220afe7 100644
3087     --- a/kernel/gcov/gcc_4_7.c
3088     +++ b/kernel/gcov/gcc_4_7.c
3089     @@ -18,7 +18,9 @@
3090     #include <linux/vmalloc.h>
3091     #include "gcov.h"
3092    
3093     -#if (__GNUC__ >= 7)
3094     +#if (__GNUC__ >= 10)
3095     +#define GCOV_COUNTERS 8
3096     +#elif (__GNUC__ >= 7)
3097     #define GCOV_COUNTERS 9
3098     #elif (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1)
3099     #define GCOV_COUNTERS 10
3100     diff --git a/net/core/skbuff.c b/net/core/skbuff.c
3101     index e72775024c6af..a4c4234976862 100644
3102     --- a/net/core/skbuff.c
3103     +++ b/net/core/skbuff.c
3104     @@ -4990,9 +4990,13 @@ static int pskb_carve_inside_nonlinear(struct sk_buff *skb, const u32 off,
3105     if (skb_has_frag_list(skb))
3106     skb_clone_fraglist(skb);
3107    
3108     - if (k == 0) {
3109     - /* split line is in frag list */
3110     - pskb_carve_frag_list(skb, shinfo, off - pos, gfp_mask);
3111     + /* split line is in frag list */
3112     + if (k == 0 && pskb_carve_frag_list(skb, shinfo, off - pos, gfp_mask)) {
3113     + /* skb_frag_unref() is not needed here as shinfo->nr_frags = 0. */
3114     + if (skb_has_frag_list(skb))
3115     + kfree_skb_list(skb_shinfo(skb)->frag_list);
3116     + kfree(data);
3117     + return -ENOMEM;
3118     }
3119     skb_release_data(skb);
3120    
3121     diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
3122     index eafc78e063f1d..185441d7a2814 100644
3123     --- a/net/sunrpc/rpcb_clnt.c
3124     +++ b/net/sunrpc/rpcb_clnt.c
3125     @@ -975,8 +975,8 @@ static int rpcb_dec_getaddr(struct rpc_rqst *req, struct xdr_stream *xdr,
3126     p = xdr_inline_decode(xdr, len);
3127     if (unlikely(p == NULL))
3128     goto out_fail;
3129     - dprintk("RPC: %5u RPCB_%s reply: %s\n", req->rq_task->tk_pid,
3130     - req->rq_task->tk_msg.rpc_proc->p_name, (char *)p);
3131     + dprintk("RPC: %5u RPCB_%s reply: %*pE\n", req->rq_task->tk_pid,
3132     + req->rq_task->tk_msg.rpc_proc->p_name, len, (char *)p);
3133    
3134     if (rpc_uaddr2sockaddr(req->rq_xprt->xprt_net, (char *)p, len,
3135     sap, sizeof(address)) == 0)
3136     diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c
3137     index 03c9872c31cfe..73264d5f58f81 100644
3138     --- a/sound/hda/hdac_device.c
3139     +++ b/sound/hda/hdac_device.c
3140     @@ -123,6 +123,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_device_init);
3141     void snd_hdac_device_exit(struct hdac_device *codec)
3142     {
3143     pm_runtime_put_noidle(&codec->dev);
3144     + /* keep balance of runtime PM child_count in parent device */
3145     + pm_runtime_set_suspended(&codec->dev);
3146     snd_hdac_bus_remove_device(codec->bus, codec);
3147     kfree(codec->vendor_name);
3148     kfree(codec->chip_name);
3149     diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
3150     index 2def4ad579ccf..4f8dd558af48f 100644
3151     --- a/sound/pci/hda/patch_hdmi.c
3152     +++ b/sound/pci/hda/patch_hdmi.c
3153     @@ -3224,6 +3224,7 @@ static int tegra_hdmi_build_pcms(struct hda_codec *codec)
3154    
3155     static int patch_tegra_hdmi(struct hda_codec *codec)
3156     {
3157     + struct hdmi_spec *spec;
3158     int err;
3159    
3160     err = patch_generic_hdmi(codec);
3161     @@ -3231,6 +3232,10 @@ static int patch_tegra_hdmi(struct hda_codec *codec)
3162     return err;
3163    
3164     codec->patch_ops.build_pcms = tegra_hdmi_build_pcms;
3165     + spec = codec->spec;
3166     + spec->chmap.ops.chmap_cea_alloc_validate_get_type =
3167     + nvhdmi_chmap_cea_alloc_validate_get_type;
3168     + spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate;
3169    
3170     return 0;
3171     }
3172     diff --git a/tools/perf/tests/pmu.c b/tools/perf/tests/pmu.c
3173     index 1802ad3f45b63..e2fab5229ec08 100644
3174     --- a/tools/perf/tests/pmu.c
3175     +++ b/tools/perf/tests/pmu.c
3176     @@ -169,6 +169,7 @@ int test__pmu(int subtest __maybe_unused)
3177     ret = 0;
3178     } while (0);
3179    
3180     + perf_pmu__del_formats(&formats);
3181     test_format_dir_put(format);
3182     return ret;
3183     }
3184     diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
3185     index 39abbf8276464..5f1ba6f84f5f7 100644
3186     --- a/tools/perf/util/pmu.c
3187     +++ b/tools/perf/util/pmu.c
3188     @@ -1018,6 +1018,17 @@ void perf_pmu__set_format(unsigned long *bits, long from, long to)
3189     set_bit(b, bits);
3190     }
3191    
3192     +void perf_pmu__del_formats(struct list_head *formats)
3193     +{
3194     + struct perf_pmu_format *fmt, *tmp;
3195     +
3196     + list_for_each_entry_safe(fmt, tmp, formats, list) {
3197     + list_del(&fmt->list);
3198     + free(fmt->name);
3199     + free(fmt);
3200     + }
3201     +}
3202     +
3203     static int sub_non_neg(int a, int b)
3204     {
3205     if (b > a)
3206     diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
3207     index 25712034c815b..fed6c3b56ce75 100644
3208     --- a/tools/perf/util/pmu.h
3209     +++ b/tools/perf/util/pmu.h
3210     @@ -71,6 +71,7 @@ int perf_pmu__new_format(struct list_head *list, char *name,
3211     int config, unsigned long *bits);
3212     void perf_pmu__set_format(unsigned long *bits, long from, long to);
3213     int perf_pmu__format_parse(char *dir, struct list_head *head);
3214     +void perf_pmu__del_formats(struct list_head *formats);
3215    
3216     struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu);
3217