Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (25 commits)
  USB: net: asix: add support for Cables-to-Go USB Ethernet adapter
  USB: gadget: cdc-acm deadlock fix
  USB: EHCI: fix divide-by-zero bug
  USB: EHCI: fix handling of dead controllers
  usb: r8a66597-hcd: fix wrong data access in SuperH on-chip USB
  ub: stub pre_reset and post_reset to fix oops
  USB: SISUSB2VGA driver: add 0x0711, 0x0903
  usb: unusual devs patch for Nokia 7610 Supernova
  USB: remove optional bus bindings in isp1760, fixing runtime warning
  + usb-serial-cp2101-add-enfora-gsm2228.patch added to -mm tree
  USB: storage: adjust comment in Kconfig
  USB: Fix PS3 USB shutdown problems
  USB: unusual_devs entry for Argosy USB mass-storage interface
  USB: cdc-acm.c: fix recursive lock in acm_start_wb error path
  USB: CP2101 Add device ID for AMB2560
  USB: mention URB_FREE_BUFFER in usb_free_urb documentation
  USB: Add YISO u893 usb modem vendor and product IDs to option driver
  usb: musb: fix BULK request on different available endpoints
  usb: musb: fix debug global variable name
  usb: musb: Removes compilation warning in gadget mode
  ...
  • Loading branch information
Linus Torvalds committed Nov 13, 2008
2 parents 7e5b95f + ccf9540 commit 9c7c354
Show file tree
Hide file tree
Showing 27 changed files with 218 additions and 122 deletions.
20 changes: 18 additions & 2 deletions drivers/block/ub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1546,8 +1546,6 @@ static void ub_top_sense_done(struct ub_dev *sc, struct ub_scsi_cmd *scmd)

/*
* Reset management
* XXX Move usb_reset_device to khubd. Hogging kevent is not a good thing.
* XXX Make usb_sync_reset asynchronous.
*/

static void ub_reset_enter(struct ub_dev *sc, int try)
Expand Down Expand Up @@ -1632,6 +1630,22 @@ static void ub_reset_task(struct work_struct *work)
spin_unlock_irqrestore(sc->lock, flags);
}

/*
* XXX Reset brackets are too much hassle to implement, so just stub them
* in order to prevent forced unbinding (which deadlocks solid when our
* ->disconnect method waits for the reset to complete and this kills keventd).
*
* XXX Tell Alan to move usb_unlock_device inside of usb_reset_device,
* or else the post_reset is invoked, and restats I/O on a locked device.
*/
static int ub_pre_reset(struct usb_interface *iface) {
return 0;
}

static int ub_post_reset(struct usb_interface *iface) {
return 0;
}

/*
* This is called from a process context.
*/
Expand Down Expand Up @@ -2446,6 +2460,8 @@ static struct usb_driver ub_driver = {
.probe = ub_probe,
.disconnect = ub_disconnect,
.id_table = ub_usb_ids,
.pre_reset = ub_pre_reset,
.post_reset = ub_post_reset,
};

static int __init ub_init(void)
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/usb/asix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,10 @@ static const struct usb_device_id products [] = {
// Apple USB Ethernet Adapter
USB_DEVICE(0x05ac, 0x1402),
.driver_info = (unsigned long) &ax88772_info,
}, {
// Cables-to-Go USB Ethernet Adapter
USB_DEVICE(0x0b95, 0x772a),
.driver_info = (unsigned long) &ax88772_info,
},
{ }, // END
};
Expand Down
9 changes: 4 additions & 5 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,12 @@ static int acm_wb_is_avail(struct acm *acm)
}

/*
* Finish write.
* Finish write. Caller must hold acm->write_lock
*/
static void acm_write_done(struct acm *acm, struct acm_wb *wb)
{
unsigned long flags;

spin_lock_irqsave(&acm->write_lock, flags);
wb->use = 0;
acm->transmitting--;
spin_unlock_irqrestore(&acm->write_lock, flags);
}

