USB fixes for 3.6-rc7

Here are two USB bugfixes for your 3.6-rc7 tree.
 
 The OHCI fix has been reported a number of times and is a regression
 from 3.5, and the patch that causes the regression was on the way to the
 -stable trees before I was reminded (again) that this fix needed to get
 to your tree soon.
 
 The host controller bugfix was reported in older kernels as being pretty
 easy to trigger, and has been tested by Red Hat and their customers.
 
 Both have been in the usb-next branch in the -next tree for a while now,
 I just cherry-picked them out to get to you in time for the 3.6 release.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iEYEABECAAYFAlBkftYACgkQMUfUDdst+ymiqQCg17kPAosZg92EaXUb6uYjM5P1
 F2IAoKmPARaDJOQxRapr0S/G9t89mjr1
 =H+8v
 -----END PGP SIGNATURE-----

Merge tag 'usb-3.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg Kroah-Hartman:
 "Here are two USB bugfixes for your 3.6-rc7 tree.

  The OHCI fix has been reported a number of times and is a regression
  from 3.5, and the patch that causes the regression was on the way to
  the -stable trees before I was reminded (again) that this fix needed
  to get to your tree soon.

  The host controller bugfix was reported in older kernels as being
  pretty easy to trigger, and has been tested by Red Hat and their
  customers.

  Both have been in the usb-next branch in the -next tree for a while
  now, I just cherry-picked them out to get to you in time for the 3.6
  release.

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

* tag 'usb-3.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  USB: Fix race condition when removing host controllers
  USB: ohci-at91: fix null pointer in ohci_hcd_at91_overcurrent_irq
This commit is contained in:
Linus Torvalds 2012-09-27 16:49:15 -07:00
commit a31fb6988a
3 changed files with 5 additions and 6 deletions

View file

@ -624,7 +624,7 @@ static ssize_t usb_device_read(struct file *file, char __user *buf,
/* print devices for all busses */
list_for_each_entry(bus, &usb_bus_list, bus_list) {
/* recurse through all children of the root hub */
if (!bus->root_hub)
if (!bus_to_hcd(bus)->rh_registered)
continue;
usb_lock_device(bus->root_hub);
ret = usb_device_dump(&buf, &nbytes, &skip_bytes, ppos,

View file

@ -1011,10 +1011,7 @@ static int register_root_hub(struct usb_hcd *hcd)
if (retval) {
dev_err (parent_dev, "can't register root hub for %s, %d\n",
dev_name(&usb_dev->dev), retval);
}
mutex_unlock(&usb_bus_list_lock);
if (retval == 0) {
} else {
spin_lock_irq (&hcd_root_hub_lock);
hcd->rh_registered = 1;
spin_unlock_irq (&hcd_root_hub_lock);
@ -1023,6 +1020,7 @@ static int register_root_hub(struct usb_hcd *hcd)
if (HCD_DEAD(hcd))
usb_hc_died (hcd); /* This time clean up */
}
mutex_unlock(&usb_bus_list_lock);
return retval;
}

View file

@ -467,7 +467,8 @@ static irqreturn_t ohci_hcd_at91_overcurrent_irq(int irq, void *data)
/* From the GPIO notifying the over-current situation, find
* out the corresponding port */
at91_for_each_port(port) {
if (gpio_to_irq(pdata->overcurrent_pin[port]) == irq) {
if (gpio_is_valid(pdata->overcurrent_pin[port]) &&
gpio_to_irq(pdata->overcurrent_pin[port]) == irq) {
gpio = pdata->overcurrent_pin[port];
break;
}