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: (23 commits)
  USB: revert recovery from transient errors
  usb: unusual devs patch for Nokia 5310 Music Xpress
  usb: ftdi_sio: add support for Domintell devices
  USB: drivers/usb/musb/: disable it on SuperH
  USB Serial: Sierra: Add MC8785 VID/PID
  USB: serial: add ZTE CDMA Tech id to option driver
  USB: ftdi_sio: Add 0x5050/0x0900 USB IDs (Papouch Quido USB 4/4)
  usb serial: ti_usb_3410_5052 obviously broken by firmware changes
  USB: fsl_usb2_udc: fix VDBG() format string
  USB: unusual_devs addition for RockChip MP3 player
  USB: SERIAL CP2101 add device IDs
  usb-serial: Add Siemens EF81 to PL-2303 hack triggers
  USB: fix EHCI periodic transfers
  usb: musb: fix include path
  USB: Fixing Nokia 3310c in storage mode
  usb gadget: fix omap_udc DMA regression
  USB: update of Documentation/usb/anchors.txt
  USB: fix hcd interrupt disabling
  USB: Correct Sierra Wireless USB EVDO Modem Device ID
  USB: Fix the Nokia 6300 storage-mode.
  ...
  • Loading branch information
Linus Torvalds committed Sep 23, 2008
2 parents 8553f32 + 5257d97 commit fb478da
Show file tree
Hide file tree
Showing 22 changed files with 124 additions and 85 deletions.
12 changes: 12 additions & 0 deletions Documentation/usb/anchors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,21 @@ This function kills all URBs associated with an anchor. The URBs
are called in the reverse temporal order they were submitted.
This way no data can be reordered.

usb_unlink_anchored_urbs()
--------------------------

This function unlinks all URBs associated with an anchor. The URBs
are processed in the reverse temporal order they were submitted.
This is similar to usb_kill_anchored_urbs(), but it will not sleep.
Therefore no guarantee is made that the URBs have been unlinked when
the call returns. They may be unlinked later but will be unlinked in
finite time.

usb_wait_anchor_empty_timeout()
-------------------------------

This function waits for all URBs associated with an anchor to finish
or a timeout, whichever comes first. Its return value will tell you
whether the timeout was reached.


3 changes: 2 additions & 1 deletion drivers/usb/core/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,8 @@ int usb_add_hcd(struct usb_hcd *hcd,
* with IRQF_SHARED. As usb_hcd_irq() will always disable
* interrupts we can remove it here.
*/
irqflags &= ~IRQF_DISABLED;
if (irqflags & IRQF_SHARED)
irqflags &= ~IRQF_DISABLED;

snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d",
hcd->driver->description, hcd->self.busnum);
Expand Down
39 changes: 17 additions & 22 deletions drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2683,35 +2683,17 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
USB_PORT_STAT_C_ENABLE);
#endif

/* Try to use the debounce delay for protection against
* port-enable changes caused, for example, by EMI.
*/
if (portchange & (USB_PORT_STAT_C_CONNECTION |
USB_PORT_STAT_C_ENABLE)) {
status = hub_port_debounce(hub, port1);
if (status < 0) {
if (printk_ratelimit())
dev_err (hub_dev, "connect-debounce failed, "
"port %d disabled\n", port1);
portstatus &= ~USB_PORT_STAT_CONNECTION;
} else {
portstatus = status;
}
}

