Skip to content

Commit

Permalink
Merge tag 'usb-3.17-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 fixes from Greg KH:
 "Here are a bunch of fixes for the USB drivers for 3.17-rc3.

  Also in here is the movement of the usbip driver out of staging, into
  the "real" part of the kernel, it had to wait until after -rc1 to
  handle the merge issues involved between the USB and staging trees.
  The code is identical, just file movements there.

  The USB fixes are all over the place, new device ids, xhci fixes for
  reported issues and the usual gadget driver fixes as well.  All have
  been in linux-next for a while now"

* tag 'usb-3.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (46 commits)
  USB: fix build error with CONFIG_PM_RUNTIME disabled
  Revert "usb: ehci/ohci-exynos: Fix PHY getting sequence"
  xhci: Disable streams on Via XHCI with device-id 0x3432
  USB: serial: fix potential heap buffer overflow
  USB: serial: fix potential stack buffer overflow
  usb: ehci/ohci-exynos: Fix PHY getting sequence
  usb: hub: Prevent hub autosuspend if usbcore.autosuspend is -1
  USB: sisusb: add device id for Magic Control USB video
  usb: dwc2: gadget: Set the default EP max packet value as 8 bytes
  usb: ehci: using wIndex + 1 for hub port
  USB: storage: add quirk for Newer Technology uSCSI SCSI-USB converter
  MAINTAINERS: Add an entry for USB/IP driver
  usbip: remove struct usb_device_id table
  usbip: move usbip kernel code out of staging
  usbip: move usbip userspace code out of staging
  USB: whiteheat: Added bounds checking for bulk command response
  usb: gadget: remove $(PWD) in ccflags-y
  usb: pch_udc: usb gadget device support for Intel Quark X1000
  usb: gadget: uvc: fix possible lockup in uvc gadget
  usb: wusbcore: fix below build warning
  ...
  • Loading branch information
torvalds committed Aug 29, 2014
2 parents bbf6c0a + a9ef803 commit 848298c
Show file tree
Hide file tree
Showing 95 changed files with 210 additions and 165 deletions.
8 changes: 8 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -9557,6 +9557,14 @@ S: Maintained
F: Documentation/usb/ohci.txt
F: drivers/usb/host/ohci*

USB OVER IP DRIVER
M: Valentina Manea <[email protected]>
M: Shuah Khan <[email protected]>
L: [email protected]
S: Maintained
F: drivers/usb/usbip/
F: tools/usb/usbip/

USB PEGASUS DRIVER
M: Petko Manolov <[email protected]>
L: [email protected]
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ source "drivers/staging/et131x/Kconfig"

source "drivers/staging/slicoss/Kconfig"

source "drivers/staging/usbip/Kconfig"

source "drivers/staging/wlan-ng/Kconfig"

source "drivers/staging/comedi/Kconfig"
Expand Down
1 change: 0 additions & 1 deletion drivers/staging/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ obj-$(CONFIG_STAGING) += staging.o
obj-y += media/
obj-$(CONFIG_ET131X) += et131x/
obj-$(CONFIG_SLICOSS) += slicoss/
obj-$(CONFIG_USBIP_CORE) += usbip/
obj-$(CONFIG_PRISM2_USB) += wlan-ng/
obj-$(CONFIG_COMEDI) += comedi/
obj-$(CONFIG_FB_OLPC_DCON) += olpc_dcon/
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ source "drivers/usb/storage/Kconfig"

source "drivers/usb/image/Kconfig"

source "drivers/usb/usbip/Kconfig"

endif

source "drivers/usb/musb/Kconfig"
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@ obj-$(CONFIG_USB_RENESAS_USBHS) += renesas_usbhs/
obj-$(CONFIG_USB_GADGET) += gadget/

obj-$(CONFIG_USB_COMMON) += common/

obj-$(CONFIG_USBIP_CORE) += usbip/
16 changes: 10 additions & 6 deletions drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1728,8 +1728,14 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
* - Change autosuspend delay of hub can avoid unnecessary auto
* suspend timer for hub, also may decrease power consumption
* of USB bus.
*
* - If user has indicated to prevent autosuspend by passing
* usbcore.autosuspend = -1 then keep autosuspend disabled.
*/
pm_runtime_set_autosuspend_delay(&hdev->dev, 0);
#ifdef CONFIG_PM_RUNTIME
if (hdev->dev.power.autosuspend_delay >= 0)
pm_runtime_set_autosuspend_delay(&hdev->dev, 0);
#endif

