aboutsummaryrefslogtreecommitdiffstats
path: root/usb
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2008-11-17 16:54:50 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2008-11-17 16:54:50 -0800
commit3591a6634a148e81e000e47f613f94748dd4bfa9 (patch)
tree256de6854fd77553f537a49bc654ea5b91f6aee3 /usb
parent5badfa1bd84995557fd839ade0100218b77934ee (diff)
downloadpatches-3591a6634a148e81e000e47f613f94748dd4bfa9.tar.gz
usb and driver core patches
Diffstat (limited to 'usb')
-rw-r--r--usb/usb-allow-usbmon-as-a-module-even-if-usbcore-is-builtin.patch110
-rw-r--r--usb/usb-announce-new-devices-earlier.patch66
-rw-r--r--usb/usb-gadget-pxa27x_udc.c-cleanup-kernel-doc.patch38
-rw-r--r--usb/usb-serial-ipw.c-mark-__init-__exit-for-usb_ipw_-init-exit.patch38
4 files changed, 252 insertions, 0 deletions
diff --git a/usb/usb-allow-usbmon-as-a-module-even-if-usbcore-is-builtin.patch b/usb/usb-allow-usbmon-as-a-module-even-if-usbcore-is-builtin.patch
new file mode 100644
index 00000000000000..2e658bc7a6e18e
--- /dev/null
+++ b/usb/usb-allow-usbmon-as-a-module-even-if-usbcore-is-builtin.patch
@@ -0,0 +1,110 @@
+From zaitcev@redhat.com Mon Nov 17 16:39:39 2008
+From: Pete Zaitcev <zaitcev@redhat.com>
+Date: Thu, 13 Nov 2008 21:31:21 -0700
+Subject: USB: Allow usbmon as a module even if usbcore is builtin
+To: greg@kroah.com
+Cc: zaitcev@redhat.com, linux-usb@vger.kernel.org, Paul Bolle <pebolle@tiscali.nl>
+Message-ID: <20081113213121.82676816.zaitcev@redhat.com>
+
+From: Pete Zaitcev <zaitcev@redhat.com>
+
+usbmon can only be built as a module if usbcore is a module too. Trivial
+changes to the relevant Kconfig and Makefile (and a few trivial changes
+elsewhere) allow usbmon to be built as a module even if usbcore is
+builtin.
+
+This is verified to work in all 9 permutations (3 correctly prohibited
+by Kconfig, 6 build a suitable result).
+
+Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
+Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/core/hcd.c | 4 ++--
+ drivers/usb/core/hcd.h | 4 ++--
+ drivers/usb/mon/Kconfig | 13 ++++++-------
+ drivers/usb/mon/Makefile | 3 +--
+ include/linux/usb.h | 2 +-
+ 5 files changed, 12 insertions(+), 14 deletions(-)
+
+--- a/drivers/usb/core/hcd.c
++++ b/drivers/usb/core/hcd.c
+@@ -2028,7 +2028,7 @@ EXPORT_SYMBOL_GPL(usb_hcd_platform_shutd
+
+ /*-------------------------------------------------------------------------*/
+
+-#if defined(CONFIG_USB_MON)
++#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
+
+ struct usb_mon_operations *mon_ops;
+
+@@ -2064,4 +2064,4 @@ void usb_mon_deregister (void)
+ }
+ EXPORT_SYMBOL_GPL (usb_mon_deregister);
+
+-#endif /* CONFIG_USB_MON */
++#endif /* CONFIG_USB_MON || CONFIG_USB_MON_MODULE */
+--- a/drivers/usb/core/hcd.h
++++ b/drivers/usb/core/hcd.h
+@@ -421,7 +421,7 @@ static inline void usbfs_cleanup(void) {
+
+ /*-------------------------------------------------------------------------*/
+
+-#if defined(CONFIG_USB_MON)
++#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
+
+ struct usb_mon_operations {
+ void (*urb_submit)(struct usb_bus *bus, struct urb *urb);
+@@ -463,7 +463,7 @@ static inline void usbmon_urb_submit_err
+ static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
+ int status) {}
+
+-#endif /* CONFIG_USB_MON */
++#endif /* CONFIG_USB_MON || CONFIG_USB_MON_MODULE */
+
+ /*-------------------------------------------------------------------------*/
+
+--- a/drivers/usb/mon/Kconfig
++++ b/drivers/usb/mon/Kconfig
+@@ -3,14 +3,13 @@
+ #
+
+ config USB_MON
+- bool "USB Monitor"
+- depends on USB!=n
+- default y
++ tristate "USB Monitor"
++ depends on USB
++ default y if USB=y
++ default m if USB=m
+ help
+- If you say Y here, a component which captures the USB traffic
++ If you select this option, a component which captures the USB traffic
+ between peripheral-specific drivers and HC drivers will be built.
+ For more information, see <file:Documentation/usb/usbmon.txt>.
+
+- This is somewhat experimental at this time, but it should be safe.
+-
+- If unsure, say Y.
++ If unsure, say Y (if allowed), otherwise M.
+--- a/drivers/usb/mon/Makefile
++++ b/drivers/usb/mon/Makefile
+@@ -4,5 +4,4 @@
+
+ usbmon-objs := mon_main.o mon_stat.o mon_text.o mon_bin.o mon_dma.o
+
+-# This does not use CONFIG_USB_MON because we want this to use a tristate.
+-obj-$(CONFIG_USB) += usbmon.o
++obj-$(CONFIG_USB_MON) += usbmon.o
+--- a/include/linux/usb.h
++++ b/include/linux/usb.h
+@@ -336,7 +336,7 @@ struct usb_bus {
+ #endif
+ struct device *dev; /* device for this bus */
+
+-#if defined(CONFIG_USB_MON)
++#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
+ struct mon_bus *mon_bus; /* non-null when associated */
+ int monitored; /* non-zero when monitored */
+ #endif
diff --git a/usb/usb-announce-new-devices-earlier.patch b/usb/usb-announce-new-devices-earlier.patch
new file mode 100644
index 00000000000000..409c61733d5adf
--- /dev/null
+++ b/usb/usb-announce-new-devices-earlier.patch
@@ -0,0 +1,66 @@
+From stern@rowland.harvard.edu Mon Nov 17 16:40:03 2008
+From: Alan Stern <stern@rowland.harvard.edu>
+Date: Thu, 13 Nov 2008 15:08:30 -0500 (EST)
+Subject: USB: announce new devices earlier
+To: Greg KH <greg@kroah.com>
+Message-ID: <Pine.LNX.4.44L0.0811131505420.3036-100000@iolanthe.rowland.org>
+
+
+This patch (as1166) changes usb_new_device(). Now new devices will be
+announced in the log _prior_ to being registered; this way the "new
+device" lines will appear before all the output from driver probing,
+which seems much more logical.
+
+Also, the patch adds a call to usb_stop_pm() to the failure pathway,
+so that the parent's count of unsuspended children will remain correct
+if registration fails. In order for this to work properly, the code
+to increment that count has to be moved forward, before the first
+point where a failure can occur.
+
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/core/hub.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+--- a/drivers/usb/core/hub.c
++++ b/drivers/usb/core/hub.c
+@@ -1636,6 +1636,10 @@ int usb_new_device(struct usb_device *ud
+ {
+ int err;
+
++ /* Increment the parent's count of unsuspended children */
++ if (udev->parent)
++ usb_autoresume_device(udev->parent);
++
+ usb_detect_quirks(udev); /* Determine quirks */
+ err = usb_configure_device(udev); /* detect & probe dev/intfs */
+ if (err < 0)
+@@ -1644,9 +1648,8 @@ int usb_new_device(struct usb_device *ud
+ udev->dev.devt = MKDEV(USB_DEVICE_MAJOR,
+ (((udev->bus->busnum-1) * 128) + (udev->devnum-1)));
+
+- /* Increment the parent's count of unsuspended children */
+- if (udev->parent)
+- usb_autoresume_device(udev->parent);
++ /* Tell the world! */
++ announce_device(udev);
+
+ /* Register the device. The device driver is responsible
+ * for adding the device files to sysfs and for configuring
+@@ -1660,13 +1663,11 @@ int usb_new_device(struct usb_device *ud
+
+ /* put device-specific files into sysfs */
+ usb_create_sysfs_dev_files(udev);
+-
+- /* Tell the world! */
+- announce_device(udev);
+ return err;
+
+ fail:
+ usb_set_device_state(udev, USB_STATE_NOTATTACHED);
++ usb_stop_pm(udev);
+ return err;
+ }
+
diff --git a/usb/usb-gadget-pxa27x_udc.c-cleanup-kernel-doc.patch b/usb/usb-gadget-pxa27x_udc.c-cleanup-kernel-doc.patch
new file mode 100644
index 00000000000000..4308a6c4ef1bdb
--- /dev/null
+++ b/usb/usb-gadget-pxa27x_udc.c-cleanup-kernel-doc.patch
@@ -0,0 +1,38 @@
+From qhfeng.kernel@gmail.com Mon Nov 17 16:35:17 2008
+From: Qinghuang Feng <qhfeng.kernel@gmail.com>
+Date: Fri, 14 Nov 2008 20:24:05 +0800
+Subject: USB: gadget: pxa27x_udc.c: cleanup kernel-doc
+To: Greg Kroah-Hartman <gregkh@suse.de>
+Cc: qhfeng.kernel@gmail.com
+Message-ID: <491d6ded.0e0d6e0a.4656.7c38@mx.google.com>
+
+
+no argument named @index in pio_irq_disable, and
+no argument named @req in inc_ep_stats_bytes,
+remove them.
+
+Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/pxa27x_udc.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/drivers/usb/gadget/pxa27x_udc.c
++++ b/drivers/usb/gadget/pxa27x_udc.c
+@@ -430,7 +430,6 @@ static void pio_irq_enable(struct pxa_ep
+ /**
+ * pio_irq_disable - Disables irq generation for one endpoint
+ * @ep: udc endpoint
+- * @index: endpoint number
+ */
+ static void pio_irq_disable(struct pxa_ep *ep)
+ {
+@@ -586,7 +585,6 @@ static void inc_ep_stats_reqs(struct pxa
+ * inc_ep_stats_bytes - Update ep stats counts
+ * @ep: physical endpoint
+ * @count: bytes transfered on endpoint
+- * @req: usb request
+ * @is_in: ep direction (USB_DIR_IN or 0)
+ */
+ static void inc_ep_stats_bytes(struct pxa_ep *ep, int count, int is_in)
diff --git a/usb/usb-serial-ipw.c-mark-__init-__exit-for-usb_ipw_-init-exit.patch b/usb/usb-serial-ipw.c-mark-__init-__exit-for-usb_ipw_-init-exit.patch
new file mode 100644
index 00000000000000..46fa099ca0e802
--- /dev/null
+++ b/usb/usb-serial-ipw.c-mark-__init-__exit-for-usb_ipw_-init-exit.patch
@@ -0,0 +1,38 @@
+From qhfeng.kernel@gmail.com Mon Nov 17 16:35:47 2008
+From: Qinghuang Feng <qhfeng.kernel@gmail.com>
+Date: Fri, 14 Nov 2008 20:24:11 +0800
+Subject: USB: serial: ipw.c: mark {__init|__exit} for usb_ipw_{init|exit}
+To: Greg Kroah-Hartman <gregkh@suse.de>
+Cc: qhfeng.kernel@gmail.com
+Message-ID: <491d6df2.034c6e0a.150f.5dd9@mx.google.com>
+
+
+mark {__init|__exit} for usb_ipw_{init|exit} ()
+
+Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/ipw.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/usb/serial/ipw.c
++++ b/drivers/usb/serial/ipw.c
+@@ -473,7 +473,7 @@ static struct usb_serial_driver ipw_devi
+
+
+
+-static int usb_ipw_init(void)
++static int __init usb_ipw_init(void)
+ {
+ int retval;
+
+@@ -490,7 +490,7 @@ static int usb_ipw_init(void)
+ return 0;
+ }
+
+-static void usb_ipw_exit(void)
++static void __exit usb_ipw_exit(void)
+ {
+ usb_deregister(&usb_ipw_driver);
+ usb_serial_deregister(&ipw_device);