/* Try to resuscitate an existing device */
udev = hdev->children[port1-1];
if ((portstatus & USB_PORT_STAT_CONNECTION) && udev &&
udev->state != USB_STATE_NOTATTACHED) {

usb_lock_device(udev);
if (portstatus & USB_PORT_STAT_ENABLE) {
status = 0; /* Nothing to do */
} else if (!udev->persist_enabled) {
status = -ENODEV; /* Mustn't resuscitate */

#ifdef CONFIG_USB_SUSPEND
} else if (udev->state == USB_STATE_SUSPENDED) {
} else if (udev->state == USB_STATE_SUSPENDED &&
udev->persist_enabled) {
/* For a suspended device, treat this as a
* remote wakeup event.
*/
Expand All @@ -2726,7 +2708,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
#endif

} else {
status = usb_reset_device(udev);
status = -ENODEV; /* Don't resuscitate */
}
usb_unlock_device(udev);

Expand All @@ -2741,14 +2723,27 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
usb_disconnect(&hdev->children[port1-1]);
clear_bit(port1, hub->change_bits);

if (portchange & (USB_PORT_STAT_C_CONNECTION |
USB_PORT_STAT_C_ENABLE)) {
status = hub_port_debounce(hub, port1);
if (status < 0) {
if (printk_ratelimit())
dev_err(hub_dev, "connect-debounce failed, "
"port %d disabled\n", port1);
portstatus &= ~USB_PORT_STAT_CONNECTION;
} else {
portstatus = status;
}
}

/* Return now if debouncing failed or nothing is connected */
if (!(portstatus & USB_PORT_STAT_CONNECTION)) {

/* maybe switch power back on (e.g. root hub was reset) */
if ((wHubCharacteristics & HUB_CHAR_LPSM) < 2
&& !(portstatus & (1 << USB_PORT_FEAT_POWER)))
set_port_feature(hdev, port1, USB_PORT_FEAT_POWER);

if (portstatus & USB_PORT_STAT_ENABLE)
goto done;
return;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/fsl_usb2_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ static int dr_controller_setup(struct fsl_udc *udc)
fsl_writel(tmp, &dr_regs->endpointlistaddr);

VDBG("vir[qh_base] is %p phy[qh_base] is 0x%8x reg is 0x%8x",
(int)udc->ep_qh, (int)tmp,
udc->ep_qh, (int)tmp,
fsl_readl(&dr_regs->endpointlistaddr));

/* Config PHY interface */
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/omap_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
omap_set_dma_dest_params(ep->lch,
OMAP_DMA_PORT_TIPB,
OMAP_DMA_AMODE_CONSTANT,
(unsigned long) io_v2p(UDC_DATA_DMA),
UDC_DATA_DMA,
0, 0);
}
} else {
Expand All @@ -804,7 +804,7 @@ static void dma_channel_claim(struct omap_ep *ep, unsigned channel)
omap_set_dma_src_params(ep->lch,
OMAP_DMA_PORT_TIPB,
OMAP_DMA_AMODE_CONSTANT,
(unsigned long) io_v2p(UDC_DATA_DMA),
UDC_DATA_DMA,
0, 0);
/* EMIFF or SDRC */
omap_set_dma_dest_burst_mode(ep->lch,
Expand Down
26 changes: 16 additions & 10 deletions drivers/usb/host/ehci-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,6 @@ static int handshake (struct ehci_hcd *ehci, void __iomem *ptr,
return -ETIMEDOUT;
}

static int handshake_on_error_set_halt(struct ehci_hcd *ehci, void __iomem *ptr,
u32 mask, u32 done, int usec)
{
int error = handshake(ehci, ptr, mask, done, usec);
if (error)
ehci_to_hcd(ehci)->state = HC_STATE_HALT;

return error;
}

/* force HC to halt state from unknown (EHCI spec section 2.3) */
static int ehci_halt (struct ehci_hcd *ehci)
{
Expand All @@ -173,6 +163,22 @@ static int ehci_halt (struct ehci_hcd *ehci)
STS_HALT, STS_HALT, 16 * 125);
}

static int handshake_on_error_set_halt(struct ehci_hcd *ehci, void __iomem *ptr,
u32 mask, u32 done, int usec)
{
int error;

error = handshake(ehci, ptr, mask, done, usec);
if (error) {
ehci_halt(ehci);
ehci_to_hcd(ehci)->state = HC_STATE_HALT;
ehci_err(ehci, "force halt; handhake %p %08x %08x -> %d\n",
ptr, mask, done, error);
}

return error;
}

/* put TDI/ARC silicon into EHCI mode */
static void tdi_reset (struct ehci_hcd *ehci)
{
Expand Down
32 changes: 14 additions & 18 deletions drivers/usb/host/ehci-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ static int enable_periodic (struct ehci_hcd *ehci)
u32 cmd;
int status;

if (ehci->periodic_sched++)
return 0;

/* did clearing PSE did take effect yet?
* takes effect only at frame boundaries...
*/
Expand All @@ -461,6 +464,9 @@ static int disable_periodic (struct ehci_hcd *ehci)
u32 cmd;
int status;

if (--ehci->periodic_sched)
return 0;

/* did setting PSE not take effect yet?
* takes effect only at frame boundaries...
*/
Expand Down Expand Up @@ -544,13 +550,10 @@ static int qh_link_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh)
: (qh->usecs * 8);

/* maybe enable periodic schedule processing */
if (!ehci->periodic_sched++)
return enable_periodic (ehci);

return 0;
return enable_periodic(ehci);
}

static void qh_unlink_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh)
static int qh_unlink_periodic(struct ehci_hcd *ehci, struct ehci_qh *qh)
{
unsigned i;
unsigned period;
Expand Down Expand Up @@ -586,9 +589,7 @@ static void qh_unlink_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh)
qh_put (qh);

/* maybe turn off periodic schedule */
ehci->periodic_sched--;
if (!ehci->periodic_sched)
(void) disable_periodic (ehci);
return disable_periodic(ehci);
}

static void intr_deschedule (struct ehci_hcd *ehci, struct ehci_qh *qh)
Expand Down Expand Up @@ -1562,9 +1563,7 @@ itd_link_urb (
urb->hcpriv = NULL;

timer_action (ehci, TIMER_IO_WATCHDOG);
if (unlikely (!ehci->periodic_sched++))
return enable_periodic (ehci);
return 0;
return enable_periodic(ehci);
}

