Skip to content

Commit

Permalink
Merge tag 'usb-3.5-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 Kroah-Hartman:
 "Here are a bunch of tiny fixes for the USB core and drivers for
  3.5-rc3

  A bunch of gadget fixes, and new device ids, as well as some fixes for
  a number of different regressions that have been reported recently.
  We also fixed some PCI host controllers to resolve a long-standing bug
  with a whole class of host controllers that have been plaguing people
  for a number of kernel releases, preventing their systems from
  suspending properly.

  Signed-off-by: Greg Kroah-Hartman <[email protected]>"

* tag 'usb-3.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (41 commits)
  USB: fix gathering of interface associations
  usb: ehci-sh: fix illegal phy_init() running when platform_data is NULL
  usb: cdc-acm: fix devices not unthrottled on open
  Fix OMAP EHCI suspend/resume failure (i693)
  USB: ohci-hub: Mark ohci_finish_controller_resume() as __maybe_unused
  usb: use usb_serial_put in usb_serial_probe errors
  USB: EHCI: Fix build warning in xilinx ehci driver
  USB: fix PS3 EHCI systems
  xHCI: Increase the timeout for controller save/restore state operation
  xhci: Don't free endpoints in xhci_mem_cleanup()
  xhci: Fix invalid loop check in xhci_free_tt_info()
  xhci: Fix error path return value.
  USB: Checking the wrong variable in usb_disable_lpm()
  usb-storage: Add 090c:1000 to unusal-devs
  USB: serial-generic: use a single set of device IDs
  USB: serial: Enforce USB driver and USB serial driver match
  USB: add NO_D3_DURING_SLEEP flag and revert 151b612
  USB: option: add more YUGA device ids
  USB: mos7840: Fix compilation of usb serial driver
  USB: option: fix memory leak
  ...
  • Loading branch information
torvalds committed Jun 16, 2012
2 parents 8e53ed1 + b3a3dd0 commit 41c8c53
Show file tree
Hide file tree
Showing 41 changed files with 354 additions and 170 deletions.
5 changes: 5 additions & 0 deletions drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1744,6 +1744,11 @@ int pci_prepare_to_sleep(struct pci_dev *dev)
if (target_state == PCI_POWER_ERROR)
return -EIO;

/* Some devices mustn't be in D3 during system sleep */
if (target_state == PCI_D3hot &&
(dev->dev_flags & PCI_DEV_FLAGS_NO_D3_DURING_SLEEP))
return 0;

pci_enable_wake(dev, target_state, device_may_wakeup(&dev->dev));

error = pci_set_power_state(dev, target_state);
Expand Down
26 changes: 26 additions & 0 deletions drivers/pci/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -2929,6 +2929,32 @@ static void __devinit disable_igfx_irq(struct pci_dev *dev)
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);

/*
* The Intel 6 Series/C200 Series chipset's EHCI controllers on many
* ASUS motherboards will cause memory corruption or a system crash
* if they are in D3 while the system is put into S3 sleep.
*/
static void __devinit asus_ehci_no_d3(struct pci_dev *dev)
{
const char *sys_info;
static const char good_Asus_board[] = "P8Z68-V";

if (dev->dev_flags & PCI_DEV_FLAGS_NO_D3_DURING_SLEEP)
return;
if (dev->subsystem_vendor != PCI_VENDOR_ID_ASUSTEK)
return;
sys_info = dmi_get_system_info(DMI_BOARD_NAME);
if (sys_info && memcmp(sys_info, good_Asus_board,
sizeof(good_Asus_board) - 1) == 0)
return;

dev_info(&dev->dev, "broken D3 during system sleep on ASUS\n");
dev->dev_flags |= PCI_DEV_FLAGS_NO_D3_DURING_SLEEP;
device_set_wakeup_capable(&dev->dev, false);
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1c26, asus_ehci_no_d3);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1c2d, asus_ehci_no_d3);

