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: (32 commits)
  USB: serial: no unnecessary GFP_ATOMIC in oti6858
  USB: serial: fix race between unthrottle and completion handler in visor
  USB: serial: fix assumption that throttle/unthrottle cannot sleep
  USB: serial: fix race between unthrottle and completion handler in symbolserial
  USB: serial: fix race between unthrottle and completion handler in opticon
  USB: ehci: Fix isoc scheduling boundary checking.
  USB: storage: When a device returns no sense data, call it a Hardware Error
  USB: small fix in error case of suspend in generic usbserial code
  USB: visor: fix trivial accounting bug in visor driver
  USB: Fix throttling in generic usbserial driver
  USB: cp210x: Add support for the DW700 UART
  USB: ipaq: fix oops when device is plugged in
  USB: isp1362: fix build warnings on 64-bit systems
  USB: gadget: imx_udc: Use resource size
  USB: storage: iRiver P7 UNUSUAL_DEV patch
  USB: musb: make HAVE_CLK support optional
  USB: xhci: Fix dropping endpoints from the xHC schedule.
  USB: xhci: Don't wait for a disable slot cmd when HC dies.
  USB: xhci: Handle canceled URBs when HC dies.
  USB: xhci: Stop debugging polling loop when HC dies.
  ...
  • Loading branch information
Linus Torvalds committed Oct 11, 2009
2 parents ff945af + 40d2858 commit c6c5992
Show file tree
Hide file tree
Showing 35 changed files with 316 additions and 412 deletions.
2 changes: 1 addition & 1 deletion drivers/usb/class/usbtmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#define USBTMC_SIZE_IOBUFFER 2048

/* Default USB timeout (in milliseconds) */
#define USBTMC_TIMEOUT 10
#define USBTMC_TIMEOUT 5000

