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: (47 commits)
  usb: musb: pass configuration specifics via pdata
  usb: musb: fix hanging when rmmod gadget driver
  USB: Add MUSB and TUSB support
  USB: serial: remove CONFIG_USB_DEBUG from sierra and option drivers
  USB: Add vendor/product id of ZTE MF628 to option
  USB: quirk PLL power down mode
  USB: omap_udc: fix compilation with debug enabled
  usb: cdc-acm: drain writes on close
  usb: cdc-acm: stop dropping tx buffers
  usb: cdc-acm: bugfix release()
  usb gadget: issue notifications from ACM function
  usb gadget: remove needless struct members
  USB: sh: r8a66597-hcd: fix disconnect regression
  USB: isp1301: fix compilation
  USB: fix compiler warning fix
  usb-storage: unusual_devs entry for Nokia 5300
  USB: cdc-acm.c: Fix compile warnings
  USB: BandRich BandLuxe C150/C250 HSPA Data Card Driver
  USB: ftdi_sio: add support for PHI Fisco data cable (FT232BM based, VID/PID 0403:e40b)
  usb: isp1760: don't be noisy about short packets.
  ...
  • Loading branch information
Linus Torvalds committed Aug 14, 2008
2 parents 9921b25 + ca6d1b1 commit b635ace
Show file tree
Hide file tree
Showing 80 changed files with 16,723 additions and 2,548 deletions.
3 changes: 0 additions & 3 deletions Documentation/devices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2560,9 +2560,6 @@ Your cooperation is appreciated.
96 = /dev/usb/hiddev0 1st USB HID device
...
111 = /dev/usb/hiddev15 16th USB HID device
112 = /dev/usb/auer0 1st auerswald ISDN device
...
127 = /dev/usb/auer15 16th auerswald ISDN device
128 = /dev/usb/brlvgr0 First Braille Voyager device
...
131 = /dev/usb/brlvgr3 Fourth Braille Voyager device
Expand Down
1 change: 0 additions & 1 deletion Documentation/ioctl-number.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ Code Seq# Include File Comments
'T' all linux/soundcard.h conflict!
'T' all asm-i386/ioctls.h conflict!
'U' 00-EF linux/drivers/usb/usb.h
'U' F0-FF drivers/usb/auerswald.c
'V' all linux/vt.h
'W' 00-1F linux/watchdog.h conflict!
'W' 00-1F linux/wanrouter.h conflict!
Expand Down
30 changes: 0 additions & 30 deletions Documentation/usb/auerswald.txt

This file was deleted.

7 changes: 6 additions & 1 deletion Documentation/usb/power-management.txt
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,12 @@ post_reset; the USB core guarantees that this is true of internal
suspend/resume events as well.

If a driver wants to block all suspend/resume calls during some
critical section, it can simply acquire udev->pm_mutex.
critical section, it can simply acquire udev->pm_mutex. Note that
calls to resume may be triggered indirectly. Block IO due to memory
allocations can make the vm subsystem resume a device. Thus while
holding this lock you must not allocate memory with GFP_KERNEL or
GFP_NOFS.

Alternatively, if the critical section might call some of the
usb_autopm_* routines, the driver can avoid deadlock by doing:

Expand Down
12 changes: 6 additions & 6 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2928,6 +2928,12 @@ M: jirislaby@gmail.com
L: linux-kernel@vger.kernel.org
S: Maintained

MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER
P: Felipe Balbi
M: felipe.balbi@nokia.com
L: linux-usb@vger.kernel.org
S: Maintained

MYRICOM MYRI-10G 10GbE DRIVER (MYRI10GE)
P: Andrew Gallatin
M: gallatin@myri.com
Expand Down Expand Up @@ -4196,12 +4202,6 @@ M: oliver@neukum.name
L: linux-usb@vger.kernel.org
S: Maintained

USB AUERSWALD DRIVER
P: Wolfgang Muees
M: wolfgang@iksw-muees.de
L: linux-usb@vger.kernel.org
S: Maintained

USB BLOCK DRIVER (UB ub)
P: Pete Zaitcev
M: zaitcev@redhat.com
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-omap2/usb-tusb6010.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ tusb6010_setup_interface(struct musb_hdrc_platform_data *data,
printk(error, 6, status);
return -ENODEV;
}
data->multipoint = 1;
tusb_device.dev.platform_data = data;

/* REVISIT let the driver know what DMA channels work */
Expand Down
1 change: 1 addition & 0 deletions drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ obj-$(CONFIG_ATA_OVER_ETH) += block/aoe/
obj-$(CONFIG_PARIDE) += block/paride/
obj-$(CONFIG_TC) += tc/
obj-$(CONFIG_USB) += usb/
obj-$(CONFIG_USB_MUSB_HDRC) += usb/musb/
obj-$(CONFIG_PCI) += usb/
obj-$(CONFIG_USB_GADGET) += usb/gadget/
obj-$(CONFIG_SERIO) += input/serio/
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/chips/isp1301_omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,7 @@ static int isp1301_probe(struct i2c_adapter *bus, int address, int kind)
if (machine_is_omap_h2()) {
/* full speed signaling by default */
isp1301_set_bits(isp, ISP1301_MODE_CONTROL_1,
MC1_SPEED_REG);
MC1_SPEED);
isp1301_set_bits(isp, ISP1301_MODE_CONTROL_2,
MC2_SPD_SUSP_CTRL);

