Pull USB / PHY fixes from Greg KH: "Here are a number of small USB and PHY driver fixes for 4.9-rc5 Nothing major, just small fixes for reported issues, all of these have been in linux-next for a while with no reported issues" * tag 'usb-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: cdc-acm: fix TIOCMIWAIT cdc-acm: fix uninitialized variable drivers/usb: Skip auto handoff for TI and RENESAS usb controllers usb: musb: remove duplicated actions usb: musb: da8xx: Don't print phy error on -EPROBE_DEFER phy: sun4i: check PMU presence when poking unknown bit of pmu phy-rockchip-pcie: remove deassert of phy_rst from exit callback phy: da8xx-usb: rename the ohci device to ohci-da8xx phy: Add reset callback for not generic phy uwb: fix device reference leaks usb: gadget: u_ether: remove interrupt throttling usb: dwc3: st: add missing <linux/pinctrl/consumer.h> include usb: dwc3: Fix error handling for core init
Unified · Split
| @@ -198,7 +198,8 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev) · 197 unmodified lines | |||
| 198 | } else { | 198 | } else { |
| 199 | int ret; | 199 | int ret; |
| 200 | 200 | ||
| 201 | ret = phy_create_lookup(d_phy->usb11_phy, "usb-phy", "ohci.0"); | 201 | ret = phy_create_lookup(d_phy->usb11_phy, "usb-phy", |
| 202 | "ohci-da8xx"); | ||
| 202 | if (ret) | 203 | if (ret) |
| 203 | dev_warn(dev, "Failed to create usb11 phy lookup\n"); | 204 | dev_warn(dev, "Failed to create usb11 phy lookup\n"); |
| 204 | ret = phy_create_lookup(d_phy->usb20_phy, "usb-phy", | 205 | ret = phy_create_lookup(d_phy->usb20_phy, "usb-phy", |
| @@ -216,7 +217,7 @@ static int da8xx_usb_phy_remove(struct platform_device *pdev) · 11 unmodified lines | |||
| 216 | 217 | ||
| 217 | if (!pdev->dev.of_node) { | 218 | if (!pdev->dev.of_node) { |
| 218 | phy_remove_lookup(d_phy->usb20_phy, "usb-phy", "musb-da8xx"); | 219 | phy_remove_lookup(d_phy->usb20_phy, "usb-phy", "musb-da8xx"); |
| 219 | phy_remove_lookup(d_phy->usb11_phy, "usb-phy", "ohci.0"); | 220 | phy_remove_lookup(d_phy->usb11_phy, "usb-phy", "ohci-da8xx"); |
| 220 | } | 221 | } |
| 221 | 222 | ||
| 222 | return 0; | 223 | return 0; |
| @@ -249,21 +249,10 @@ err_refclk: · 248 unmodified lines | |||
| 249 | static int rockchip_pcie_phy_exit(struct phy *phy) | 249 | static int rockchip_pcie_phy_exit(struct phy *phy) |
| 250 | { | 250 | { |
| 251 | struct rockchip_pcie_phy *rk_phy = phy_get_drvdata(phy); | 251 | struct rockchip_pcie_phy *rk_phy = phy_get_drvdata(phy); |
| 252 | int err = 0; | ||
| 253 | 252 | ||
| 254 | clk_disable_unprepare(rk_phy->clk_pciephy_ref); | 253 | clk_disable_unprepare(rk_phy->clk_pciephy_ref); |
| 255 | 254 | ||
| 256 | err = reset_control_deassert(rk_phy->phy_rst); | 255 | return 0; |
| 257 | if (err) { | ||
| 258 | dev_err(&phy->dev, "deassert phy_rst err %d\n", err); | ||
| 259 | goto err_reset; | ||
| 260 | } | ||
| 261 | |||
| 262 | return err; | ||
| 263 | |||
| 264 | err_reset: | ||
| 265 | clk_prepare_enable(rk_phy->clk_pciephy_ref); | ||
| 266 | return err; | ||
| 267 | } | 256 | } |
| 268 | 257 | ||
| 269 | static const struct phy_ops ops = { | 258 | static const struct phy_ops ops = { |
| @@ -264,7 +264,7 @@ static int sun4i_usb_phy_init(struct phy *_phy) · 263 unmodified lines | |||
| 264 | return ret; | 264 | return ret; |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | if (data->cfg->enable_pmu_unk1) { | 267 | if (phy->pmu && data->cfg->enable_pmu_unk1) { |
| 268 | val = readl(phy->pmu + REG_PMU_UNK1); | 268 | val = readl(phy->pmu + REG_PMU_UNK1); |
| 269 | writel(val & ~2, phy->pmu + REG_PMU_UNK1); | 269 | writel(val & ~2, phy->pmu + REG_PMU_UNK1); |
| 270 | } | 270 | } |
| @@ -932,8 +932,6 @@ static int wait_serial_change(struct acm *acm, unsigned long arg) · 931 unmodified lines | |||
| 932 | DECLARE_WAITQUEUE(wait, current); | 932 | DECLARE_WAITQUEUE(wait, current); |
| 933 | struct async_icount old, new; | 933 | struct async_icount old, new; |
| 934 | 934 | ||
| 935 | if (arg & (TIOCM_DSR | TIOCM_RI | TIOCM_CD)) | ||
| 936 | return -EINVAL; | ||
| 937 | do { | 935 | do { |
| 938 | spin_lock_irq(&acm->read_lock); | 936 | spin_lock_irq(&acm->read_lock); |
| 939 | old = acm->oldcount; | 937 | old = acm->oldcount; |
| @@ -1161,6 +1159,8 @@ static int acm_probe(struct usb_interface *intf, · 221 unmodified lines | |||
| 1161 | if (quirks == IGNORE_DEVICE) | 1159 | if (quirks == IGNORE_DEVICE) |
| 1162 | return -ENODEV; | 1160 | return -ENODEV; |
| 1163 | 1161 | ||
| 1162 | memset(&h, 0x00, sizeof(struct usb_cdc_parsed_header)); | ||
| 1163 | |||
| 1164 | num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR; | 1164 | num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR; |
| 1165 | 1165 | ||
| 1166 | /* handle quirks deadly to normal probing*/ | 1166 | /* handle quirks deadly to normal probing*/ |
| @@ -769,15 +769,14 @@ static int dwc3_core_init(struct dwc3 *dwc) · 768 unmodified lines | |||
| 769 | return 0; | 769 | return 0; |
| 770 | 770 | ||
| 771 | err4: | 771 | err4: |
| 772 | phy_power_off(dwc->usb2_generic_phy); | 772 | phy_power_off(dwc->usb3_generic_phy); |
| 773 | 773 | ||
| 774 | err3: | 774 | err3: |
| 775 | phy_power_off(dwc->usb3_generic_phy); | 775 | phy_power_off(dwc->usb2_generic_phy); |
| 776 | 776 | ||
| 777 | err2: | 777 | err2: |
| 778 | usb_phy_set_suspend(dwc->usb2_phy, 1); | 778 | usb_phy_set_suspend(dwc->usb2_phy, 1); |
| 779 | usb_phy_set_suspend(dwc->usb3_phy, 1); | 779 | usb_phy_set_suspend(dwc->usb3_phy, 1); |
| 780 | dwc3_core_exit(dwc); | ||
| 781 | 780 | ||
| 782 | err1: | 781 | err1: |
| 783 | usb_phy_shutdown(dwc->usb2_phy); | 782 | usb_phy_shutdown(dwc->usb2_phy); |
| @@ -31,6 +31,7 @@ · 30 unmodified lines | |||
| 31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
| 32 | #include <linux/regmap.h> | 32 | #include <linux/regmap.h> |
| 33 | #include <linux/reset.h> | 33 | #include <linux/reset.h> |
| 34 | #include <linux/pinctrl/consumer.h> | ||
| 34 | #include <linux/usb/of.h> | 35 | #include <linux/usb/of.h> |
| 35 | 36 | ||
| 36 | #include "core.h" | 37 | #include "core.h" |
| @@ -588,14 +588,6 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb, · 587 unmodified lines | |||
| 588 | 588 | ||
| 589 | req->length = length; | 589 | req->length = length; |
| 590 | 590 | ||
| 591 | /* throttle high/super speed IRQ rate back slightly */ | ||
| 592 | if (gadget_is_dualspeed(dev->gadget)) | ||
| 593 | req->no_interrupt = (((dev->gadget->speed == USB_SPEED_HIGH || | ||
| 594 | dev->gadget->speed == USB_SPEED_SUPER)) && | ||
| 595 | !list_empty(&dev->tx_reqs)) | ||
| 596 | ? ((atomic_read(&dev->tx_qlen) % dev->qmult) != 0) | ||
| 597 | : 0; | ||
| 598 | |||
| 599 | retval = usb_ep_queue(in, req, GFP_ATOMIC); | 591 | retval = usb_ep_queue(in, req, GFP_ATOMIC); |
| 600 | switch (retval) { | 592 | switch (retval) { |
| 601 | default: | 593 | default: |
| @@ -995,6 +995,14 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev) · 994 unmodified lines | |||
| 995 | } | 995 | } |
| 996 | val = readl(base + ext_cap_offset); | 996 | val = readl(base + ext_cap_offset); |
| 997 | 997 | ||
| 998 | /* Auto handoff never worked for these devices. Force it and continue */ | ||
| 999 | if ((pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241) || | ||
| 1000 | (pdev->vendor == PCI_VENDOR_ID_RENESAS | ||
| 1001 | && pdev->device == 0x0014)) { | ||
| 1002 | val = (val | XHCI_HC_OS_OWNED) & ~XHCI_HC_BIOS_OWNED; | ||
| 1003 | writel(val, base + ext_cap_offset); | ||
| 1004 | } | ||
| 1005 | |||
| 998 | /* If the BIOS owns the HC, signal that the OS wants it, and wait */ | 1006 | /* If the BIOS owns the HC, signal that the OS wants it, and wait */ |
| 999 | if (val & XHCI_HC_BIOS_OWNED) { | 1007 | if (val & XHCI_HC_BIOS_OWNED) { |
| 1000 | writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset); | 1008 | writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset); |
| @@ -479,7 +479,8 @@ static int da8xx_probe(struct platform_device *pdev) · 478 unmodified lines | |||
| 479 | 479 | ||
| 480 | glue->phy = devm_phy_get(&pdev->dev, "usb-phy"); | 480 | glue->phy = devm_phy_get(&pdev->dev, "usb-phy"); |
| 481 | if (IS_ERR(glue->phy)) { | 481 | if (IS_ERR(glue->phy)) { |
| 482 | dev_err(&pdev->dev, "failed to get phy\n"); | 482 | if (PTR_ERR(glue->phy) != -EPROBE_DEFER) |
| 483 | dev_err(&pdev->dev, "failed to get phy\n"); | ||
| 483 | return PTR_ERR(glue->phy); | 484 | return PTR_ERR(glue->phy); |
| 484 | } | 485 | } |
| 485 | 486 | ||
| @@ -2114,11 +2114,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) · 2113 unmodified lines | |||
| 2114 | musb->io.ep_offset = musb_flat_ep_offset; | 2114 | musb->io.ep_offset = musb_flat_ep_offset; |
| 2115 | musb->io.ep_select = musb_flat_ep_select; | 2115 | musb->io.ep_select = musb_flat_ep_select; |
| 2116 | } | 2116 | } |
| 2117 | /* And override them with platform specific ops if specified. */ | ||
| 2118 | if (musb->ops->ep_offset) | ||
| 2119 | musb->io.ep_offset = musb->ops->ep_offset; | ||
| 2120 | if (musb->ops->ep_select) | ||
| 2121 | musb->io.ep_select = musb->ops->ep_select; | ||
| 2122 | 2117 | ||
| 2123 | /* At least tusb6010 has its own offsets */ | 2118 | /* At least tusb6010 has its own offsets */ |
| 2124 | if (musb->ops->ep_offset) | 2119 | if (musb->ops->ep_offset) |
| @@ -56,8 +56,11 @@ static struct uwb_rc *uwb_rc_find_by_index(int index) · 55 unmodified lines | |||
| 56 | struct uwb_rc *rc = NULL; | 56 | struct uwb_rc *rc = NULL; |
| 57 | 57 | ||
| 58 | dev = class_find_device(&uwb_rc_class, NULL, &index, uwb_rc_index_match); | 58 | dev = class_find_device(&uwb_rc_class, NULL, &index, uwb_rc_index_match); |
| 59 | if (dev) | 59 | if (dev) { |
| 60 | rc = dev_get_drvdata(dev); | 60 | rc = dev_get_drvdata(dev); |
| 61 | put_device(dev); | ||
| 62 | } | ||
| 63 | |||
| 61 | return rc; | 64 | return rc; |
| 62 | } | 65 | } |
| 63 | 66 | ||
| @@ -467,7 +470,9 @@ struct uwb_rc *__uwb_rc_try_get(struct uwb_rc *target_rc) · 403 unmodified lines | |||
| 467 | if (dev) { | 470 | if (dev) { |
| 468 | rc = dev_get_drvdata(dev); | 471 | rc = dev_get_drvdata(dev); |
| 469 | __uwb_rc_get(rc); | 472 | __uwb_rc_get(rc); |
| 473 | put_device(dev); | ||
| 470 | } | 474 | } |
| 475 | |||
| 471 | return rc; | 476 | return rc; |
| 472 | } | 477 | } |
| 473 | EXPORT_SYMBOL_GPL(__uwb_rc_try_get); | 478 | EXPORT_SYMBOL_GPL(__uwb_rc_try_get); |
| @@ -520,8 +525,11 @@ struct uwb_rc *uwb_rc_get_by_grandpa(const struct device *grandpa_dev) · 46 unmodified lines | |||
| 520 | 525 | ||
| 521 | dev = class_find_device(&uwb_rc_class, NULL, grandpa_dev, | 526 | dev = class_find_device(&uwb_rc_class, NULL, grandpa_dev, |
| 522 | find_rc_grandpa); | 527 | find_rc_grandpa); |
| 523 | if (dev) | 528 | if (dev) { |
| 524 | rc = dev_get_drvdata(dev); | 529 | rc = dev_get_drvdata(dev); |
| 530 | put_device(dev); | ||
| 531 | } | ||
| 532 | |||
| 525 | return rc; | 533 | return rc; |
| 526 | } | 534 | } |
| 527 | EXPORT_SYMBOL_GPL(uwb_rc_get_by_grandpa); | 535 | EXPORT_SYMBOL_GPL(uwb_rc_get_by_grandpa); |
| @@ -553,8 +561,10 @@ struct uwb_rc *uwb_rc_get_by_dev(const struct uwb_dev_addr *addr) · 25 unmodified lines | |||
| 553 | struct uwb_rc *rc = NULL; | 561 | struct uwb_rc *rc = NULL; |
| 554 | 562 | ||
| 555 | dev = class_find_device(&uwb_rc_class, NULL, addr, find_rc_dev); | 563 | dev = class_find_device(&uwb_rc_class, NULL, addr, find_rc_dev); |
| 556 | if (dev) | 564 | if (dev) { |
| 557 | rc = dev_get_drvdata(dev); | 565 | rc = dev_get_drvdata(dev); |
| 566 | put_device(dev); | ||
| 567 | } | ||
| 558 | 568 | ||
| 559 | return rc; | 569 | return rc; |
| 560 | } | 570 | } |
| @@ -97,6 +97,8 @@ static bool uwb_rc_class_device_exists(struct uwb_rc *target_rc) · 96 unmodified lines | |||
| 97 | 97 | ||
| 98 | dev = class_find_device(&uwb_rc_class, NULL, target_rc, find_rc); | 98 | dev = class_find_device(&uwb_rc_class, NULL, target_rc, find_rc); |
| 99 | 99 | ||
| 100 | put_device(dev); | ||
| 101 | |||
| 100 | return (dev != NULL); | 102 | return (dev != NULL); |
| 101 | } | 103 | } |
| 102 | 104 | ||
| @@ -253,6 +253,13 @@ static inline int phy_set_mode(struct phy *phy, enum phy_mode mode) · 252 unmodified lines | |||
| 253 | return -ENOSYS; | 253 | return -ENOSYS; |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | static inline int phy_reset(struct phy *phy) | ||
| 257 | { | ||
| 258 | if (!phy) | ||
| 259 | return 0; | ||
| 260 | return -ENOSYS; | ||
| 261 | } | ||
| 262 | |||
| 256 | static inline int phy_get_bus_width(struct phy *phy) | 263 | static inline int phy_get_bus_width(struct phy *phy) |
| 257 | { | 264 | { |
| 258 | return -ENOSYS; | 265 | return -ENOSYS; |