static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f,
struct pci_fixup *end)
{
Expand Down
8 changes: 8 additions & 0 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,14 @@ static int acm_port_activate(struct tty_port *port, struct tty_struct *tty)

usb_autopm_put_interface(acm->control);

/*
* Unthrottle device in case the TTY was closed while throttled.
*/
spin_lock_irq(&acm->read_lock);
acm->throttled = 0;
acm->throttle_req = 0;
spin_unlock_irq(&acm->read_lock);

if (acm_submit_read_urbs(acm, GFP_KERNEL))
goto error_submit_read_urbs;

Expand Down
9 changes: 9 additions & 0 deletions drivers/usb/class/cdc-wdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ static const struct usb_device_id wdm_ids[] = {
.bInterfaceSubClass = 1,
.bInterfaceProtocol = 9, /* NOTE: CDC ECM control interface! */
},
{
/* Vodafone/Huawei K5005 (12d1:14c8) and similar modems */
.match_flags = USB_DEVICE_ID_MATCH_VENDOR |
USB_DEVICE_ID_MATCH_INT_INFO,
.idVendor = HUAWEI_VENDOR_ID,
.bInterfaceClass = USB_CLASS_VENDOR_SPEC,
.bInterfaceSubClass = 1,
.bInterfaceProtocol = 57, /* NOTE: CDC ECM control interface! */
},
{ }
};

Expand Down
9 changes: 0 additions & 9 deletions drivers/usb/core/hcd-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,15 +493,6 @@ static int hcd_pci_suspend_noirq(struct device *dev)

pci_save_state(pci_dev);

/*
* Some systems crash if an EHCI controller is in D3 during
* a sleep transition. We have to leave such controllers in D0.
*/
if (hcd->broken_pci_sleep) {
dev_dbg(dev, "Staying in PCI D0\n");
return retval;
}

/* If the root hub is dead rather than suspended, disallow remote
* wakeup. usb_hc_died() should ensure that both hosts are marked as
* dying, so we only need to check the primary roothub.
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -3379,7 +3379,7 @@ int usb_disable_lpm(struct usb_device *udev)
return 0;

udev->lpm_disable_count++;
if ((udev->u1_params.timeout == 0 && udev->u1_params.timeout == 0))
if ((udev->u1_params.timeout == 0 && udev->u2_params.timeout == 0))
return 0;

/* If LPM is enabled, attempt to disable it. */
Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,6 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
intfc = cp->intf_cache[i];
intf->altsetting = intfc->altsetting;
intf->num_altsetting = intfc->num_altsetting;
intf->intf_assoc = find_iad(dev, cp, i);
kref_get(&intfc->ref);

alt = usb_altnum_to_altsetting(intf, 0);
Expand All @@ -1851,6 +1850,8 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
if (!alt)
alt = &intf->altsetting[0];

intf->intf_assoc =
find_iad(dev, cp, alt->desc.bInterfaceNumber);
intf->cur_altsetting = alt;
usb_enable_interface(dev, intf, true);
intf->dev.parent = &dev->dev;
Expand Down
6 changes: 0 additions & 6 deletions drivers/usb/gadget/atmel_usba_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,12 +599,6 @@ usba_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)

spin_lock_irqsave(&ep->udc->lock, flags);

if (ep->ep.desc) {
spin_unlock_irqrestore(&ep->udc->lock, flags);
DBG(DBG_ERR, "ep%d already enabled\n", ep->index);
return -EBUSY;
}

ep->ep.desc = desc;
ep->ep.maxpacket = maxpacket;

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/fsl_qe_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,7 @@ static int qe_ep_enable(struct usb_ep *_ep,
ep = container_of(_ep, struct qe_ep, ep);

/* catch various bogus parameters */
if (!_ep || !desc || ep->ep.desc || _ep->name == ep_name[0] ||
if (!_ep || !desc || _ep->name == ep_name[0] ||
(desc->bDescriptorType != USB_DT_ENDPOINT))
return -EINVAL;

Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/fsl_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ static int fsl_ep_enable(struct usb_ep *_ep,
ep = container_of(_ep, struct fsl_ep, ep);

/* catch various bogus parameters */
if (!_ep || !desc || ep->ep.desc
if (!_ep || !desc
|| (desc->bDescriptorType != USB_DT_ENDPOINT))
return -EINVAL;

Expand Down Expand Up @@ -2575,7 +2575,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev)
/* for ep0: the desc defined here;
* for other eps, gadget layer called ep_enable with defined desc
*/
udc_controller->eps[0].desc = &fsl_ep0_desc;
udc_controller->eps[0].ep.desc = &fsl_ep0_desc;
udc_controller->eps[0].ep.maxpacket = USB_MAX_CTRL_PAYLOAD;

/* setup the udc->eps[] for non-control endpoints and link
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/fsl_usb2_udc.h
Original file line number Diff line number Diff line change
Expand Up @@ -568,10 +568,10 @@ static void dump_msg(const char *label, const u8 * buf, unsigned int length)
/*
* ### internal used help routines.
*/
#define ep_index(EP) ((EP)->desc->bEndpointAddress&0xF)
#define ep_index(EP) ((EP)->ep.desc->bEndpointAddress&0xF)
#define ep_maxpacket(EP) ((EP)->ep.maxpacket)
#define ep_is_in(EP) ( (ep_index(EP) == 0) ? (EP->udc->ep0_dir == \
USB_DIR_IN ):((EP)->desc->bEndpointAddress \
USB_DIR_IN) : ((EP)->ep.desc->bEndpointAddress \
& USB_DIR_IN)==USB_DIR_IN)
#define get_ep_by_pipe(udc, pipe) ((pipe == 1)? &udc->eps[0]: \
&udc->eps[pipe])
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/goku_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ goku_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
unsigned long flags;

