diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-02 12:15:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-02 12:15:30 -0400 |
commit | 2c248f92fa4fae3036e656da2f9a077020a99f6e (patch) | |
tree | ac8985f5dcd0272e9d13c1304001c8b6f96e4d36 | |
parent | 345464fb760d1b772e891538b498e111c588b692 (diff) | |
parent | 1426bd2c9f7e3126e2678e7469dca9fd9fc6dd3e (diff) |
Merge tag 'usb-5.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH:
"Here are some small USB fixes that have been in linux-next this past
week for 5.3-rc7
They fix the usual xhci, syzbot reports, and other small issues that
have come up last week.
All have been in linux-next with no reported issues"
* tag 'usb-5.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
USB: cdc-wdm: fix race between write and disconnect due to flag abuse
usb: host: xhci: rcar: Fix typo in compatible string matching
usb: host: xhci-tegra: Set DMA mask correctly
USB: storage: ums-realtek: Whitelist auto-delink support
USB: storage: ums-realtek: Update module parameter description for auto_delink_en
usb: host: ohci: fix a race condition between shutdown and irq
usb: hcd: use managed device resources
typec: tcpm: fix a typo in the comparison of pdo_max_voltage
usb-storage: Add new JMS567 revision to unusual_devs
usb: chipidea: udc: don't do hardware access if gadget has stopped
usbtmc: more sanity checking for packet size
usb: udc: lpc32xx: silence fall-through warning
-rw-r--r-- | drivers/usb/chipidea/udc.c | 32 | ||||
-rw-r--r-- | drivers/usb/class/cdc-wdm.c | 16 | ||||
-rw-r--r-- | drivers/usb/class/usbtmc.c | 3 | ||||
-rw-r--r-- | drivers/usb/core/hcd-pci.c | 30 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/lpc32xx_udc.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/ohci-hcd.c | 15 | ||||
-rw-r--r-- | drivers/usb/host/xhci-rcar.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/xhci-tegra.c | 10 | ||||
-rw-r--r-- | drivers/usb/storage/realtek_cr.c | 15 | ||||
-rw-r--r-- | drivers/usb/storage/unusual_devs.h | 2 | ||||
-rw-r--r-- | drivers/usb/typec/tcpm/tcpm.c | 2 |
11 files changed, 82 insertions, 47 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 6a5ee8e6da10..67ad40b0a05b 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
@@ -709,12 +709,6 @@ static int _gadget_stop_activity(struct usb_gadget *gadget) | |||
709 | struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget); | 709 | struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget); |
710 | unsigned long flags; | 710 | unsigned long flags; |
711 | 711 | ||
712 | spin_lock_irqsave(&ci->lock, flags); | ||
713 | ci->gadget.speed = USB_SPEED_UNKNOWN; | ||
714 | ci->remote_wakeup = 0; | ||
715 | ci->suspended = 0; | ||
716 | spin_unlock_irqrestore(&ci->lock, flags); | ||
717 | |||
718 | /* flush all endpoints */ | 712 | /* flush all endpoints */ |
719 | gadget_for_each_ep(ep, gadget) { | 713 | gadget_for_each_ep(ep, gadget) { |
720 | usb_ep_fifo_flush(ep); | 714 | usb_ep_fifo_flush(ep); |
@@ -732,6 +726,12 @@ static int _gadget_stop_activity(struct usb_gadget *gadget) | |||
732 | ci->status = NULL; | 726 | ci->status = NULL; |
733 | } | 727 | } |
734 | 728 | ||
729 | spin_lock_irqsave(&ci->lock, flags); | ||
730 | ci->gadget.speed = USB_SPEED_UNKNOWN; | ||
731 | ci->remote_wakeup = 0; | ||
732 | ci->suspended = 0; | ||
733 | spin_unlock_irqrestore(&ci->lock, flags); | ||
734 | |||
735 | return 0; | 735 | return 0; |
736 | } | 736 | } |
737 | 737 | ||
@@ -1303,6 +1303,10 @@ static int ep_disable(struct usb_ep *ep) | |||
1303 | return -EBUSY; | 1303 | return -EBUSY; |
1304 | 1304 | ||
1305 | spin_lock_irqsave(hwep->lock, flags); | 1305 | spin_lock_irqsave(hwep->lock, flags); |
1306 | if (hwep->ci->gadget.speed == USB_SPEED_UNKNOWN) { | ||
1307 | spin_unlock_irqrestore(hwep->lock, flags); | ||
1308 | return 0; | ||
1309 | } | ||
1306 | 1310 | ||
1307 | /* only internal SW should disable ctrl endpts */ | 1311 | /* only internal SW should disable ctrl endpts */ |
1308 | 1312 | ||
@@ -1392,6 +1396,10 @@ static int ep_queue(struct usb_ep *ep, struct usb_request *req, | |||
1392 | return -EINVAL; | 1396 | return -EINVAL; |
1393 | 1397 | ||
1394 | spin_lock_irqsave(hwep->lock, flags); | 1398 | spin_lock_irqsave(hwep->lock, flags); |
1399 | if (hwep->ci->gadget.speed == USB_SPEED_UNKNOWN) { | ||
1400 | spin_unlock_irqrestore(hwep->lock, flags); | ||
1401 | return 0; | ||
1402 | } | ||
1395 | retval = _ep_queue(ep, req, gfp_flags); | 1403 | retval = _ep_queue(ep, req, gfp_flags); |
1396 | spin_unlock_irqrestore(hwep->lock, flags); | 1404 | spin_unlock_irqrestore(hwep->lock, flags); |
1397 | return retval; | 1405 | return retval; |
@@ -1415,8 +1423,8 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req) | |||
1415 | return -EINVAL; | 1423 | return -EINVAL; |
1416 | 1424 | ||
1417 | spin_lock_irqsave(hwep->lock, flags); | 1425 | spin_lock_irqsave(hwep->lock, flags); |
1418 | 1426 | if (hwep->ci->gadget.speed != USB_SPEED_UNKNOWN) | |
1419 | hw_ep_flush(hwep->ci, hwep->num, hwep->dir); | 1427 | hw_ep_flush(hwep->ci, hwep->num, hwep->dir); |
1420 | 1428 | ||
1421 | list_for_each_entry_safe(node, tmpnode, &hwreq->tds, td) { | 1429 | list_for_each_entry_safe(node, tmpnode, &hwreq->tds, td) { |
1422 | dma_pool_free(hwep->td_pool, node->ptr, node->dma); | 1430 | dma_pool_free(hwep->td_pool, node->ptr, node->dma); |
@@ -1487,6 +1495,10 @@ static void ep_fifo_flush(struct usb_ep *ep) | |||
1487 | } | 1495 | } |
1488 | 1496 | ||
1489 | spin_lock_irqsave(hwep->lock, flags); | 1497 | spin_lock_irqsave(hwep->lock, flags); |
1498 | if (hwep->ci->gadget.speed == USB_SPEED_UNKNOWN) { | ||
1499 | spin_unlock_irqrestore(hwep->lock, flags); | ||
1500 | return; | ||
1501 | } | ||
1490 | 1502 | ||
1491 | hw_ep_flush(hwep->ci, hwep->num, hwep->dir); | 1503 | hw_ep_flush(hwep->ci, hwep->num, hwep->dir); |
1492 | 1504 | ||
@@ -1559,6 +1571,10 @@ static int ci_udc_wakeup(struct usb_gadget *_gadget) | |||
1559 | int ret = 0; | 1571 | int ret = 0; |
1560 | 1572 | ||
1561 | spin_lock_irqsave(&ci->lock, flags); | 1573 | spin_lock_irqsave(&ci->lock, flags); |
1574 | if (ci->gadget.speed == USB_SPEED_UNKNOWN) { | ||
1575 | spin_unlock_irqrestore(&ci->lock, flags); | ||
1576 | return 0; | ||
1577 | } | ||
1562 | if (!ci->remote_wakeup) { | 1578 | if (!ci->remote_wakeup) { |
1563 | ret = -EOPNOTSUPP; | 1579 | ret = -EOPNOTSUPP; |
1564 | goto out; | 1580 | goto out; |
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index a7824a51f86d..70afb2ca1eab 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -587,10 +587,20 @@ static int wdm_flush(struct file *file, fl_owner_t id) | |||
587 | { | 587 | { |
588 | struct wdm_device *desc = file->private_data; | 588 | struct wdm_device *desc = file->private_data; |
589 | 589 | ||
590 | wait_event(desc->wait, !test_bit(WDM_IN_USE, &desc->flags)); | 590 | wait_event(desc->wait, |
591 | /* | ||
592 | * needs both flags. We cannot do with one | ||
593 | * because resetting it would cause a race | ||
594 | * with write() yet we need to signal | ||
595 | * a disconnect | ||
596 | */ | ||
597 | !test_bit(WDM_IN_USE, &desc->flags) || | ||
598 | test_bit(WDM_DISCONNECTING, &desc->flags)); | ||
591 | 599 | ||
592 | /* cannot dereference desc->intf if WDM_DISCONNECTING */ | 600 | /* cannot dereference desc->intf if WDM_DISCONNECTING */ |
593 | if (desc->werr < 0 && !test_bit(WDM_DISCONNECTING, &desc->flags)) | 601 | if (test_bit(WDM_DISCONNECTING, &desc->flags)) |
602 | return -ENODEV; | ||
603 | if (desc->werr < 0) | ||
594 | dev_err(&desc->intf->dev, "Error in flush path: %d\n", | 604 | dev_err(&desc->intf->dev, "Error in flush path: %d\n", |
595 | desc->werr); | 605 | desc->werr); |
596 | 606 | ||
@@ -974,8 +984,6 @@ static void wdm_disconnect(struct usb_interface *intf) | |||
974 | spin_lock_irqsave(&desc->iuspin, flags); | 984 | spin_lock_irqsave(&desc->iuspin, flags); |
975 | set_bit(WDM_DISCONNECTING, &desc->flags); | 985 | set_bit(WDM_DISCONNECTING, &desc->flags); |
976 | set_bit(WDM_READ, &desc->flags); | 986 | set_bit(WDM_READ, &desc->flags); |
977 | /* to terminate pending flushes */ | ||
978 | clear_bit(WDM_IN_USE, &desc->flags); | ||
979 | spin_unlock_irqrestore(&desc->iuspin, flags); | 987 | spin_unlock_irqrestore(&desc->iuspin, flags); |
980 | wake_up_all(&desc->wait); | 988 | wake_up_all(&desc->wait); |
981 | mutex_lock(&desc->rlock); | 989 | mutex_lock(&desc->rlock); |
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 4942122b2346..36858ddd8d9b 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c | |||
@@ -2362,8 +2362,11 @@ static int usbtmc_probe(struct usb_interface *intf, | |||
2362 | goto err_put; | 2362 | goto err_put; |
2363 | } | 2363 | } |
2364 | 2364 | ||
2365 | retcode = -EINVAL; | ||
2365 | data->bulk_in = bulk_in->bEndpointAddress; | 2366 | data->bulk_in = bulk_in->bEndpointAddress; |
2366 | data->wMaxPacketSize = usb_endpoint_maxp(bulk_in); | 2367 | data->wMaxPacketSize = usb_endpoint_maxp(bulk_in); |
2368 | if (!data->wMaxPacketSize) | ||
2369 | goto err_put; | ||
2367 | dev_dbg(&intf->dev, "Found bulk in endpoint at %u\n", data->bulk_in); | 2370 | dev_dbg(&intf->dev, "Found bulk in endpoint at %u\n", data->bulk_in); |
2368 | 2371 | ||
2369 | data->bulk_out = bulk_out->bEndpointAddress; | 2372 | data->bulk_out = bulk_out->bEndpointAddress; |
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 03432467b05f..7537681355f6 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c | |||
@@ -216,17 +216,18 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
216 | /* EHCI, OHCI */ | 216 | /* EHCI, OHCI */ |
217 | hcd->rsrc_start = pci_resource_start(dev, 0); | 217 | hcd->rsrc_start = pci_resource_start(dev, 0); |
218 | hcd->rsrc_len = pci_resource_len(dev, 0); | 218 | hcd->rsrc_len = pci_resource_len(dev, 0); |
219 | if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, | 219 | if (!devm_request_mem_region(&dev->dev, hcd->rsrc_start, |
220 | driver->description)) { | 220 | hcd->rsrc_len, driver->description)) { |
221 | dev_dbg(&dev->dev, "controller already in use\n"); | 221 | dev_dbg(&dev->dev, "controller already in use\n"); |
222 | retval = -EBUSY; | 222 | retval = -EBUSY; |
223 | goto put_hcd; | 223 | goto put_hcd; |
224 | } | 224 | } |
225 | hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len); | 225 | hcd->regs = devm_ioremap_nocache(&dev->dev, hcd->rsrc_start, |
226 | hcd->rsrc_len); | ||
226 | if (hcd->regs == NULL) { | 227 | if (hcd->regs == NULL) { |
227 | dev_dbg(&dev->dev, "error mapping memory\n"); | 228 | dev_dbg(&dev->dev, "error mapping memory\n"); |
228 | retval = -EFAULT; | 229 | retval = -EFAULT; |
229 | goto release_mem_region; | 230 | goto put_hcd; |
230 | } | 231 | } |
231 | 232 | ||
232 | } else { | 233 | } else { |
@@ -240,8 +241,8 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
240 | 241 | ||
241 | hcd->rsrc_start = pci_resource_start(dev, region); | 242 | hcd->rsrc_start = pci_resource_start(dev, region); |
242 | hcd->rsrc_len = pci_resource_len(dev, region); | 243 | hcd->rsrc_len = pci_resource_len(dev, region); |
243 | if (request_region(hcd->rsrc_start, hcd->rsrc_len, | 244 | if (devm_request_region(&dev->dev, hcd->rsrc_start, |
244 | driver->description)) | 245 | hcd->rsrc_len, driver->description)) |
245 | break; | 246 | break; |
246 | } | 247 | } |
247 | if (region == PCI_ROM_RESOURCE) { | 248 | if (region == PCI_ROM_RESOURCE) { |
@@ -275,20 +276,13 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
275 | } | 276 | } |
276 | 277 | ||
277 | if (retval != 0) | 278 | if (retval != 0) |
278 | goto unmap_registers; | 279 | goto put_hcd; |
279 | device_wakeup_enable(hcd->self.controller); | 280 | device_wakeup_enable(hcd->self.controller); |
280 | 281 | ||
281 | if (pci_dev_run_wake(dev)) | 282 | if (pci_dev_run_wake(dev)) |
282 | pm_runtime_put_noidle(&dev->dev); | 283 | pm_runtime_put_noidle(&dev->dev); |
283 | return retval; | 284 | return retval; |
284 | 285 | ||
285 | unmap_registers: | ||
286 | if (driver->flags & HCD_MEMORY) { | ||
287 | iounmap(hcd->regs); | ||
288 | release_mem_region: | ||
289 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | ||
290 | } else | ||
291 | release_region(hcd->rsrc_start, hcd->rsrc_len); | ||
292 | put_hcd: | 286 | put_hcd: |
293 | usb_put_hcd(hcd); | 287 | usb_put_hcd(hcd); |
294 | disable_pci: | 288 | disable_pci: |
@@ -347,14 +341,6 @@ void usb_hcd_pci_remove(struct pci_dev *dev) | |||
347 | dev_set_drvdata(&dev->dev, NULL); | 341 | dev_set_drvdata(&dev->dev, NULL); |
348 | up_read(&companions_rwsem); | 342 | up_read(&companions_rwsem); |
349 | } | 343 | } |
350 | |||
351 | if (hcd->driver->flags & HCD_MEMORY) { | ||
352 | iounmap(hcd->regs); | ||
353 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | ||
354 | } else { | ||
355 | release_region(hcd->rsrc_start, hcd->rsrc_len); | ||
356 | } | ||
357 | |||
358 | usb_put_hcd(hcd); | 344 | usb_put_hcd(hcd); |
359 | pci_disable_device(dev); | 345 | pci_disable_device(dev); |
360 | } | 346 | } |
diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c index 5f1b14f3e5a0..bb6af6b5ac97 100644 --- a/drivers/usb/gadget/udc/lpc32xx_udc.c +++ b/drivers/usb/gadget/udc/lpc32xx_udc.c | |||
@@ -2265,7 +2265,7 @@ static void udc_handle_ep0_setup(struct lpc32xx_udc *udc) | |||
2265 | default: | 2265 | default: |
2266 | break; | 2266 | break; |
2267 | } | 2267 | } |
2268 | 2268 | break; | |
2269 | 2269 | ||
2270 | case USB_REQ_SET_ADDRESS: | 2270 | case USB_REQ_SET_ADDRESS: |
2271 | if (reqtype == (USB_TYPE_STANDARD | USB_RECIP_DEVICE)) { | 2271 | if (reqtype == (USB_TYPE_STANDARD | USB_RECIP_DEVICE)) { |
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index b457fdaff297..1fe3deec35cf 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -419,8 +419,7 @@ static void ohci_usb_reset (struct ohci_hcd *ohci) | |||
419 | * other cases where the next software may expect clean state from the | 419 | * other cases where the next software may expect clean state from the |
420 | * "firmware". this is bus-neutral, unlike shutdown() methods. | 420 | * "firmware". this is bus-neutral, unlike shutdown() methods. |
421 | */ | 421 | */ |
422 | static void | 422 | static void _ohci_shutdown(struct usb_hcd *hcd) |
423 | ohci_shutdown (struct usb_hcd *hcd) | ||
424 | { | 423 | { |
425 | struct ohci_hcd *ohci; | 424 | struct ohci_hcd *ohci; |
426 | 425 | ||
@@ -436,6 +435,16 @@ ohci_shutdown (struct usb_hcd *hcd) | |||
436 | ohci->rh_state = OHCI_RH_HALTED; | 435 | ohci->rh_state = OHCI_RH_HALTED; |
437 | } | 436 | } |
438 | 437 | ||
438 | static void ohci_shutdown(struct usb_hcd *hcd) | ||
439 | { | ||
440 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); | ||
441 | unsigned long flags; | ||
442 | |||
443 | spin_lock_irqsave(&ohci->lock, flags); | ||
444 | _ohci_shutdown(hcd); | ||
445 | spin_unlock_irqrestore(&ohci->lock, flags); | ||
446 | } | ||
447 | |||
439 | /*-------------------------------------------------------------------------* | 448 | /*-------------------------------------------------------------------------* |
440 | * HC functions | 449 | * HC functions |
441 | *-------------------------------------------------------------------------*/ | 450 | *-------------------------------------------------------------------------*/ |
@@ -760,7 +769,7 @@ static void io_watchdog_func(struct timer_list *t) | |||
760 | died: | 769 | died: |
761 | usb_hc_died(ohci_to_hcd(ohci)); | 770 | usb_hc_died(ohci_to_hcd(ohci)); |
762 | ohci_dump(ohci); | 771 | ohci_dump(ohci); |
763 | ohci_shutdown(ohci_to_hcd(ohci)); | 772 | _ohci_shutdown(ohci_to_hcd(ohci)); |
764 | goto done; | 773 | goto done; |
765 | } else { | 774 | } else { |
766 | /* No write back because the done queue was empty */ | 775 | /* No write back because the done queue was empty */ |
diff --git a/drivers/usb/host/xhci-rcar.c b/drivers/usb/host/xhci-rcar.c index 8616c52849c6..2b0ccd150209 100644 --- a/drivers/usb/host/xhci-rcar.c +++ b/drivers/usb/host/xhci-rcar.c | |||
@@ -104,7 +104,7 @@ static int xhci_rcar_is_gen2(struct device *dev) | |||
104 | return of_device_is_compatible(node, "renesas,xhci-r8a7790") || | 104 | return of_device_is_compatible(node, "renesas,xhci-r8a7790") || |
105 | of_device_is_compatible(node, "renesas,xhci-r8a7791") || | 105 | of_device_is_compatible(node, "renesas,xhci-r8a7791") || |
106 | of_device_is_compatible(node, "renesas,xhci-r8a7793") || | 106 | of_device_is_compatible(node, "renesas,xhci-r8a7793") || |
107 | of_device_is_compatible(node, "renensas,rcar-gen2-xhci"); | 107 | of_device_is_compatible(node, "renesas,rcar-gen2-xhci"); |
108 | } | 108 | } |
109 | 109 | ||
110 | static int xhci_rcar_is_gen3(struct device *dev) | 110 | static int xhci_rcar_is_gen3(struct device *dev) |
diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c index dafc65911fc0..2ff7c911fbd0 100644 --- a/drivers/usb/host/xhci-tegra.c +++ b/drivers/usb/host/xhci-tegra.c | |||
@@ -1194,6 +1194,16 @@ static int tegra_xusb_probe(struct platform_device *pdev) | |||
1194 | 1194 | ||
1195 | tegra_xusb_config(tegra, regs); | 1195 | tegra_xusb_config(tegra, regs); |
1196 | 1196 | ||
1197 | /* | ||
1198 | * The XUSB Falcon microcontroller can only address 40 bits, so set | ||
1199 | * the DMA mask accordingly. | ||
1200 | */ | ||
1201 | err = dma_set_mask_and_coherent(tegra->dev, DMA_BIT_MASK(40)); | ||
1202 | if (err < 0) { | ||
1203 | dev_err(&pdev->dev, "failed to set DMA mask: %d\n", err); | ||
1204 | goto put_rpm; | ||
1205 | } | ||
1206 | |||
1197 | err = tegra_xusb_load_firmware(tegra); | 1207 | err = tegra_xusb_load_firmware(tegra); |
1198 | if (err < 0) { | 1208 | if (err < 0) { |
1199 | dev_err(&pdev->dev, "failed to load firmware: %d\n", err); | 1209 | dev_err(&pdev->dev, "failed to load firmware: %d\n", err); |
diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c index cc794e25a0b6..1d9ce9cbc831 100644 --- a/drivers/usb/storage/realtek_cr.c +++ b/drivers/usb/storage/realtek_cr.c | |||
@@ -38,7 +38,7 @@ MODULE_LICENSE("GPL"); | |||
38 | 38 | ||
39 | static int auto_delink_en = 1; | 39 | static int auto_delink_en = 1; |
40 | module_param(auto_delink_en, int, S_IRUGO | S_IWUSR); | 40 | module_param(auto_delink_en, int, S_IRUGO | S_IWUSR); |
41 | MODULE_PARM_DESC(auto_delink_en, "enable auto delink"); | 41 | MODULE_PARM_DESC(auto_delink_en, "auto delink mode (0=firmware, 1=software [default])"); |
42 | 42 | ||
43 | #ifdef CONFIG_REALTEK_AUTOPM | 43 | #ifdef CONFIG_REALTEK_AUTOPM |
44 | static int ss_en = 1; | 44 | static int ss_en = 1; |
@@ -996,12 +996,15 @@ static int init_realtek_cr(struct us_data *us) | |||
996 | goto INIT_FAIL; | 996 | goto INIT_FAIL; |
997 | } | 997 | } |
998 | 998 | ||
999 | if (CHECK_FW_VER(chip, 0x5888) || CHECK_FW_VER(chip, 0x5889) || | 999 | if (CHECK_PID(chip, 0x0138) || CHECK_PID(chip, 0x0158) || |
1000 | CHECK_FW_VER(chip, 0x5901)) | 1000 | CHECK_PID(chip, 0x0159)) { |
1001 | SET_AUTO_DELINK(chip); | 1001 | if (CHECK_FW_VER(chip, 0x5888) || CHECK_FW_VER(chip, 0x5889) || |
1002 | if (STATUS_LEN(chip) == 16) { | 1002 | CHECK_FW_VER(chip, 0x5901)) |
1003 | if (SUPPORT_AUTO_DELINK(chip)) | ||
1004 | SET_AUTO_DELINK(chip); | 1003 | SET_AUTO_DELINK(chip); |
1004 | if (STATUS_LEN(chip) == 16) { | ||
1005 | if (SUPPORT_AUTO_DELINK(chip)) | ||
1006 | SET_AUTO_DELINK(chip); | ||
1007 | } | ||
1005 | } | 1008 | } |
1006 | #ifdef CONFIG_REALTEK_AUTOPM | 1009 | #ifdef CONFIG_REALTEK_AUTOPM |
1007 | if (ss_en) | 1010 | if (ss_en) |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index ea0d27a94afe..1cd9b6305b06 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -2100,7 +2100,7 @@ UNUSUAL_DEV( 0x14cd, 0x6600, 0x0201, 0x0201, | |||
2100 | US_FL_IGNORE_RESIDUE ), | 2100 | US_FL_IGNORE_RESIDUE ), |
2101 | 2101 | ||
2102 | /* Reported by Michael Büsch <m@bues.ch> */ | 2102 | /* Reported by Michael Büsch <m@bues.ch> */ |
2103 | UNUSUAL_DEV( 0x152d, 0x0567, 0x0114, 0x0116, | 2103 | UNUSUAL_DEV( 0x152d, 0x0567, 0x0114, 0x0117, |
2104 | "JMicron", | 2104 | "JMicron", |
2105 | "USB to ATA/ATAPI Bridge", | 2105 | "USB to ATA/ATAPI Bridge", |
2106 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, | 2106 | USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 15abe1d9958f..bcfdb55fd198 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c | |||
@@ -1446,7 +1446,7 @@ static enum pdo_err tcpm_caps_err(struct tcpm_port *port, const u32 *pdo, | |||
1446 | else if ((pdo_min_voltage(pdo[i]) == | 1446 | else if ((pdo_min_voltage(pdo[i]) == |
1447 | pdo_min_voltage(pdo[i - 1])) && | 1447 | pdo_min_voltage(pdo[i - 1])) && |
1448 | (pdo_max_voltage(pdo[i]) == | 1448 | (pdo_max_voltage(pdo[i]) == |
1449 | pdo_min_voltage(pdo[i - 1]))) | 1449 | pdo_max_voltage(pdo[i - 1]))) |
1450 | return PDO_ERR_DUPE_PDO; | 1450 | return PDO_ERR_DUPE_PDO; |
1451 | break; | 1451 | break; |
1452 | /* | 1452 | /* |