Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f8e35fc authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6:
  USB: "sparse" cleanups for usb gadgets
  usb-serial: Fix edgeport regression on non-EPiC devices
  USB: more pxa2xx_udc dead code removal
  USB: NIKON D50 is an unusual device
  USB: drivers/usb/serial/sierra.c: make 3 functions static
  USB: fix BUG: sleeping function called from invalid context at /home/jeremy/hg/xen/paravirt/linux/drivers/usb/core/urb.c:524, in_atomic():1, irqs_disabled():0
  USB: mct_u232: Convert to proper speed handling API
  digi_acceleport: Drag the driver kicking and screaming into coding style
  cp2101: Remove broken termios optimisation, use proper speed API
  USB: Fix a bug in usb_start_wait_urb
  USB: fix scatterlist PIO case (IOMMU)
  USB: fix usb_serial_suspend(): buggy code
  USB: yet another quirky device
  USB: Add CanonScan LiDE30 to the quirk list
  USB: even more quirks
  USB: usb.h kernel-doc additions
  USB: more quirky devices
  USB: Don't let usb-storage steal Blackberry Pearl
  USB: devices misc: Trivial patch to build the IOWARRIOR when it is selected in Kconfig
parents 970e2dfa a9475226
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -48,6 +48,7 @@ obj-$(CONFIG_USB_SISUSBVGA) += misc/
obj-$(CONFIG_USB_TEST)		+= misc/
obj-$(CONFIG_USB_TEST)		+= misc/
obj-$(CONFIG_USB_TRANCEVIBRATOR)+= misc/
obj-$(CONFIG_USB_TRANCEVIBRATOR)+= misc/
obj-$(CONFIG_USB_USS720)	+= misc/
obj-$(CONFIG_USB_USS720)	+= misc/
obj-$(CONFIG_USB_IOWARRIOR)	+= misc/


obj-$(CONFIG_USB_ATM)		+= atm/
obj-$(CONFIG_USB_ATM)		+= atm/
obj-$(CONFIG_USB_SPEEDTOUCH)	+= atm/
obj-$(CONFIG_USB_SPEEDTOUCH)	+= atm/
+27 −14
Original line number Original line Diff line number Diff line
@@ -18,9 +18,17 @@
#include "hcd.h"	/* for usbcore internals */
#include "hcd.h"	/* for usbcore internals */
#include "usb.h"
#include "usb.h"


struct api_context {
	struct completion	done;
	int			status;
};

static void usb_api_blocking_completion(struct urb *urb)
static void usb_api_blocking_completion(struct urb *urb)
{
{
	complete((struct completion *)urb->context);
	struct api_context *ctx = urb->context;

	ctx->status = urb->status;
	complete(&ctx->done);
}
}




@@ -32,20 +40,21 @@ static void usb_api_blocking_completion(struct urb *urb)
 */
 */