#define ISO_ERRS (EHCI_ISOC_BUF_ERR | EHCI_ISOC_BABBLE | EHCI_ISOC_XACTERR)
Expand Down Expand Up @@ -1642,7 +1641,7 @@ itd_complete (
ehci_urb_done(ehci, urb, 0);
retval = true;
urb = NULL;
ehci->periodic_sched--;
(void) disable_periodic(ehci);
ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;

if (unlikely (list_empty (&stream->td_list))) {
Expand Down Expand Up @@ -1951,9 +1950,7 @@ sitd_link_urb (
urb->hcpriv = NULL;

timer_action (ehci, TIMER_IO_WATCHDOG);
if (!ehci->periodic_sched++)
return enable_periodic (ehci);
return 0;
return enable_periodic(ehci);
}

/*-------------------------------------------------------------------------*/
Expand Down Expand Up @@ -2019,7 +2016,7 @@ sitd_complete (
ehci_urb_done(ehci, urb, 0);
retval = true;
urb = NULL;
ehci->periodic_sched--;
(void) disable_periodic(ehci);
ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;

if (list_empty (&stream->td_list)) {
Expand Down Expand Up @@ -2243,8 +2240,7 @@ scan_periodic (struct ehci_hcd *ehci)
if (unlikely (modified)) {
if (likely(ehci->periodic_sched > 0))
goto restart;
/* maybe we can short-circuit this scan! */
disable_periodic(ehci);
/* short-circuit this scan */
now_uframe = clock;
break;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/musb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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 !SUPERH
select TWL4030_USB if MACH_OMAP_3430SDP
tristate 'Inventra Highspeed Dual Role Controller (TI, ...)'
help
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@
#include <linux/io.h>

#ifdef CONFIG_ARM
#include <asm/arch/hardware.h>
#include <asm/arch/memory.h>
#include <mach/hardware.h>
#include <mach/memory.h>
#include <asm/mach-types.h>
#endif

Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/musb/omap2430.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#include <linux/io.h>

#include <asm/mach-types.h>
#include <asm/arch/hardware.h>
#include <asm/arch/mux.h>
#include <mach/hardware.h>
#include <mach/mux.h>

#include "musb_core.h"
#include "omap2430.h"
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/musb/omap2430.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#define __MUSB_OMAP243X_H__

#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430)
#include <asm/arch/hardware.h>
#include <asm/arch/usb.h>
#include <mach/hardware.h>
#include <mach/usb.h>

/*
* OMAP2430-specific definitions
Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/serial/cp2101.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ static struct usb_device_id id_table [] = {
{ USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */
{ USB_DEVICE(0x10C4, 0x80DD) }, /* Tracient RFID */
{ USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */
{ USB_DEVICE(0x10C4, 0x8115) }, /* Arygon NFC/Mifare Reader */
{ USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */
{ USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */
{ USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */
Expand All @@ -83,6 +84,7 @@ static struct usb_device_id id_table [] = {
{ USB_DEVICE(0x10C4, 0x81E7) }, /* Aerocomm Radio */
{ USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */
{ USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */
{ USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */
{ USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
{ USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
{ USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */
Expand All @@ -93,6 +95,7 @@ static struct usb_device_id id_table [] = {
{ USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */
{ 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 */
{ } /* Terminating Entry */
};

Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,9 @@ static struct usb_device_id id_table_combined [] = {
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
{ USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
{ USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
{ USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DGQG_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) },
{ }, /* Optional parameter entry */
{ } /* Terminating entry */
};
Expand Down
5 changes: 5 additions & 0 deletions drivers/usb/serial/ftdi_sio.h
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@

#define PAPOUCH_VID 0x5050 /* Vendor ID */
#define PAPOUCH_TMU_PID 0x0400 /* TMU USB Thermometer */
#define PAPOUCH_QUIDO4x4_PID 0x0900 /* Quido 4/4 Module */

/*
* ACG Identification Technologies GmbH products (http://www.acg.de/).
Expand Down Expand Up @@ -838,6 +839,10 @@
/* Rig Expert Ukraine devices */
#define FTDI_REU_TINY_PID 0xED22 /* RigExpert Tiny */

/* Domintell products http://www.domintell.com */
#define FTDI_DOMINTELL_DGQG_PID 0xEF50 /* Master */
#define FTDI_DOMINTELL_DUSB_PID 0xEF51 /* DUSB01 module */

/* Commands */
#define FTDI_SIO_RESET 0 /* Reset the port */
#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/serial/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po
/* ZTE PRODUCTS */
#define ZTE_VENDOR_ID 0x19d2
#define ZTE_PRODUCT_MF628 0x0015
#define ZTE_PRODUCT_CDMA_TECH 0xfffe

static struct usb_device_id option_ids[] = {
{ USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
Expand Down Expand Up @@ -347,6 +348,7 @@ static struct usb_device_id option_ids[] = {
{ USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) },
{ USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) },
{ USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, option_ids);
Expand Down
Loading

0 comments on commit fb478da

Please sign in to comment.