Skip to content

Commit

Permalink
Merge tag 'usb-4.0-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's a round of USB fixes for 4.0-rc3.

  Nothing major, the usual gadget, xhci and usb-serial fixes and a few
  new device ids as well.

  All have been in linux-next successfully"

* tag 'usb-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (36 commits)
  xhci: Workaround for PME stuck issues in Intel xhci
  xhci: fix reporting of 0-sized URBs in control endpoint
  usb: ftdi_sio: Add jtag quirk support for Cyber Cortex AV boards
  USB: ch341: set tty baud speed according to tty struct
  USB: serial: cp210x: Adding Seletek device id's
  USB: pl2303: disable break on shutdown
  USB: mxuport: fix null deref when used as a console
  USB: serial: clean up bus probe error handling
  USB: serial: fix port attribute-creation race
  USB: serial: fix tty-device error handling at probe
  USB: serial: fix potential use-after-free after failed probe
  USB: console: add dummy __module_get
  USB: ftdi_sio: add PIDs for Actisense USB devices
  Revert "USB: serial: make bulk_out_size a lower limit"
  cdc-acm: Add support for Denso cradle CU-321
  usb-storage: support for more than 8 LUNs
  uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS539
  USB: usbfs: don't leak kernel data in siginfo
  xhci: Clear the host side toggle manually when endpoint is 'soft reset'
  xhci: Allocate correct amount of scratchpad buffers
  ...
  • Loading branch information
torvalds committed Mar 8, 2015
2 parents bbbce51 + b8cb91e commit 1163d50
Show file tree
Hide file tree
Showing 34 changed files with 374 additions and 109 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,8 @@ static int acm_reset_resume(struct usb_interface *intf)

