Skip to content

Commit

Permalink
Merge tag 'usb-3.6-rc3' 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 patches from Greg Kroah-Hartman:
 "Here are a number of small USB patches for 3.6-rc3.

  The "large" one is just a number of device id updates to the option
  driver, done by the manufacturer, properly fixing up the device ids
  based on shipping devices.

  Other than that, some gadget driver fixes, the obligitary XHCI
  patches, and some other device ids and bugs fixed.

  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

* tag 'usb-3.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (26 commits)
  USB: qcserial: fix port handling on Gobi 1K and 2K+
  USB: serial: Fix mos7840 timeout
  USB: option: add ZTE K5006-Z
  usb: gadget: u_ether: fix kworker 100% CPU issue with still used interfaces in eth_stop
  usb: host: tegra: fix warning messages in ehci_remove
  usb: host: mips: sead3: Update for EHCI register structure.
  usb: renesas_usbhs: fixup resume method for autonomy mode
  usb: renesas_usbhs: mod_host: add missing .bus_suspend/resume
  update MAINTAINERS for Oliver Neukum
  usb: usb_wwan: resume/suspend can be called after port is gone
  usb: serial: prevent suspend/resume from racing against probe/remove
  usb: usb_wwan: replace release and disconnect with a port_remove hook
  usb: serial: mos7840: Fixup mos7840_chars_in_buffer()
  USB: isp1362-hcd.c: usb message always saved in case of underrun
  OMAP: USB : Fix the EHCI enumeration and core retention issue
  usb: chipidea: fix and improve dependencies if usb host or gadget support is built as module
  USB: support the new interfaces of Huawei Data Card devices in option driver
  USB: ftdi_sio: Add VID/PID for Kondo Serial USB
  xhci: Switch PPT ports to EHCI on shutdown.
  xhci: Fix bug after deq ptr set to link TRB.
  ...
  • Loading branch information
Linus Torvalds committed Aug 17, 2012
2 parents 0df7c0e + 731879f commit 9134e7d
Show file tree
Hide file tree
Showing 26 changed files with 299 additions and 457 deletions.
10 changes: 5 additions & 5 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2217,7 +2217,7 @@ S: Maintained
F: drivers/scsi/tmscsim.*

DC395x SCSI driver
M: Oliver Neukum <oliver@neukum.name>
M: Oliver Neukum <oliver@neukum.org>
M: Ali Akcaagac <aliakc@web.de>
M: Jamie Lenehan <lenehan@twibble.org>
W: http://twibble.org/dist/dc395x/
Expand Down Expand Up @@ -4537,7 +4537,7 @@ S: Supported
F: arch/microblaze/

MICROTEK X6 SCANNER
M: Oliver Neukum <oliver@neukum.name>
M: Oliver Neukum <oliver@neukum.org>
S: Maintained
F: drivers/usb/image/microtek.*

Expand Down Expand Up @@ -7076,7 +7076,7 @@ F: include/linux/mtd/ubi.h
F: include/mtd/ubi-user.h

USB ACM DRIVER
M: Oliver Neukum <oliver@neukum.name>
M: Oliver Neukum <oliver@neukum.org>
L: linux-usb@vger.kernel.org
S: Maintained
F: Documentation/usb/acm.txt
Expand All @@ -7097,7 +7097,7 @@ S: Supported
F: drivers/block/ub.c

USB CDC ETHERNET DRIVER
M: Oliver Neukum <oliver@neukum.name>
M: Oliver Neukum <oliver@neukum.org>
L: linux-usb@vger.kernel.org
S: Maintained
F: drivers/net/usb/cdc_*.c
Expand Down Expand Up @@ -7170,7 +7170,7 @@ F: drivers/usb/host/isp116x*
F: include/linux/usb/isp116x.h

USB KAWASAKI LSI DRIVER
M: Oliver Neukum <oliver@neukum.name>
M: Oliver Neukum <oliver@neukum.org>
L: linux-usb@vger.kernel.org
S: Maintained
F: drivers/usb/serial/kl5kusb105.*
Expand Down
9 changes: 5 additions & 4 deletions drivers/usb/chipidea/Kconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
config USB_CHIPIDEA
tristate "ChipIdea Highspeed Dual Role Controller"
depends on USB
depends on USB || USB_GADGET
help
Say Y here if your system has a dual role high speed USB
controller based on ChipIdea silicon IP. Currently, only the
Say Y here if your system has a dual role high speed USB
controller based on ChipIdea silicon IP. Currently, only the
peripheral mode is supported.