static int usb_start_wait_urb(struct urb *urb, int timeout, int *actual_length)
static int usb_start_wait_urb(struct urb *urb, int timeout, int *actual_length)
{ 
{ 
	struct completion done;
	struct api_context ctx;
	unsigned long expire;
	unsigned long expire;
	int retval;
	int retval;
	int status = urb->status;


	init_completion(&done); 	
	init_completion(&ctx.done);
	urb->context = &done;
	urb->context = &ctx;
	urb->actual_length = 0;
	urb->actual_length = 0;
	retval = usb_submit_urb(urb, GFP_NOIO);
	retval = usb_submit_urb(urb, GFP_NOIO);
	if (unlikely(retval))
	if (unlikely(retval))
		goto out;
		goto out;


	expire = timeout ? msecs_to_jiffies(timeout) : MAX_SCHEDULE_TIMEOUT;
	expire = timeout ? msecs_to_jiffies(timeout) : MAX_SCHEDULE_TIMEOUT;
	if (!wait_for_completion_timeout(&done, expire)) {
	if (!wait_for_completion_timeout(&ctx.done, expire)) {
		usb_kill_urb(urb);
		retval = (ctx.status == -ENOENT ? -ETIMEDOUT : ctx.status);


		dev_dbg(&urb->dev->dev,
		dev_dbg(&urb->dev->dev,
			"%s timed out on ep%d%s len=%d/%d\n",
			"%s timed out on ep%d%s len=%d/%d\n",
@@ -54,11 +63,8 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int *actual_length)
			usb_pipein(urb->pipe) ? "in" : "out",
			usb_pipein(urb->pipe) ? "in" : "out",
			urb->actual_length,
			urb->actual_length,
			urb->transfer_buffer_length);
			urb->transfer_buffer_length);

		usb_kill_urb(urb);
		retval = status == -ENOENT ? -ETIMEDOUT : status;
	} else
	} else
		retval = status;
		retval = ctx.status;
out:
out:
	if (actual_length)
	if (actual_length)
		*actual_length = urb->actual_length;
		*actual_length = urb->actual_length;
@@ -411,15 +417,22 @@ int usb_sg_init (
		 * Some systems need to revert to PIO when DMA is temporarily
		 * Some systems need to revert to PIO when DMA is temporarily
		 * unavailable.  For their sakes, both transfer_buffer and
		 * unavailable.  For their sakes, both transfer_buffer and
		 * transfer_dma are set when possible.  However this can only
		 * transfer_dma are set when possible.  However this can only
		 * work on systems without HIGHMEM, since DMA buffers located
		 * work on systems without:
		 * in high memory are not directly addressable by the CPU for
		 *
		 * PIO ... so when HIGHMEM is in use, transfer_buffer is NULL
		 *  - HIGHMEM, since DMA buffers located in high memory are
		 *    not directly addressable by the CPU for PIO;
		 *
		 *  - IOMMU, since dma_map_sg() is allowed to use an IOMMU to
		 *    make virtually discontiguous buffers be "dma-contiguous"
		 *    so that PIO and DMA need diferent numbers of URBs.
		 *
		 * So when HIGHMEM or IOMMU are in use, transfer_buffer is NULL
		 * to prevent stale pointers and to help spot bugs.
		 * to prevent stale pointers and to help spot bugs.
		 */
		 */
		if (dma) {
		if (dma) {
			io->urbs [i]->transfer_dma = sg_dma_address (sg + i);
			io->urbs [i]->transfer_dma = sg_dma_address (sg + i);
			len = sg_dma_len (sg + i);
			len = sg_dma_len (sg + i);
#ifdef CONFIG_HIGHMEM
#if defined(CONFIG_HIGHMEM) || defined(CONFIG_IOMMU)
			io->urbs[i]->transfer_buffer = NULL;
			io->urbs[i]->transfer_buffer = NULL;
#else
#else
			io->urbs[i]->transfer_buffer =
			io->urbs[i]->transfer_buffer =
+22 −0
Original line number Original line Diff line number Diff line
@@ -30,18 +30,40 @@
static const struct usb_device_id usb_quirk_list[] = {
static const struct usb_device_id usb_quirk_list[] = {
	/* HP 5300/5370C scanner */
	/* HP 5300/5370C scanner */
	{ USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 },
	{ USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 },
	/* Acer Peripherals Inc. (now BenQ Corp.) Prisa 640BU */
	{ USB_DEVICE(0x04a5, 0x207e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Benq S2W 3300U */
	/* Benq S2W 3300U */
	{ USB_DEVICE(0x04a5, 0x20b0), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	{ USB_DEVICE(0x04a5, 0x20b0), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Canon, Inc. CanoScan N1240U/LiDE30 */
	{ USB_DEVICE(0x04a9, 0x220e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Canon, Inc. CanoScan N650U/N656U */
	{ USB_DEVICE(0x04a9, 0x2206), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Canon, Inc. CanoScan 1220U */
	{ USB_DEVICE(0x04a9, 0x2207), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Canon, Inc. CanoScan N670U/N676U/LiDE 20 */
	{ USB_DEVICE(0x04a9, 0x220d), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* old Cannon scanner */
	{ USB_DEVICE(0x04a9, 0x2220), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Seiko Epson Corp. Perfection 1200 */
	/* Seiko Epson Corp. Perfection 1200 */
	{ USB_DEVICE(0x04b8, 0x0104), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	{ USB_DEVICE(0x04b8, 0x0104), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Seiko Epson Corp. Perfection 660 */
	{ USB_DEVICE(0x04b8, 0x0114), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Epson Perfection 1260 Photo */
	{ USB_DEVICE(0x04b8, 0x011d), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Seiko Epson Corp - Perfection 1670 */
	/* Seiko Epson Corp - Perfection 1670 */
	{ USB_DEVICE(0x04b8, 0x011f), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	{ USB_DEVICE(0x04b8, 0x011f), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* EPSON Perfection 2480 */
	{ USB_DEVICE(0x04b8, 0x0121), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Seiko Epson Corp.*/
	{ USB_DEVICE(0x04b8, 0x0122), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Samsung ML-2510 Series printer */
	/* Samsung ML-2510 Series printer */
	{ USB_DEVICE(0x04e8, 0x327e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	{ USB_DEVICE(0x04e8, 0x327e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Elsa MicroLink 56k (V.250) */
	/* Elsa MicroLink 56k (V.250) */
	{ USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	{ USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Ultima Electronics Corp.*/
	/* Ultima Electronics Corp.*/
	{ USB_DEVICE(0x05d8, 0x4005), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	{ USB_DEVICE(0x05d8, 0x4005), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Agfa Snapscan1212u */
	{ USB_DEVICE(0x06bd, 0x2061), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	/* Umax [hex] Astra 3400U */
	/* Umax [hex] Astra 3400U */
	{ USB_DEVICE(0x1606, 0x0060), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
	{ USB_DEVICE(0x1606, 0x0060), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },


+1 −1
Original line number Original line Diff line number Diff line
@@ -50,7 +50,7 @@ usb_descriptor_fillbuf(void *buf, unsigned buflen,
		return -EINVAL;
		return -EINVAL;


	/* fill buffer from src[] until null descriptor ptr */
	/* fill buffer from src[] until null descriptor ptr */
	for (; 0 != *src; src++) {
	for (; NULL != *src; src++) {
		unsigned		len = (*src)->bLength;
		unsigned		len = (*src)->bLength;


		if (len > buflen)
		if (len > buflen)
+1 −1
Original line number Original line Diff line number Diff line
@@ -71,7 +71,7 @@ ep_matches (
	u16		max;
	u16		max;


	/* endpoint already claimed? */
	/* endpoint already claimed? */
	if (0 != ep->driver_data)
	if (NULL != ep->driver_data)
		return 0;
		return 0;


	/* only support ep0 for portable CONTROL traffic */
	/* only support ep0 for portable CONTROL traffic */
Loading