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

Commit 460223d2 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: (39 commits)
  USB: at91-ohci, handle extra at91sam9261 ahb clock
  USB: another id for cp2101 driver
  USB: ueagle-atm.c needs sched.h
  USB: at91_udc, shrink runtime footprint
  usbnet: add missing Kconfig for KC2190 cables
  usbnet: init fault (oops) cleanup, whitespace fixes
  usbnet: recognize SiteCom CN-124
  usb: Remove Airprime device from option.c
  USB: change __init to __devinit for isp116x_probe
  USB: ps3: don't call ps3_system_bus_driver_register on other platforms
  USB: hid-core.c: Removes GTCO CalComp Interwrite IPanel PIDs from blacklist
  USB: kernel-doc fixes
  USB: quirky device for cdc-acm
  USB: cdc-acm: fix incorrect throtteling, make set_control optional
  USB: unconfigure devices which have config 0
  USB: make usb_iso_packet_descriptor.status signed
  USB: fix g_serial small error
  USB: use __u32 rather than u32 in userspace ioctls in usbdevice_fs.h
  USB Storage: US_FL_IGNORE_RESIDUE needed for Aiptek MP3 Player
  USB: Fix misspelled "USBNET_MII" kernel config option.
  ...
parents 255f0385 ed077bb7
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -1269,9 +1269,18 @@ sd_read_capacity(struct scsi_disk *sdkp, char *diskname,

	/* Some devices return the total number of sectors, not the
	 * highest sector number.  Make the necessary adjustment. */
	if (sdp->fix_capacity)
	if (sdp->fix_capacity) {
		--sdkp->capacity;

	/* Some devices have version which report the correct sizes
	 * and others which do not. We guess size according to a heuristic
	 * and err on the side of lowering the capacity. */
	} else {
		if (sdp->guess_capacity)
			if (sdkp->capacity & 0x01) /* odd sizes are odd */
				--sdkp->capacity;
	}

got_data:
	if (sector_size == 0) {
		sector_size = 512;
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ obj-$(CONFIG_USB_SERIAL) += serial/
obj-$(CONFIG_USB_ADUTUX)	+= misc/
obj-$(CONFIG_USB_APPLEDISPLAY)	+= misc/
obj-$(CONFIG_USB_AUERSWALD)	+= misc/
obj-$(CONFIG_USB_BERRY_CHARGE)	+= misc/
obj-$(CONFIG_USB_CYPRESS_CY7C63)+= misc/
obj-$(CONFIG_USB_CYTHERM)	+= misc/
obj-$(CONFIG_USB_EMI26)		+= misc/
+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@
#include <linux/usb.h>
#include <linux/firmware.h>
#include <linux/ctype.h>
#include <linux/sched.h>
#include <linux/kthread.h>
#include <linux/version.h>
#include <linux/mutex.h>
+22 −11
Original line number Diff line number Diff line
@@ -326,10 +326,16 @@ static void acm_rx_tasklet(unsigned long _acm)
	struct tty_struct *tty = acm->tty;
	struct acm_ru *rcv;
	unsigned long flags;
	int i = 0;
	unsigned char throttled;
	dbg("Entering acm_rx_tasklet");

	if (!ACM_READY(acm) || acm->throttle)
	if (!ACM_READY(acm))
		return;

	spin_lock(&acm->throttle_lock);
	throttled = acm->throttle;
	spin_unlock(&acm->throttle_lock);
	if (throttled)
		return;

next_buffer:
@@ -346,22 +352,20 @@ static void acm_rx_tasklet(unsigned long _acm)
	dbg("acm_rx_tasklet: procesing buf 0x%p, size = %d", buf, buf->size);

	tty_buffer_request_room(tty, buf->size);
	if (!acm->throttle)
	spin_lock(&acm->throttle_lock);
	throttled = acm->throttle;
	spin_unlock(&acm->throttle_lock);
	if (!throttled)
		tty_insert_flip_string(tty, buf->base, buf->size);
	tty_flip_buffer_push(tty);

	spin_lock(&acm->throttle_lock);
	if (acm->throttle) {
		dbg("Throtteling noticed");
		memmove(buf->base, buf->base + i, buf->size - i);
		buf->size -= i;
		spin_unlock(&acm->throttle_lock);
	if (throttled) {
		dbg("Throttling noticed");
		spin_lock_irqsave(&acm->read_lock, flags);
		list_add(&buf->list, &acm->filled_read_bufs);
		spin_unlock_irqrestore(&acm->read_lock, flags);
		return;
	}
	spin_unlock(&acm->throttle_lock);

	spin_lock_irqsave(&acm->read_lock, flags);
	list_add(&buf->list, &acm->spare_read_bufs);
@@ -467,7 +471,8 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
		goto bail_out;
	}

	if (0 > acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS))
	if (0 > acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS) &&
	    (acm->ctrl_caps & USB_CDC_CAP_LINE))
		goto full_bailout;

	INIT_LIST_HEAD(&acm->spare_read_urbs);
@@ -480,6 +485,8 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
		list_add(&(acm->rb[i].list), &acm->spare_read_bufs);
	}

	acm->throttle = 0;

	tasklet_schedule(&acm->urb_task);

done:
@@ -1092,6 +1099,10 @@ static struct usb_device_id acm_ids[] = {
	{ USB_DEVICE(0x0ace, 0x1611), /* ZyDAS 56K USB MODEM - new version */
	.driver_info = SINGLE_RX_URB, /* firmware bug */
	},
	{ USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */
	.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
	},

	/* control interfaces with various AT-command sets */
	{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
		USB_CDC_ACM_PROTO_AT_V25TER) },
+5 −4
Original line number Diff line number Diff line
@@ -604,10 +604,6 @@ static unsigned int usb_device_poll(struct file *file, struct poll_table_struct
	lock_kernel();
	if (!st) {
		st = kmalloc(sizeof(struct usb_device_status), GFP_KERNEL);
		if (!st) {
			unlock_kernel();
			return POLLIN;
		}

		/* we may have dropped BKL - need to check for having lost the race */
		if (file->private_data) {
@@ -615,6 +611,11 @@ static unsigned int usb_device_poll(struct file *file, struct poll_table_struct
			st = file->private_data;
			goto lost_race;
		}
		/* we haven't lost - check for allocation failure now */
		if (!st) {
			unlock_kernel();
			return POLLIN;
		}

		/*
		 * need to prevent the module from being unloaded, since
Loading