static const struct usb_device_id acm_ids[] = {
/* quirky and broken devices */
{ USB_DEVICE(0x076d, 0x0006), /* Denso Cradle CU-321 */
.driver_info = NO_UNION_NORMAL, },/* has no union descriptor */
{ USB_DEVICE(0x17ef, 0x7000), /* Lenovo USB modem */
.driver_info = NO_UNION_NORMAL, },/* has no union descriptor */
{ USB_DEVICE(0x0870, 0x0001), /* Metricom GS Modem */
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ static void async_completed(struct urb *urb)
as->status = urb->status;
signr = as->signr;
if (signr) {
memset(&sinfo, 0, sizeof(sinfo));
sinfo.si_signo = as->signr;
sinfo.si_errno = as->status;
sinfo.si_code = SI_ASYNCIO;
Expand Down Expand Up @@ -2382,6 +2383,7 @@ static void usbdev_remove(struct usb_device *udev)
wake_up_all(&ps->wait);
list_del_init(&ps->list);
if (ps->discsignr) {
memset(&sinfo, 0, sizeof(sinfo));
sinfo.si_signo = ps->discsignr;
sinfo.si_errno = EPIPE;
sinfo.si_code = SI_ASYNCIO;
Expand Down
30 changes: 28 additions & 2 deletions drivers/usb/dwc3/dwc3-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,18 @@ static void dwc3_omap_write_irq0_set(struct dwc3_omap *omap, u32 value)
omap->irq0_offset, value);
}

static void dwc3_omap_write_irqmisc_clr(struct dwc3_omap *omap, u32 value)
{
dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_CLR_MISC +
omap->irqmisc_offset, value);
}

static void dwc3_omap_write_irq0_clr(struct dwc3_omap *omap, u32 value)
{
dwc3_omap_writel(omap->base, USBOTGSS_IRQENABLE_CLR_0 -
omap->irq0_offset, value);
}

static void dwc3_omap_set_mailbox(struct dwc3_omap *omap,
enum omap_dwc3_vbus_id_status status)
{
Expand Down Expand Up @@ -345,9 +357,23 @@ static void dwc3_omap_enable_irqs(struct dwc3_omap *omap)

static void dwc3_omap_disable_irqs(struct dwc3_omap *omap)
{
u32 reg;

/* disable all IRQs */
dwc3_omap_write_irqmisc_set(omap, 0x00);
dwc3_omap_write_irq0_set(omap, 0x00);
reg = USBOTGSS_IRQO_COREIRQ_ST;
dwc3_omap_write_irq0_clr(omap, reg);

reg = (USBOTGSS_IRQMISC_OEVT |
USBOTGSS_IRQMISC_DRVVBUS_RISE |
USBOTGSS_IRQMISC_CHRGVBUS_RISE |
USBOTGSS_IRQMISC_DISCHRGVBUS_RISE |
USBOTGSS_IRQMISC_IDPULLUP_RISE |
USBOTGSS_IRQMISC_DRVVBUS_FALL |
USBOTGSS_IRQMISC_CHRGVBUS_FALL |
USBOTGSS_IRQMISC_DISCHRGVBUS_FALL |
USBOTGSS_IRQMISC_IDPULLUP_FALL);

dwc3_omap_write_irqmisc_clr(omap, reg);
}

static u64 dwc3_omap_dma_mask = DMA_BIT_MASK(32);
Expand Down
2 changes: 0 additions & 2 deletions drivers/usb/gadget/configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,6 @@ static ssize_t interf_grp_compatible_id_store(struct usb_os_desc *desc,
if (desc->opts_mutex)
mutex_lock(desc->opts_mutex);
memcpy(desc->ext_compat_id, page, l);
desc->ext_compat_id[l] = '\0';

if (desc->opts_mutex)
mutex_unlock(desc->opts_mutex);
Expand Down Expand Up @@ -1192,7 +1191,6 @@ static ssize_t interf_grp_sub_compatible_id_store(struct usb_os_desc *desc,
if (desc->opts_mutex)
mutex_lock(desc->opts_mutex);
memcpy(desc->ext_compat_id + 8, page, l);
desc->ext_compat_id[l + 8] = '\0';

if (desc->opts_mutex)
mutex_unlock(desc->opts_mutex);
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/function/f_hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
return status;
}

const struct file_operations f_hidg_fops = {
static const struct file_operations f_hidg_fops = {
.owner = THIS_MODULE,
.open = f_hidg_open,
.release = f_hidg_release,
Expand Down
5 changes: 4 additions & 1 deletion drivers/usb/gadget/function/f_phonet.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,10 @@ static int pn_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
return -EINVAL;

spin_lock(&port->lock);
__pn_reset(f);

if (fp->in_ep->driver_data)
__pn_reset(f);

if (alt == 1) {
int i;

Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/function/f_sourcesink.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ static struct usb_endpoint_descriptor ss_int_source_desc = {
.bInterval = USB_MS_TO_SS_INTERVAL(GZERO_INT_INTERVAL),
};

struct usb_ss_ep_comp_descriptor ss_int_source_comp_desc = {
static struct usb_ss_ep_comp_descriptor ss_int_source_comp_desc = {
.bLength = USB_DT_SS_EP_COMP_SIZE,
.bDescriptorType = USB_DT_SS_ENDPOINT_COMP,

Expand All @@ -362,7 +362,7 @@ static struct usb_endpoint_descriptor ss_int_sink_desc = {
.bInterval = USB_MS_TO_SS_INTERVAL(GZERO_INT_INTERVAL),
};

struct usb_ss_ep_comp_descriptor ss_int_sink_comp_desc = {
static struct usb_ss_ep_comp_descriptor ss_int_sink_comp_desc = {
.bLength = USB_DT_SS_EP_COMP_SIZE,
.bDescriptorType = USB_DT_SS_ENDPOINT_COMP,

Expand Down
34 changes: 17 additions & 17 deletions drivers/usb/gadget/function/f_uac2.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#define UNFLW_CTRL 8
#define OVFLW_CTRL 10

const char *uac2_name = "snd_uac2";
static const char *uac2_name = "snd_uac2";

struct uac2_req {
struct uac2_rtd_params *pp; /* parent param */
Expand Down Expand Up @@ -634,7 +634,7 @@ static struct usb_interface_descriptor std_ac_if_desc = {
};

/* Clock source for IN traffic */
struct uac_clock_source_descriptor in_clk_src_desc = {
static struct uac_clock_source_descriptor in_clk_src_desc = {
.bLength = sizeof in_clk_src_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -646,7 +646,7 @@ struct uac_clock_source_descriptor in_clk_src_desc = {
};

/* Clock source for OUT traffic */
struct uac_clock_source_descriptor out_clk_src_desc = {
static struct uac_clock_source_descriptor out_clk_src_desc = {
.bLength = sizeof out_clk_src_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -658,7 +658,7 @@ struct uac_clock_source_descriptor out_clk_src_desc = {
};

/* Input Terminal for USB_OUT */
struct uac2_input_terminal_descriptor usb_out_it_desc = {
static struct uac2_input_terminal_descriptor usb_out_it_desc = {
.bLength = sizeof usb_out_it_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -672,7 +672,7 @@ struct uac2_input_terminal_descriptor usb_out_it_desc = {
};

/* Input Terminal for I/O-In */
struct uac2_input_terminal_descriptor io_in_it_desc = {
static struct uac2_input_terminal_descriptor io_in_it_desc = {
.bLength = sizeof io_in_it_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -686,7 +686,7 @@ struct uac2_input_terminal_descriptor io_in_it_desc = {
};

/* Ouput Terminal for USB_IN */
struct uac2_output_terminal_descriptor usb_in_ot_desc = {
static struct uac2_output_terminal_descriptor usb_in_ot_desc = {
.bLength = sizeof usb_in_ot_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -700,7 +700,7 @@ struct uac2_output_terminal_descriptor usb_in_ot_desc = {
};

/* Ouput Terminal for I/O-Out */
struct uac2_output_terminal_descriptor io_out_ot_desc = {
static struct uac2_output_terminal_descriptor io_out_ot_desc = {
.bLength = sizeof io_out_ot_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -713,7 +713,7 @@ struct uac2_output_terminal_descriptor io_out_ot_desc = {
.bmControls = (CONTROL_RDWR << COPY_CTRL),
};

struct uac2_ac_header_descriptor ac_hdr_desc = {
static struct uac2_ac_header_descriptor ac_hdr_desc = {
.bLength = sizeof ac_hdr_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand Down Expand Up @@ -751,7 +751,7 @@ static struct usb_interface_descriptor std_as_out_if1_desc = {
};

/* Audio Stream OUT Intface Desc */
struct uac2_as_header_descriptor as_out_hdr_desc = {
static struct uac2_as_header_descriptor as_out_hdr_desc = {
.bLength = sizeof as_out_hdr_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -764,15 +764,15 @@ struct uac2_as_header_descriptor as_out_hdr_desc = {
};

/* Audio USB_OUT Format */
struct uac2_format_type_i_descriptor as_out_fmt1_desc = {
static struct uac2_format_type_i_descriptor as_out_fmt1_desc = {
.bLength = sizeof as_out_fmt1_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,
.bDescriptorSubtype = UAC_FORMAT_TYPE,
.bFormatType = UAC_FORMAT_TYPE_I,
};

/* STD AS ISO OUT Endpoint */
struct usb_endpoint_descriptor fs_epout_desc = {
static struct usb_endpoint_descriptor fs_epout_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,

Expand All @@ -782,7 +782,7 @@ struct usb_endpoint_descriptor fs_epout_desc = {
.bInterval = 1,
};

struct usb_endpoint_descriptor hs_epout_desc = {
static struct usb_endpoint_descriptor hs_epout_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,

Expand Down Expand Up @@ -828,7 +828,7 @@ static struct usb_interface_descriptor std_as_in_if1_desc = {
};

/* Audio Stream IN Intface Desc */
struct uac2_as_header_descriptor as_in_hdr_desc = {
static struct uac2_as_header_descriptor as_in_hdr_desc = {
.bLength = sizeof as_in_hdr_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,

Expand All @@ -841,15 +841,15 @@ struct uac2_as_header_descriptor as_in_hdr_desc = {
};

/* Audio USB_IN Format */
struct uac2_format_type_i_descriptor as_in_fmt1_desc = {
static struct uac2_format_type_i_descriptor as_in_fmt1_desc = {
.bLength = sizeof as_in_fmt1_desc,
.bDescriptorType = USB_DT_CS_INTERFACE,
.bDescriptorSubtype = UAC_FORMAT_TYPE,
.bFormatType = UAC_FORMAT_TYPE_I,
};

/* STD AS ISO IN Endpoint */
struct usb_endpoint_descriptor fs_epin_desc = {
static struct usb_endpoint_descriptor fs_epin_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,

Expand All @@ -859,7 +859,7 @@ struct usb_endpoint_descriptor fs_epin_desc = {
.bInterval = 1,
};

struct usb_endpoint_descriptor hs_epin_desc = {
static struct usb_endpoint_descriptor hs_epin_desc = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,

Expand Down Expand Up @@ -1563,7 +1563,7 @@ static void afunc_unbind(struct usb_configuration *c, struct usb_function *f)
agdev->out_ep->driver_data = NULL;
}

struct usb_function *afunc_alloc(struct usb_function_instance *fi)
static struct usb_function *afunc_alloc(struct usb_function_instance *fi)
{
struct audio_dev *agdev;
struct f_uac2_opts *opts;
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/gadget/function/uvc_v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "uvc.h"
#include "uvc_queue.h"
#include "uvc_video.h"
#include "uvc_v4l2.h"

/* --------------------------------------------------------------------------
* Requests handling
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/gadget/function/uvc_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "uvc.h"
#include "uvc_queue.h"
#include "uvc_video.h"

/* --------------------------------------------------------------------------
* Video codecs
Expand Down
6 changes: 4 additions & 2 deletions drivers/usb/gadget/legacy/g_ffs.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ struct gfs_configuration {
struct usb_configuration c;
int (*eth)(struct usb_configuration *c);
int num;
} gfs_configurations[] = {
};

static struct gfs_configuration gfs_configurations[] = {
#ifdef CONFIG_USB_FUNCTIONFS_RNDIS
{
.eth = bind_rndis_config,
Expand Down Expand Up @@ -278,7 +280,7 @@ static void *functionfs_acquire_dev(struct ffs_dev *dev)
if (!try_module_get(THIS_MODULE))
return ERR_PTR(-ENOENT);

return 0;
return NULL;
}

static void functionfs_release_dev(struct ffs_dev *dev)
Expand Down
30 changes: 30 additions & 0 deletions drivers/usb/host/xhci-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@

#define PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI 0x8c31
#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31
#define PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI 0x22b5
#define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI 0xa12f
#define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI 0x9d2f

static const char hcd_name[] = "xhci_hcd";

Expand Down Expand Up @@ -133,6 +136,12 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI) {
xhci->quirks |= XHCI_SPURIOUS_REBOOT;
}
if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
(pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI ||
pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI ||
pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI)) {
xhci->quirks |= XHCI_PME_STUCK_QUIRK;
}
if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
pdev->device == PCI_DEVICE_ID_EJ168) {
xhci->quirks |= XHCI_RESET_ON_RESUME;
Expand All @@ -159,6 +168,21 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
"QUIRK: Resetting on resume");
}

/*
* Make sure PME works on some Intel xHCI controllers by writing 1 to clear
* the Internal PME flag bit in vendor specific PMCTRL register at offset 0x80a4
*/
static void xhci_pme_quirk(struct xhci_hcd *xhci)
{
u32 val;
void __iomem *reg;

reg = (void __iomem *) xhci->cap_regs + 0x80a4;
val = readl(reg);
writel(val | BIT(28), reg);
readl(reg);
}

/* called during probe() after chip reset completes */
static int xhci_pci_setup(struct usb_hcd *hcd)
{
Expand Down Expand Up @@ -283,6 +307,9 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
if (xhci->quirks & XHCI_COMP_MODE_QUIRK)
pdev->no_d3cold = true;

if (xhci->quirks & XHCI_PME_STUCK_QUIRK)
xhci_pme_quirk(xhci);

return xhci_suspend(xhci, do_wakeup);
}

Expand Down Expand Up @@ -313,6 +340,9 @@ static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated)
if (pdev->vendor == PCI_VENDOR_ID_INTEL)
usb_enable_intel_xhci_ports(pdev);

if (xhci->quirks & XHCI_PME_STUCK_QUIRK)
xhci_pme_quirk(xhci);

retval = xhci_resume(xhci, hibernated);
return retval;
}
Expand Down
Loading

0 comments on commit 1163d50

Please sign in to comment.