When compiled dynamically, the module will be called ci-hdrc.ko.
Expand All @@ -12,14 +12,15 @@ if USB_CHIPIDEA

config USB_CHIPIDEA_UDC
bool "ChipIdea device controller"
depends on USB_GADGET
depends on USB_GADGET=y || USB_GADGET=USB_CHIPIDEA
select USB_GADGET_DUALSPEED
help
Say Y here to enable device controller functionality of the
ChipIdea driver.

config USB_CHIPIDEA_HOST
bool "ChipIdea host controller"
depends on USB=y || USB=USB_CHIPIDEA
select USB_EHCI_ROOT_HUB_TT
help
Say Y here to enable host controller functionality of the
Expand Down
6 changes: 6 additions & 0 deletions drivers/usb/gadget/u_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,8 @@ static int eth_stop(struct net_device *net)
spin_lock_irqsave(&dev->lock, flags);
if (dev->port_usb) {
struct gether *link = dev->port_usb;
const struct usb_endpoint_descriptor *in;
const struct usb_endpoint_descriptor *out;

if (link->close)
link->close(link);
Expand All @@ -682,10 +684,14 @@ static int eth_stop(struct net_device *net)
* their own pace; the network stack can handle old packets.
* For the moment we leave this here, since it works.
*/
in = link->in_ep->desc;
out = link->out_ep->desc;
usb_ep_disable(link->in_ep);
usb_ep_disable(link->out_ep);
if (netif_carrier_ok(net)) {
DBG(dev, "host still using in/out endpoints\n");
link->in_ep->desc = in;
link->out_ep->desc = out;
usb_ep_enable(link->in_ep);
usb_ep_enable(link->out_ep);
}
Expand Down
167 changes: 1 addition & 166 deletions drivers/usb/host/ehci-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@
#define EHCI_INSNREG05_ULPI_EXTREGADD_SHIFT 8
#define EHCI_INSNREG05_ULPI_WRDATA_SHIFT 0

/* Errata i693 */
static struct clk *utmi_p1_fck;
static struct clk *utmi_p2_fck;
static struct clk *xclk60mhsp1_ck;
static struct clk *xclk60mhsp2_ck;
static struct clk *usbhost_p1_fck;
static struct clk *usbhost_p2_fck;
static struct clk *init_60m_fclk;

/*-------------------------------------------------------------------------*/

static const struct hc_driver ehci_omap_hc_driver;
Expand All @@ -80,40 +71,6 @@ static inline u32 ehci_read(void __iomem *base, u32 reg)
return __raw_readl(base + reg);
}

/* Erratum i693 workaround sequence */
static void omap_ehci_erratum_i693(struct ehci_hcd *ehci)
{
int ret = 0;

/* Switch to the internal 60 MHz clock */
ret = clk_set_parent(utmi_p1_fck, init_60m_fclk);
if (ret != 0)
ehci_err(ehci, "init_60m_fclk set parent"
"failed error:%d\n", ret);

ret = clk_set_parent(utmi_p2_fck, init_60m_fclk);
if (ret != 0)
ehci_err(ehci, "init_60m_fclk set parent"
"failed error:%d\n", ret);

clk_enable(usbhost_p1_fck);
clk_enable(usbhost_p2_fck);

/* Wait 1ms and switch back to the external clock */
mdelay(1);
ret = clk_set_parent(utmi_p1_fck, xclk60mhsp1_ck);
if (ret != 0)
ehci_err(ehci, "xclk60mhsp1_ck set parent"
"failed error:%d\n", ret);

ret = clk_set_parent(utmi_p2_fck, xclk60mhsp2_ck);
if (ret != 0)
ehci_err(ehci, "xclk60mhsp2_ck set parent"
"failed error:%d\n", ret);

clk_disable(usbhost_p1_fck);
clk_disable(usbhost_p2_fck);
}

static void omap_ehci_soft_phy_reset(struct usb_hcd *hcd, u8 port)
{
Expand Down Expand Up @@ -195,50 +152,6 @@ static int omap_ehci_init(struct usb_hcd *hcd)
return rc;
}