ep = container_of(_ep, struct goku_ep, ep);
if (!_ep || !desc || ep->ep.desc
if (!_ep || !desc
|| desc->bDescriptorType != USB_DT_ENDPOINT)
return -EINVAL;
dev = ep->dev;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/mv_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ static int mv_ep_enable(struct usb_ep *_ep,
ep = container_of(_ep, struct mv_ep, ep);
udc = ep->udc;

if (!_ep || !desc || ep->ep.desc
if (!_ep || !desc
|| desc->bDescriptorType != USB_DT_ENDPOINT)
return -EINVAL;

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/omap_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static int omap_ep_enable(struct usb_ep *_ep,
u16 maxp;

/* catch various bogus parameters */
if (!_ep || !desc || ep->ep.desc
if (!_ep || !desc
|| desc->bDescriptorType != USB_DT_ENDPOINT
|| ep->bEndpointAddress != desc->bEndpointAddress
|| ep->maxpacket < usb_endpoint_maxp(desc)) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/pxa25x_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static int pxa25x_ep_enable (struct usb_ep *_ep,
struct pxa25x_udc *dev;

ep = container_of (_ep, struct pxa25x_ep, ep);
if (!_ep || !desc || ep->ep.desc || _ep->name == ep0name
if (!_ep || !desc || _ep->name == ep0name
|| desc->bDescriptorType != USB_DT_ENDPOINT
|| ep->bEndpointAddress != desc->bEndpointAddress
|| ep->fifo_size < usb_endpoint_maxp (desc)) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/s3c-hsudc.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ static int s3c_hsudc_ep_enable(struct usb_ep *_ep,
u32 ecr = 0;

hsep = our_ep(_ep);
if (!_ep || !desc || hsep->ep.desc || _ep->name == ep0name
if (!_ep || !desc || _ep->name == ep0name
|| desc->bDescriptorType != USB_DT_ENDPOINT
|| hsep->bEndpointAddress != desc->bEndpointAddress
|| ep_maxpacket(hsep) < usb_endpoint_maxp(desc))
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/s3c2410_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ static int s3c2410_udc_ep_enable(struct usb_ep *_ep,

ep = to_s3c2410_ep(_ep);

if (!_ep || !desc || ep->ep.desc
if (!_ep || !desc
|| _ep->name == ep0name
|| desc->bDescriptorType != USB_DT_ENDPOINT)
return -EINVAL;
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/host/ehci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,9 @@ static int ehci_init(struct usb_hcd *hcd)
hw = ehci->async->hw;
hw->hw_next = QH_NEXT(ehci, ehci->async->qh_dma);
hw->hw_info1 = cpu_to_hc32(ehci, QH_HEAD);
#if defined(CONFIG_PPC_PS3)
hw->hw_info1 |= cpu_to_hc32(ehci, (1 << 7)); /* I = 1 */
#endif
hw->hw_token = cpu_to_hc32(ehci, QTD_STS_HALT);
hw->hw_qtd_next = EHCI_LIST_END(ehci);
ehci->async->qh_state = QH_STATE_LINKED;
Expand Down
Loading

0 comments on commit 41c8c53

Please sign in to comment.