Skip to content

Commit

Permalink
Merge tag 'usb-4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Linus Torvalds committed Nov 13, 2016
2 parents 348ce85 + 1826640 commit befdfff
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 37 deletions.
5 changes: 3 additions & 2 deletions drivers/phy/phy-da8xx-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev)
} else {
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)
dev_warn(dev, "Failed to create usb11 phy lookup\n");
ret = phy_create_lookup(d_phy->usb20_phy, "usb-phy",
Expand All @@ -216,7 +217,7 @@ static int da8xx_usb_phy_remove(struct platform_device *pdev)

if (!pdev->dev.of_node) {
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;
Expand Down
13 changes: 1 addition & 12 deletions drivers/phy/phy-rockchip-pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,21 +249,10 @@ static int rockchip_pcie_phy_init(struct phy *phy)
static int rockchip_pcie_phy_exit(struct phy *phy)
{
struct rockchip_pcie_phy *rk_phy = phy_get_drvdata(phy);
int err = 0;

clk_disable_unprepare(rk_phy->clk_pciephy_ref);

err = reset_control_deassert(rk_phy->phy_rst);
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;
return 0;
}

static const struct phy_ops ops = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/phy/phy-sun4i-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static int sun4i_usb_phy_init(struct phy *_phy)
return ret;
}

if (data->cfg->enable_pmu_unk1) {
if (phy->pmu && data->cfg->enable_pmu_unk1) {
val = readl(phy->pmu + REG_PMU_UNK1);
writel(val & ~2, phy->pmu + REG_PMU_UNK1);
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,8 +932,6 @@ static int wait_serial_change(struct acm *acm, unsigned long arg)
DECLARE_WAITQUEUE(wait, current);
struct async_icount old, new;

if (arg & (TIOCM_DSR | TIOCM_RI | TIOCM_CD))
return -EINVAL;
do {
spin_lock_irq(&acm->read_lock);
old = acm->oldcount;
Expand Down Expand Up @@ -1161,6 +1159,8 @@ static int acm_probe(struct usb_interface *intf,
if (quirks == IGNORE_DEVICE)
return -ENODEV;

memset(&h, 0x00, sizeof(struct usb_cdc_parsed_header));

num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR;

/* handle quirks deadly to normal probing*/
Expand Down
5 changes: 2 additions & 3 deletions drivers/usb/dwc3/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,15 +769,14 @@ static int dwc3_core_init(struct dwc3 *dwc)
return 0;

err4:
phy_power_off(dwc->usb2_generic_phy);
phy_power_off(dwc->usb3_generic_phy);

err3:
phy_power_off(dwc->usb3_generic_phy);
phy_power_off(dwc->usb2_generic_phy);

err2:
usb_phy_set_suspend(dwc->usb2_phy, 1);
usb_phy_set_suspend(dwc->usb3_phy, 1);
dwc3_core_exit(dwc);

err1:
usb_phy_shutdown(dwc->usb2_phy);
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/dwc3/dwc3-st.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/slab.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/pinctrl/consumer.h>
#include <linux/usb/of.h>

#include "core.h"
Expand Down
8 changes: 0 additions & 8 deletions drivers/usb/gadget/function/u_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,14 +588,6 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb,

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);
switch (retval) {
default:
Expand Down
8 changes: 8 additions & 0 deletions drivers/usb/host/pci-quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,14 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
}
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 (val & XHCI_HC_BIOS_OWNED) {
writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset);
Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/musb/da8xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ static int da8xx_probe(struct platform_device *pdev)

glue->phy = devm_phy_get(&pdev->dev, "usb-phy");
if (IS_ERR(glue->phy)) {
dev_err(&pdev->dev, "failed to get phy\n");
if (PTR_ERR(glue->phy) != -EPROBE_DEFER)
dev_err(&pdev->dev, "failed to get phy\n");
return PTR_ERR(glue->phy);
}

Expand Down
5 changes: 0 additions & 5 deletions drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_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 */
if (musb->ops->ep_offset)
Expand Down
16 changes: 13 additions & 3 deletions drivers/uwb/lc-rc.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ static struct uwb_rc *uwb_rc_find_by_index(int index)
struct uwb_rc *rc = NULL;

dev = class_find_device(&uwb_rc_class, NULL, &index, uwb_rc_index_match);
if (dev)
if (dev) {
rc = dev_get_drvdata(dev);
put_device(dev);
}

return rc;
}

Expand Down Expand Up @@ -467,7 +470,9 @@ struct uwb_rc *__uwb_rc_try_get(struct uwb_rc *target_rc)
if (dev) {
rc = dev_get_drvdata(dev);
__uwb_rc_get(rc);
put_device(dev);
}

return rc;
}
EXPORT_SYMBOL_GPL(__uwb_rc_try_get);
Expand Down Expand Up @@ -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,
find_rc_grandpa);
if (dev)
if (dev) {
rc = dev_get_drvdata(dev);
put_device(dev);
}

return rc;
}
EXPORT_SYMBOL_GPL(uwb_rc_get_by_grandpa);
Expand Down Expand Up @@ -553,8 +561,10 @@ struct uwb_rc *uwb_rc_get_by_dev(const struct uwb_dev_addr *addr)
struct uwb_rc *rc = NULL;

dev = class_find_device(&uwb_rc_class, NULL, addr, find_rc_dev);
if (dev)
if (dev) {
rc = dev_get_drvdata(dev);
put_device(dev);
}

return rc;
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/uwb/pal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

put_device(dev);

return (dev != NULL);
}

Expand Down
7 changes: 7 additions & 0 deletions include/linux/phy/phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,13 @@ static inline int phy_set_mode(struct phy *phy, enum phy_mode mode)
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)
{
return -ENOSYS;
Expand Down

0 comments on commit befdfff

Please sign in to comment.