static int omap_ehci_hub_control(
struct usb_hcd *hcd,
u16 typeReq,
u16 wValue,
u16 wIndex,
char *buf,
u16 wLength
)
{
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
u32 __iomem *status_reg = &ehci->regs->port_status[
(wIndex & 0xff) - 1];
u32 temp;
unsigned long flags;
int retval = 0;

spin_lock_irqsave(&ehci->lock, flags);

if (typeReq == SetPortFeature && wValue == USB_PORT_FEAT_SUSPEND) {
temp = ehci_readl(ehci, status_reg);
if ((temp & PORT_PE) == 0 || (temp & PORT_RESET) != 0) {
retval = -EPIPE;
goto done;
}

temp &= ~PORT_WKCONN_E;
temp |= PORT_WKDISC_E | PORT_WKOC_E;
ehci_writel(ehci, temp | PORT_SUSPEND, status_reg);

omap_ehci_erratum_i693(ehci);

set_bit((wIndex & 0xff) - 1, &ehci->suspended_ports);
goto done;
}

spin_unlock_irqrestore(&ehci->lock, flags);

/* Handle the hub control events here */
return ehci_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength);
done:
spin_unlock_irqrestore(&ehci->lock, flags);
return retval;
}

static void disable_put_regulator(
struct ehci_hcd_omap_platform_data *pdata)
{
Expand Down Expand Up @@ -351,79 +264,9 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
goto err_pm_runtime;
}

/* get clocks */
utmi_p1_fck = clk_get(dev, "utmi_p1_gfclk");
if (IS_ERR(utmi_p1_fck)) {
ret = PTR_ERR(utmi_p1_fck);
dev_err(dev, "utmi_p1_gfclk failed error:%d\n", ret);
goto err_add_hcd;
}

xclk60mhsp1_ck = clk_get(dev, "xclk60mhsp1_ck");
if (IS_ERR(xclk60mhsp1_ck)) {
ret = PTR_ERR(xclk60mhsp1_ck);
dev_err(dev, "xclk60mhsp1_ck failed error:%d\n", ret);
goto err_utmi_p1_fck;
}

utmi_p2_fck = clk_get(dev, "utmi_p2_gfclk");
if (IS_ERR(utmi_p2_fck)) {
ret = PTR_ERR(utmi_p2_fck);
dev_err(dev, "utmi_p2_gfclk failed error:%d\n", ret);
goto err_xclk60mhsp1_ck;
}

xclk60mhsp2_ck = clk_get(dev, "xclk60mhsp2_ck");
if (IS_ERR(xclk60mhsp2_ck)) {
ret = PTR_ERR(xclk60mhsp2_ck);
dev_err(dev, "xclk60mhsp2_ck failed error:%d\n", ret);
goto err_utmi_p2_fck;
}

usbhost_p1_fck = clk_get(dev, "usb_host_hs_utmi_p1_clk");
if (IS_ERR(usbhost_p1_fck)) {
ret = PTR_ERR(usbhost_p1_fck);
dev_err(dev, "usbhost_p1_fck failed error:%d\n", ret);
goto err_xclk60mhsp2_ck;
}

usbhost_p2_fck = clk_get(dev, "usb_host_hs_utmi_p2_clk");
if (IS_ERR(usbhost_p2_fck)) {
ret = PTR_ERR(usbhost_p2_fck);
dev_err(dev, "usbhost_p2_fck failed error:%d\n", ret);
goto err_usbhost_p1_fck;
}

init_60m_fclk = clk_get(dev, "init_60m_fclk");
if (IS_ERR(init_60m_fclk)) {
ret = PTR_ERR(init_60m_fclk);
dev_err(dev, "init_60m_fclk failed error:%d\n", ret);
goto err_usbhost_p2_fck;
}

return 0;

err_usbhost_p2_fck:
clk_put(usbhost_p2_fck);

err_usbhost_p1_fck:
clk_put(usbhost_p1_fck);

err_xclk60mhsp2_ck:
clk_put(xclk60mhsp2_ck);

err_utmi_p2_fck:
clk_put(utmi_p2_fck);

err_xclk60mhsp1_ck:
clk_put(xclk60mhsp1_ck);

err_utmi_p1_fck:
clk_put(utmi_p1_fck);

err_add_hcd:
usb_remove_hcd(hcd);

err_pm_runtime:
disable_put_regulator(pdata);
pm_runtime_put_sync(dev);
Expand Down Expand Up @@ -454,14 +297,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
iounmap(hcd->regs);
usb_put_hcd(hcd);

clk_put(utmi_p1_fck);
clk_put(utmi_p2_fck);
clk_put(xclk60mhsp1_ck);
clk_put(xclk60mhsp2_ck);
clk_put(usbhost_p1_fck);
clk_put(usbhost_p2_fck);
clk_put(init_60m_fclk);