/*
* Hubs have proper suspend/resume support, except for root hubs
Expand Down Expand Up @@ -2107,8 +2113,8 @@ void usb_disconnect(struct usb_device **pdev)
{
struct usb_port *port_dev = NULL;
struct usb_device *udev = *pdev;
struct usb_hub *hub;
int port1;
struct usb_hub *hub = NULL;
int port1 = 1;

/* mark the device as inactive, so any further urb submissions for
* this device (and any of its children) will fail immediately.
Expand Down Expand Up @@ -4631,9 +4637,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
if (status != -ENODEV &&
port1 != unreliable_port &&
printk_ratelimit())
dev_err(&udev->dev, "connect-debounce failed, port %d disabled\n",
port1);

dev_err(&port_dev->dev, "connect-debounce failed\n");
portstatus &= ~USB_PORT_STAT_CONNECTION;
unreliable_port = port1;
} else {
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/dwc2/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1901,7 +1901,7 @@ static void s3c_hsotg_epint(struct s3c_hsotg *hsotg, unsigned int idx,
static void s3c_hsotg_irq_enumdone(struct s3c_hsotg *hsotg)
{
u32 dsts = readl(hsotg->regs + DSTS);
int ep0_mps = 0, ep_mps;
int ep0_mps = 0, ep_mps = 8;

/*
* This should signal the finish of the enumeration phase
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/dwc3/dwc3-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ static void dwc3_omap_set_utmi_mode(struct dwc3_omap *omap)

static int dwc3_omap_extcon_register(struct dwc3_omap *omap)
{
u32 ret;
int ret;
struct device_node *node = omap->dev->of_node;
struct extcon_dev *edev;

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
subdir-ccflags-$(CONFIG_USB_GADGET_DEBUG) := -DDEBUG
subdir-ccflags-$(CONFIG_USB_GADGET_VERBOSE) += -DVERBOSE_DEBUG
ccflags-y += -I$(PWD)/drivers/usb/gadget/udc
ccflags-y += -Idrivers/usb/gadget/udc

obj-$(CONFIG_USB_LIBCOMPOSITE) += libcomposite.o
libcomposite-y := usbstring.o config.o epautoconf.o
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/function/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# USB peripheral controller drivers
#

ccflags-y := -I$(PWD)/drivers/usb/gadget/
ccflags-y += -I$(PWD)/drivers/usb/gadget/udc/
ccflags-y := -Idrivers/usb/gadget/
ccflags-y += -Idrivers/usb/gadget/udc/

# USB Functions
usb_f_acm-y := f_acm.o
Expand Down
3 changes: 0 additions & 3 deletions drivers/usb/gadget/function/u_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -1127,10 +1127,7 @@ void gether_disconnect(struct gether *link)

DBG(dev, "%s\n", __func__);

netif_tx_lock(dev->net);
netif_stop_queue(dev->net);
netif_tx_unlock(dev->net);

netif_carrier_off(dev->net);

/* disable endpoints, forcing (synchronous) completion
Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/gadget/function/uvc_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ uvc_video_complete(struct usb_ep *ep, struct usb_request *req)
printk(KERN_INFO "Failed to queue request (%d).\n", ret);
usb_ep_set_halt(ep);
spin_unlock_irqrestore(&video->queue.irqlock, flags);
uvc_queue_cancel(queue, 0);
goto requeue;
}
spin_unlock_irqrestore(&video->queue.irqlock, flags);
Expand Down Expand Up @@ -281,6 +282,7 @@ uvc_video_alloc_requests(struct uvc_video *video)
static int
uvc_video_pump(struct uvc_video *video)
{
struct uvc_video_queue *queue = &video->queue;
struct usb_request *req;
struct uvc_buffer *buf;
unsigned long flags;
Expand Down Expand Up @@ -322,6 +324,7 @@ uvc_video_pump(struct uvc_video *video)
printk(KERN_INFO "Failed to queue request (%d)\n", ret);
usb_ep_set_halt(video->ep);
spin_unlock_irqrestore(&video->queue.irqlock, flags);
uvc_queue_cancel(queue, 0);
break;
}
spin_unlock_irqrestore(&video->queue.irqlock, flags);
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/gadget/legacy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# USB gadget drivers
#

ccflags-y := -I$(PWD)/drivers/usb/gadget/
ccflags-y += -I$(PWD)/drivers/usb/gadget/udc/
ccflags-y += -I$(PWD)/drivers/usb/gadget/function/
ccflags-y := -Idrivers/usb/gadget/
ccflags-y += -Idrivers/usb/gadget/udc/
ccflags-y += -Idrivers/usb/gadget/function/

g_zero-y := zero.o
g_audio-y := audio.o
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/gadget/legacy/dbgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,12 @@ static void dbgp_unbind(struct usb_gadget *gadget)
{
#ifdef CONFIG_USB_G_DBGP_SERIAL
kfree(dbgp.serial);
dbgp.serial = NULL;
#endif
if (dbgp.req) {
kfree(dbgp.req->buf);
usb_ep_free_request(gadget->ep0, dbgp.req);
dbgp.req = NULL;
}

gadget->ep0->driver_data = NULL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/legacy/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ ep_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)

value = -ENOMEM;
kbuf = memdup_user(buf, len);
if (!kbuf) {
if (IS_ERR(kbuf)) {
value = PTR_ERR(kbuf);
goto free1;
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/gadget/udc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ config USB_GOKU
gadget drivers to also be dynamically linked.

config USB_EG20T
tristate "Intel EG20T PCH/LAPIS Semiconductor IOH(ML7213/ML7831) UDC"
tristate "Intel QUARK X1000/EG20T PCH/LAPIS Semiconductor IOH(ML7213/ML7831) UDC"
depends on PCI
help
This is a USB device driver for EG20T PCH.
Expand All @@ -353,6 +353,7 @@ config USB_EG20T
ML7213/ML7831 is companion chip for Intel Atom E6xx series.
ML7213/ML7831 is completely compatible for Intel EG20T PCH.

This driver can be used with Intel's Quark X1000 SOC platform
#
# LAST -- dummy/emulated controller
#
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/udc/atmel_usba_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid)
if (dma_status) {
int i;

for (i = 1; i < USBA_NR_DMAS; i++)
for (i = 1; i <= USBA_NR_DMAS; i++)
if (dma_status & (1 << i))
usba_dma_irq(udc, &udc->usba_ep[i]);
}
Expand Down
8 changes: 6 additions & 2 deletions drivers/usb/gadget/udc/fusb300_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1398,13 +1398,17 @@ static int fusb300_probe(struct platform_device *pdev)

/* initialize udc */
fusb300 = kzalloc(sizeof(struct fusb300), GFP_KERNEL);
if (fusb300 == NULL)
if (fusb300 == NULL) {
ret = -ENOMEM;
goto clean_up;
}