Expand Down
6 changes: 4 additions & 2 deletions drivers/usb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,18 @@ config USB

source "drivers/usb/core/Kconfig"

source "drivers/usb/mon/Kconfig"

source "drivers/usb/host/Kconfig"

source "drivers/usb/musb/Kconfig"

source "drivers/usb/class/Kconfig"

source "drivers/usb/storage/Kconfig"

source "drivers/usb/image/Kconfig"

source "drivers/usb/mon/Kconfig"

comment "USB port drivers"
depends on USB

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/atm/cxacru.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ static int cxacru_cm_get_array(struct cxacru_data *instance, enum cxacru_cm_requ
offd = le32_to_cpu(buf[offb++]);
if (offd >= size) {
if (printk_ratelimit())
usb_err(instance->usbatm, "wrong index #%x in response to cm #%x\n",
usb_err(instance->usbatm, "wrong index %#x in response to cm %#x\n",
offd, cm);
ret = -EIO;
goto cleanup;
Expand Down
86 changes: 46 additions & 40 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
*/

#undef DEBUG
#undef VERBOSE_DEBUG

#include <linux/kernel.h>
#include <linux/errno.h>
Expand All @@ -70,6 +71,9 @@

#include "cdc-acm.h"


#define ACM_CLOSE_TIMEOUT 15 /* seconds to let writes drain */

/*
* Version Information
*/
Expand All @@ -85,6 +89,12 @@ static DEFINE_MUTEX(open_mutex);

#define ACM_READY(acm) (acm && acm->dev && acm->used)

#ifdef VERBOSE_DEBUG
#define verbose 1
#else
#define verbose 0
#endif

/*
* Functions for ACM control messages.
*/
Expand Down Expand Up @@ -136,19 +146,17 @@ static int acm_wb_alloc(struct acm *acm)
static int acm_wb_is_avail(struct acm *acm)
{
int i, n;
unsigned long flags;

n = ACM_NW;
spin_lock_irqsave(&acm->write_lock, flags);
for (i = 0; i < ACM_NW; i++) {
n -= acm->wb[i].use;
}
spin_unlock_irqrestore(&acm->write_lock, flags);
return n;
}

static inline int acm_wb_is_used(struct acm *acm, int wbn)
{
return acm->wb[wbn].use;
}

/*
* Finish write.
*/
Expand All @@ -157,7 +165,6 @@ static void acm_write_done(struct acm *acm, struct acm_wb *wb)
unsigned long flags;

spin_lock_irqsave(&acm->write_lock, flags);
acm->write_ready = 1;
wb->use = 0;
acm->transmitting--;
spin_unlock_irqrestore(&acm->write_lock, flags);
Expand Down Expand Up @@ -190,40 +197,25 @@ static int acm_start_wb(struct acm *acm, struct acm_wb *wb)
static int acm_write_start(struct acm *acm, int wbn)
{
unsigned long flags;
struct acm_wb *wb;
struct acm_wb *wb = &acm->wb[wbn];
int rc;

spin_lock_irqsave(&acm->write_lock, flags);
if (!acm->dev) {
wb->use = 0;
spin_unlock_irqrestore(&acm->write_lock, flags);
return -ENODEV;
}

if (!acm->write_ready) {
spin_unlock_irqrestore(&acm->write_lock, flags);
return 0; /* A white lie */
}

wb = &acm->wb[wbn];
if(acm_wb_is_avail(acm) <= 1)
acm->write_ready = 0;

dbg("%s susp_count: %d", __func__, acm->susp_count);
if (acm->susp_count) {
acm->old_ready = acm->write_ready;
acm->delayed_wb = wb;
acm->write_ready = 0;
schedule_work(&acm->waker);
spin_unlock_irqrestore(&acm->write_lock, flags);
return 0; /* A white lie */
}
usb_mark_last_busy(acm->dev);

if (!acm_wb_is_used(acm, wbn)) {
spin_unlock_irqrestore(&acm->write_lock, flags);
return 0;
}

rc = acm_start_wb(acm, wb);
spin_unlock_irqrestore(&acm->write_lock, flags);

Expand Down Expand Up @@ -488,22 +480,28 @@ static void acm_rx_tasklet(unsigned long _acm)
/* data interface wrote those outgoing bytes */
static void acm_write_bulk(struct urb *urb)
{
struct acm *acm;
struct acm_wb *wb = urb->context;
struct acm *acm = wb->instance;

dbg("Entering acm_write_bulk with status %d", urb->status);
if (verbose || urb->status
|| (urb->actual_length != urb->transfer_buffer_length))
dev_dbg(&acm->data->dev, "tx %d/%d bytes -- > %d\n",
urb->actual_length,
urb->transfer_buffer_length,
urb->status);

acm = wb->instance;
acm_write_done(acm, wb);
if (ACM_READY(acm))
schedule_work(&acm->work);
else
wake_up_interruptible(&acm->drain_wait);
}

static void acm_softint(struct work_struct *work)
{
struct acm *acm = container_of(work, struct acm, work);
dbg("Entering acm_softint.");


dev_vdbg(&acm->data->dev, "tx work\n");
if (!ACM_READY(acm))
return;
tty_wakeup(acm->tty);
Expand All @@ -512,7 +510,6 @@ static void acm_softint(struct work_struct *work)
static void acm_waker(struct work_struct *waker)
{
struct acm *acm = container_of(waker, struct acm, waker);
long flags;
int rv;

rv = usb_autopm_get_interface(acm->control);
Expand All @@ -524,9 +521,6 @@ static void acm_waker(struct work_struct *waker)
acm_start_wb(acm, acm->delayed_wb);
acm->delayed_wb = NULL;
}
spin_lock_irqsave(&acm->write_lock, flags);
acm->write_ready = acm->old_ready;
spin_unlock_irqrestore(&acm->write_lock, flags);
usb_autopm_put_interface(acm->control);
}

Expand Down Expand Up @@ -628,6 +622,8 @@ static void acm_tty_unregister(struct acm *acm)
kfree(acm);
}

static int acm_tty_chars_in_buffer(struct tty_struct *tty);

static void acm_tty_close(struct tty_struct *tty, struct file *filp)
{
struct acm *acm = tty->driver_data;
Expand All @@ -642,6 +638,13 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
if (acm->dev) {
usb_autopm_get_interface(acm->control);
acm_set_control(acm, acm->ctrlout = 0);

/* try letting the last writes drain naturally */
wait_event_interruptible_timeout(acm->drain_wait,
(ACM_NW == acm_wb_is_avail(acm))
|| !acm->dev,
ACM_CLOSE_TIMEOUT * HZ);

usb_kill_urb(acm->ctrlurb);
for (i = 0; i < ACM_NW; i++)
usb_kill_urb(acm->wb[i].urb);
Expand Down Expand Up @@ -697,7 +700,7 @@ static int acm_tty_write_room(struct tty_struct *tty)
* Do not let the line discipline to know that we have a reserve,
* or it might get too enthusiastic.
*/
return (acm->write_ready && acm_wb_is_avail(acm)) ? acm->writesize : 0;
return acm_wb_is_avail(acm) ? acm->writesize : 0;
}

static int acm_tty_chars_in_buffer(struct tty_struct *tty)
Expand Down Expand Up @@ -1072,11 +1075,11 @@ static int acm_probe (struct usb_interface *intf,
acm->urb_task.data = (unsigned long) acm;
INIT_WORK(&acm->work, acm_softint);
INIT_WORK(&acm->waker, acm_waker);
init_waitqueue_head(&acm->drain_wait);
spin_lock_init(&acm->throttle_lock);
spin_lock_init(&acm->write_lock);
spin_lock_init(&acm->read_lock);
mutex_init(&acm->mutex);
acm->write_ready = 1;
acm->rx_endpoint = usb_rcvbulkpipe(usb_dev, epread->bEndpointAddress);

buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
Expand Down Expand Up @@ -1108,9 +1111,11 @@ static int acm_probe (struct usb_interface *intf,
rcv->instance = acm;
}
for (i = 0; i < num_rx_buf; i++) {
struct acm_rb *buf = &(acm->rb[i]);
struct acm_rb *rb = &(acm->rb[i]);

if (!(buf->base = usb_buffer_alloc(acm->dev, readsize, GFP_KERNEL, &buf->dma))) {
rb->base = usb_buffer_alloc(acm->dev, readsize,
GFP_KERNEL, &rb->dma);
if (!rb->base) {
dev_dbg(&intf->dev, "out of memory (read bufs usb_buffer_alloc)\n");
goto alloc_fail7;
}
Expand Down Expand Up @@ -1172,6 +1177,7 @@ static int acm_probe (struct usb_interface *intf,
acm_set_line(acm, &acm->line);

usb_driver_claim_interface(&acm_driver, data_interface, acm);
usb_set_intfdata(data_interface, acm);

usb_get_intf(control_interface);
tty_register_device(acm_tty_driver, minor, &control_interface->dev);
Expand Down Expand Up @@ -1221,11 +1227,11 @@ static void acm_disconnect(struct usb_interface *intf)
struct acm *acm = usb_get_intfdata(intf);
struct usb_device *usb_dev = interface_to_usbdev(intf);

mutex_lock(&open_mutex);
if (!acm || !acm->dev) {
mutex_unlock(&open_mutex);
/* sibling interface is already cleaning up */
if (!acm)
return;
}

mutex_lock(&open_mutex);
if (acm->country_codes){
device_remove_file(&acm->control->dev,
&dev_attr_wCountryCodes);
Expand Down
Loading

0 comments on commit b635ace

Please sign in to comment.