/*
Expand Down Expand Up @@ -482,6 +478,7 @@ static void acm_write_bulk(struct urb *urb)
{
struct acm_wb *wb = urb->context;
struct acm *acm = wb->instance;
unsigned long flags;

if (verbose || urb->status
|| (urb->actual_length != urb->transfer_buffer_length))
Expand All @@ -490,7 +487,9 @@ static void acm_write_bulk(struct urb *urb)
urb->transfer_buffer_length,
urb->status);

spin_lock_irqsave(&acm->write_lock, flags);
acm_write_done(acm, wb);
spin_unlock_irqrestore(&acm->write_lock, flags);
if (ACM_READY(acm))
schedule_work(&acm->work);
else
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,7 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
continue;
dev_dbg(&dev->dev, "unregistering interface %s\n",
dev_name(&interface->dev));
interface->unregistering = 1;
usb_remove_sysfs_intf_files(interface);
device_del(&interface->dev);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/core/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ int usb_create_sysfs_intf_files(struct usb_interface *intf)
struct usb_host_interface *alt = intf->cur_altsetting;
int retval;

if (intf->sysfs_files_created)
if (intf->sysfs_files_created || intf->unregistering)
return 0;

/* The interface string may be present in some altsettings
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/core/urb.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ EXPORT_SYMBOL_GPL(usb_alloc_urb);
* Must be called when a user of a urb is finished with it. When the last user
* of the urb calls this function, the memory of the urb is freed.
*
* Note: The transfer buffer associated with the urb is not freed, that must be
* done elsewhere.
* Note: The transfer buffer associated with the urb is not freed unless the
* URB_FREE_BUFFER transfer flag is set.
*/
void usb_free_urb(struct urb *urb)
{
Expand Down
4 changes: 4 additions & 0 deletions drivers/usb/gadget/f_acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,11 @@ static int acm_cdc_notify(struct f_acm *acm, u8 type, u16 value,
notify->wLength = cpu_to_le16(length);
memcpy(buf, data, length);

/* ep_queue() can complete immediately if it fills the fifo... */
spin_unlock(&acm->lock);
status = usb_ep_queue(ep, req, GFP_ATOMIC);
spin_lock(&acm->lock);

if (status < 0) {
ERROR(acm->port.func.config->cdev,
"acm ttyGS%d can't notify serial state, %d\n",
Expand Down
23 changes: 6 additions & 17 deletions drivers/usb/host/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -110,29 +110,18 @@ config USB_ISP116X_HCD

config USB_ISP1760_HCD
tristate "ISP 1760 HCD support"
depends on USB && EXPERIMENTAL
depends on USB && EXPERIMENTAL && (PCI || PPC_OF)
---help---
The ISP1760 chip is a USB 2.0 host controller.

This driver does not support isochronous transfers or OTG.
This USB controller is usually attached to a non-DMA-Master
capable bus. NXP's eval kit brings this chip on PCI card
where the chip itself is behind a PLB to simulate such
a bus.

To compile this driver as a module, choose M here: the
module will be called isp1760-hcd.

config USB_ISP1760_PCI
bool "Support for the PCI bus"
depends on USB_ISP1760_HCD && PCI
---help---
Enables support for the device present on the PCI bus.
This should only be required if you happen to have the eval kit from
NXP and you are going to test it.

config USB_ISP1760_OF
bool "Support for the OF platform bus"
depends on USB_ISP1760_HCD && PPC_OF
---help---
Enables support for the device present on the PowerPC
OpenFirmware platform bus.
module will be called isp1760.

config USB_OHCI_HCD
tristate "OHCI HCD support"
Expand Down
25 changes: 12 additions & 13 deletions drivers/usb/host/ehci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ static int ehci_run (struct usb_hcd *hcd)
static irqreturn_t ehci_irq (struct usb_hcd *hcd)
{
struct ehci_hcd *ehci = hcd_to_ehci (hcd);
u32 status, pcd_status = 0, cmd;
u32 status, masked_status, pcd_status = 0, cmd;
int bh;

spin_lock (&ehci->lock);
Expand All @@ -656,14 +656,14 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
goto dead;
}

status &= INTR_MASK;
if (!status) { /* irq sharing? */
masked_status = status & INTR_MASK;
if (!masked_status) { /* irq sharing? */
spin_unlock(&ehci->lock);
return IRQ_NONE;
}

/* clear (just) interrupts */
ehci_writel(ehci, status, &ehci->regs->status);
ehci_writel(ehci, masked_status, &ehci->regs->status);
cmd = ehci_readl(ehci, &ehci->regs->command);
bh = 0;

Expand Down Expand Up @@ -734,18 +734,17 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)

/* PCI errors [4.15.2.4] */
if (unlikely ((status & STS_FATAL) != 0)) {
ehci_err(ehci, "fatal error\n");
dbg_cmd(ehci, "fatal", cmd);
dbg_status(ehci, "fatal", status);
if (status & STS_HALT) {
ehci_err (ehci, "fatal error\n");
ehci_halt(ehci);
dead:
ehci_reset (ehci);
ehci_writel(ehci, 0, &ehci->regs->configured_flag);
/* generic layer kills/unlinks all urbs, then
* uses ehci_stop to clean up the rest
*/
bh = 1;
}
ehci_reset(ehci);
ehci_writel(ehci, 0, &ehci->regs->configured_flag);
/* generic layer kills/unlinks all urbs, then
* uses ehci_stop to clean up the rest
*/
bh = 1;
}

if (bh)
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/host/ehci-ps3.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ static int ps3_ehci_remove(struct ps3_system_bus_device *dev)

tmp = hcd->irq;

ehci_shutdown(hcd);
usb_remove_hcd(hcd);

ps3_system_bus_set_driver_data(dev, NULL);
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/host/ehci-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ iso_stream_init (
*/
stream->usecs = HS_USECS_ISO (maxp);
bandwidth = stream->usecs * 8;
bandwidth /= 1 << (interval - 1);
bandwidth /= interval;

} else {
u32 addr;
Expand Down Expand Up @@ -951,7 +951,7 @@ iso_stream_init (
} else
stream->raw_mask = smask_out [hs_transfers - 1];
bandwidth = stream->usecs + stream->c_usecs;
bandwidth /= 1 << (interval + 2);
bandwidth /= interval << 3;

/* stream->splits gets created from raw_mask later */
stream->address = cpu_to_hc32(ehci, addr);
Expand Down
22 changes: 11 additions & 11 deletions drivers/usb/host/isp1760-if.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
#include "../core/hcd.h"
#include "isp1760-hcd.h"

#ifdef CONFIG_USB_ISP1760_OF
#ifdef CONFIG_PPC_OF
#include <linux/of.h>
#include <linux/of_platform.h>
#endif

#ifdef CONFIG_USB_ISP1760_PCI
#ifdef CONFIG_PCI
#include <linux/pci.h>
#endif

#ifdef CONFIG_USB_ISP1760_OF
#ifdef CONFIG_PPC_OF
static int of_isp1760_probe(struct of_device *dev,
const struct of_device_id *match)
{
Expand Down Expand Up @@ -128,7 +128,7 @@ static struct of_platform_driver isp1760_of_driver = {
};
#endif

#ifdef CONFIG_USB_ISP1760_PCI
#ifdef CONFIG_PCI
static u32 nxp_pci_io_base;
static u32 iolength;
static u32 pci_mem_phy0;
Expand Down Expand Up @@ -288,28 +288,28 @@ static struct pci_driver isp1761_pci_driver = {

static int __init isp1760_init(void)
{
int ret = -ENODEV;
int ret;

init_kmem_once();

#ifdef CONFIG_USB_ISP1760_OF
#ifdef CONFIG_PPC_OF
ret = of_register_platform_driver(&isp1760_of_driver);
if (ret) {
deinit_kmem_cache();
return ret;
}
#endif
#ifdef CONFIG_USB_ISP1760_PCI
#ifdef CONFIG_PCI
ret = pci_register_driver(&isp1761_pci_driver);
if (ret)
goto unreg_of;
#endif
return ret;

#ifdef CONFIG_USB_ISP1760_PCI
#ifdef CONFIG_PCI
unreg_of:
#endif
#ifdef CONFIG_USB_ISP1760_OF
#ifdef CONFIG_PPC_OF
of_unregister_platform_driver(&isp1760_of_driver);
#endif
deinit_kmem_cache();
Expand All @@ -319,10 +319,10 @@ module_init(isp1760_init);

static void __exit isp1760_exit(void)
{
#ifdef CONFIG_USB_ISP1760_OF
#ifdef CONFIG_PPC_OF
of_unregister_platform_driver(&isp1760_of_driver);
#endif
#ifdef CONFIG_USB_ISP1760_PCI
#ifdef CONFIG_PCI
pci_unregister_driver(&isp1761_pci_driver);
#endif
deinit_kmem_cache();
Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/host/ohci-ps3.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static int ps3_ohci_probe(struct ps3_system_bus_device *dev)
return result;
}

static int ps3_ohci_remove (struct ps3_system_bus_device *dev)
static int ps3_ohci_remove(struct ps3_system_bus_device *dev)
{
unsigned int tmp;
struct usb_hcd *hcd =
Expand All @@ -205,6 +205,7 @@ static int ps3_ohci_remove (struct ps3_system_bus_device *dev)

tmp = hcd->irq;

ohci_shutdown(hcd);
usb_remove_hcd(hcd);

ps3_system_bus_set_driver_data(dev, NULL);
Expand Down
5 changes: 3 additions & 2 deletions drivers/usb/host/r8a66597-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1763,11 +1763,12 @@ static void r8a66597_timer(unsigned long _r8a66597)
{
struct r8a66597 *r8a66597 = (struct r8a66597 *)_r8a66597;
unsigned long flags;
int port;

spin_lock_irqsave(&r8a66597->lock, flags);

r8a66597_root_hub_control(r8a66597, 0);
r8a66597_root_hub_control(r8a66597, 1);
for (port = 0; port < R8A66597_MAX_ROOT_HUB; port++)
r8a66597_root_hub_control(r8a66597, port);

spin_unlock_irqrestore(&r8a66597->lock, flags);
}
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/misc/sisusbvga/sisusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3270,6 +3270,7 @@ static struct usb_device_id sisusb_table [] = {
{ USB_DEVICE(0x0711, 0x0900) },
{ USB_DEVICE(0x0711, 0x0901) },
{ USB_DEVICE(0x0711, 0x0902) },
{ USB_DEVICE(0x0711, 0x0903) },
{ USB_DEVICE(0x0711, 0x0918) },
{ USB_DEVICE(0x182d, 0x021c) },
{ USB_DEVICE(0x182d, 0x0269) },
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/misc/vstusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ static long vstusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
__func__);
retval = -EFAULT;
} else {
dev_dbg(&dev->dev, "%s: recv %d bytes from pipe %d\n",
dev_dbg(&dev->dev, "%s: recv %zd bytes from pipe %d\n",
__func__, usb_data.count, usb_data.pipe);
}

Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@



unsigned debug;
module_param(debug, uint, S_IRUGO | S_IWUSR);
unsigned musb_debug;
module_param(musb_debug, uint, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(debug, "Debug message level. Default = 0");

#define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia"
Expand Down Expand Up @@ -2248,7 +2248,7 @@ static int __init musb_init(void)
"host"
#endif
", debug=%d\n",
musb_driver_name, debug);
musb_driver_name, musb_debug);
return platform_driver_probe(&musb_driver, musb_probe);
}

Expand Down
Loading

0 comments on commit 9c7c354

Please sign in to comment.