aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-11-13 13:10:46 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-11-13 13:10:46 -0500
commitbefdfffdbdacd59b02eb162f5fbf05b9f67198ed (patch)
treeaaa6391c758486850f30b03a36e4e885949d25bd
parent348ce85b0ac6feb2972414f81362c5a5f292354e (diff)
parent18266403f3fe507f0246faa1d5432333a2f139ca (diff)
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
-rw-r--r--drivers/phy/phy-da8xx-usb.c5
-rw-r--r--drivers/phy/phy-rockchip-pcie.c13
-rw-r--r--drivers/phy/phy-sun4i-usb.c2
-rw-r--r--drivers/usb/class/cdc-acm.c4
-rw-r--r--drivers/usb/dwc3/core.c5
-rw-r--r--drivers/usb/dwc3/dwc3-st.c1
-rw-r--r--drivers/usb/gadget/function/u_ether.c8
-rw-r--r--drivers/usb/host/pci-quirks.c8
-rw-r--r--drivers/usb/musb/da8xx.c3
-rw-r--r--drivers/usb/musb/musb_core.c5
-rw-r--r--drivers/uwb/lc-rc.c16
-rw-r--r--drivers/uwb/pal.c2
-rw-r--r--include/linux/phy/phy.h7
13 files changed, 42 insertions, 37 deletions
diff --git a/drivers/phy/phy-da8xx-usb.c b/drivers/phy/phy-da8xx-usb.c
index 32ae78c8ca17..c85fb0b59729 100644
--- a/drivers/phy/phy-da8xx-usb.c
+++ b/drivers/phy/phy-da8xx-usb.c
@@ -198,7 +198,8 @@ static int da8xx_usb_phy_probe(struct platform_device *pdev)
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)
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;
diff --git a/drivers/phy/phy-rockchip-pcie.c b/drivers/phy/phy-rockchip-pcie.c
index a2b4c6b58aea..6904633cad68 100644
--- a/drivers/phy/phy-rockchip-pcie.c
+++ b/drivers/phy/phy-rockchip-pcie.c
@@ -249,21 +249,10 @@ err_refclk:
249static int rockchip_pcie_phy_exit(struct phy *phy) 249static 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
264err_reset:
265 clk_prepare_enable(rk_phy->clk_pciephy_ref);
266 return err;
267} 256}
268 257
269static const struct phy_ops ops = { 258static const struct phy_ops ops = {
diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
index b9342a2af7b3..fec34f5213c4 100644
--- a/drivers/phy/phy-sun4i-usb.c
+++ b/drivers/phy/phy-sun4i-usb.c
@@ -264,7 +264,7 @@ static int sun4i_usb_phy_init(struct phy *_phy)
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 }
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 78f0f85bebdc..fada988512a1 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -932,8 +932,6 @@ static int wait_serial_change(struct acm *acm, unsigned long arg)
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,
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*/
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 7287a763cd0c..fea446900cad 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -769,15 +769,14 @@ static int dwc3_core_init(struct dwc3 *dwc)
769 return 0; 769 return 0;
770 770
771err4: 771err4:
772 phy_power_off(dwc->usb2_generic_phy); 772 phy_power_off(dwc->usb3_generic_phy);
773 773
774err3: 774err3:
775 phy_power_off(dwc->usb3_generic_phy); 775 phy_power_off(dwc->usb2_generic_phy);
776 776
777err2: 777err2:
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
782err1: 781err1:
783 usb_phy_shutdown(dwc->usb2_phy); 782 usb_phy_shutdown(dwc->usb2_phy);
diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
index 89a2f712fdfe..aaaf256f71dd 100644
--- a/drivers/usb/dwc3/dwc3-st.c
+++ b/drivers/usb/dwc3/dwc3-st.c
@@ -31,6 +31,7 @@
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"
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index fe1811650dbc..5d1bd13a56c1 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -588,14 +588,6 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb,
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:
diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index d793f548dfe2..a9a1e4c40480 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -995,6 +995,14 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
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);
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 210b7e43a6fd..2440f88e07a3 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -479,7 +479,8 @@ static int da8xx_probe(struct platform_device *pdev)
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
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 27dadc0d9114..e01116e4c067 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2114,11 +2114,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
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)
diff --git a/drivers/uwb/lc-rc.c b/drivers/uwb/lc-rc.c
index d059ad4d0dbd..97ee1b46db69 100644
--- a/drivers/uwb/lc-rc.c
+++ b/drivers/uwb/lc-rc.c
@@ -56,8 +56,11 @@ static struct uwb_rc *uwb_rc_find_by_index(int index)
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)
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}
473EXPORT_SYMBOL_GPL(__uwb_rc_try_get); 478EXPORT_SYMBOL_GPL(__uwb_rc_try_get);
@@ -520,8 +525,11 @@ struct uwb_rc *uwb_rc_get_by_grandpa(const struct device *grandpa_dev)
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}
527EXPORT_SYMBOL_GPL(uwb_rc_get_by_grandpa); 535EXPORT_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 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}
diff --git a/drivers/uwb/pal.c b/drivers/uwb/pal.c
index c1304b8d4985..678e93741ae1 100644
--- a/drivers/uwb/pal.c
+++ b/drivers/uwb/pal.c
@@ -97,6 +97,8 @@ static bool uwb_rc_class_device_exists(struct uwb_rc *target_rc)
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
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index ee1bed7dbfc6..78bb0d7f6b11 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -253,6 +253,13 @@ static inline int phy_set_mode(struct phy *phy, enum phy_mode mode)
253 return -ENOSYS; 253 return -ENOSYS;
254} 254}
255 255
256static inline int phy_reset(struct phy *phy)
257{
258 if (!phy)
259 return 0;
260 return -ENOSYS;
261}
262
256static inline int phy_get_bus_width(struct phy *phy) 263static inline int phy_get_bus_width(struct phy *phy)
257{ 264{
258 return -ENOSYS; 265 return -ENOSYS;