for (i = 0; i < FUSB300_MAX_NUM_EP; i++) {
_ep[i] = kzalloc(sizeof(struct fusb300_ep), GFP_KERNEL);
if (_ep[i] == NULL)
if (_ep[i] == NULL) {
ret = -ENOMEM;
goto clean_up;
}
fusb300->ep[i] = _ep[i];
}

Expand Down
22 changes: 19 additions & 3 deletions drivers/usb/gadget/udc/pch_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ struct pch_vbus_gpio_data {
* @setup_data: Received setup data
* @phys_addr: of device memory
* @base_addr: for mapped device memory
* @bar: Indicates which PCI BAR for USB regs
* @irq: IRQ line for the device
* @cfg_data: current cfg, intf, and alt in use
* @vbus_gpio: GPIO informaton for detecting VBUS
Expand Down Expand Up @@ -370,14 +371,17 @@ struct pch_udc_dev {
struct usb_ctrlrequest setup_data;
unsigned long phys_addr;
void __iomem *base_addr;
unsigned bar;
unsigned irq;
struct pch_udc_cfg_data cfg_data;
struct pch_vbus_gpio_data vbus_gpio;
};
#define to_pch_udc(g) (container_of((g), struct pch_udc_dev, gadget))

#define PCH_UDC_PCI_BAR_QUARK_X1000 0
#define PCH_UDC_PCI_BAR 1
#define PCI_DEVICE_ID_INTEL_EG20T_UDC 0x8808
#define PCI_DEVICE_ID_INTEL_QUARK_X1000_UDC 0x0939
#define PCI_VENDOR_ID_ROHM 0x10DB
#define PCI_DEVICE_ID_ML7213_IOH_UDC 0x801D
#define PCI_DEVICE_ID_ML7831_IOH_UDC 0x8808
Expand Down Expand Up @@ -3076,7 +3080,7 @@ static void pch_udc_remove(struct pci_dev *pdev)
iounmap(dev->base_addr);
if (dev->mem_region)
release_mem_region(dev->phys_addr,
pci_resource_len(pdev, PCH_UDC_PCI_BAR));
pci_resource_len(pdev, dev->bar));
if (dev->active)
pci_disable_device(pdev);
kfree(dev);
Expand Down Expand Up @@ -3144,9 +3148,15 @@ static int pch_udc_probe(struct pci_dev *pdev,
dev->active = 1;
pci_set_drvdata(pdev, dev);

/* Determine BAR based on PCI ID */
if (id->device == PCI_DEVICE_ID_INTEL_QUARK_X1000_UDC)
dev->bar = PCH_UDC_PCI_BAR_QUARK_X1000;
else
dev->bar = PCH_UDC_PCI_BAR;

/* PCI resource allocation */
resource = pci_resource_start(pdev, 1);
len = pci_resource_len(pdev, 1);
resource = pci_resource_start(pdev, dev->bar);
len = pci_resource_len(pdev, dev->bar);

if (!request_mem_region(resource, len, KBUILD_MODNAME)) {
dev_err(&pdev->dev, "%s: pci device used already\n", __func__);
Expand Down Expand Up @@ -3211,6 +3221,12 @@ static int pch_udc_probe(struct pci_dev *pdev,
}

static const struct pci_device_id pch_udc_pcidev_id[] = {
{
PCI_DEVICE(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_QUARK_X1000_UDC),
.class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe,
.class_mask = 0xffffffff,
},
{
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EG20T_UDC),
.class = (PCI_CLASS_SERIAL_USB << 8) | 0xfe,
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/udc/r8a66597-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1868,8 +1868,8 @@ static int r8a66597_probe(struct platform_device *pdev)

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
reg = devm_ioremap_resource(&pdev->dev, res);
if (!reg)
return -ENODEV;
if (IS_ERR(reg))
return PTR_ERR(reg);

ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
irq = ires->start;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/host/ehci-hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ int ehci_hub_control(
if (selector == EHSET_TEST_SINGLE_STEP_SET_FEATURE) {
spin_unlock_irqrestore(&ehci->lock, flags);
retval = ehset_single_step_set_feature(hcd,
wIndex);
wIndex + 1);
spin_lock_irqsave(&ehci->lock, flags);
break;
}
Expand Down
9 changes: 9 additions & 0 deletions drivers/usb/host/xhci-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
/* AMD PLL quirk */
if (pdev->vendor == PCI_VENDOR_ID_AMD && usb_amd_find_chipset_info())
xhci->quirks |= XHCI_AMD_PLL_FIX;

if (pdev->vendor == PCI_VENDOR_ID_AMD)
xhci->quirks |= XHCI_TRUST_TX_LENGTH;

if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
xhci->quirks |= XHCI_LPM_SUPPORT;
xhci->quirks |= XHCI_INTEL_HOST;
Expand Down Expand Up @@ -151,6 +155,11 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
if (pdev->vendor == PCI_VENDOR_ID_VIA)
xhci->quirks |= XHCI_RESET_ON_RESUME;

/* See https://bugzilla.kernel.org/show_bug.cgi?id=79511 */
if (pdev->vendor == PCI_VENDOR_ID_VIA &&
pdev->device == 0x3432)
xhci->quirks |= XHCI_BROKEN_STREAMS;

if (xhci->quirks & XHCI_RESET_ON_RESUME)
xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
"QUIRK: Resetting on resume");
Expand Down
Loading

0 comments on commit 848298c

Please sign in to comment.