Commit befdfffd authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'usb-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

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
parents 348ce85b 18266403
...@@ -198,7 +198,8 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev) ...@@ -198,7 +198,8 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev)
} else { } else {
int ret; int ret;
ret = phy_create_lookup(d_phy->usb11_phy, "usb-phy", "ohci.0"); ret = phy_create_lookup(d_phy->usb11_phy, "usb-phy",
"ohci-da8xx");
if (ret) if (ret)
dev_warn(dev, "Failed to create usb11 phy lookup\n"); dev_warn(dev, "Failed to create usb11 phy lookup\n");
ret = phy_create_lookup(d_phy->usb20_phy, "usb-phy", ret = phy_create_lookup(d_phy->usb20_phy, "usb-phy",
...@@ -216,7 +217,7 @@ static int da8xx_usb_phy_remove(struct platform_device *pdev) ...@@ -216,7 +217,7 @@ static int da8xx_usb_phy_remove(struct platform_device *pdev)
if (!pdev->dev.of_node) { if (!pdev->dev.of_node) {
phy_remove_lookup(d_phy->usb20_phy, "usb-phy", "musb-da8xx"); phy_remove_lookup(d_phy->usb20_phy, "usb-phy", "musb-da8xx");
phy_remove_lookup(d_phy->usb11_phy, "usb-phy", "ohci.0"); phy_remove_lookup(d_phy->usb11_phy, "usb-phy", "ohci-da8xx");
} }
return 0; return 0;
......
...@@ -249,21 +249,10 @@ static int rockchip_pcie_phy_init(struct phy *phy) ...@@ -249,21 +249,10 @@ static int rockchip_pcie_phy_init(struct phy *phy)
static int rockchip_pcie_phy_exit(struct phy *phy) static int rockchip_pcie_phy_exit(struct phy *phy)
{ {
struct rockchip_pcie_phy *rk_phy = phy_get_drvdata(phy); struct rockchip_pcie_phy *rk_phy = phy_get_drvdata(phy);
int err = 0;
clk_disable_unprepare(rk_phy->clk_pciephy_ref); clk_disable_unprepare(rk_phy->clk_pciephy_ref);
err = reset_control_deassert(rk_phy->phy_rst); return 0;
if (err) {
dev_err(&phy->dev, "deassert phy_rst err %d\n", err);
goto err_reset;
}
return err;
err_reset:
clk_prepare_enable(rk_phy->clk_pciephy_ref);
return err;
} }
static const struct phy_ops ops = { static const struct phy_ops ops = {
......
...@@ -264,7 +264,7 @@ static int sun4i_usb_phy_init(struct phy *_phy) ...@@ -264,7 +264,7 @@ static int sun4i_usb_phy_init(struct phy *_phy)
return ret; return ret;
} }
if (data->cfg->enable_pmu_unk1) { if (phy->pmu && data->cfg->enable_pmu_unk1) {
val = readl(phy->pmu + REG_PMU_UNK1); val = readl(phy->pmu + REG_PMU_UNK1);
writel(val & ~2, phy->pmu + REG_PMU_UNK1); writel(val & ~2, phy->pmu + REG_PMU_UNK1);
} }
......
...@@ -932,8 +932,6 @@ static int wait_serial_change(struct acm *acm, unsigned long arg) ...@@ -932,8 +932,6 @@ static int wait_serial_change(struct acm *acm, unsigned long arg)
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
struct async_icount old, new; struct async_icount old, new;
if (arg & (TIOCM_DSR | TIOCM_RI | TIOCM_CD))
return -EINVAL;
do { do {
spin_lock_irq(&acm->read_lock); spin_lock_irq(&acm->read_lock);
old = acm->oldcount; old = acm->oldcount;
...@@ -1161,6 +1159,8 @@ static int acm_probe(struct usb_interface *intf, ...@@ -1161,6 +1159,8 @@ static int acm_probe(struct usb_interface *intf,
if (quirks == IGNORE_DEVICE) if (quirks == IGNORE_DEVICE)
return -ENODEV; return -ENODEV;
memset(&h, 0x00, sizeof(struct usb_cdc_parsed_header));
num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR; num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR;
/* handle quirks deadly to normal probing*/ /* handle quirks deadly to normal probing*/
......
...@@ -769,15 +769,14 @@ static int dwc3_core_init(struct dwc3 *dwc) ...@@ -769,15 +769,14 @@ static int dwc3_core_init(struct dwc3 *dwc)
return 0; return 0;
err4: err4:
phy_power_off(dwc->usb2_generic_phy); phy_power_off(dwc->usb3_generic_phy);
err3: err3:
phy_power_off(dwc->usb3_generic_phy); phy_power_off(dwc->usb2_generic_phy);
err2: err2:
usb_phy_set_suspend(dwc->usb2_phy, 1); usb_phy_set_suspend(dwc->usb2_phy, 1);
usb_phy_set_suspend(dwc->usb3_phy, 1); usb_phy_set_suspend(dwc->usb3_phy, 1);
dwc3_core_exit(dwc);
err1: err1:
usb_phy_shutdown(dwc->usb2_phy); usb_phy_shutdown(dwc->usb2_phy);
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/reset.h> #include <linux/reset.h>
#include <linux/pinctrl/consumer.h>
#include <linux/usb/of.h> #include <linux/usb/of.h>
#include "core.h" #include "core.h"
......
...@@ -588,14 +588,6 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb, ...@@ -588,14 +588,6 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb,
req->length = length; req->length = length;
/* throttle high/super speed IRQ rate back slightly */
if (gadget_is_dualspeed(dev->gadget))
req->no_interrupt = (((dev->gadget->speed == USB_SPEED_HIGH ||
dev->gadget->speed == USB_SPEED_SUPER)) &&
!list_empty(&dev->tx_reqs))
? ((atomic_read(&dev->tx_qlen) % dev->qmult) != 0)
: 0;
retval = usb_ep_queue(in, req, GFP_ATOMIC); retval = usb_ep_queue(in, req, GFP_ATOMIC);
switch (retval) { switch (retval) {
default: default:
......
...@@ -995,6 +995,14 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev) ...@@ -995,6 +995,14 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
} }
val = readl(base + ext_cap_offset); val = readl(base + ext_cap_offset);
/* Auto handoff never worked for these devices. Force it and continue */
if ((pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241) ||
(pdev->vendor == PCI_VENDOR_ID_RENESAS
&& pdev->device == 0x0014)) {
val = (val | XHCI_HC_OS_OWNED) & ~XHCI_HC_BIOS_OWNED;
writel(val, base + ext_cap_offset);
}
/* If the BIOS owns the HC, signal that the OS wants it, and wait */ /* If the BIOS owns the HC, signal that the OS wants it, and wait */
if (val & XHCI_HC_BIOS_OWNED) { if (val & XHCI_HC_BIOS_OWNED) {
writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset); writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset);
......
...@@ -479,6 +479,7 @@ static int da8xx_probe(struct platform_device *pdev) ...@@ -479,6 +479,7 @@ static int da8xx_probe(struct platform_device *pdev)
glue->phy = devm_phy_get(&pdev->dev, "usb-phy"); glue->phy = devm_phy_get(&pdev->dev, "usb-phy");
if (IS_ERR(glue->phy)) { if (IS_ERR(glue->phy)) {
if (PTR_ERR(glue->phy) != -EPROBE_DEFER)
dev_err(&pdev->dev, "failed to get phy\n"); dev_err(&pdev->dev, "failed to get phy\n");
return PTR_ERR(glue->phy); return PTR_ERR(glue->phy);
} }
......
...@@ -2114,11 +2114,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) ...@@ -2114,11 +2114,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
musb->io.ep_offset = musb_flat_ep_offset; musb->io.ep_offset = musb_flat_ep_offset;
musb->io.ep_select = musb_flat_ep_select; musb->io.ep_select = musb_flat_ep_select;
} }
/* And override them with platform specific ops if specified. */
if (musb->ops->ep_offset)
musb->io.ep_offset = musb->ops->ep_offset;
if (musb->ops->ep_select)
musb->io.ep_select = musb->ops->ep_select;
/* At least tusb6010 has its own offsets */ /* At least tusb6010 has its own offsets */
if (musb->ops->ep_offset) if (musb->ops->ep_offset)
......
...@@ -56,8 +56,11 @@ static struct uwb_rc *uwb_rc_find_by_index(int index) ...@@ -56,8 +56,11 @@ static struct uwb_rc *uwb_rc_find_by_index(int index)
struct uwb_rc *rc = NULL; struct uwb_rc *rc = NULL;
dev = class_find_device(&uwb_rc_class, NULL, &index, uwb_rc_index_match); dev = class_find_device(&uwb_rc_class, NULL, &index, uwb_rc_index_match);
if (dev) if (dev) {
rc = dev_get_drvdata(dev); rc = dev_get_drvdata(dev);
put_device(dev);
}
return rc; return rc;
} }
...@@ -467,7 +470,9 @@ struct uwb_rc *__uwb_rc_try_get(struct uwb_rc *target_rc) ...@@ -467,7 +470,9 @@ struct uwb_rc *__uwb_rc_try_get(struct uwb_rc *target_rc)
if (dev) { if (dev) {
rc = dev_get_drvdata(dev); rc = dev_get_drvdata(dev);
__uwb_rc_get(rc); __uwb_rc_get(rc);
put_device(dev);
} }
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(__uwb_rc_try_get); EXPORT_SYMBOL_GPL(__uwb_rc_try_get);
...@@ -520,8 +525,11 @@ struct uwb_rc *uwb_rc_get_by_grandpa(const struct device *grandpa_dev) ...@@ -520,8 +525,11 @@ struct uwb_rc *uwb_rc_get_by_grandpa(const struct device *grandpa_dev)
dev = class_find_device(&uwb_rc_class, NULL, grandpa_dev, dev = class_find_device(&uwb_rc_class, NULL, grandpa_dev,
find_rc_grandpa); find_rc_grandpa);
if (dev) if (dev) {
rc = dev_get_drvdata(dev); rc = dev_get_drvdata(dev);
put_device(dev);
}
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(uwb_rc_get_by_grandpa); 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) ...@@ -553,8 +561,10 @@ struct uwb_rc *uwb_rc_get_by_dev(const struct uwb_dev_addr *addr)
struct uwb_rc *rc = NULL; struct uwb_rc *rc = NULL;
dev = class_find_device(&uwb_rc_class, NULL, addr, find_rc_dev); dev = class_find_device(&uwb_rc_class, NULL, addr, find_rc_dev);
if (dev) if (dev) {
rc = dev_get_drvdata(dev); rc = dev_get_drvdata(dev);
put_device(dev);
}
return rc; return rc;
} }
......
...@@ -97,6 +97,8 @@ static bool uwb_rc_class_device_exists(struct uwb_rc *target_rc) ...@@ -97,6 +97,8 @@ static bool uwb_rc_class_device_exists(struct uwb_rc *target_rc)
dev = class_find_device(&uwb_rc_class, NULL, target_rc, find_rc); dev = class_find_device(&uwb_rc_class, NULL, target_rc, find_rc);
put_device(dev);
return (dev != NULL); return (dev != NULL);
} }
......
...@@ -253,6 +253,13 @@ static inline int phy_set_mode(struct phy *phy, enum phy_mode mode) ...@@ -253,6 +253,13 @@ static inline int phy_set_mode(struct phy *phy, enum phy_mode mode)
return -ENOSYS; return -ENOSYS;
} }
static inline int phy_reset(struct phy *phy)
{
if (!phy)
return 0;
return -ENOSYS;
}
static inline int phy_get_bus_width(struct phy *phy) static inline int phy_get_bus_width(struct phy *phy)
{ {
return -ENOSYS; return -ENOSYS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment