Magellan Linux

Contents of /trunk/kernel-alx-legacy/patches-4.9/0272-4.9.173-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3608 - (show annotations) (download)
Fri Aug 14 07:34:29 2020 UTC (3 years, 9 months ago) by niro
File size: 28890 byte(s)
-added kerenl-alx-legacy pkg
1 diff --git a/Makefile b/Makefile
2 index 75cba5fbdb46..a4e35453f9e4 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 4
7 PATCHLEVEL = 9
8 -SUBLEVEL = 172
9 +SUBLEVEL = 173
10 EXTRAVERSION =
11 NAME = Roaring Lionus
12
13 diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
14 index 84df85ea6296..7efde03daadd 100644
15 --- a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
16 +++ b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
17 @@ -26,5 +26,5 @@
18 };
19
20 &hdmi {
21 - hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
22 + hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
23 };
24 diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
25 index e0280cac2484..fed72a5f3ffa 100644
26 --- a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
27 +++ b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
28 @@ -90,6 +90,7 @@
29 pinctrl-names = "default";
30 pinctrl-0 = <&pinctrl_enet>;
31 phy-mode = "rgmii";
32 + phy-reset-duration = <10>; /* in msecs */
33 phy-reset-gpios = <&gpio3 23 GPIO_ACTIVE_LOW>;
34 phy-supply = <&vdd_eth_io_reg>;
35 status = "disabled";
36 diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
37 index 8d665f1b29f8..f0fe566a9910 100644
38 --- a/arch/s390/include/asm/elf.h
39 +++ b/arch/s390/include/asm/elf.h
40 @@ -215,11 +215,14 @@ do { \
41
42 /*
43 * Cache aliasing on the latest machines calls for a mapping granularity
44 - * of 512KB. For 64-bit processes use a 512KB alignment and a randomization
45 - * of up to 1GB. For 31-bit processes the virtual address space is limited,
46 - * use no alignment and limit the randomization to 8MB.
47 + * of 512KB for the anonymous mapping base. For 64-bit processes use a
48 + * 512KB alignment and a randomization of up to 1GB. For 31-bit processes
49 + * the virtual address space is limited, use no alignment and limit the
50 + * randomization to 8MB.
51 + * For the additional randomization of the program break use 32MB for
52 + * 64-bit and 8MB for 31-bit.
53 */
54 -#define BRK_RND_MASK (is_compat_task() ? 0x7ffUL : 0x3ffffUL)
55 +#define BRK_RND_MASK (is_compat_task() ? 0x7ffUL : 0x1fffUL)
56 #define MMAP_RND_MASK (is_compat_task() ? 0x7ffUL : 0x3ff80UL)
57 #define MMAP_ALIGN_MASK (is_compat_task() ? 0 : 0x7fUL)
58 #define STACK_RND_MASK MMAP_RND_MASK
59 diff --git a/drivers/ata/libata-zpodd.c b/drivers/ata/libata-zpodd.c
60 index 0ad96c647541..7017a81d53cf 100644
61 --- a/drivers/ata/libata-zpodd.c
62 +++ b/drivers/ata/libata-zpodd.c
63 @@ -51,38 +51,52 @@ static int eject_tray(struct ata_device *dev)
64 /* Per the spec, only slot type and drawer type ODD can be supported */
65 static enum odd_mech_type zpodd_get_mech_type(struct ata_device *dev)
66 {
67 - char buf[16];
68 + char *buf;
69 unsigned int ret;
70 - struct rm_feature_desc *desc = (void *)(buf + 8);
71 + struct rm_feature_desc *desc;
72 struct ata_taskfile tf;
73 static const char cdb[] = { GPCMD_GET_CONFIGURATION,
74 2, /* only 1 feature descriptor requested */
75 0, 3, /* 3, removable medium feature */
76 0, 0, 0,/* reserved */
77 - 0, sizeof(buf),
78 + 0, 16,
79 0, 0, 0,
80 };
81
82 + buf = kzalloc(16, GFP_KERNEL);
83 + if (!buf)
84 + return ODD_MECH_TYPE_UNSUPPORTED;
85 + desc = (void *)(buf + 8);
86 +
87 ata_tf_init(dev, &tf);
88 tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
89 tf.command = ATA_CMD_PACKET;
90 tf.protocol = ATAPI_PROT_PIO;
91 - tf.lbam = sizeof(buf);
92 + tf.lbam = 16;
93
94 ret = ata_exec_internal(dev, &tf, cdb, DMA_FROM_DEVICE,
95 - buf, sizeof(buf), 0);
96 - if (ret)
97 + buf, 16, 0);
98 + if (ret) {
99 + kfree(buf);
100 return ODD_MECH_TYPE_UNSUPPORTED;
101 + }
102
103 - if (be16_to_cpu(desc->feature_code) != 3)
104 + if (be16_to_cpu(desc->feature_code) != 3) {
105 + kfree(buf);
106 return ODD_MECH_TYPE_UNSUPPORTED;
107 + }
108
109 - if (desc->mech_type == 0 && desc->load == 0 && desc->eject == 1)
110 + if (desc->mech_type == 0 && desc->load == 0 && desc->eject == 1) {
111 + kfree(buf);
112 return ODD_MECH_TYPE_SLOT;
113 - else if (desc->mech_type == 1 && desc->load == 0 && desc->eject == 1)
114 + } else if (desc->mech_type == 1 && desc->load == 0 &&
115 + desc->eject == 1) {
116 + kfree(buf);
117 return ODD_MECH_TYPE_DRAWER;
118 - else
119 + } else {
120 + kfree(buf);
121 return ODD_MECH_TYPE_UNSUPPORTED;
122 + }
123 }
124
125 /* Test if ODD is zero power ready by sense code */
126 diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
127 index aac84329c759..b863386be911 100644
128 --- a/drivers/gpio/gpiolib-of.c
129 +++ b/drivers/gpio/gpiolib-of.c
130 @@ -531,7 +531,13 @@ int of_gpiochip_add(struct gpio_chip *chip)
131
132 of_node_get(chip->of_node);
133
134 - return of_gpiochip_scan_gpios(chip);
135 + status = of_gpiochip_scan_gpios(chip);
136 + if (status) {
137 + of_node_put(chip->of_node);
138 + gpiochip_remove_pin_ranges(chip);
139 + }
140 +
141 + return status;
142 }
143
144 void of_gpiochip_remove(struct gpio_chip *chip)
145 diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
146 index 09a7cffbc46f..896b38f6f9c0 100644
147 --- a/drivers/leds/leds-pca9532.c
148 +++ b/drivers/leds/leds-pca9532.c
149 @@ -488,6 +488,7 @@ static int pca9532_probe(struct i2c_client *client,
150 const struct i2c_device_id *id)
151 {
152 int devid;
153 + const struct of_device_id *of_id;
154 struct pca9532_data *data = i2c_get_clientdata(client);
155 struct pca9532_platform_data *pca9532_pdata =
156 dev_get_platdata(&client->dev);
157 @@ -503,8 +504,11 @@ static int pca9532_probe(struct i2c_client *client,
158 dev_err(&client->dev, "no platform data\n");
159 return -EINVAL;
160 }
161 - devid = (int)(uintptr_t)of_match_device(
162 - of_pca9532_leds_match, &client->dev)->data;
163 + of_id = of_match_device(of_pca9532_leds_match,
164 + &client->dev);
165 + if (unlikely(!of_id))
166 + return -EINVAL;
167 + devid = (int)(uintptr_t) of_id->data;
168 } else {
169 devid = id->driver_data;
170 }
171 diff --git a/drivers/media/platform/vivid/vivid-vid-common.c b/drivers/media/platform/vivid/vivid-vid-common.c
172 index f9a810e3f521..5f052189a6c4 100644
173 --- a/drivers/media/platform/vivid/vivid-vid-common.c
174 +++ b/drivers/media/platform/vivid/vivid-vid-common.c
175 @@ -841,6 +841,7 @@ int vidioc_g_edid(struct file *file, void *_fh,
176 if (edid->start_block + edid->blocks > dev->edid_blocks)
177 edid->blocks = dev->edid_blocks - edid->start_block;
178 memcpy(edid->edid, dev->edid, edid->blocks * 128);
179 - cec_set_edid_phys_addr(edid->edid, edid->blocks * 128, adap->phys_addr);
180 + if (adap)
181 + cec_set_edid_phys_addr(edid->edid, edid->blocks * 128, adap->phys_addr);
182 return 0;
183 }
184 diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
185 index bd719e25dd76..2dd17e01e3a7 100644
186 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
187 +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
188 @@ -3184,6 +3184,7 @@ static ssize_t ehea_probe_port(struct device *dev,
189
190 if (ehea_add_adapter_mr(adapter)) {
191 pr_err("creating MR failed\n");
192 + of_node_put(eth_dn);
193 return -EIO;
194 }
195
196 diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
197 index 1edc973df4c4..7377dca6eb57 100644
198 --- a/drivers/net/ethernet/micrel/ks8851.c
199 +++ b/drivers/net/ethernet/micrel/ks8851.c
200 @@ -547,9 +547,8 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
201 /* set dma read address */
202 ks8851_wrreg16(ks, KS_RXFDPR, RXFDPR_RXFPAI | 0x00);
203
204 - /* start the packet dma process, and set auto-dequeue rx */
205 - ks8851_wrreg16(ks, KS_RXQCR,
206 - ks->rc_rxqcr | RXQCR_SDA | RXQCR_ADRFE);
207 + /* start DMA access */
208 + ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr | RXQCR_SDA);
209
210 if (rxlen > 4) {
211 unsigned int rxalign;
212 @@ -580,7 +579,8 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
213 }
214 }
215
216 - ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr);
217 + /* end DMA access and dequeue packet */
218 + ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr | RXQCR_RRXEF);
219 }
220 }
221
222 @@ -797,6 +797,15 @@ static void ks8851_tx_work(struct work_struct *work)
223 static int ks8851_net_open(struct net_device *dev)
224 {
225 struct ks8851_net *ks = netdev_priv(dev);
226 + int ret;
227 +
228 + ret = request_threaded_irq(dev->irq, NULL, ks8851_irq,
229 + IRQF_TRIGGER_LOW | IRQF_ONESHOT,
230 + dev->name, ks);
231 + if (ret < 0) {
232 + netdev_err(dev, "failed to get irq\n");
233 + return ret;
234 + }
235
236 /* lock the card, even if we may not actually be doing anything
237 * else at the moment */
238 @@ -861,6 +870,7 @@ static int ks8851_net_open(struct net_device *dev)
239 netif_dbg(ks, ifup, ks->netdev, "network device up\n");
240
241 mutex_unlock(&ks->lock);
242 + mii_check_link(&ks->mii);
243 return 0;
244 }
245
246 @@ -911,6 +921,8 @@ static int ks8851_net_stop(struct net_device *dev)
247 dev_kfree_skb(txb);
248 }
249
250 + free_irq(dev->irq, ks);
251 +
252 return 0;
253 }
254
255 @@ -1516,6 +1528,7 @@ static int ks8851_probe(struct spi_device *spi)
256
257 spi_set_drvdata(spi, ks);
258
259 + netif_carrier_off(ks->netdev);
260 ndev->if_port = IF_PORT_100BASET;
261 ndev->netdev_ops = &ks8851_netdev_ops;
262 ndev->irq = spi->irq;
263 @@ -1542,14 +1555,6 @@ static int ks8851_probe(struct spi_device *spi)
264 ks8851_read_selftest(ks);
265 ks8851_init_mac(ks);
266
267 - ret = request_threaded_irq(spi->irq, NULL, ks8851_irq,
268 - IRQF_TRIGGER_LOW | IRQF_ONESHOT,
269 - ndev->name, ks);
270 - if (ret < 0) {
271 - dev_err(&spi->dev, "failed to get irq\n");
272 - goto err_irq;
273 - }
274 -
275 ret = register_netdev(ndev);
276 if (ret) {
277 dev_err(&spi->dev, "failed to register network device\n");
278 @@ -1562,14 +1567,10 @@ static int ks8851_probe(struct spi_device *spi)
279
280 return 0;
281
282 -
283 err_netdev:
284 - free_irq(ndev->irq, ks);
285 -
286 -err_irq:
287 +err_id:
288 if (gpio_is_valid(gpio))
289 gpio_set_value(gpio, 0);
290 -err_id:
291 regulator_disable(ks->vdd_reg);
292 err_reg:
293 regulator_disable(ks->vdd_io);
294 @@ -1587,7 +1588,6 @@ static int ks8851_remove(struct spi_device *spi)
295 dev_info(&spi->dev, "remove\n");
296
297 unregister_netdev(priv->netdev);
298 - free_irq(spi->irq, priv);
299 if (gpio_is_valid(priv->gpio))
300 gpio_set_value(priv->gpio, 0);
301 regulator_disable(priv->vdd_reg);
302 diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
303 index 0a2318cad34d..63ebc491057b 100644
304 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
305 +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
306 @@ -1038,6 +1038,8 @@ int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode)
307
308 for (i = 0; i < QLCNIC_NUM_ILB_PKT; i++) {
309 skb = netdev_alloc_skb(adapter->netdev, QLCNIC_ILB_PKT_SIZE);
310 + if (!skb)
311 + break;
312 qlcnic_create_loopback_buff(skb->data, adapter->mac_addr);
313 skb_put(skb, QLCNIC_ILB_PKT_SIZE);
314 adapter->ahw->diag_cnt = 0;
315 diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
316 index d543298d6750..ff24524e7f46 100644
317 --- a/drivers/net/ethernet/ti/netcp_ethss.c
318 +++ b/drivers/net/ethernet/ti/netcp_ethss.c
319 @@ -3122,12 +3122,16 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
320
321 ret = netcp_txpipe_init(&gbe_dev->tx_pipe, netcp_device,
322 gbe_dev->dma_chan_name, gbe_dev->tx_queue_id);
323 - if (ret)
324 + if (ret) {
325 + of_node_put(interfaces);
326 return ret;
327 + }
328
329 ret = netcp_txpipe_open(&gbe_dev->tx_pipe);
330 - if (ret)
331 + if (ret) {
332 + of_node_put(interfaces);
333 return ret;
334 + }
335
336 /* Create network interfaces */
337 INIT_LIST_HEAD(&gbe_dev->gbe_intf_head);
338 diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
339 index c688d68c39aa..a8afc92cbfca 100644
340 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
341 +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
342 @@ -1548,12 +1548,14 @@ static int axienet_probe(struct platform_device *pdev)
343 ret = of_address_to_resource(np, 0, &dmares);
344 if (ret) {
345 dev_err(&pdev->dev, "unable to get DMA resource\n");
346 + of_node_put(np);
347 goto free_netdev;
348 }
349 lp->dma_regs = devm_ioremap_resource(&pdev->dev, &dmares);
350 if (IS_ERR(lp->dma_regs)) {
351 dev_err(&pdev->dev, "could not map DMA regs\n");
352 ret = PTR_ERR(lp->dma_regs);
353 + of_node_put(np);
354 goto free_netdev;
355 }
356 lp->rx_irq = irq_of_parse_and_map(np, 1);
357 diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
358 index f1f8227e7342..01f95d192d25 100644
359 --- a/drivers/net/usb/ipheth.c
360 +++ b/drivers/net/usb/ipheth.c
361 @@ -148,6 +148,7 @@ struct ipheth_device {
362 u8 bulk_in;
363 u8 bulk_out;
364 struct delayed_work carrier_work;
365 + bool confirmed_pairing;
366 };
367
368 static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags);
369 @@ -259,7 +260,7 @@ static void ipheth_rcvbulk_callback(struct urb *urb)
370
371 dev->net->stats.rx_packets++;
372 dev->net->stats.rx_bytes += len;
373 -
374 + dev->confirmed_pairing = true;
375 netif_rx(skb);
376 ipheth_rx_submit(dev, GFP_ATOMIC);
377 }
378 @@ -280,14 +281,24 @@ static void ipheth_sndbulk_callback(struct urb *urb)
379 dev_err(&dev->intf->dev, "%s: urb status: %d\n",
380 __func__, status);
381
382 - netif_wake_queue(dev->net);
383 + if (status == 0)
384 + netif_wake_queue(dev->net);
385 + else
386 + // on URB error, trigger immediate poll
387 + schedule_delayed_work(&dev->carrier_work, 0);
388 }
389
390 static int ipheth_carrier_set(struct ipheth_device *dev)
391 {
392 - struct usb_device *udev = dev->udev;
393 + struct usb_device *udev;
394 int retval;
395
396 + if (!dev)
397 + return 0;
398 + if (!dev->confirmed_pairing)
399 + return 0;
400 +
401 + udev = dev->udev;
402 retval = usb_control_msg(udev,
403 usb_rcvctrlpipe(udev, IPHETH_CTRL_ENDP),
404 IPHETH_CMD_CARRIER_CHECK, /* request */
405 @@ -302,11 +313,14 @@ static int ipheth_carrier_set(struct ipheth_device *dev)
406 return retval;
407 }
408
409 - if (dev->ctrl_buf[0] == IPHETH_CARRIER_ON)
410 + if (dev->ctrl_buf[0] == IPHETH_CARRIER_ON) {
411 netif_carrier_on(dev->net);
412 - else
413 + if (dev->tx_urb->status != -EINPROGRESS)
414 + netif_wake_queue(dev->net);
415 + } else {
416 netif_carrier_off(dev->net);
417 -
418 + netif_stop_queue(dev->net);
419 + }
420 return 0;
421 }
422
423 @@ -386,7 +400,6 @@ static int ipheth_open(struct net_device *net)
424 return retval;
425
426 schedule_delayed_work(&dev->carrier_work, IPHETH_CARRIER_CHECK_TIMEOUT);
427 - netif_start_queue(net);
428 return retval;
429 }
430
431 @@ -489,7 +502,7 @@ static int ipheth_probe(struct usb_interface *intf,
432 dev->udev = udev;
433 dev->net = netdev;
434 dev->intf = intf;
435 -
436 + dev->confirmed_pairing = false;
437 /* Set up endpoints */
438 hintf = usb_altnum_to_altsetting(intf, IPHETH_ALT_INTFNUM);
439 if (hintf == NULL) {
440 @@ -540,7 +553,9 @@ static int ipheth_probe(struct usb_interface *intf,
441 retval = -EIO;
442 goto err_register_netdev;
443 }
444 -
445 + // carrier down and transmit queues stopped until packet from device
446 + netif_carrier_off(netdev);
447 + netif_tx_stop_all_queues(netdev);
448 dev_info(&intf->dev, "Apple iPhone USB Ethernet device attached\n");
449 return 0;
450
451 diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c
452 index 237688af179b..f7630cf581cd 100644
453 --- a/drivers/s390/scsi/zfcp_fc.c
454 +++ b/drivers/s390/scsi/zfcp_fc.c
455 @@ -238,10 +238,6 @@ static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range,
456 list_for_each_entry(port, &adapter->port_list, list) {
457 if ((port->d_id & range) == (ntoh24(page->rscn_fid) & range))
458 zfcp_fc_test_link(port);
459 - if (!port->d_id)
460 - zfcp_erp_port_reopen(port,
461 - ZFCP_STATUS_COMMON_ERP_FAILED,
462 - "fcrscn1");
463 }
464 read_unlock_irqrestore(&adapter->port_list_lock, flags);
465 }
466 @@ -249,6 +245,7 @@ static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range,
467 static void zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req)
468 {
469 struct fsf_status_read_buffer *status_buffer = (void *)fsf_req->data;
470 + struct zfcp_adapter *adapter = fsf_req->adapter;
471 struct fc_els_rscn *head;
472 struct fc_els_rscn_page *page;
473 u16 i;
474 @@ -261,6 +258,22 @@ static void zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req)
475 /* see FC-FS */
476 no_entries = head->rscn_plen / sizeof(struct fc_els_rscn_page);
477
478 + if (no_entries > 1) {
479 + /* handle failed ports */
480 + unsigned long flags;
481 + struct zfcp_port *port;
482 +
483 + read_lock_irqsave(&adapter->port_list_lock, flags);
484 + list_for_each_entry(port, &adapter->port_list, list) {
485 + if (port->d_id)
486 + continue;
487 + zfcp_erp_port_reopen(port,
488 + ZFCP_STATUS_COMMON_ERP_FAILED,
489 + "fcrscn1");
490 + }
491 + read_unlock_irqrestore(&adapter->port_list_lock, flags);
492 + }
493 +
494 for (i = 1; i < no_entries; i++) {
495 /* skip head and start with 1st element */
496 page++;
497 diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
498 index f9f899ec9427..c158967b59d7 100644
499 --- a/drivers/scsi/qla4xxx/ql4_os.c
500 +++ b/drivers/scsi/qla4xxx/ql4_os.c
501 @@ -3207,6 +3207,8 @@ static int qla4xxx_conn_bind(struct iscsi_cls_session *cls_session,
502 if (iscsi_conn_bind(cls_session, cls_conn, is_leading))
503 return -EINVAL;
504 ep = iscsi_lookup_endpoint(transport_fd);
505 + if (!ep)
506 + return -EINVAL;
507 conn = cls_conn->dd_data;
508 qla_conn = conn->dd_data;
509 qla_conn->qla_ep = ep->dd_data;
510 diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c
511 index 9f61583af150..41b667c8385c 100644
512 --- a/drivers/staging/rtl8712/rtl8712_cmd.c
513 +++ b/drivers/staging/rtl8712/rtl8712_cmd.c
514 @@ -158,17 +158,9 @@ static u8 write_macreg_hdl(struct _adapter *padapter, u8 *pbuf)
515
516 static u8 read_bbreg_hdl(struct _adapter *padapter, u8 *pbuf)
517 {
518 - u32 val;
519 - void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
520 struct cmd_obj *pcmd = (struct cmd_obj *)pbuf;
521
522 - if (pcmd->rsp && pcmd->rspsz > 0)
523 - memcpy(pcmd->rsp, (u8 *)&val, pcmd->rspsz);
524 - pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
525 - if (!pcmd_callback)
526 - r8712_free_cmd_obj(pcmd);
527 - else
528 - pcmd_callback(padapter, pcmd);
529 + r8712_free_cmd_obj(pcmd);
530 return H2C_SUCCESS;
531 }
532
533 diff --git a/drivers/staging/rtl8712/rtl8712_cmd.h b/drivers/staging/rtl8712/rtl8712_cmd.h
534 index 67e9e910aef9..d10a59d4a550 100644
535 --- a/drivers/staging/rtl8712/rtl8712_cmd.h
536 +++ b/drivers/staging/rtl8712/rtl8712_cmd.h
537 @@ -152,7 +152,7 @@ enum rtl8712_h2c_cmd {
538 static struct _cmd_callback cmd_callback[] = {
539 {GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/
540 {GEN_CMD_CODE(_Write_MACREG), NULL},
541 - {GEN_CMD_CODE(_Read_BBREG), &r8712_getbbrfreg_cmdrsp_callback},
542 + {GEN_CMD_CODE(_Read_BBREG), NULL},
543 {GEN_CMD_CODE(_Write_BBREG), NULL},
544 {GEN_CMD_CODE(_Read_RFREG), &r8712_getbbrfreg_cmdrsp_callback},
545 {GEN_CMD_CODE(_Write_RFREG), NULL}, /*5*/
546 diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c
547 index 73137f4aac20..d4462512605b 100644
548 --- a/drivers/tty/serial/ar933x_uart.c
549 +++ b/drivers/tty/serial/ar933x_uart.c
550 @@ -52,11 +52,6 @@ struct ar933x_uart_port {
551 struct clk *clk;
552 };
553
554 -static inline bool ar933x_uart_console_enabled(void)
555 -{
556 - return IS_ENABLED(CONFIG_SERIAL_AR933X_CONSOLE);
557 -}
558 -
559 static inline unsigned int ar933x_uart_read(struct ar933x_uart_port *up,
560 int offset)
561 {
562 @@ -511,6 +506,7 @@ static struct uart_ops ar933x_uart_ops = {
563 .verify_port = ar933x_uart_verify_port,
564 };
565
566 +#ifdef CONFIG_SERIAL_AR933X_CONSOLE
567 static struct ar933x_uart_port *
568 ar933x_console_ports[CONFIG_SERIAL_AR933X_NR_UARTS];
569
570 @@ -607,14 +603,7 @@ static struct console ar933x_uart_console = {
571 .index = -1,
572 .data = &ar933x_uart_driver,
573 };
574 -
575 -static void ar933x_uart_add_console_port(struct ar933x_uart_port *up)
576 -{
577 - if (!ar933x_uart_console_enabled())
578 - return;
579 -
580 - ar933x_console_ports[up->port.line] = up;
581 -}
582 +#endif /* CONFIG_SERIAL_AR933X_CONSOLE */
583
584 static struct uart_driver ar933x_uart_driver = {
585 .owner = THIS_MODULE,
586 @@ -703,7 +692,9 @@ static int ar933x_uart_probe(struct platform_device *pdev)
587 baud = ar933x_uart_get_baud(port->uartclk, 0, AR933X_UART_MAX_STEP);
588 up->max_baud = min_t(unsigned int, baud, AR933X_UART_MAX_BAUD);
589
590 - ar933x_uart_add_console_port(up);
591 +#ifdef CONFIG_SERIAL_AR933X_CONSOLE
592 + ar933x_console_ports[up->port.line] = up;
593 +#endif
594
595 ret = uart_add_one_port(&ar933x_uart_driver, &up->port);
596 if (ret)
597 @@ -752,8 +743,9 @@ static int __init ar933x_uart_init(void)
598 {
599 int ret;
600
601 - if (ar933x_uart_console_enabled())
602 - ar933x_uart_driver.cons = &ar933x_uart_console;
603 +#ifdef CONFIG_SERIAL_AR933X_CONSOLE
604 + ar933x_uart_driver.cons = &ar933x_uart_console;
605 +#endif
606
607 ret = uart_register_driver(&ar933x_uart_driver);
608 if (ret)
609 diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
610 index ea6b62cece88..82451bb6622b 100644
611 --- a/drivers/tty/serial/sc16is7xx.c
612 +++ b/drivers/tty/serial/sc16is7xx.c
613 @@ -1482,7 +1482,7 @@ static int __init sc16is7xx_init(void)
614 ret = i2c_add_driver(&sc16is7xx_i2c_uart_driver);
615 if (ret < 0) {
616 pr_err("failed to init sc16is7xx i2c --> %d\n", ret);
617 - return ret;
618 + goto err_i2c;
619 }
620 #endif
621
622 @@ -1490,10 +1490,18 @@ static int __init sc16is7xx_init(void)
623 ret = spi_register_driver(&sc16is7xx_spi_uart_driver);
624 if (ret < 0) {
625 pr_err("failed to init sc16is7xx spi --> %d\n", ret);
626 - return ret;
627 + goto err_spi;
628 }
629 #endif
630 return ret;
631 +
632 +err_spi:
633 +#ifdef CONFIG_SERIAL_SC16IS7XX_I2C
634 + i2c_del_driver(&sc16is7xx_i2c_uart_driver);
635 +#endif
636 +err_i2c:
637 + uart_unregister_driver(&sc16is7xx_uart);
638 + return ret;
639 }
640 module_init(sc16is7xx_init);
641
642 diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c
643 index 40396a265a3f..f57d293a1791 100644
644 --- a/drivers/usb/gadget/udc/net2272.c
645 +++ b/drivers/usb/gadget/udc/net2272.c
646 @@ -958,6 +958,7 @@ net2272_dequeue(struct usb_ep *_ep, struct usb_request *_req)
647 break;
648 }
649 if (&req->req != _req) {
650 + ep->stopped = stopped;
651 spin_unlock_irqrestore(&ep->dev->lock, flags);
652 return -EINVAL;
653 }
654 diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c
655 index 7a8c36642293..dfaed8e8cc52 100644
656 --- a/drivers/usb/gadget/udc/net2280.c
657 +++ b/drivers/usb/gadget/udc/net2280.c
658 @@ -870,9 +870,6 @@ static void start_queue(struct net2280_ep *ep, u32 dmactl, u32 td_dma)
659 (void) readl(&ep->dev->pci->pcimstctl);
660
661 writel(BIT(DMA_START), &dma->dmastat);
662 -
663 - if (!ep->is_in)
664 - stop_out_naking(ep);
665 }
666
667 static void start_dma(struct net2280_ep *ep, struct net2280_request *req)
668 @@ -911,6 +908,7 @@ static void start_dma(struct net2280_ep *ep, struct net2280_request *req)
669 writel(BIT(DMA_START), &dma->dmastat);
670 return;
671 }
672 + stop_out_naking(ep);
673 }
674
675 tmp = dmactl_default;
676 @@ -1279,9 +1277,9 @@ static int net2280_dequeue(struct usb_ep *_ep, struct usb_request *_req)
677 break;
678 }
679 if (&req->req != _req) {
680 + ep->stopped = stopped;
681 spin_unlock_irqrestore(&ep->dev->lock, flags);
682 - dev_err(&ep->dev->pdev->dev, "%s: Request mismatch\n",
683 - __func__);
684 + ep_dbg(ep->dev, "%s: Request mismatch\n", __func__);
685 return -EINVAL;
686 }
687
688 diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
689 index 43618976d68a..3efb7b0e8269 100644
690 --- a/drivers/usb/host/u132-hcd.c
691 +++ b/drivers/usb/host/u132-hcd.c
692 @@ -3208,6 +3208,9 @@ static int __init u132_hcd_init(void)
693 printk(KERN_INFO "driver %s\n", hcd_name);
694 workqueue = create_singlethread_workqueue("u132");
695 retval = platform_driver_register(&u132_platform_driver);
696 + if (retval)
697 + destroy_workqueue(workqueue);
698 +
699 return retval;
700 }
701
702 diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
703 index 1d48e62f4f52..0d5b667c0e65 100644
704 --- a/drivers/vfio/vfio_iommu_type1.c
705 +++ b/drivers/vfio/vfio_iommu_type1.c
706 @@ -53,10 +53,16 @@ module_param_named(disable_hugepages,
707 MODULE_PARM_DESC(disable_hugepages,
708 "Disable VFIO IOMMU support for IOMMU hugepages.");
709
710 +static unsigned int dma_entry_limit __read_mostly = U16_MAX;
711 +module_param_named(dma_entry_limit, dma_entry_limit, uint, 0644);
712 +MODULE_PARM_DESC(dma_entry_limit,
713 + "Maximum number of user DMA mappings per container (65535).");
714 +
715 struct vfio_iommu {
716 struct list_head domain_list;
717 struct mutex lock;
718 struct rb_root dma_list;
719 + unsigned int dma_avail;
720 bool v2;
721 bool nesting;
722 };
723 @@ -384,6 +390,7 @@ static void vfio_remove_dma(struct vfio_iommu *iommu, struct vfio_dma *dma)
724 vfio_unmap_unpin(iommu, dma);
725 vfio_unlink_dma(iommu, dma);
726 kfree(dma);
727 + iommu->dma_avail++;
728 }
729
730 static unsigned long vfio_pgsize_bitmap(struct vfio_iommu *iommu)
731 @@ -584,12 +591,18 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu,
732 return -EEXIST;
733 }
734
735 + if (!iommu->dma_avail) {
736 + mutex_unlock(&iommu->lock);
737 + return -ENOSPC;
738 + }
739 +
740 dma = kzalloc(sizeof(*dma), GFP_KERNEL);
741 if (!dma) {
742 mutex_unlock(&iommu->lock);
743 return -ENOMEM;
744 }
745
746 + iommu->dma_avail--;
747 dma->iova = iova;
748 dma->vaddr = vaddr;
749 dma->prot = prot;
750 @@ -905,6 +918,7 @@ static void *vfio_iommu_type1_open(unsigned long arg)
751
752 INIT_LIST_HEAD(&iommu->domain_list);
753 iommu->dma_list = RB_ROOT;
754 + iommu->dma_avail = dma_entry_limit;
755 mutex_init(&iommu->lock);
756
757 return iommu;
758 diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
759 index 30d9d9e7057d..7a4052501866 100644
760 --- a/fs/ceph/inode.c
761 +++ b/fs/ceph/inode.c
762 @@ -523,6 +523,7 @@ static void ceph_i_callback(struct rcu_head *head)
763 struct inode *inode = container_of(head, struct inode, i_rcu);
764 struct ceph_inode_info *ci = ceph_inode(inode);
765
766 + kfree(ci->i_symlink);
767 kmem_cache_free(ceph_inode_cachep, ci);
768 }
769
770 @@ -554,7 +555,6 @@ void ceph_destroy_inode(struct inode *inode)
771 ceph_put_snap_realm(mdsc, realm);
772 }
773
774 - kfree(ci->i_symlink);
775 while ((n = rb_first(&ci->i_fragtree)) != NULL) {
776 frag = rb_entry(n, struct ceph_inode_frag, node);
777 rb_erase(n, &ci->i_fragtree);
778 diff --git a/fs/nfs/client.c b/fs/nfs/client.c
779 index ebecfb8fba06..28d8a57a9908 100644
780 --- a/fs/nfs/client.c
781 +++ b/fs/nfs/client.c
782 @@ -440,7 +440,7 @@ void nfs_init_timeout_values(struct rpc_timeout *to, int proto,
783 case XPRT_TRANSPORT_RDMA:
784 if (retrans == NFS_UNSPEC_RETRANS)
785 to->to_retries = NFS_DEF_TCP_RETRANS;
786 - if (timeo == NFS_UNSPEC_TIMEO || to->to_retries == 0)
787 + if (timeo == NFS_UNSPEC_TIMEO || to->to_initval == 0)
788 to->to_initval = NFS_DEF_TCP_TIMEO * HZ / 10;
789 if (to->to_initval > NFS_MAX_TCP_TIMEOUT)
790 to->to_initval = NFS_MAX_TCP_TIMEOUT;
791 diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c
792 index 38865deab3ac..0c96773d1829 100644
793 --- a/net/bridge/br_netfilter_hooks.c
794 +++ b/net/bridge/br_netfilter_hooks.c
795 @@ -512,6 +512,7 @@ static unsigned int br_nf_pre_routing(void *priv,
796 nf_bridge->ipv4_daddr = ip_hdr(skb)->daddr;
797
798 skb->protocol = htons(ETH_P_IP);
799 + skb->transport_header = skb->network_header + ip_hdr(skb)->ihl * 4;
800
801 NF_HOOK(NFPROTO_IPV4, NF_INET_PRE_ROUTING, state->net, state->sk, skb,
802 skb->dev, NULL,
803 diff --git a/net/bridge/br_netfilter_ipv6.c b/net/bridge/br_netfilter_ipv6.c
804 index a1b57cb07f1e..8c08dd07419f 100644
805 --- a/net/bridge/br_netfilter_ipv6.c
806 +++ b/net/bridge/br_netfilter_ipv6.c
807 @@ -235,6 +235,8 @@ unsigned int br_nf_pre_routing_ipv6(void *priv,
808 nf_bridge->ipv6_daddr = ipv6_hdr(skb)->daddr;
809
810 skb->protocol = htons(ETH_P_IPV6);
811 + skb->transport_header = skb->network_header + sizeof(struct ipv6hdr);
812 +
813 NF_HOOK(NFPROTO_IPV6, NF_INET_PRE_ROUTING, state->net, state->sk, skb,
814 skb->dev, NULL,
815 br_nf_pre_routing_finish_ipv6);
816 diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c
817 index 93820e0d8814..4ee8acded0a4 100644
818 --- a/net/netfilter/nft_set_rbtree.c
819 +++ b/net/netfilter/nft_set_rbtree.c
820 @@ -191,10 +191,6 @@ static void *nft_rbtree_deactivate(const struct net *net,
821 else if (d > 0)
822 parent = parent->rb_right;
823 else {
824 - if (!nft_set_elem_active(&rbe->ext, genmask)) {
825 - parent = parent->rb_left;
826 - continue;
827 - }
828 if (nft_rbtree_interval_end(rbe) &&
829 !nft_rbtree_interval_end(this)) {
830 parent = parent->rb_left;
831 @@ -203,6 +199,9 @@ static void *nft_rbtree_deactivate(const struct net *net,
832 nft_rbtree_interval_end(this)) {
833 parent = parent->rb_right;
834 continue;
835 + } else if (!nft_set_elem_active(&rbe->ext, genmask)) {
836 + parent = parent->rb_left;
837 + continue;
838 }
839 nft_set_elem_change_active(net, set, &rbe->ext);
840 return rbe;
841 diff --git a/scripts/kconfig/lxdialog/inputbox.c b/scripts/kconfig/lxdialog/inputbox.c
842 index d58de1dc5360..510049a7bd1d 100644
843 --- a/scripts/kconfig/lxdialog/inputbox.c
844 +++ b/scripts/kconfig/lxdialog/inputbox.c
845 @@ -126,7 +126,8 @@ do_resize:
846 case KEY_DOWN:
847 break;
848 case KEY_BACKSPACE:
849 - case 127:
850 + case 8: /* ^H */
851 + case 127: /* ^? */
852 if (pos) {
853 wattrset(dialog, dlg.inputbox.atr);
854 if (input_x == 0) {
855 diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
856 index d42d534a66cd..f7049e288e93 100644
857 --- a/scripts/kconfig/nconf.c
858 +++ b/scripts/kconfig/nconf.c
859 @@ -1046,7 +1046,7 @@ static int do_match(int key, struct match_state *state, int *ans)
860 state->match_direction = FIND_NEXT_MATCH_UP;
861 *ans = get_mext_match(state->pattern,
862 state->match_direction);
863 - } else if (key == KEY_BACKSPACE || key == 127) {
864 + } else if (key == KEY_BACKSPACE || key == 8 || key == 127) {
865 state->pattern[strlen(state->pattern)-1] = '\0';
866 adj_match_dir(&state->match_direction);
867 } else
868 diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c
869 index 4b2f44c20caf..9a65035cf787 100644
870 --- a/scripts/kconfig/nconf.gui.c
871 +++ b/scripts/kconfig/nconf.gui.c
872 @@ -439,7 +439,8 @@ int dialog_inputbox(WINDOW *main_window,
873 case KEY_F(F_EXIT):
874 case KEY_F(F_BACK):
875 break;
876 - case 127:
877 + case 8: /* ^H */
878 + case 127: /* ^? */
879 case KEY_BACKSPACE:
880 if (cursor_position > 0) {
881 memmove(&result[cursor_position-1],