/*
* Maximum number of read cycles to empty bulk in endpoint during CLEAR and
Expand Down
8 changes: 4 additions & 4 deletions drivers/usb/gadget/imx_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,8 @@ static int __init imx_udc_probe(struct platform_device *pdev)
struct clk *clk;
void __iomem *base;
int ret = 0;
int i, res_size;
int i;
resource_size_t res_size;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
Expand All @@ -1416,7 +1417,7 @@ static int __init imx_udc_probe(struct platform_device *pdev)
return -ENODEV;
}

res_size = res->end - res->start + 1;
res_size = resource_size(res);
if (!request_mem_region(res->start, res_size, res->name)) {
dev_err(&pdev->dev, "can't allocate %d bytes at %d address\n",
res_size, res->start);
Expand Down Expand Up @@ -1527,8 +1528,7 @@ static int __exit imx_udc_remove(struct platform_device *pdev)
clk_disable(imx_usb->clk);
iounmap(imx_usb->base);

release_mem_region(imx_usb->res->start,
imx_usb->res->end - imx_usb->res->start + 1);
release_mem_region(imx_usb->res->start, resource_size(imx_usb->res));

if (pdata->exit)
pdata->exit(&pdev->dev);
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/host/ehci-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,7 @@ iso_stream_schedule (
status = -EFBIG;
goto fail;
}
stream->next_uframe = start;
goto ready;
}

Expand Down
18 changes: 9 additions & 9 deletions drivers/usb/host/isp1362-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2284,10 +2284,10 @@ static int isp1362_mem_config(struct usb_hcd *hcd)
dev_info(hcd->self.controller, "ISP1362 Memory usage:\n");
dev_info(hcd->self.controller, " ISTL: 2 * %4d: %4d @ $%04x:$%04x\n",
istl_size / 2, istl_size, 0, istl_size / 2);
dev_info(hcd->self.controller, " INTL: %4d * (%3u+8): %4d @ $%04x\n",
dev_info(hcd->self.controller, " INTL: %4d * (%3lu+8): %4d @ $%04x\n",
ISP1362_INTL_BUFFERS, intl_blksize - PTD_HEADER_SIZE,
intl_size, istl_size);
dev_info(hcd->self.controller, " ATL : %4d * (%3u+8): %4d @ $%04x\n",
dev_info(hcd->self.controller, " ATL : %4d * (%3lu+8): %4d @ $%04x\n",
atl_buffers, atl_blksize - PTD_HEADER_SIZE,
atl_size, istl_size + intl_size);
dev_info(hcd->self.controller, " USED/FREE: %4d %4d\n", total,
Expand Down Expand Up @@ -2677,12 +2677,12 @@ static int __devexit isp1362_remove(struct platform_device *pdev)
DBG(0, "%s: Removing HCD\n", __func__);
usb_remove_hcd(hcd);

DBG(0, "%s: Unmapping data_reg @ %08x\n", __func__,
(u32)isp1362_hcd->data_reg);
DBG(0, "%s: Unmapping data_reg @ %p\n", __func__,
isp1362_hcd->data_reg);
iounmap(isp1362_hcd->data_reg);

DBG(0, "%s: Unmapping addr_reg @ %08x\n", __func__,
(u32)isp1362_hcd->addr_reg);
DBG(0, "%s: Unmapping addr_reg @ %p\n", __func__,
isp1362_hcd->addr_reg);
iounmap(isp1362_hcd->addr_reg);

res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
Expand Down Expand Up @@ -2810,16 +2810,16 @@ static int __init isp1362_probe(struct platform_device *pdev)
return 0;

err6:
DBG(0, "%s: Freeing dev %08x\n", __func__, (u32)isp1362_hcd);
DBG(0, "%s: Freeing dev %p\n", __func__, isp1362_hcd);
usb_put_hcd(hcd);
err5:
DBG(0, "%s: Unmapping data_reg @ %08x\n", __func__, (u32)data_reg);
DBG(0, "%s: Unmapping data_reg @ %p\n", __func__, data_reg);
iounmap(data_reg);
err4:
DBG(0, "%s: Releasing mem region %08lx\n", __func__, (long unsigned int)data->start);
release_mem_region(data->start, resource_len(data));
err3:
DBG(0, "%s: Unmapping addr_reg @ %08x\n", __func__, (u32)addr_reg);
DBG(0, "%s: Unmapping addr_reg @ %p\n", __func__, addr_reg);
iounmap(addr_reg);
err2:
DBG(0, "%s: Releasing mem region %08lx\n", __func__, (long unsigned int)addr->start);
Expand Down
12 changes: 6 additions & 6 deletions drivers/usb/host/isp1362.h
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ static inline const char *ISP1362_INT_NAME(int n)

static inline void ALIGNSTAT(struct isp1362_hcd *isp1362_hcd, void *ptr)
{
unsigned p = (unsigned)ptr;
unsigned long p = (unsigned long)ptr;
if (!(p & 0xf))
isp1362_hcd->stat16++;
else if (!(p & 0x7))
Expand Down Expand Up @@ -770,7 +770,7 @@ static void isp1362_write_fifo(struct isp1362_hcd *isp1362_hcd, void *buf, u16 l
if (!len)
return;

if ((unsigned)dp & 0x1) {
if ((unsigned long)dp & 0x1) {
/* not aligned */
for (; len > 1; len -= 2) {
data = *dp++;
Expand Down Expand Up @@ -962,8 +962,8 @@ static void isp1362_read_buffer(struct isp1362_hcd *isp1362_hcd, void *buf, u16

isp1362_write_diraddr(isp1362_hcd, offset, len);

DBG(3, "%s: Reading %d byte from buffer @%04x to memory @ %08x\n", __func__,
len, offset, (u32)buf);
DBG(3, "%s: Reading %d byte from buffer @%04x to memory @ %p\n",
__func__, len, offset, buf);

isp1362_write_reg16(isp1362_hcd, HCuPINT, HCuPINT_EOT);
_WARN_ON((isp1362_read_reg16(isp1362_hcd, HCuPINT) & HCuPINT_EOT));
Expand All @@ -982,8 +982,8 @@ static void isp1362_write_buffer(struct isp1362_hcd *isp1362_hcd, void *buf, u16

isp1362_write_diraddr(isp1362_hcd, offset, len);

DBG(3, "%s: Writing %d byte to buffer @%04x from memory @ %08x\n", __func__,
len, offset, (u32)buf);
DBG(3, "%s: Writing %d byte to buffer @%04x from memory @ %p\n",
__func__, len, offset, buf);

isp1362_write_reg16(isp1362_hcd, HCuPINT, HCuPINT_EOT);
_WARN_ON((isp1362_read_reg16(isp1362_hcd, HCuPINT) & HCuPINT_EOT));
Expand Down
29 changes: 28 additions & 1 deletion drivers/usb/host/xhci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,12 @@ void xhci_event_ring_work(unsigned long arg)
spin_lock_irqsave(&xhci->lock, flags);
temp = xhci_readl(xhci, &xhci->op_regs->status);
xhci_dbg(xhci, "op reg status = 0x%x\n", temp);
if (temp == 0xffffffff) {
xhci_dbg(xhci, "HW died, polling stopped.\n");
spin_unlock_irqrestore(&xhci->lock, flags);
return;
}

temp = xhci_readl(xhci, &xhci->ir_set->irq_pending);
xhci_dbg(xhci, "ir_set 0 pending = 0x%x\n", temp);
xhci_dbg(xhci, "No-op commands handled = %d\n", xhci->noops_handled);
Expand Down Expand Up @@ -776,6 +782,7 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
{
unsigned long flags;
int ret;
u32 temp;
struct xhci_hcd *xhci;
struct xhci_td *td;
unsigned int ep_index;
Expand All @@ -788,6 +795,17 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
ret = usb_hcd_check_unlink_urb(hcd, urb, status);
if (ret || !urb->hcpriv)
goto done;
temp = xhci_readl(xhci, &xhci->op_regs->status);
if (temp == 0xffffffff) {
xhci_dbg(xhci, "HW died, freeing TD.\n");
td = (struct xhci_td *) urb->hcpriv;

usb_hcd_unlink_urb_from_ep(hcd, urb);
spin_unlock_irqrestore(&xhci->lock, flags);
usb_hcd_giveback_urb(xhci_to_hcd(xhci), urb, -ESHUTDOWN);
kfree(td);
return ret;
}

xhci_dbg(xhci, "Cancel URB %p\n", urb);
xhci_dbg(xhci, "Event ring:\n");
Expand Down Expand Up @@ -877,7 +895,7 @@ int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
ctrl_ctx->drop_flags |= drop_flag;
new_drop_flags = ctrl_ctx->drop_flags;

ctrl_ctx->add_flags = ~drop_flag;
ctrl_ctx->add_flags &= ~drop_flag;
new_add_flags = ctrl_ctx->add_flags;

last_ctx = xhci_last_valid_endpoint(ctrl_ctx->add_flags);
Expand Down Expand Up @@ -1410,11 +1428,20 @@ void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
{
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
unsigned long flags;
u32 state;

if (udev->slot_id == 0)
return;

spin_lock_irqsave(&xhci->lock, flags);
/* Don't disable the slot if the host controller is dead. */
state = xhci_readl(xhci, &xhci->op_regs->status);
if (state == 0xffffffff) {
xhci_free_virt_device(xhci, udev->slot_id);
spin_unlock_irqrestore(&xhci->lock, flags);
return;
}

if (xhci_queue_slot_control(xhci, TRB_DISABLE_SLOT, udev->slot_id)) {
spin_unlock_irqrestore(&xhci->lock, flags);
xhci_dbg(xhci, "FIXME: allocate a command ring segment\n");
Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/misc/usblcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ static int lcd_probe(struct usb_interface *interface, const struct usb_device_id

if (le16_to_cpu(dev->udev->descriptor.idProduct) != 0x0001) {
dev_warn(&interface->dev, "USBLCD model not supported.\n");
return -ENODEV;
retval = -ENODEV;
goto error;
}

/* set up the endpoint information */
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/musb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ comment "Enable Host or Gadget support to see Inventra options"

# (M)HDRC = (Multipoint) Highspeed Dual-Role Controller
config USB_MUSB_HDRC
depends on (USB || USB_GADGET) && HAVE_CLK
depends on (USB || USB_GADGET)
depends on !SUPERH
select NOP_USB_XCEIV if ARCH_DAVINCI
select TWL4030_USB if MACH_OMAP_3430SDP
Expand Down
1 change: 0 additions & 1 deletion drivers/usb/musb/blackfin.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/list.h>
#include <linux/clk.h>
#include <linux/gpio.h>
#include <linux/io.h>

Expand Down
7 changes: 7 additions & 0 deletions drivers/usb/musb/musb_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ struct musb_ep;
#endif
#endif /* need MUSB gadget selection */

#ifndef CONFIG_HAVE_CLK
/* Dummy stub for clk framework */
#define clk_get(dev, id) NULL
#define clk_put(clock) do {} while (0)
#define clk_enable(clock) do {} while (0)
#define clk_disable(clock) do {} while (0)
#endif

#ifdef CONFIG_PROC_FS
#include <linux/fs.h>
Expand Down
9 changes: 0 additions & 9 deletions drivers/usb/musb/musb_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,15 +439,6 @@ static inline void musb_write_txhubport(void __iomem *mbase, u8 epnum,
/* Not implemented - HW has seperate Tx/Rx FIFO */
#define MUSB_TXCSR_MODE 0x0000

/*
* Dummy stub for clk framework, it will be removed
* until Blackfin supports clk framework
*/
#define clk_get(dev, id) NULL
#define clk_put(clock) do {} while (0)
#define clk_enable(clock) do {} while (0)
#define clk_disable(clock) do {} while (0)

static inline void musb_write_txfifosz(void __iomem *mbase, u8 c_size)
{
}
Expand Down
10 changes: 4 additions & 6 deletions drivers/usb/serial/aircable.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,13 +554,12 @@ static void aircable_throttle(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
struct aircable_private *priv = usb_get_serial_port_data(port);
unsigned long flags;

dbg("%s - port %d", __func__, port->number);

spin_lock_irqsave(&priv->rx_lock, flags);
spin_lock_irq(&priv->rx_lock);
priv->rx_flags |= THROTTLED;
spin_unlock_irqrestore(&priv->rx_lock, flags);
spin_unlock_irq(&priv->rx_lock);
}

/* Based on ftdi_sio.c unthrottle */
Expand All @@ -569,14 +568,13 @@ static void aircable_unthrottle(struct tty_struct *tty)
struct usb_serial_port *port = tty->driver_data;
struct aircable_private *priv = usb_get_serial_port_data(port);
int actually_throttled;
unsigned long flags;

dbg("%s - port %d", __func__, port->number);

spin_lock_irqsave(&priv->rx_lock, flags);
spin_lock_irq(&priv->rx_lock);
actually_throttled = priv->rx_flags & ACTUALLY_THROTTLED;
priv->rx_flags &= ~(THROTTLED | ACTUALLY_THROTTLED);
spin_unlock_irqrestore(&priv->rx_lock, flags);
spin_unlock_irq(&priv->rx_lock);

if (actually_throttled)
schedule_work(&priv->rx_work);
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/serial/cp210x.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ static struct usb_device_id id_table [] = {
{ USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */
{ USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */
{ USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
{ USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
{ } /* Terminating Entry */
};

Expand Down
12 changes: 5 additions & 7 deletions drivers/usb/serial/cypress_m8.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,13 +1155,12 @@ static void cypress_throttle(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
struct cypress_private *priv = usb_get_serial_port_data(port);
unsigned long flags;

dbg("%s - port %d", __func__, port->number);

spin_lock_irqsave(&priv->lock, flags);
spin_lock_irq(&priv->lock);
priv->rx_flags = THROTTLED;
spin_unlock_irqrestore(&priv->lock, flags);
spin_unlock_irq(&priv->lock);
}


Expand All @@ -1170,22 +1169,21 @@ static void cypress_unthrottle(struct tty_struct *tty)
struct usb_serial_port *port = tty->driver_data;
struct cypress_private *priv = usb_get_serial_port_data(port);
int actually_throttled, result;
unsigned long flags;

dbg("%s - port %d", __func__, port->number);

spin_lock_irqsave(&priv->lock, flags);
spin_lock_irq(&priv->lock);
actually_throttled = priv->rx_flags & ACTUALLY_THROTTLED;
priv->rx_flags = 0;
spin_unlock_irqrestore(&priv->lock, flags);
spin_unlock_irq(&priv->lock);

if (!priv->comm_is_ok)
return;

if (actually_throttled) {
port->interrupt_in_urb->dev = port->serial->dev;

result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (result) {
dev_err(&port->dev, "%s - failed submitting read urb, "
"error %d\n", __func__, result);
Expand Down
8 changes: 4 additions & 4 deletions drivers/usb/serial/digi_acceleport.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,16 +898,16 @@ static void digi_rx_unthrottle(struct tty_struct *tty)

spin_lock_irqsave(&priv->dp_port_lock, flags);

/* turn throttle off */
priv->dp_throttled = 0;
priv->dp_throttle_restart = 0;

/* restart read chain */
if (priv->dp_throttle_restart) {
port->read_urb->dev = port->serial->dev;
ret = usb_submit_urb(port->read_urb, GFP_ATOMIC);
}

/* turn throttle off */
priv->dp_throttled = 0;
priv->dp_throttle_restart = 0;

spin_unlock_irqrestore(&priv->dp_port_lock, flags);

if (ret)
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/empeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ static void empeg_unthrottle(struct tty_struct *tty)
dbg("%s - port %d", __func__, port->number);

port->read_urb->dev = port->serial->dev;
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
result = usb_submit_urb(port->read_urb, GFP_KERNEL);
if (result)
dev_err(&port->dev,
"%s - failed submitting read urb, error %d\n",
Expand Down
Loading

0 comments on commit c6c5992

Please sign in to comment.