pm_runtime_put_sync(dev);
pm_runtime_disable(dev);

Expand Down Expand Up @@ -532,7 +367,7 @@ static const struct hc_driver ehci_omap_hc_driver = {
* root hub support
*/
.hub_status_data = ehci_hub_status_data,
.hub_control = omap_ehci_hub_control,
.hub_control = ehci_hub_control,
.bus_suspend = ehci_bus_suspend,
.bus_resume = ehci_bus_resume,

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-sead3.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static int ehci_sead3_setup(struct usb_hcd *hcd)
ehci->need_io_watchdog = 0;

/* Set burst length to 16 words. */
ehci_writel(ehci, 0x1010, &ehci->regs->reserved[1]);
ehci_writel(ehci, 0x1010, &ehci->regs->reserved1[1]);

return ret;
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/host/ehci-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,11 +799,12 @@ static int tegra_ehci_remove(struct platform_device *pdev)
#endif

usb_remove_hcd(hcd);
usb_put_hcd(hcd);

tegra_usb_phy_close(tegra->phy);
iounmap(hcd->regs);

usb_put_hcd(hcd);

clk_disable_unprepare(tegra->clk);
clk_put(tegra->clk);

Expand Down
8 changes: 4 additions & 4 deletions drivers/usb/host/isp1362-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,12 +543,12 @@ static void postproc_ep(struct isp1362_hcd *isp1362_hcd, struct isp1362_ep *ep)
usb_pipein(urb->pipe) ? "IN" : "OUT", ep->nextpid,
short_ok ? "" : "not_",
PTD_GET_COUNT(ptd), ep->maxpacket, len);
/* save the data underrun error code for later and
* proceed with the status stage
*/
urb->actual_length += PTD_GET_COUNT(ptd);
if (usb_pipecontrol(urb->pipe)) {
ep->nextpid = USB_PID_ACK;
/* save the data underrun error code for later and
* proceed with the status stage
*/
urb->actual_length += PTD_GET_COUNT(ptd);
BUG_ON(urb->actual_length > urb->transfer_buffer_length);

if (urb->status == -EINPROGRESS)
Expand Down
7 changes: 7 additions & 0 deletions drivers/usb/host/pci-quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,13 @@ void usb_enable_xhci_ports(struct pci_dev *xhci_pdev)
}
EXPORT_SYMBOL_GPL(usb_enable_xhci_ports);

void usb_disable_xhci_ports(struct pci_dev *xhci_pdev)
{
pci_write_config_dword(xhci_pdev, USB_INTEL_USB3_PSSEN, 0x0);
pci_write_config_dword(xhci_pdev, USB_INTEL_XUSB2PR, 0x0);
}
EXPORT_SYMBOL_GPL(usb_disable_xhci_ports);

/**
* PCI Quirks for xHCI.
*
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/host/pci-quirks.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ void usb_amd_quirk_pll_disable(void);
void usb_amd_quirk_pll_enable(void);
bool usb_is_intel_switchable_xhci(struct pci_dev *pdev);
void usb_enable_xhci_ports(struct pci_dev *xhci_pdev);
void usb_disable_xhci_ports(struct pci_dev *xhci_pdev);
#else
static inline void usb_amd_quirk_pll_disable(void) {}
static inline void usb_amd_quirk_pll_enable(void) {}
Expand Down
10 changes: 10 additions & 0 deletions drivers/usb/host/xhci-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,21 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
xhci->quirks |= XHCI_EP_LIMIT_QUIRK;
xhci->limit_active_eps = 64;
xhci->quirks |= XHCI_SW_BW_CHECKING;
/*
* PPT desktop boards DH77EB and DH77DF will power back on after
* a few seconds of being shutdown. The fix for this is to
* switch the ports from xHCI to EHCI on shutdown. We can't use
* DMI information to find those particular boards (since each
* vendor will change the board name), so we have to key off all
* PPT chipsets.
*/
xhci->quirks |= XHCI_SPURIOUS_REBOOT;
}
if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
pdev->device == PCI_DEVICE_ID_ASROCK_P67) {
xhci->quirks |= XHCI_RESET_ON_RESUME;
xhci_dbg(xhci, "QUIRK: Resetting on resume\n");
xhci->quirks |= XHCI_TRUST_TX_LENGTH;
}
if (pdev->vendor == PCI_VENDOR_ID_VIA)
xhci->quirks |= XHCI_RESET_ON_RESUME;
Expand Down
Loading

0 comments on commit 9134e7d

Please sign in to comment.