diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-02 16:16:10 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-02 16:16:10 -0700 |
| commit | 694979daa122546f6cc04b1780861bea89481dc9 (patch) | |
| tree | 512c66b6a820bcc86afa5ce285996e056d10dedd /usb.current | |
| parent | 3368273340383a657e28ba3dabeb0660fe7c189f (diff) | |
| download | patches-694979daa122546f6cc04b1780861bea89481dc9.tar.gz | |
usb patches for .31
Diffstat (limited to 'usb.current')
22 files changed, 1723 insertions, 0 deletions
diff --git a/usb.current/usb-add-missing-class-descriptions-used-in-usb-devices-file.patch b/usb.current/usb-add-missing-class-descriptions-used-in-usb-devices-file.patch new file mode 100644 index 00000000000000..6b019c9c92ac89 --- /dev/null +++ b/usb.current/usb-add-missing-class-descriptions-used-in-usb-devices-file.patch @@ -0,0 +1,47 @@ +From elendil@planet.nl Thu Jul 2 15:56:46 2009 +From: Frans Pop <elendil@planet.nl> +Date: Fri, 26 Jun 2009 16:10:19 +0200 +Subject: USB: add missing class descriptions used in usb/devices file +To: linux-usb@vger.kernel.org +Message-ID: <200906261610.20075.elendil@planet.nl> + + +Added descriptions (for WIRELESS_CONTROLLER and MISC) were taken from +the usb-devices script now included in usbutils. + +Also sort the classes in the same order as in include/linux/usb/ch9.h +for easier comparison for future updates. + +Signed-off-by: Frans Pop <elendil@planet.nl> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/devices.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/usb/core/devices.c ++++ b/drivers/usb/core/devices.c +@@ -136,17 +136,19 @@ static const struct class_info clas_info + {USB_CLASS_AUDIO, "audio"}, + {USB_CLASS_COMM, "comm."}, + {USB_CLASS_HID, "HID"}, +- {USB_CLASS_HUB, "hub"}, + {USB_CLASS_PHYSICAL, "PID"}, ++ {USB_CLASS_STILL_IMAGE, "still"}, + {USB_CLASS_PRINTER, "print"}, + {USB_CLASS_MASS_STORAGE, "stor."}, ++ {USB_CLASS_HUB, "hub"}, + {USB_CLASS_CDC_DATA, "data"}, +- {USB_CLASS_APP_SPEC, "app."}, +- {USB_CLASS_VENDOR_SPEC, "vend."}, +- {USB_CLASS_STILL_IMAGE, "still"}, + {USB_CLASS_CSCID, "scard"}, + {USB_CLASS_CONTENT_SEC, "c-sec"}, + {USB_CLASS_VIDEO, "video"}, ++ {USB_CLASS_WIRELESS_CONTROLLER, "wlcon"}, ++ {USB_CLASS_MISC, "misc"}, ++ {USB_CLASS_APP_SPEC, "app."}, ++ {USB_CLASS_VENDOR_SPEC, "vend."}, + {-1, "unk."} /* leave as last */ + }; + diff --git a/usb.current/usb-buildfix-ppc-randconfig.patch b/usb.current/usb-buildfix-ppc-randconfig.patch new file mode 100644 index 00000000000000..e93f6b098cb3cb --- /dev/null +++ b/usb.current/usb-buildfix-ppc-randconfig.patch @@ -0,0 +1,71 @@ +From david-b@pacbell.net Thu Jul 2 15:13:30 2009 +From: David Brownell <david-b@pacbell.net> +Date: Fri, 19 Jun 2009 05:35:34 -0700 +Subject: USB: buildfix ppc randconfig +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Subrata Modak <subrata@linux.vnet.ibm.com>, Arnd Bergmann <arnd@arndb.de> +Message-ID: <200906190535.35138.david-b@pacbell.net> +Content-Disposition: inline + + +From: Arnd Bergmann <arnd@arndb.de> + +We could just make the USB_OHCI_HCD_PPC_OF option implicit +and selected only if at least one of USB_OHCI_HCD_PPC_OF_BE +and USB_OHCI_HCD_PPC_OF_LE are set. + +[ dbrownell@users.sourceforge.net: fix patch manglation and dependencies ] + +Signed-off-by: Arnd Bergmann <arnd@arndb.de> +Tested-by: Subrata Modak <subrata@linux.vnet.ibm.com> +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/Kconfig | 29 +++++++++++++++-------------- + 1 file changed, 15 insertions(+), 14 deletions(-) + +--- a/drivers/usb/host/Kconfig ++++ b/drivers/usb/host/Kconfig +@@ -181,26 +181,27 @@ config USB_OHCI_HCD_PPC_SOC + Enables support for the USB controller on the MPC52xx or + STB03xxx processor chip. If unsure, say Y. + +-config USB_OHCI_HCD_PPC_OF +- bool "OHCI support for PPC USB controller on OF platform bus" +- depends on USB_OHCI_HCD && PPC_OF +- default y +- ---help--- +- Enables support for the USB controller PowerPC present on the +- OpenFirmware platform bus. +- + config USB_OHCI_HCD_PPC_OF_BE +- bool "Support big endian HC" +- depends on USB_OHCI_HCD_PPC_OF +- default y ++ bool "OHCI support for OF platform bus (big endian)" ++ depends on USB_OHCI_HCD && PPC_OF + select USB_OHCI_BIG_ENDIAN_DESC + select USB_OHCI_BIG_ENDIAN_MMIO ++ ---help--- ++ Enables support for big-endian USB controllers present on the ++ OpenFirmware platform bus. + + config USB_OHCI_HCD_PPC_OF_LE +- bool "Support little endian HC" +- depends on USB_OHCI_HCD_PPC_OF +- default n ++ bool "OHCI support for OF platform bus (little endian)" ++ depends on USB_OHCI_HCD && PPC_OF + select USB_OHCI_LITTLE_ENDIAN ++ ---help--- ++ Enables support for little-endian USB controllers present on the ++ OpenFirmware platform bus. ++ ++config USB_OHCI_HCD_PPC_OF ++ bool ++ depends on USB_OHCI_HCD && PPC_OF ++ default USB_OHCI_HCD_PPC_OF_BE || USB_OHCI_HCD_PPC_OF_LE + + config USB_OHCI_HCD_PCI + bool "OHCI support for PCI-bus USB controllers" diff --git a/usb.current/usb-cdc-acm-work-around-some-broken-devices.patch b/usb.current/usb-cdc-acm-work-around-some-broken-devices.patch new file mode 100644 index 00000000000000..fa40f40170570a --- /dev/null +++ b/usb.current/usb-cdc-acm-work-around-some-broken-devices.patch @@ -0,0 +1,75 @@ +From ars3n@yandex.ru Thu Jul 2 15:48:15 2009 +From: Arseniy Lartsev <ars3n@yandex.ru> +Date: Wed, 1 Jul 2009 16:27:26 +0400 +Subject: USB: cdc-acm: work around some broken devices +To: Oliver Neukum <oliver@neukum.org> +Cc: Alan Stern <stern@rowland.harvard.edu>, USB list <linux-usb@vger.kernel.org>, linux-kernel@vger.kernel.org, greg@kroah.com +Message-ID: <200907011627.31170.ars3n@yandex.ru> + +This patch introduces a work around for cdc-acm devices which are +low speed contrary to the specification, which requires bulk endpoints +which are banned in low speed and converted by usbcore to virtual +interrupt endpoints if they are used nevertheless. + +Signed-off-by: Arseniy Lartsev <ars3n@yandex.ru> +Cc: Oliver Neukum <oliver@neukum.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/class/cdc-acm.c | 31 +++++++++++++++++++++++-------- + 1 file changed, 23 insertions(+), 8 deletions(-) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -387,6 +387,7 @@ static void acm_rx_tasklet(unsigned long + struct acm_ru *rcv; + unsigned long flags; + unsigned char throttled; ++ struct usb_host_endpoint *ep; + + dbg("Entering acm_rx_tasklet"); + +@@ -462,11 +463,20 @@ urbs: + + rcv->buffer = buf; + +- usb_fill_bulk_urb(rcv->urb, acm->dev, +- acm->rx_endpoint, +- buf->base, +- acm->readsize, +- acm_read_bulk, rcv); ++ ep = (usb_pipein(acm->rx_endpoint) ? acm->dev->ep_in : acm->dev->ep_out) ++ [usb_pipeendpoint(acm->rx_endpoint)]; ++ if (usb_endpoint_xfer_int(&ep->desc)) ++ usb_fill_int_urb(rcv->urb, acm->dev, ++ acm->rx_endpoint, ++ buf->base, ++ acm->readsize, ++ acm_read_bulk, rcv, ep->desc.bInterval); ++ else ++ usb_fill_bulk_urb(rcv->urb, acm->dev, ++ acm->rx_endpoint, ++ buf->base, ++ acm->readsize, ++ acm_read_bulk, rcv); + rcv->urb->transfer_dma = buf->dma; + rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; + +@@ -1227,9 +1237,14 @@ made_compressed_probe: + goto alloc_fail7; + } + +- usb_fill_bulk_urb(snd->urb, usb_dev, +- usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress), +- NULL, acm->writesize, acm_write_bulk, snd); ++ if (usb_endpoint_xfer_int(epwrite)) ++ usb_fill_int_urb(snd->urb, usb_dev, ++ usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress), ++ NULL, acm->writesize, acm_write_bulk, snd, epwrite->bInterval); ++ else ++ usb_fill_bulk_urb(snd->urb, usb_dev, ++ usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress), ++ NULL, acm->writesize, acm_write_bulk, snd); + snd->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; + snd->instance = acm; + } diff --git a/usb.current/usb-console-fix-regression-in-usb-console-on-kernel-boot.patch b/usb.current/usb-console-fix-regression-in-usb-console-on-kernel-boot.patch new file mode 100644 index 00000000000000..b22db10bf3de8e --- /dev/null +++ b/usb.current/usb-console-fix-regression-in-usb-console-on-kernel-boot.patch @@ -0,0 +1,84 @@ +From jason.wessel@windriver.com Thu Jul 2 16:00:23 2009 +From: Jason Wessel <jason.wessel@windriver.com> +Date: Mon, 22 Jun 2009 11:32:20 -0500 +Subject: USB: console: Fix regression in usb console on kernel boot +To: greg@kroah.com +Cc: Jason Wessel <jason.wessel@windriver.com> +Message-ID: <1245688342-26373-2-git-send-email-jason.wessel@windriver.com> + + +The commit 335f8514f200e63d689113d29cb7253a5c282967 introduced a +regression which stopped usb consoles from working correctly as a +kernel boot console as well as interactive login device. + +The addition of the serial_close() which in turn calls +tty_port_close_start() will change the reference count of port.count +and warn about it. The usb console code had previously incremented +the port.count to indicate it was making use of the device as a +console and the forced change causes a double open on the usb device +which leads to a non obvious kernel oops later on when the tty is +freed. + +To fix the problem instead make use of port->console to track if the +port is in fact an active console port to avoid double initialization +of the usb serial device. The port.count is incremented and +decremented only with in the scope of usb_console_setup() for the +purpose of the low level driver initialization. + +Signed-off-by: Jason Wessel <jason.wessel@windriver.com> +Acked-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/console.c | 13 +++++++------ + drivers/usb/serial/usb-serial.c | 3 ++- + 2 files changed, 9 insertions(+), 7 deletions(-) + +--- a/drivers/usb/serial/console.c ++++ b/drivers/usb/serial/console.c +@@ -169,9 +169,11 @@ static int usb_console_setup(struct cons + kfree(tty); + } + } +- /* So we know not to kill the hardware on a hangup on this +- port. We have also bumped the use count by one so it won't go +- idle */ ++ /* Now that any required fake tty operations are completed restore ++ * the tty port count */ ++ --port->port.count; ++ /* The console is special in terms of closing the device so ++ * indicate this port is now acting as a system console. */ + port->console = 1; + retval = 0; + +@@ -204,7 +206,7 @@ static void usb_console_write(struct con + + dbg("%s - port %d, %d byte(s)", __func__, port->number, count); + +- if (!port->port.count) { ++ if (!port->console) { + dbg("%s - port not opened", __func__); + return; + } +@@ -300,8 +302,7 @@ void usb_serial_console_exit(void) + { + if (usbcons_info.port) { + unregister_console(&usbcons); +- if (usbcons_info.port->port.count) +- usbcons_info.port->port.count--; ++ usbcons_info.port->console = 0; + usbcons_info.port = NULL; + } + } +--- a/drivers/usb/serial/usb-serial.c ++++ b/drivers/usb/serial/usb-serial.c +@@ -220,7 +220,8 @@ static int serial_open (struct tty_struc + tty->driver_data = port; + tty_port_tty_set(&port->port, tty); + +- if (port->port.count == 1) { ++ /* If the console is attached, the device is already open */ ++ if (port->port.count == 1 && !port->console) { + + /* lock this module before we call it + * this may fail, which means we must bail out, diff --git a/usb.current/usb-ehci-check-for-stall-before-other-errors.patch b/usb.current/usb-ehci-check-for-stall-before-other-errors.patch new file mode 100644 index 00000000000000..d9fb02d4c0cb87 --- /dev/null +++ b/usb.current/usb-ehci-check-for-stall-before-other-errors.patch @@ -0,0 +1,78 @@ +From stern@rowland.harvard.edu Thu Jul 2 15:55:25 2009 +From: Alan Stern <stern@rowland.harvard.edu> +Date: Mon, 29 Jun 2009 17:36:14 -0400 (EDT) +Subject: USB: EHCI: check for STALL before other errors +To: Greg KH <greg@kroah.com> +Cc: David Brownell <david-b@pacbell.net>, USB list <linux-usb@vger.kernel.org> +Message-ID: <Pine.LNX.4.44L0.0906291735260.18279-100000@iolanthe.rowland.org> + + +This patch (as1257) revises the way ehci-hcd detects STALLs. The +logic is a little peculiar because there's no hardware status bit +specifically meant to indicate a STALL. You just have to guess that a +STALL was received if the BABBLE bit (which is fatal) isn't set and +the transfer stopped before all its retries were used up. + +The existing code doesn't do this properly, because it tests for MMF +(Missed MicroFrame) and DBE (Data Buffer Error) before testing the +retry counter. Thus, if a transaction gets either MMF or DBE the +corresponding flag is set and the transaction is retried. If the +second attempt receives a STALL then -EPIPE is the correct return +value. But the existing code would see the MMF or DBE flag instead +and return -EPROTO, -ENOSR, or -ECOMM. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +CC: David Brownell <david-b@pacbell.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/ehci-q.c | 30 ++++++++++++++++-------------- + 1 file changed, 16 insertions(+), 14 deletions(-) + +--- a/drivers/usb/host/ehci-q.c ++++ b/drivers/usb/host/ehci-q.c +@@ -214,6 +214,14 @@ static int qtd_copy_status ( + if (token & QTD_STS_BABBLE) { + /* FIXME "must" disable babbling device's port too */ + status = -EOVERFLOW; ++ /* CERR nonzero + halt --> stall */ ++ } else if (QTD_CERR(token)) { ++ status = -EPIPE; ++ ++ /* In theory, more than one of the following bits can be set ++ * since they are sticky and the transaction is retried. ++ * Which to test first is rather arbitrary. ++ */ + } else if (token & QTD_STS_MMF) { + /* fs/ls interrupt xfer missed the complete-split */ + status = -EPROTO; +@@ -222,21 +230,15 @@ static int qtd_copy_status ( + ? -ENOSR /* hc couldn't read data */ + : -ECOMM; /* hc couldn't write data */ + } else if (token & QTD_STS_XACT) { +- /* timeout, bad crc, wrong PID, etc; retried */ +- if (QTD_CERR (token)) +- status = -EPIPE; +- else { +- ehci_dbg (ehci, "devpath %s ep%d%s 3strikes\n", +- urb->dev->devpath, +- usb_pipeendpoint (urb->pipe), +- usb_pipein (urb->pipe) ? "in" : "out"); +- status = -EPROTO; +- } +- /* CERR nonzero + no errors + halt --> stall */ +- } else if (QTD_CERR (token)) +- status = -EPIPE; +- else /* unknown */ ++ /* timeout, bad CRC, wrong PID, etc */ ++ ehci_dbg(ehci, "devpath %s ep%d%s 3strikes\n", ++ urb->dev->devpath, ++ usb_pipeendpoint(urb->pipe), ++ usb_pipein(urb->pipe) ? "in" : "out"); ++ status = -EPROTO; ++ } else { /* unknown */ + status = -EPROTO; ++ } + + ehci_vdbg (ehci, + "dev%d ep%d%s qtd token %08x --> status %d\n", diff --git a/usb.current/usb-ehci-use-the-new-clear_tt_buffer-interface.patch b/usb.current/usb-ehci-use-the-new-clear_tt_buffer-interface.patch new file mode 100644 index 00000000000000..2c7f78b607285b --- /dev/null +++ b/usb.current/usb-ehci-use-the-new-clear_tt_buffer-interface.patch @@ -0,0 +1,263 @@ +From stern@rowland.harvard.edu Thu Jul 2 15:54:39 2009 +From: Alan Stern <stern@rowland.harvard.edu> +Date: Mon, 29 Jun 2009 10:47:30 -0400 (EDT) +Subject: USB: EHCI: use the new clear_tt_buffer interface +To: Greg KH <greg@kroah.com> +Cc: USB list <linux-usb@vger.kernel.org> +Message-ID: <Pine.LNX.4.44L0.0906291043370.16597-100000@iolanthe.rowland.org> + + +This patch (as1256) changes ehci-hcd and all the other drivers in the +EHCI family to make use of the new clear_tt_buffer callbacks. When a +Clear-TT-Buffer request is in progress for a QH, the QH is not allowed +to be linked into the async schedule until the request is finished. +At that time, if there are any URBs queued for the QH, it is linked +into the async schedule. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/ehci-au1xxx.c | 2 + drivers/usb/host/ehci-fsl.c | 2 + drivers/usb/host/ehci-hcd.c | 2 + drivers/usb/host/ehci-ixp4xx.c | 2 + drivers/usb/host/ehci-orion.c | 2 + drivers/usb/host/ehci-pci.c | 2 + drivers/usb/host/ehci-ppc-of.c | 2 + drivers/usb/host/ehci-ps3.c | 2 + drivers/usb/host/ehci-q.c | 91 ++++++++++++++++++++++++++++++----------- + drivers/usb/host/ehci.h | 2 + 10 files changed, 86 insertions(+), 23 deletions(-) + +--- a/drivers/usb/host/ehci-au1xxx.c ++++ b/drivers/usb/host/ehci-au1xxx.c +@@ -113,6 +113,8 @@ static const struct hc_driver ehci_au1xx + .bus_resume = ehci_bus_resume, + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, ++ ++ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + + static int ehci_hcd_au1xxx_drv_probe(struct platform_device *pdev) +--- a/drivers/usb/host/ehci-fsl.c ++++ b/drivers/usb/host/ehci-fsl.c +@@ -325,6 +325,8 @@ static const struct hc_driver ehci_fsl_h + .bus_resume = ehci_bus_resume, + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, ++ ++ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + + static int ehci_fsl_drv_probe(struct platform_device *pdev) +--- a/drivers/usb/host/ehci.h ++++ b/drivers/usb/host/ehci.h +@@ -354,7 +354,9 @@ struct ehci_qh { + unsigned short period; /* polling interval */ + unsigned short start; /* where polling starts */ + #define NO_FRAME ((unsigned short)~0) /* pick new start */ ++ + struct usb_device *dev; /* access to TT */ ++ unsigned clearing_tt:1; /* Clear-TT-Buf in progress */ + } __attribute__ ((aligned (32))); + + /*-------------------------------------------------------------------------*/ +--- a/drivers/usb/host/ehci-hcd.c ++++ b/drivers/usb/host/ehci-hcd.c +@@ -1003,6 +1003,8 @@ idle_timeout: + schedule_timeout_uninterruptible(1); + goto rescan; + case QH_STATE_IDLE: /* fully unlinked */ ++ if (qh->clearing_tt) ++ goto idle_timeout; + if (list_empty (&qh->qtd_list)) { + qh_put (qh); + break; +--- a/drivers/usb/host/ehci-ixp4xx.c ++++ b/drivers/usb/host/ehci-ixp4xx.c +@@ -61,6 +61,8 @@ static const struct hc_driver ixp4xx_ehc + #endif + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, ++ ++ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + + static int ixp4xx_ehci_probe(struct platform_device *pdev) +--- a/drivers/usb/host/ehci-orion.c ++++ b/drivers/usb/host/ehci-orion.c +@@ -165,6 +165,8 @@ static const struct hc_driver ehci_orion + .bus_resume = ehci_bus_resume, + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, ++ ++ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + + static void __init +--- a/drivers/usb/host/ehci-pci.c ++++ b/drivers/usb/host/ehci-pci.c +@@ -404,6 +404,8 @@ static const struct hc_driver ehci_pci_h + .bus_resume = ehci_bus_resume, + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, ++ ++ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + + /*-------------------------------------------------------------------------*/ +--- a/drivers/usb/host/ehci-ppc-of.c ++++ b/drivers/usb/host/ehci-ppc-of.c +@@ -79,6 +79,8 @@ static const struct hc_driver ehci_ppc_o + #endif + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, ++ ++ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + + +--- a/drivers/usb/host/ehci-ps3.c ++++ b/drivers/usb/host/ehci-ps3.c +@@ -75,6 +75,8 @@ static const struct hc_driver ps3_ehci_h + #endif + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, ++ ++ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + + static int __devinit ps3_ehci_probe(struct ps3_system_bus_device *dev) +--- a/drivers/usb/host/ehci-q.c ++++ b/drivers/usb/host/ehci-q.c +@@ -139,6 +139,55 @@ qh_refresh (struct ehci_hcd *ehci, struc + + /*-------------------------------------------------------------------------*/ + ++static void qh_link_async(struct ehci_hcd *ehci, struct ehci_qh *qh); ++ ++static void ehci_clear_tt_buffer_complete(struct usb_hcd *hcd, ++ struct usb_host_endpoint *ep) ++{ ++ struct ehci_hcd *ehci = hcd_to_ehci(hcd); ++ struct ehci_qh *qh = ep->hcpriv; ++ unsigned long flags; ++ ++ spin_lock_irqsave(&ehci->lock, flags); ++ qh->clearing_tt = 0; ++ if (qh->qh_state == QH_STATE_IDLE && !list_empty(&qh->qtd_list) ++ && HC_IS_RUNNING(hcd->state)) ++ qh_link_async(ehci, qh); ++ spin_unlock_irqrestore(&ehci->lock, flags); ++} ++ ++static void ehci_clear_tt_buffer(struct ehci_hcd *ehci, struct ehci_qh *qh, ++ struct urb *urb, u32 token) ++{ ++ ++ /* If an async split transaction gets an error or is unlinked, ++ * the TT buffer may be left in an indeterminate state. We ++ * have to clear the TT buffer. ++ * ++ * Note: this routine is never called for Isochronous transfers. ++ */ ++ if (urb->dev->tt && !usb_pipeint(urb->pipe) && !qh->clearing_tt) { ++#ifdef DEBUG ++ struct usb_device *tt = urb->dev->tt->hub; ++ dev_dbg(&tt->dev, ++ "clear tt buffer port %d, a%d ep%d t%08x\n", ++ urb->dev->ttport, urb->dev->devnum, ++ usb_pipeendpoint(urb->pipe), token); ++#endif /* DEBUG */ ++ if (!ehci_is_TDI(ehci) ++ || urb->dev->tt->hub != ++ ehci_to_hcd(ehci)->self.root_hub) { ++ if (usb_hub_clear_tt_buffer(urb) == 0) ++ qh->clearing_tt = 1; ++ } else { ++ ++ /* REVISIT ARC-derived cores don't clear the root ++ * hub TT buffer in this way... ++ */ ++ } ++ } ++} ++ + static int qtd_copy_status ( + struct ehci_hcd *ehci, + struct urb *urb, +@@ -195,28 +244,6 @@ static int qtd_copy_status ( + usb_pipeendpoint (urb->pipe), + usb_pipein (urb->pipe) ? "in" : "out", + token, status); +- +- /* if async CSPLIT failed, try cleaning out the TT buffer */ +- if (status != -EPIPE +- && urb->dev->tt +- && !usb_pipeint(urb->pipe) +- && ((token & QTD_STS_MMF) != 0 +- || QTD_CERR(token) == 0) +- && (!ehci_is_TDI(ehci) +- || urb->dev->tt->hub != +- ehci_to_hcd(ehci)->self.root_hub)) { +-#ifdef DEBUG +- struct usb_device *tt = urb->dev->tt->hub; +- dev_dbg (&tt->dev, +- "clear tt buffer port %d, a%d ep%d t%08x\n", +- urb->dev->ttport, urb->dev->devnum, +- usb_pipeendpoint (urb->pipe), token); +-#endif /* DEBUG */ +- /* REVISIT ARC-derived cores don't clear the root +- * hub TT buffer in this way... +- */ +- usb_hub_clear_tt_buffer(urb); +- } + } + + return status; +@@ -407,9 +434,16 @@ qh_completions (struct ehci_hcd *ehci, s + /* qh unlinked; token in overlay may be most current */ + if (state == QH_STATE_IDLE + && cpu_to_hc32(ehci, qtd->qtd_dma) +- == qh->hw_current) ++ == qh->hw_current) { + token = hc32_to_cpu(ehci, qh->hw_token); + ++ /* An unlink may leave an incomplete ++ * async transaction in the TT buffer. ++ * We have to clear it. ++ */ ++ ehci_clear_tt_buffer(ehci, qh, urb, token); ++ } ++ + /* force halt for unlinked or blocked qh, so we'll + * patch the qh later and so that completions can't + * activate it while we "know" it's stopped. +@@ -435,6 +469,13 @@ halt: + && (qtd->hw_alt_next + & EHCI_LIST_END(ehci))) + last_status = -EINPROGRESS; ++ ++ /* As part of low/full-speed endpoint-halt processing ++ * we must clear the TT buffer (11.17.5). ++ */ ++ if (unlikely(last_status != -EINPROGRESS && ++ last_status != -EREMOTEIO)) ++ ehci_clear_tt_buffer(ehci, qh, urb, token); + } + + /* if we're removing something not at the queue head, +@@ -864,6 +905,10 @@ static void qh_link_async (struct ehci_h + __hc32 dma = QH_NEXT(ehci, qh->qh_dma); + struct ehci_qh *head; + ++ /* Don't link a QH if there's a Clear-TT-Buffer pending */ ++ if (unlikely(qh->clearing_tt)) ++ return; ++ + /* (re)start the async schedule? */ + head = ehci->async; + timer_action_done (ehci, TIMER_ASYNC_OFF); diff --git a/usb.current/usb-fix-memleak-in-usbfs.patch b/usb.current/usb-fix-memleak-in-usbfs.patch new file mode 100644 index 00000000000000..d0eab53ec09d1b --- /dev/null +++ b/usb.current/usb-fix-memleak-in-usbfs.patch @@ -0,0 +1,64 @@ +From oliver@neukum.org Thu Jul 2 15:55:58 2009 +From: Oliver Neukum <oliver@neukum.org> +Date: Sun, 28 Jun 2009 23:34:14 +0200 +Subject: USB: fix memleak in usbfs +To: Greg KH <greg@kroah.com>, USB list <linux-usb@vger.kernel.org> +Message-ID: <200906282334.15172.oliver@neukum.org> +Content-Disposition: inline + + +This patch fixes a memory leak in devio.c::processcompl + +If writing to user space fails the packet must be discarded, as it +already has been removed from the queue of completed packets. + +Signed-off-by: Oliver Neukum <oliver@neukum.org> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/devio.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +--- a/drivers/usb/core/devio.c ++++ b/drivers/usb/core/devio.c +@@ -1231,22 +1231,22 @@ static int processcompl(struct async *as + if (as->userbuffer) + if (copy_to_user(as->userbuffer, urb->transfer_buffer, + urb->transfer_buffer_length)) +- return -EFAULT; ++ goto err_out; + if (put_user(as->status, &userurb->status)) +- return -EFAULT; ++ goto err_out; + if (put_user(urb->actual_length, &userurb->actual_length)) +- return -EFAULT; ++ goto err_out; + if (put_user(urb->error_count, &userurb->error_count)) +- return -EFAULT; ++ goto err_out; + + if (usb_endpoint_xfer_isoc(&urb->ep->desc)) { + for (i = 0; i < urb->number_of_packets; i++) { + if (put_user(urb->iso_frame_desc[i].actual_length, + &userurb->iso_frame_desc[i].actual_length)) +- return -EFAULT; ++ goto err_out; + if (put_user(urb->iso_frame_desc[i].status, + &userurb->iso_frame_desc[i].status)) +- return -EFAULT; ++ goto err_out; + } + } + +@@ -1255,6 +1255,10 @@ static int processcompl(struct async *as + if (put_user(addr, (void __user * __user *)arg)) + return -EFAULT; + return 0; ++ ++err_out: ++ free_async(as); ++ return -EFAULT; + } + + static struct async *reap_as(struct dev_state *ps) diff --git a/usb.current/usb-fix-memory-leak-in-usbtmc.patch b/usb.current/usb-fix-memory-leak-in-usbtmc.patch new file mode 100644 index 00000000000000..d2d875635b79d3 --- /dev/null +++ b/usb.current/usb-fix-memory-leak-in-usbtmc.patch @@ -0,0 +1,60 @@ +From oliver@neukum.org Thu Jul 2 15:44:40 2009 +From: Oliver Neukum <oliver@neukum.org> +Date: Thu, 2 Jul 2009 16:41:39 +0200 +Subject: USB: fix memory leak in usbtmc +To: Tilman Schmidt <tilman@imap.cc>, greg@kroah.com, USB list <linux-usb@vger.kernel.org> +Message-ID: <200907021641.39562.oliver@neukum.org> +Content-Disposition: inline + + +If an error is returned kfree must also be called. + + +Signed-off-by: Oliver Neukum <oliver@neukum.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/class/usbtmc.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/usb/class/usbtmc.c ++++ b/drivers/usb/class/usbtmc.c +@@ -751,7 +751,7 @@ static int get_capabilities(struct usbtm + { + struct device *dev = &data->usb_dev->dev; + char *buffer; +- int rv; ++ int rv = 0; + + buffer = kmalloc(0x18, GFP_KERNEL); + if (!buffer) +@@ -763,7 +763,7 @@ static int get_capabilities(struct usbtm + 0, 0, buffer, 0x18, USBTMC_TIMEOUT); + if (rv < 0) { + dev_err(dev, "usb_control_msg returned %d\n", rv); +- return rv; ++ goto err_out; + } + + dev_dbg(dev, "GET_CAPABILITIES returned %x\n", buffer[0]); +@@ -773,7 +773,8 @@ static int get_capabilities(struct usbtm + dev_dbg(dev, "USB488 device capabilities are %x\n", buffer[15]); + if (buffer[0] != USBTMC_STATUS_SUCCESS) { + dev_err(dev, "GET_CAPABILITIES returned %x\n", buffer[0]); +- return -EPERM; ++ rv = -EPERM; ++ goto err_out; + } + + data->capabilities.interface_capabilities = buffer[4]; +@@ -781,8 +782,9 @@ static int get_capabilities(struct usbtm + data->capabilities.usb488_interface_capabilities = buffer[14]; + data->capabilities.usb488_device_capabilities = buffer[15]; + ++err_out: + kfree(buffer); +- return 0; ++ return rv; + } + + #define capability_attribute(name) \ diff --git a/usb.current/usb-fix-the-clear_tt_buffer-interface.patch b/usb.current/usb-fix-the-clear_tt_buffer-interface.patch new file mode 100644 index 00000000000000..8341957c35f53f --- /dev/null +++ b/usb.current/usb-fix-the-clear_tt_buffer-interface.patch @@ -0,0 +1,201 @@ +From stern@rowland.harvard.edu Thu Jul 2 15:54:07 2009 +From: Alan Stern <stern@rowland.harvard.edu> +Date: Mon, 29 Jun 2009 10:43:32 -0400 (EDT) +Subject: USB: fix the clear_tt_buffer interface +To: Greg KH <greg@kroah.com> +Cc: USB list <linux-usb@vger.kernel.org> +Message-ID: <Pine.LNX.4.44L0.0906291040020.16597-100000@iolanthe.rowland.org> + + +This patch (as1255) updates the interface for calling +usb_hub_clear_tt_buffer(). Even the name of the function is changed! + +When an async URB (i.e., Control or Bulk) going through a high-speed +hub to a non-high-speed device is cancelled or fails, the hub's +Transaction Translator buffer may be left busy still trying to +complete the transaction. The buffer has to be cleared; that's what +usb_hub_clear_tt_buffer() does. + +It isn't safe to send any more URBs to the same endpoint until the TT +buffer is fully clear. Therefore the HCD needs to be told when the +Clear-TT-Buffer request has finished. This patch adds a callback +method to struct hc_driver for that purpose, and makes the hub driver +invoke the callback at the proper time. + +The patch also changes a couple of names; "hub_tt_kevent" and +"tt.kevent" now look rather antiquated. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/hcd.h | 4 ++++ + drivers/usb/core/hub.c | 40 ++++++++++++++++++++++++++-------------- + drivers/usb/core/hub.h | 6 ++++-- + drivers/usb/host/ehci-q.c | 2 +- + 4 files changed, 35 insertions(+), 17 deletions(-) + +--- a/drivers/usb/core/hcd.h ++++ b/drivers/usb/core/hcd.h +@@ -227,6 +227,10 @@ struct hc_driver { + /* has a port been handed over to a companion? */ + int (*port_handed_over)(struct usb_hcd *, int); + ++ /* CLEAR_TT_BUFFER completion callback */ ++ void (*clear_tt_buffer_complete)(struct usb_hcd *, ++ struct usb_host_endpoint *); ++ + /* xHCI specific functions */ + /* Called by usb_alloc_dev to alloc HC device structures */ + int (*alloc_dev)(struct usb_hcd *, struct usb_device *); +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -450,10 +450,10 @@ hub_clear_tt_buffer (struct usb_device * + * talking to TTs must queue control transfers (not just bulk and iso), so + * both can talk to the same hub concurrently. + */ +-static void hub_tt_kevent (struct work_struct *work) ++static void hub_tt_work(struct work_struct *work) + { + struct usb_hub *hub = +- container_of(work, struct usb_hub, tt.kevent); ++ container_of(work, struct usb_hub, tt.clear_work); + unsigned long flags; + int limit = 100; + +@@ -462,6 +462,7 @@ static void hub_tt_kevent (struct work_s + struct list_head *next; + struct usb_tt_clear *clear; + struct usb_device *hdev = hub->hdev; ++ const struct hc_driver *drv; + int status; + + next = hub->tt.clear_list.next; +@@ -471,21 +472,25 @@ static void hub_tt_kevent (struct work_s + /* drop lock so HCD can concurrently report other TT errors */ + spin_unlock_irqrestore (&hub->tt.lock, flags); + status = hub_clear_tt_buffer (hdev, clear->devinfo, clear->tt); +- spin_lock_irqsave (&hub->tt.lock, flags); +- + if (status) + dev_err (&hdev->dev, + "clear tt %d (%04x) error %d\n", + clear->tt, clear->devinfo, status); ++ ++ /* Tell the HCD, even if the operation failed */ ++ drv = clear->hcd->driver; ++ if (drv->clear_tt_buffer_complete) ++ (drv->clear_tt_buffer_complete)(clear->hcd, clear->ep); ++ + kfree(clear); ++ spin_lock_irqsave(&hub->tt.lock, flags); + } + spin_unlock_irqrestore (&hub->tt.lock, flags); + } + + /** +- * usb_hub_tt_clear_buffer - clear control/bulk TT state in high speed hub +- * @udev: the device whose split transaction failed +- * @pipe: identifies the endpoint of the failed transaction ++ * usb_hub_clear_tt_buffer - clear control/bulk TT state in high speed hub ++ * @urb: an URB associated with the failed or incomplete split transaction + * + * High speed HCDs use this to tell the hub driver that some split control or + * bulk transaction failed in a way that requires clearing internal state of +@@ -495,8 +500,10 @@ static void hub_tt_kevent (struct work_s + * It may not be possible for that hub to handle additional full (or low) + * speed transactions until that state is fully cleared out. + */ +-void usb_hub_tt_clear_buffer (struct usb_device *udev, int pipe) ++int usb_hub_clear_tt_buffer(struct urb *urb) + { ++ struct usb_device *udev = urb->dev; ++ int pipe = urb->pipe; + struct usb_tt *tt = udev->tt; + unsigned long flags; + struct usb_tt_clear *clear; +@@ -508,7 +515,7 @@ void usb_hub_tt_clear_buffer (struct usb + if ((clear = kmalloc (sizeof *clear, GFP_ATOMIC)) == NULL) { + dev_err (&udev->dev, "can't save CLEAR_TT_BUFFER state\n"); + /* FIXME recover somehow ... RESET_TT? */ +- return; ++ return -ENOMEM; + } + + /* info that CLEAR_TT_BUFFER needs */ +@@ -520,14 +527,19 @@ void usb_hub_tt_clear_buffer (struct usb + : (USB_ENDPOINT_XFER_BULK << 11); + if (usb_pipein (pipe)) + clear->devinfo |= 1 << 15; +- ++ ++ /* info for completion callback */ ++ clear->hcd = bus_to_hcd(udev->bus); ++ clear->ep = urb->ep; ++ + /* tell keventd to clear state for this TT */ + spin_lock_irqsave (&tt->lock, flags); + list_add_tail (&clear->clear_list, &tt->clear_list); +- schedule_work (&tt->kevent); ++ schedule_work(&tt->clear_work); + spin_unlock_irqrestore (&tt->lock, flags); ++ return 0; + } +-EXPORT_SYMBOL_GPL(usb_hub_tt_clear_buffer); ++EXPORT_SYMBOL_GPL(usb_hub_clear_tt_buffer); + + /* If do_delay is false, return the number of milliseconds the caller + * needs to delay. +@@ -818,7 +830,7 @@ static void hub_quiesce(struct usb_hub * + if (hub->has_indicators) + cancel_delayed_work_sync(&hub->leds); + if (hub->tt.hub) +- cancel_work_sync(&hub->tt.kevent); ++ cancel_work_sync(&hub->tt.clear_work); + } + + /* caller has locked the hub device */ +@@ -935,7 +947,7 @@ static int hub_configure(struct usb_hub + + spin_lock_init (&hub->tt.lock); + INIT_LIST_HEAD (&hub->tt.clear_list); +- INIT_WORK (&hub->tt.kevent, hub_tt_kevent); ++ INIT_WORK(&hub->tt.clear_work, hub_tt_work); + switch (hdev->descriptor.bDeviceProtocol) { + case 0: + break; +--- a/drivers/usb/core/hub.h ++++ b/drivers/usb/core/hub.h +@@ -188,16 +188,18 @@ struct usb_tt { + /* for control/bulk error recovery (CLEAR_TT_BUFFER) */ + spinlock_t lock; + struct list_head clear_list; /* of usb_tt_clear */ +- struct work_struct kevent; ++ struct work_struct clear_work; + }; + + struct usb_tt_clear { + struct list_head clear_list; + unsigned tt; + u16 devinfo; ++ struct usb_hcd *hcd; ++ struct usb_host_endpoint *ep; + }; + +-extern void usb_hub_tt_clear_buffer(struct usb_device *dev, int pipe); ++extern int usb_hub_clear_tt_buffer(struct urb *urb); + extern void usb_ep0_reinit(struct usb_device *); + + #endif /* __LINUX_HUB_H */ +--- a/drivers/usb/host/ehci-q.c ++++ b/drivers/usb/host/ehci-q.c +@@ -215,7 +215,7 @@ static int qtd_copy_status ( + /* REVISIT ARC-derived cores don't clear the root + * hub TT buffer in this way... + */ +- usb_hub_tt_clear_buffer (urb->dev, urb->pipe); ++ usb_hub_clear_tt_buffer(urb); + } + } + diff --git a/usb.current/usb-fix-uninitialised-variable-in-ti_do_download.patch b/usb.current/usb-fix-uninitialised-variable-in-ti_do_download.patch new file mode 100644 index 00000000000000..7cd94c70f3a779 --- /dev/null +++ b/usb.current/usb-fix-uninitialised-variable-in-ti_do_download.patch @@ -0,0 +1,31 @@ +From oliver@neukum.org Thu Jul 2 15:52:21 2009 +From: Oliver Neukum <oliver@neukum.org> +Date: Tue, 30 Jun 2009 09:44:24 +0200 +Subject: USB: fix uninitialised variable in ti_do_download +To: Andrew Morton <akpm@linux-foundation.org>, greg@kroah.com, USB list <linux-usb@vger.kernel.org>, stable@kernel.org +Message-ID: <200906300944.24551.oliver@neukum.org> +Content-Disposition: inline + + + +Signed-off-by: Oliver Neukum <oliver@neukum.org> +Cc: stable <stable@kernel.org> +Cc: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/serial/ti_usb_3410_5052.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/serial/ti_usb_3410_5052.c ++++ b/drivers/usb/serial/ti_usb_3410_5052.c +@@ -1657,7 +1657,7 @@ static int ti_do_download(struct usb_dev + u8 cs = 0; + int done; + struct ti_firmware_header *header; +- int status; ++ int status = 0; + int len; + + for (pos = sizeof(struct ti_firmware_header); pos < size; pos++) diff --git a/usb.current/usb-gadget-pxa25x-compiler-warning-fix.patch b/usb.current/usb-gadget-pxa25x-compiler-warning-fix.patch new file mode 100644 index 00000000000000..84922483dab67a --- /dev/null +++ b/usb.current/usb-gadget-pxa25x-compiler-warning-fix.patch @@ -0,0 +1,41 @@ +From david-b@pacbell.net Thu Jul 2 15:47:16 2009 +From: David Brownell <david-b@pacbell.net> +Date: Wed, 1 Jul 2009 03:43:58 -0700 +Subject: USB: gadget: pxa25x compiler warning fix +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Philipp Zabel <philipp.zabel@gmail.com>, Eric Miao <eric.y.miao@gmail.com> +Message-ID: <200907010343.59075.david-b@pacbell.net> +Content-Disposition: inline + + +From: David Brownell <dbrownell@users.sourceforge.net> + +Fix config-dependent compiler warning: + + CC drivers/usb/gadget/pxa25x_udc.o +drivers/usb/gadget/pxa25x_udc.c: In function 'pxa25x_udc_irq': +drivers/usb/gadget/pxa25x_udc.c:1806: warning: array subscript is above array bounds + +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/pxa25x_udc.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/gadget/pxa25x_udc.c ++++ b/drivers/usb/gadget/pxa25x_udc.c +@@ -1802,11 +1802,13 @@ pxa25x_udc_irq(int irq, void *_dev) + USIR0 |= tmp; + handled = 1; + } ++#ifndef CONFIG_USB_PXA25X_SMALL + if (usir1 & tmp) { + handle_ep(&dev->ep[i+8]); + USIR1 |= tmp; + handled = 1; + } ++#endif + } + } + diff --git a/usb.current/usb-gadget-pxa25x-uses-gpio_is_valid.patch b/usb.current/usb-gadget-pxa25x-uses-gpio_is_valid.patch new file mode 100644 index 00000000000000..593470de28d21c --- /dev/null +++ b/usb.current/usb-gadget-pxa25x-uses-gpio_is_valid.patch @@ -0,0 +1,116 @@ +From david-b@pacbell.net Thu Jul 2 15:46:57 2009 +From: Philipp Zabel <philipp.zabel@gmail.com> +Date: Wed, 1 Jul 2009 03:42:45 -0700 +Subject: USB: gadget: pxa25x uses gpio_is_valid +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Eric Miao <eric.y.miao@gmail.com>, Philipp Zabel <philipp.zabel@gmail.com> +Message-ID: <200907010342.45567.david-b@pacbell.net> +Content-Disposition: inline + + +From: Philipp Zabel <philipp.zabel@gmail.com> + +Use gpio_is_valid instead of assuming that every GPIO +number != 0 is valid while 0 is not. + +Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> +Acked-by: Eric Miao <eric.y.miao@gmail.com> +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/pxa25x_udc.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +--- a/drivers/usb/gadget/pxa25x_udc.c ++++ b/drivers/usb/gadget/pxa25x_udc.c +@@ -139,7 +139,7 @@ static int is_vbus_present(void) + { + struct pxa2xx_udc_mach_info *mach = the_controller->mach; + +- if (mach->gpio_vbus) { ++ if (gpio_is_valid(mach->gpio_vbus)) { + int value = gpio_get_value(mach->gpio_vbus); + + if (mach->gpio_vbus_inverted) +@@ -158,7 +158,7 @@ static void pullup_off(void) + struct pxa2xx_udc_mach_info *mach = the_controller->mach; + int off_level = mach->gpio_pullup_inverted; + +- if (mach->gpio_pullup) ++ if (gpio_is_valid(mach->gpio_pullup)) + gpio_set_value(mach->gpio_pullup, off_level); + else if (mach->udc_command) + mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT); +@@ -169,7 +169,7 @@ static void pullup_on(void) + struct pxa2xx_udc_mach_info *mach = the_controller->mach; + int on_level = !mach->gpio_pullup_inverted; + +- if (mach->gpio_pullup) ++ if (gpio_is_valid(mach->gpio_pullup)) + gpio_set_value(mach->gpio_pullup, on_level); + else if (mach->udc_command) + mach->udc_command(PXA2XX_UDC_CMD_CONNECT); +@@ -1000,7 +1000,7 @@ static int pxa25x_udc_pullup(struct usb_ + udc = container_of(_gadget, struct pxa25x_udc, gadget); + + /* not all boards support pullup control */ +- if (!udc->mach->gpio_pullup && !udc->mach->udc_command) ++ if (!gpio_is_valid(udc->mach->gpio_pullup) && !udc->mach->udc_command) + return -EOPNOTSUPP; + + udc->pullup = (is_active != 0); +@@ -2160,7 +2160,7 @@ static int __init pxa25x_udc_probe(struc + dev->dev = &pdev->dev; + dev->mach = pdev->dev.platform_data; + +- if (dev->mach->gpio_vbus) { ++ if (gpio_is_valid(dev->mach->gpio_vbus)) { + if ((retval = gpio_request(dev->mach->gpio_vbus, + "pxa25x_udc GPIO VBUS"))) { + dev_dbg(&pdev->dev, +@@ -2173,7 +2173,7 @@ static int __init pxa25x_udc_probe(struc + } else + vbus_irq = 0; + +- if (dev->mach->gpio_pullup) { ++ if (gpio_is_valid(dev->mach->gpio_pullup)) { + if ((retval = gpio_request(dev->mach->gpio_pullup, + "pca25x_udc GPIO PULLUP"))) { + dev_dbg(&pdev->dev, +@@ -2256,10 +2256,10 @@ lubbock_fail0: + #endif + free_irq(irq, dev); + err_irq1: +- if (dev->mach->gpio_pullup) ++ if (gpio_is_valid(dev->mach->gpio_pullup)) + gpio_free(dev->mach->gpio_pullup); + err_gpio_pullup: +- if (dev->mach->gpio_vbus) ++ if (gpio_is_valid(dev->mach->gpio_vbus)) + gpio_free(dev->mach->gpio_vbus); + err_gpio_vbus: + clk_put(dev->clk); +@@ -2294,11 +2294,11 @@ static int __exit pxa25x_udc_remove(stru + free_irq(LUBBOCK_USB_IRQ, dev); + } + #endif +- if (dev->mach->gpio_vbus) { ++ if (gpio_is_valid(dev->mach->gpio_vbus)) { + free_irq(gpio_to_irq(dev->mach->gpio_vbus), dev); + gpio_free(dev->mach->gpio_vbus); + } +- if (dev->mach->gpio_pullup) ++ if (gpio_is_valid(dev->mach->gpio_pullup)) + gpio_free(dev->mach->gpio_pullup); + + clk_put(dev->clk); +@@ -2329,7 +2329,7 @@ static int pxa25x_udc_suspend(struct pla + struct pxa25x_udc *udc = platform_get_drvdata(dev); + unsigned long flags; + +- if (!udc->mach->gpio_pullup && !udc->mach->udc_command) ++ if (!gpio_is_valid(udc->mach->gpio_pullup) && !udc->mach->udc_command) + WARNING("USB host won't detect disconnect!\n"); + udc->suspended = 1; + diff --git a/usb.current/usb-gadget-rndis-conformance-tweak.patch b/usb.current/usb-gadget-rndis-conformance-tweak.patch new file mode 100644 index 00000000000000..e9c8f92984f6f8 --- /dev/null +++ b/usb.current/usb-gadget-rndis-conformance-tweak.patch @@ -0,0 +1,42 @@ +From david-b@pacbell.net Thu Jul 2 15:45:24 2009 +From: Qiuping Chen <cqiuping@gmail.com> +Date: Wed, 1 Jul 2009 03:49:29 -0700 +Subject: USB: gadget: rndis conformance tweak +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Qiuping Chen <cqiuping@gmail.com>, Helen Chen <helen.chen@intel.com> +Message-ID: <200907010349.29608.david-b@pacbell.net> +Content-Disposition: inline + + +From: Qiuping Chen <cqiuping@gmail.com> + +Support OID_802_3_MAC_OPTIONS in gen_ndis_query_resp() of rndis.c to +make RNDIS gadget pass 1c_SetMulticast subtest in Microsoft NDISTest6: + + http://www.microsoft.com/whdc/DevTools/tools/NDIStest.mspx + +The other tests in NDISTest6 are passed. + +[ dbrownell@users.sourceforge.net: remove OID_802_3_MAXIMUM_LIST_SIZE +setting ... it was bogus, this code only handles one entry, not 32. +And we don't know what would break if we lied about that... ] + +Signed-off-by: Helen Chen <helen.chen@intel.com> +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/rndis.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/gadget/rndis.c ++++ b/drivers/usb/gadget/rndis.c +@@ -442,6 +442,8 @@ gen_ndis_query_resp (int configNr, u32 O + + case OID_802_3_MAC_OPTIONS: + pr_debug("%s: OID_802_3_MAC_OPTIONS\n", __func__); ++ *outbuf = cpu_to_le32(0); ++ retval = 0; + break; + + /* ieee802.3 statistics OIDs (table 4-4) */ diff --git a/usb.current/usb-musb-davinci-dm355-updates.patch b/usb.current/usb-musb-davinci-dm355-updates.patch new file mode 100644 index 00000000000000..d7964d279f14df --- /dev/null +++ b/usb.current/usb-musb-davinci-dm355-updates.patch @@ -0,0 +1,71 @@ +From david-b@pacbell.net Thu Jul 2 15:46:04 2009 +From: David Brownell <david-b@pacbell.net> +Date: Wed, 1 Jul 2009 03:32:43 -0700 +Subject: USB: musb: davinci dm355 updates (remainder) +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Kevin Hilman <khilman@deeprootsystems.com> +Message-ID: <200907010332.43849.david-b@pacbell.net> +Content-Disposition: inline + + +From: David Brownell <dbrownell@users.sourceforge.net> + +Finish merging updates for DM355 chips into musb/davinci.c now +that its support is in mainline: kick in new DRVVBUS controls. + +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/davinci.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +--- a/drivers/usb/musb/davinci.c ++++ b/drivers/usb/musb/davinci.c +@@ -35,6 +35,7 @@ + #include <mach/hardware.h> + #include <mach/memory.h> + #include <mach/gpio.h> ++#include <mach/cputype.h> + + #include <asm/mach-types.h> + +@@ -411,6 +412,21 @@ int __init musb_platform_init(struct mus + __raw_writel(phy_ctrl, USB_PHY_CTRL); + } + ++ /* On dm355, the default-A state machine needs DRVVBUS control. ++ * If we won't be a host, there's no need to turn it on. ++ */ ++ if (cpu_is_davinci_dm355()) { ++ u32 deepsleep = __raw_readl(DM355_DEEPSLEEP); ++ ++ if (is_host_enabled(musb)) { ++ deepsleep &= ~DRVVBUS_OVERRIDE; ++ } else { ++ deepsleep &= ~DRVVBUS_FORCE; ++ deepsleep |= DRVVBUS_OVERRIDE; ++ } ++ __raw_writel(deepsleep, DM355_DEEPSLEEP); ++ } ++ + /* reset the controller */ + musb_writel(tibase, DAVINCI_USB_CTRL_REG, 0x1); + +@@ -437,6 +453,15 @@ int musb_platform_exit(struct musb *musb + if (is_host_enabled(musb)) + del_timer_sync(&otg_workaround); + ++ /* force VBUS off */ ++ if (cpu_is_davinci_dm355()) { ++ u32 deepsleep = __raw_readl(DM355_DEEPSLEEP); ++ ++ deepsleep &= ~DRVVBUS_FORCE; ++ deepsleep |= DRVVBUS_OVERRIDE; ++ __raw_writel(deepsleep, DM355_DEEPSLEEP); ++ } ++ + davinci_source_power(musb, 0 /*off*/, 1); + + /* delay, to avoid problems with module reload */ diff --git a/usb.current/usb-musb-davinci-dm6446evm-gpio-renumbering.patch b/usb.current/usb-musb-davinci-dm6446evm-gpio-renumbering.patch new file mode 100644 index 00000000000000..e178505c18f1cf --- /dev/null +++ b/usb.current/usb-musb-davinci-dm6446evm-gpio-renumbering.patch @@ -0,0 +1,39 @@ +From david-b@pacbell.net Thu Jul 2 15:46:21 2009 +From: Kevin Hilman <khilman@deeprootsystems.com> +Date: Wed, 1 Jul 2009 03:33:46 -0700 +Subject: USB: musb: davinci dm6446evm GPIO renumbering +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Kevin Hilman <khilman@deeprootsystems.com> +Message-ID: <200907010333.46803.david-b@pacbell.net> +Content-Disposition: inline + + +From: Kevin Hilman <khilman@deeprootsystems.com> + +Numbering for GPIOs on the pcf857x chips on the dm644x EVM board +changed when DaVinci chips with more GPIOs were supported. Update +the GPIO number used for nVBUS_DRV. + +Longer term, we need a better abstraction of board-specific setup in +this code so we're not hard-coding board specific GPIOs into the +driver, but for now this at least gets it back to working with +mainline davinci core code. + +Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/davinci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/musb/davinci.c ++++ b/drivers/usb/musb/davinci.c +@@ -42,7 +42,7 @@ + #include "musb_core.h" + + #ifdef CONFIG_MACH_DAVINCI_EVM +-#define GPIO_nVBUS_DRV 87 ++#define GPIO_nVBUS_DRV 144 + #endif + + #include "davinci.h" diff --git a/usb.current/usb-musb-silence-suspend-as-a_wait_vrise-is_active-msgs.patch b/usb.current/usb-musb-silence-suspend-as-a_wait_vrise-is_active-msgs.patch new file mode 100644 index 00000000000000..24bbb6df95d0a9 --- /dev/null +++ b/usb.current/usb-musb-silence-suspend-as-a_wait_vrise-is_active-msgs.patch @@ -0,0 +1,91 @@ +From david-b@pacbell.net Thu Jul 2 15:47:44 2009 +From: David Brownell <david-b@pacbell.net> +Date: Wed, 1 Jul 2009 03:36:16 -0700 +Subject: USB: musb: silence "suspend as a_wait_vrise is_active" msgs +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org +Message-ID: <200907010336.16890.david-b@pacbell.net> +Content-Disposition: inline + + +From: David Brownell <dbrownell@users.sourceforge.net> + +Get rid of some obnoxious and inappropriate messaging, mostly on +DaVinci, when usbcore tries to autosuspend a root hub if just a +mini/micro-A connector is connected. Symptom: endless stream of +messages reading like: + + musb_bus_suspend 2221: trying to suspend as a_wait_vrise is_active=1 + +Improve that musb bus suspend primitive a bit. Take advantage of +this call to update the OTG state machine if appropriate, moving +the device out of the A_WAIT_VRISE state. There's basically no +timer for that state transition just now, except with tusb6010; +that can make trouble. + +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/davinci.c | 5 +++-- + drivers/usb/musb/musb_host.c | 25 +++++++++++++++++++++---- + 2 files changed, 24 insertions(+), 6 deletions(-) + +--- a/drivers/usb/musb/davinci.c ++++ b/drivers/usb/musb/davinci.c +@@ -330,7 +330,6 @@ static irqreturn_t davinci_interrupt(int + mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ); + WARNING("VBUS error workaround (delay coming)\n"); + } else if (is_host_enabled(musb) && drvvbus) { +- musb->is_active = 1; + MUSB_HST_MODE(musb); + musb->xceiv->default_a = 1; + musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; +@@ -344,7 +343,9 @@ static irqreturn_t davinci_interrupt(int + portstate(musb->port1_status &= ~USB_PORT_STAT_POWER); + } + +- /* NOTE: this must complete poweron within 100 msec */ ++ /* NOTE: this must complete poweron within 100 msec ++ * (OTG_TIME_A_WAIT_VRISE) but we don't check for that. ++ */ + davinci_source_power(musb, drvvbus, 0); + DBG(2, "VBUS %s (%s)%s, devctl %02x\n", + drvvbus ? "on" : "off", +--- a/drivers/usb/musb/musb_host.c ++++ b/drivers/usb/musb/musb_host.c +@@ -2235,13 +2235,30 @@ static void musb_h_stop(struct usb_hcd * + static int musb_bus_suspend(struct usb_hcd *hcd) + { + struct musb *musb = hcd_to_musb(hcd); ++ u8 devctl; + +- if (musb->xceiv->state == OTG_STATE_A_SUSPEND) ++ if (!is_host_active(musb)) + return 0; + +- if (is_host_active(musb) && musb->is_active) { +- WARNING("trying to suspend as %s is_active=%i\n", +- otg_state_string(musb), musb->is_active); ++ switch (musb->xceiv->state) { ++ case OTG_STATE_A_SUSPEND: ++ return 0; ++ case OTG_STATE_A_WAIT_VRISE: ++ /* ID could be grounded even if there's no device ++ * on the other end of the cable. NOTE that the ++ * A_WAIT_VRISE timers are messy with MUSB... ++ */ ++ devctl = musb_readb(musb->mregs, MUSB_DEVCTL); ++ if ((devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) ++ musb->xceiv->state = OTG_STATE_A_WAIT_BCON; ++ break; ++ default: ++ break; ++ } ++ ++ if (musb->is_active) { ++ WARNING("trying to suspend as %s while active\n", ++ otg_state_string(musb)); + return -EBUSY; + } else + return 0; diff --git a/usb.current/usb-option-add-novatel-ovation-mc760.patch b/usb.current/usb-option-add-novatel-ovation-mc760.patch new file mode 100644 index 00000000000000..99b5454bb66328 --- /dev/null +++ b/usb.current/usb-option-add-novatel-ovation-mc760.patch @@ -0,0 +1,36 @@ +From dcbw@redhat.com Thu Jul 2 15:49:10 2009 +From: Dan Williams <dcbw@redhat.com> +Date: Tue, 30 Jun 2009 16:09:28 -0400 +Subject: USB: option: add Novatel Ovation MC760 +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, stable@kernel.org +Message-ID: <1246392568.31037.6.camel@localhost.localdomain> + + +Used by Virgin Mobile with the Broadband2Go service, for example. + +Signed-off-by: Dan Williams <dcbw@redhat.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/option.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -206,6 +206,7 @@ static int option_resume(struct usb_ser + #define NOVATELWIRELESS_PRODUCT_MC950D 0x4400 + #define NOVATELWIRELESS_PRODUCT_U727 0x5010 + #define NOVATELWIRELESS_PRODUCT_MC760 0x6000 ++#define NOVATELWIRELESS_PRODUCT_OVMC760 0x6002 + + /* FUTURE NOVATEL PRODUCTS */ + #define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0X6001 +@@ -436,6 +437,7 @@ static struct usb_device_id option_ids[] + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */ + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel MC727/U727/USB727 */ + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC760) }, /* Novatel MC760/U760/USB760 */ ++ { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_OVMC760) }, /* Novatel Ovation MC760 */ + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, /* Novatel HSPA product */ + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, /* Novatel EVDO Embedded product */ + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, /* Novatel HSPA Embedded product */ diff --git a/usb.current/usb-rndis-gadget-fix-issues-talking-from-pxa.patch b/usb.current/usb-rndis-gadget-fix-issues-talking-from-pxa.patch new file mode 100644 index 00000000000000..c7f5cb0d9b13d3 --- /dev/null +++ b/usb.current/usb-rndis-gadget-fix-issues-talking-from-pxa.patch @@ -0,0 +1,55 @@ +From david-b@pacbell.net Thu Jul 2 16:02:42 2009 +From: David Brownell <david-b@pacbell.net> +Date: Fri, 19 Jun 2009 03:09:04 -0700 +Subject: USB: RNDIS gadget, fix issues talking from PXA +To: Greg KH <greg@kroah.com> +Cc: "Aric D. Blumer" <aric@sdgsystems.com>, linux-usb@vger.kernel.org +Message-ID: <200906190309.04632.david-b@pacbell.net> +Content-Disposition: inline + + +From: David Brownell <dbrownell@users.sourceforge.net> + +The reworked Ethernet gadget has an RNDIS interop problem when used +with the CDC subset driver ... e.g. on PXA 2xx and 3xx hardware, +which currently has a hard time talking to MS-Windows hosts. + +The issue is that Microsoft requires USB_CLASS_COMM. Fix by tweaking +the CDC subset driver to not switch to USB_CLASS_VENDOR_SPEC if RNDIS +is used in some other device configuration. + +[ UPDATED: some "statements" were comma-terminated; fix that. ] + +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Cc: Aric Blumer <aric@sdgsystems.net> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/ether.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +--- a/drivers/usb/gadget/ether.c ++++ b/drivers/usb/gadget/ether.c +@@ -293,15 +293,16 @@ static int __init eth_bind(struct usb_co + /* CDC Subset */ + eth_config_driver.label = "CDC Subset/SAFE"; + +- device_desc.idVendor = cpu_to_le16(SIMPLE_VENDOR_NUM), +- device_desc.idProduct = cpu_to_le16(SIMPLE_PRODUCT_NUM), +- device_desc.bDeviceClass = USB_CLASS_VENDOR_SPEC; ++ device_desc.idVendor = cpu_to_le16(SIMPLE_VENDOR_NUM); ++ device_desc.idProduct = cpu_to_le16(SIMPLE_PRODUCT_NUM); ++ if (!has_rndis()) ++ device_desc.bDeviceClass = USB_CLASS_VENDOR_SPEC; + } + + if (has_rndis()) { + /* RNDIS plus ECM-or-Subset */ +- device_desc.idVendor = cpu_to_le16(RNDIS_VENDOR_NUM), +- device_desc.idProduct = cpu_to_le16(RNDIS_PRODUCT_NUM), ++ device_desc.idVendor = cpu_to_le16(RNDIS_VENDOR_NUM); ++ device_desc.idProduct = cpu_to_le16(RNDIS_PRODUCT_NUM); + device_desc.bNumConfigurations = 2; + } + diff --git a/usb.current/usb-serial-ftdi-with-product-code-fb80-and-vendor-id-0403.patch b/usb.current/usb-serial-ftdi-with-product-code-fb80-and-vendor-id-0403.patch new file mode 100644 index 00000000000000..b73075dc2bcca1 --- /dev/null +++ b/usb.current/usb-serial-ftdi-with-product-code-fb80-and-vendor-id-0403.patch @@ -0,0 +1,48 @@ +From folkert@vanheusden.com Thu Jul 2 16:01:46 2009 +From: Folkert van Heusden <folkert@vanheusden.com> +Date: Fri, 19 Jun 2009 22:14:42 +0200 +Subject: USB: serial: FTDI with product code FB80 and vendor id 0403 +To: greg@kroah.com, bryder@sgi.com, kuba@mareimbrium.org +Cc: pawilber@gmail.com, udovdh@xs4all.nl +Message-ID: <20090619201442.GR23218@vanheusden.com> +Content-Disposition: inline + + +It seems an USB device with vendor id 0403 and product code FB80 has an +FTDI serial io chip as well: http://ftdichip.com/Drivers/D2XX.htm +This device in fact is a true random generantor by comsci: +http://comscire.com/Products/R2000KU/ +So the following patch should add support for this device if I am +correct. Not tested as I do not own this device (I would like support in +the kernel so that my entropybroker application (which distributes +entrop data (random values) between servers and clients)). + + +From: Folkert van Heusden <folkert@vanheusden.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/ftdi_sio.c | 1 + + drivers/usb/serial/ftdi_sio.h | 1 + + 2 files changed, 2 insertions(+) + +--- a/drivers/usb/serial/ftdi_sio.c ++++ b/drivers/usb/serial/ftdi_sio.c +@@ -191,6 +191,7 @@ static struct usb_device_id id_table_com + { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, ++ { USB_DEVICE(FTDI_VID, FTDI_R2000KU_TRUE_RNG) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0100_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0101_PID) }, + { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0102_PID) }, +--- a/drivers/usb/serial/ftdi_sio.h ++++ b/drivers/usb/serial/ftdi_sio.h +@@ -506,6 +506,7 @@ + * + * Armin Laeuger originally sent the PID for the UM 100 module. + */ ++#define FTDI_R2000KU_TRUE_RNG 0xFB80 /* R2000KU TRUE RNG */ + #define FTDI_ELV_UR100_PID 0xFB58 /* USB-RS232-Umsetzer (UR 100) */ + #define FTDI_ELV_UM100_PID 0xFB5A /* USB-Modul UM 100 */ + #define FTDI_ELV_UO100_PID 0xFB5B /* USB-Modul UO 100 */ diff --git a/usb.current/usb-serial-optimize-sysrq-function-calls.patch b/usb.current/usb-serial-optimize-sysrq-function-calls.patch new file mode 100644 index 00000000000000..e79d14618bd7aa --- /dev/null +++ b/usb.current/usb-serial-optimize-sysrq-function-calls.patch @@ -0,0 +1,103 @@ +From jason.wessel@windriver.com Thu Jul 2 16:00:51 2009 +From: Jason Wessel <jason.wessel@windriver.com> +Date: Mon, 22 Jun 2009 11:32:22 -0500 +Subject: USB: serial: optimize sysrq function calls +To: greg@kroah.com +Cc: Jason Wessel <jason.wessel@windriver.com> +Message-ID: <1245688342-26373-4-git-send-email-jason.wessel@windriver.com> + + +There is no need to have external function calls for the sysrq +functions. The compiler can inline the sysrq calls such that they are +entirely a NOP if CONFIG_MAGIC_SYSRQ is not set. + +Signed-off-by: Jason Wessel <jason.wessel@windriver.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/generic.c | 25 ------------------------- + include/linux/usb/serial.h | 32 ++++++++++++++++++++++++++++---- + 2 files changed, 28 insertions(+), 29 deletions(-) + +--- a/drivers/usb/serial/generic.c ++++ b/drivers/usb/serial/generic.c +@@ -535,31 +535,6 @@ void usb_serial_generic_unthrottle(struc + } + } + +-int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch) +-{ +- if (port->sysrq && port->console) { +- if (ch && time_before(jiffies, port->sysrq)) { +- handle_sysrq(ch, tty_port_tty_get(&port->port)); +- port->sysrq = 0; +- return 1; +- } +- port->sysrq = 0; +- } +- return 0; +-} +-EXPORT_SYMBOL_GPL(usb_serial_handle_sysrq_char); +- +-int usb_serial_handle_break(struct usb_serial_port *port) +-{ +- if (!port->sysrq) { +- port->sysrq = jiffies + HZ*5; +- return 1; +- } +- port->sysrq = 0; +- return 0; +-} +-EXPORT_SYMBOL_GPL(usb_serial_handle_break); +- + void usb_serial_generic_disconnect(struct usb_serial *serial) + { + int i; +--- a/include/linux/usb/serial.h ++++ b/include/linux/usb/serial.h +@@ -317,10 +317,6 @@ extern int usb_serial_generic_register(i + extern void usb_serial_generic_deregister(void); + extern void usb_serial_generic_resubmit_read_urb(struct usb_serial_port *port, + gfp_t mem_flags); +-extern int usb_serial_handle_sysrq_char(struct usb_serial_port *port, +- unsigned int ch); +-extern int usb_serial_handle_break(struct usb_serial_port *port); +- + + extern int usb_serial_bus_register(struct usb_serial_driver *device); + extern void usb_serial_bus_deregister(struct usb_serial_driver *device); +@@ -329,6 +325,34 @@ extern struct usb_serial_driver usb_seri + extern struct bus_type usb_serial_bus_type; + extern struct tty_driver *usb_serial_tty_driver; + ++static inline int usb_serial_handle_sysrq_char(struct usb_serial_port *port, ++ unsigned int ch) ++{ ++#ifdef CONFIG_MAGIC_SYSRQ ++ if (port->sysrq && port->console) { ++ if (ch && time_before(jiffies, port->sysrq)) { ++ handle_sysrq(ch, tty_port_tty_get(&port->port)); ++ port->sysrq = 0; ++ return 1; ++ } ++ port->sysrq = 0; ++ } ++#endif /* CONFIG_MAGIC_SYSRQ */ ++ return 0; ++} ++ ++static inline int usb_serial_handle_break(struct usb_serial_port *port) ++{ ++#ifdef CONFIG_MAGIC_SYSRQ ++ if (!port->sysrq) { ++ port->sysrq = jiffies + HZ*5; ++ return 1; ++ } ++ port->sysrq = 0; ++#endif /* CONFIG_MAGIC_SYSRQ */ ++ return 0; ++} ++ + static inline void usb_serial_debug_data(int debug, + struct device *dev, + const char *function, int size, diff --git a/usb.current/usb-serial-regression-fix-to-move-sysrq-from-hot-path.patch b/usb.current/usb-serial-regression-fix-to-move-sysrq-from-hot-path.patch new file mode 100644 index 00000000000000..0152a3a5ed8974 --- /dev/null +++ b/usb.current/usb-serial-regression-fix-to-move-sysrq-from-hot-path.patch @@ -0,0 +1,54 @@ +From jason.wessel@windriver.com Thu Jul 2 16:00:37 2009 +From: Jason Wessel <jason.wessel@windriver.com> +Date: Mon, 22 Jun 2009 11:32:21 -0500 +Subject: USB: serial: regression fix to move sysrq from hot path +To: greg@kroah.com +Cc: Jason Wessel <jason.wessel@windriver.com> +Message-ID: <1245688342-26373-3-git-send-email-jason.wessel@windriver.com> + + +A performance regression was introduced by commit: +98fcb5f78165b8a3d93870ad7afd4d9ebbb8b43a + +The sysrq handling should only get executed if the attached usb serial +device is acting as a serial system console. A serial system console +has a very low input throughput vs a 3g usb modem which pushes bytes +through the same interface at a high rate. + +Entire strings of output can be processed via the tty input when the +device is not a console. + +Signed-off-by: Jason Wessel <jason.wessel@windriver.com> +Acked-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/generic.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +--- a/drivers/usb/serial/generic.c ++++ b/drivers/usb/serial/generic.c +@@ -425,11 +425,19 @@ static void flush_and_resubmit_read_urb( + goto done; + + /* Push data to tty */ +- for (i = 0; i < urb->actual_length; i++, ch++) { +- if (!usb_serial_handle_sysrq_char(port, *ch)) +- tty_insert_flip_char(tty, *ch, TTY_NORMAL); ++ if (unlikely(port->console)) { ++ for (i = 0; i < urb->actual_length; i++, ch++) { ++ if (!usb_serial_handle_sysrq_char(port, *ch)) ++ tty_insert_flip_char(tty, *ch, TTY_NORMAL); ++ } ++ tty_flip_buffer_push(tty); ++ } else if (urb->actual_length) { ++ i = tty_buffer_request_room(tty, urb->actual_length); ++ if (i) { ++ tty_insert_flip_string(tty, urb->transfer_buffer, i); ++ tty_flip_buffer_push(tty); ++ } + } +- tty_flip_buffer_push(tty); + tty_kref_put(tty); + done: + usb_serial_generic_resubmit_read_urb(port, GFP_ATOMIC); diff --git a/usb.current/usb-usb.h-fix-kernel-doc-notation.patch b/usb.current/usb-usb.h-fix-kernel-doc-notation.patch new file mode 100644 index 00000000000000..f6f14351f8338f --- /dev/null +++ b/usb.current/usb-usb.h-fix-kernel-doc-notation.patch @@ -0,0 +1,53 @@ +From randy.dunlap@oracle.com Thu Jul 2 16:03:51 2009 +From: Randy Dunlap <randy.dunlap@oracle.com> +Date: Thu, 18 Jun 2009 10:39:11 -0700 +Subject: USB: usb.h: fix kernel-doc notation +To: linux-usb <linux-usb@vger.kernel.org>, Greg KH <gregkh@suse.de> +Message-ID: <4A3A7BBF.1000507@oracle.com> + + +From: Randy Dunlap <randy.dunlap@oracle.com> + +Fix usb.h kernel-doc warnings: + +Warning(include/linux/usb.h:918): Excess struct/union/enum/typedef member 'nodename' description in 'usb_device_driver' +Warning(include/linux/usb.h:939): No description found for parameter 'nodename' +Warning(include/linux/usb.h:1219): No description found for parameter 'sg' +Warning(include/linux/usb.h:1219): No description found for parameter 'num_sgs' + +Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + include/linux/usb.h | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/include/linux/usb.h ++++ b/include/linux/usb.h +@@ -888,8 +888,6 @@ struct usb_driver { + * struct usb_device_driver - identifies USB device driver to usbcore + * @name: The driver name should be unique among USB drivers, + * and should normally be the same as the module name. +- * @nodename: Callback to provide a naming hint for a possible +- * device node to create. + * @probe: Called to see if the driver is willing to manage a particular + * device. If it is, probe returns zero and uses dev_set_drvdata() + * to associate driver-specific data with the device. If unwilling +@@ -924,6 +922,8 @@ extern struct bus_type usb_bus_type; + /** + * struct usb_class_driver - identifies a USB driver that wants to use the USB major number + * @name: the usb class device name for this driver. Will show up in sysfs. ++ * @nodename: Callback to provide a naming hint for a possible ++ * device node to create. + * @fops: pointer to the struct file_operations of this driver. + * @minor_base: the start of the minor range for this driver. + * +@@ -1046,6 +1046,8 @@ typedef void (*usb_complete_t)(struct ur + * the device driver is saying that it provided this DMA address, + * which the host controller driver should use in preference to the + * transfer_buffer. ++ * @sg: scatter gather buffer list ++ * @num_sgs: number of entries in the sg list + * @transfer_buffer_length: How big is transfer_buffer. The transfer may + * be broken up into chunks according to the current maximum packet + * size for the endpoint, which is a function of the configuration |
