diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-16 13:46:56 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-16 13:46:56 -0700 |
| commit | 0f1dc22952d8dd30606a3a2f829624cca69f8603 (patch) | |
| tree | 295c56cc6a87a17e3689a58487e7de84e02527ef | |
| parent | f080c4868aeb061562f4addeffb9deedf9300766 (diff) | |
| download | patches-0f1dc22952d8dd30606a3a2f829624cca69f8603.tar.gz | |
more patches
23 files changed, 1643 insertions, 13 deletions
diff --git a/driver-core.current/driver-core-document-err_ptr-return-values.patch b/driver-core.current/driver-core-document-err_ptr-return-values.patch new file mode 100644 index 00000000000000..236dce7658dd1e --- /dev/null +++ b/driver-core.current/driver-core-document-err_ptr-return-values.patch @@ -0,0 +1,92 @@ +From ext-jani.1.nikula@nokia.com Tue Mar 16 13:24:35 2010 +From: Jani Nikula <ext-jani.1.nikula@nokia.com> +Date: Thu, 11 Mar 2010 18:11:45 +0200 +Subject: driver-core: document ERR_PTR() return values +To: gregkh@suse.de +Cc: linux-kernel@vger.kernel.org, ext-jani.1.nikula@nokia.com +Message-ID: <1268323905-30309-1-git-send-email-ext-jani.1.nikula@nokia.com> + + +From: Jani Nikula <ext-jani.1.nikula@nokia.com> + +A number of functions in the driver core return ERR_PTR() values on +error. Document this in the kernel-doc of the functions. + +Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/base/class.c | 2 ++ + drivers/base/core.c | 6 ++++++ + drivers/base/platform.c | 6 ++++++ + 3 files changed, 14 insertions(+) + +--- a/drivers/base/class.c ++++ b/drivers/base/class.c +@@ -219,6 +219,8 @@ static void class_create_release(struct + * This is used to create a struct class pointer that can then be used + * in calls to device_create(). + * ++ * Returns &struct class pointer on success, or ERR_PTR() on error. ++ * + * Note, the pointer created here is to be destroyed when finished by + * making a call to class_destroy(). + */ +--- a/drivers/base/core.c ++++ b/drivers/base/core.c +@@ -1345,6 +1345,8 @@ static void root_device_release(struct d + * 'module' symlink which points to the @owner directory + * in sysfs. + * ++ * Returns &struct device pointer on success, or ERR_PTR() on error. ++ * + * Note: You probably want to use root_device_register(). + */ + struct device *__root_device_register(const char *name, struct module *owner) +@@ -1432,6 +1434,8 @@ static void device_create_release(struct + * Any further sysfs files that might be required can be created using this + * pointer. + * ++ * Returns &struct device pointer on success, or ERR_PTR() on error. ++ * + * Note: the struct class passed to this function must have previously + * been created with a call to class_create(). + */ +@@ -1492,6 +1496,8 @@ EXPORT_SYMBOL_GPL(device_create_vargs); + * Any further sysfs files that might be required can be created using this + * pointer. + * ++ * Returns &struct device pointer on success, or ERR_PTR() on error. ++ * + * Note: the struct class passed to this function must have previously + * been created with a call to class_create(). + */ +--- a/drivers/base/platform.c ++++ b/drivers/base/platform.c +@@ -362,6 +362,8 @@ EXPORT_SYMBOL_GPL(platform_device_unregi + * enumeration tasks, they don't fully conform to the Linux driver model. + * In particular, when such drivers are built as modules, they can't be + * "hotplugged". ++ * ++ * Returns &struct platform_device pointer on success, or ERR_PTR() on error. + */ + struct platform_device *platform_device_register_simple(const char *name, + int id, +@@ -408,6 +410,8 @@ EXPORT_SYMBOL_GPL(platform_device_regist + * allocated for the device allows drivers using such devices to be + * unloaded without waiting for the last reference to the device to be + * dropped. ++ * ++ * Returns &struct platform_device pointer on success, or ERR_PTR() on error. + */ + struct platform_device *platform_device_register_data( + struct device *parent, +@@ -559,6 +563,8 @@ EXPORT_SYMBOL_GPL(platform_driver_probe) + * + * Use this in legacy-style modules that probe hardware directly and + * register a single platform device and corresponding platform driver. ++ * ++ * Returns &struct platform_device pointer on success, or ERR_PTR() on error. + */ + struct platform_device * __init_or_module platform_create_bundle( + struct platform_driver *driver, diff --git a/driver-core.current/driver-core-numa-fix-build_bug_on-for-node_read_distance.patch b/driver-core.current/driver-core-numa-fix-build_bug_on-for-node_read_distance.patch new file mode 100644 index 00000000000000..f0dcecb9aba5b8 --- /dev/null +++ b/driver-core.current/driver-core-numa-fix-build_bug_on-for-node_read_distance.patch @@ -0,0 +1,38 @@ +From rientjes@google.com Tue Mar 16 13:26:23 2010 +From: David Rientjes <rientjes@google.com> +Date: Wed, 10 Mar 2010 14:50:21 -0800 (PST) +Subject: driver core: numa: fix BUILD_BUG_ON for node_read_distance +To: Greg Kroah-Hartman <gregkh@suse.de> +Message-ID: <alpine.DEB.2.00.1003101449480.21849@chino.kir.corp.google.com> + + +node_read_distance() has a BUILD_BUG_ON() to prevent buffer overruns when +the number of nodes printed will exceed the buffer length. + +Each node only needs four chars: three for distance (maximum distance is +255) and one for a seperating space or a trailing newline. + +Signed-off-by: David Rientjes <rientjes@google.com> +Cc: Ingo Molnar <mingo@elte.hu> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/base/node.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/base/node.c ++++ b/drivers/base/node.c +@@ -165,8 +165,11 @@ static ssize_t node_read_distance(struct + int len = 0; + int i; + +- /* buf currently PAGE_SIZE, need ~4 chars per node */ +- BUILD_BUG_ON(MAX_NUMNODES*4 > PAGE_SIZE/2); ++ /* ++ * buf is currently PAGE_SIZE in length and each node needs 4 chars ++ * at the most (distance + space or newline). ++ */ ++ BUILD_BUG_ON(MAX_NUMNODES * 4 > PAGE_SIZE); + + for_each_online_node(i) + len += sprintf(buf + len, "%s%d", i ? " " : "", node_distance(nid, i)); diff --git a/driver-core.current/kobject-documentation-update-to-refer-to-kset-example.c.patch b/driver-core.current/kobject-documentation-update-to-refer-to-kset-example.c.patch new file mode 100644 index 00000000000000..9610bfd3c4cdbf --- /dev/null +++ b/driver-core.current/kobject-documentation-update-to-refer-to-kset-example.c.patch @@ -0,0 +1,25 @@ +From rpjday@crashcourse.ca Tue Mar 16 13:35:44 2010 +From: "Robert P. J. Day" <rpjday@crashcourse.ca> +Date: Fri, 12 Mar 2010 07:30:35 -0500 (EST) +Subject: kobject: documentation: Update to refer to kset-example.c. +Cc: Greg KH <greg@kroah.com> +Message-ID: <alpine.LFD.2.00.1003120728450.7261@localhost> + + + +Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + Documentation/kobject.txt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/Documentation/kobject.txt ++++ b/Documentation/kobject.txt +@@ -406,4 +406,5 @@ called, and the objects in the former ci + Example code to copy from + + For a more complete example of using ksets and kobjects properly, see the +-sample/kobject/kset-example.c code. ++example programs samples/kobject/{kobject-example.c,kset-example.c}, ++which will be built as loadable modules if you select CONFIG_SAMPLE_KOBJECT. diff --git a/driver-core/driver-core-early-dev_name-support.patch b/driver-core/driver-core-early-dev_name-support.patch new file mode 100644 index 00000000000000..134432e9795137 --- /dev/null +++ b/driver-core/driver-core-early-dev_name-support.patch @@ -0,0 +1,81 @@ +From lethal@linux-sh.org Tue Mar 16 13:29:36 2010 +From: Paul Mundt <lethal@linux-sh.org> +Date: Tue, 9 Mar 2010 15:57:53 +0900 +Subject: driver core: Early dev_name() support. +To: Greg KH <greg@kroah.com> +Cc: Magnus Damm <damm@opensource.se>, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org +Message-ID: <20100309065753.GA8287@linux-sh.org> +Content-Disposition: inline + + +Presently early platform devices suffer from the fact they are unable to +use dev_xxx() calls early on due to dev_name() and others being +unavailable at the time ->probe() is called. + +This implements early init_name construction from the matched name/id +pair following the semantics of the late device/driver match. As a +result, matched IDs (inclusive of requested ones) are preserved when the +handoff from the early platform code happens at kobject initialization +time. + +Since we still require kmalloc slabs to be available at this point, using +kstrdup() for establishing the init_name works fine. This subsequently +needs to be tested from dev_name() prior to the init_name being cleared +by the driver core. We don't kfree() since others will already have a +handle on the string long before the kobject initialization takes place. + +This is also needed to permit drivers to use the clock framework early, +without having to manually construct their own device IDs from the match +id/name pair locally (needed by the early console and timer code on sh +and arm). + +Signed-off-by: Paul Mundt <lethal@linux-sh.org> +Cc: Kay Sievers <kay.sievers@vrfy.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/base/platform.c | 19 +++++++++++++++++++ + include/linux/device.h | 4 ++++ + 2 files changed, 23 insertions(+) + +--- a/drivers/base/platform.c ++++ b/drivers/base/platform.c +@@ -1254,6 +1254,25 @@ static int __init early_platform_driver_ + } + + if (match) { ++ /* ++ * Set up a sensible init_name to enable ++ * dev_name() and others to be used before the ++ * rest of the driver core is initialized. ++ */ ++ if (!match->dev.init_name) { ++ char buf[32]; ++ ++ if (match->id != -1) ++ snprintf(buf, sizeof(buf), "%s.%d", ++ match->name, match->id); ++ else ++ snprintf(buf, sizeof(buf), "%s", ++ match->name); ++ ++ match->dev.init_name = kstrdup(buf, GFP_KERNEL); ++ if (!match->dev.init_name) ++ return -ENOMEM; ++ } + if (epdrv->pdrv->probe(match)) + pr_warning("%s: unable to probe %s early.\n", + class_str, match->name); +--- a/include/linux/device.h ++++ b/include/linux/device.h +@@ -451,6 +451,10 @@ struct device { + + static inline const char *dev_name(const struct device *dev) + { ++ /* Use the init name until the kobject becomes available */ ++ if (dev->init_name) ++ return dev->init_name; ++ + return kobject_name(&dev->kobj); + } + diff --git a/driver-core/driver-core-module.c-use-kasprintf.patch b/driver-core/driver-core-module.c-use-kasprintf.patch new file mode 100644 index 00000000000000..1da2c53e37d88a --- /dev/null +++ b/driver-core/driver-core-module.c-use-kasprintf.patch @@ -0,0 +1,54 @@ +From julia@diku.dk Tue Mar 16 13:31:39 2010 From: Julia Lawall <julia@diku.dk> +Date: Wed, 10 Mar 2010 22:18:13 +0100 (CET) +Subject: driver core: module.c: Use kasprintf +To: Greg Kroah-Hartman <gregkh@suse.de>, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org +Message-ID: <Pine.LNX.4.64.1003102217500.1672@ask.diku.dk> + + +From: Julia Lawall <julia@diku.dk> + +kasprintf combines kmalloc and sprintf, and takes care of the size +calculation itself. + +The semantic patch that makes this change is as follows: +(http://coccinelle.lip6.fr/) + +// <smpl> +@@ +expression a,flag; +expression list args; +statement S; +@@ + + a = +- \(kmalloc\|kzalloc\)(...,flag) ++ kasprintf(flag,args) + <... when != a + if (a == NULL || ...) S + ...> +- sprintf(a,args); +// </smpl> + +Signed-off-by: Julia Lawall <julia@diku.dk> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/base/module.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/base/module.c ++++ b/drivers/base/module.c +@@ -14,12 +14,10 @@ static char *make_driver_name(struct dev + { + char *driver_name; + +- driver_name = kmalloc(strlen(drv->name) + strlen(drv->bus->name) + 2, +- GFP_KERNEL); ++ driver_name = kasprintf(GFP_KERNEL, "%s:%s", drv->bus->name, drv->name); + if (!driver_name) + return NULL; + +- sprintf(driver_name, "%s:%s", drv->bus->name, drv->name); + return driver_name; + } + diff --git a/driver-core/drivers-base-convert-sema.patch b/driver-core/drivers-base-convert-sema.patch index 8b55af23fa405c..c02aa8410fdf62 100644 --- a/driver-core/drivers-base-convert-sema.patch +++ b/driver-core/drivers-base-convert-sema.patch @@ -92,7 +92,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> * its driver. */ -@@ -510,17 +509,17 @@ static inline bool device_async_suspend_ +@@ -514,17 +513,17 @@ static inline bool device_async_suspend_ static inline void device_lock(struct device *dev) { @@ -17,6 +17,9 @@ driver-core.current/driver-core-early-platform-kernel-doc-update.patch driver-core.current/driver-core-fix-missing-kernel-doc-in-firmware_class.patch driver-core.current/kobject-documentation-fix-erroneous-example-in-kobject-doc.patch driver-core.current/sysdev-the-cpu-probe-release-attributes-should-be-sysdev_class_attributes.patch +driver-core.current/kobject-documentation-update-to-refer-to-kset-example.c.patch +driver-core.current/driver-core-document-err_ptr-return-values.patch +driver-core.current/driver-core-numa-fix-build_bug_on-for-node_read_distance.patch ################################# # TTY patches for 2.6.34 @@ -71,6 +74,11 @@ usb.current/usb-g_mass_storage-fixed-module-name-in-kconfig.patch usb.current/usb-ftdi_sio-fix-locking-for-change_speed-function.patch usb.current/usb-gadget-add-gadget-controller-number-for-s3c-hsotg-driver.patch usb.current/usb-remove-last-bit-of-config_usb_berry_charge.patch +usb.current/usb-cp210x-remove-double-usb_control_msg-from-cp210x_set_config.patch +usb.current/usb-fix-usb_fill_int_urb-for-superspeed-devices.patch +usb.current/usb-xhci-make-endpoint-interval-debugging-clearer.patch +usb.current/usb-r8a66597-hcd-fix-removed-from-an-attached-hub.patch + ################################# @@ -89,6 +97,8 @@ driver-core/kref-remove-kref_set.patch driver-core/driver-core-reduce-the-level-of-request_firmware-messages.patch driver-core/driver-core-fix-potential-race-condition-in-drivers-base-dd.c.patch driver-core/driver-core-don-t-initialize-wakeup-flags.patch +driver-core/driver-core-early-dev_name-support.patch +driver-core/driver-core-module.c-use-kasprintf.patch # will we make it this time??? driver-core/drivers-base-convert-sema.patch @@ -111,8 +121,16 @@ usb/usb-straighten-out-port-feature-vs.-port-status-usage.patch usb/usb-remove-uses-of-urb_no_setup_dma_map.patch usb/usb-ehci-au1xxx-does-not-need-ehci-io-watchdog.patch usb/usb-serial-use-tty_port-version-console-instead-of-usb_serial_port.patch - - +usb/usb-musb-allow-board-to-pass-down-fifo-mode.patch +usb/usb-musb-set-transceiver-interface-type.patch +usb/usb-musb-build-musb-driver-for-omap4.patch +usb/usb-musb-add-omap4-support-in-musb-driver.patch +usb/usb-musb-allow-the-blackfin-vrsel-gpio-to-be-active-low.patch +usb/usb-musb-add-debugfs-support.patch +usb/usb-musb-gadget-support-musb-specific-test-modes.patch +usb/usb-musb-hsdma-use-musb_read-writel.patch +usb/usb-gadget-multi-cdc_do_config-remove-redundant-check.patch +usb/usb-f_mass_storage-dynamic-buffers-for-better-alignment.patch ####################################### diff --git a/usb.current/usb-cp210x-remove-double-usb_control_msg-from-cp210x_set_config.patch b/usb.current/usb-cp210x-remove-double-usb_control_msg-from-cp210x_set_config.patch new file mode 100644 index 00000000000000..b94c1d23476f66 --- /dev/null +++ b/usb.current/usb-cp210x-remove-double-usb_control_msg-from-cp210x_set_config.patch @@ -0,0 +1,35 @@ +From mibru@gmx.de Tue Mar 16 13:27:47 2010 +From: Michael Brunner <mibru@gmx.de> +Date: Wed, 10 Mar 2010 23:26:37 +0100 +Subject: USB: cp210x: Remove double usb_control_msg from cp210x_set_config +To: craig@microtron.org.uk, gregkh@suse.de +Message-ID: <20100310232637.7e14e773@mail.gmx.de> + + +This patch removes a double usb_control_msg that sets the cp210x +configuration registers a second time when calling cp210x_set_config. +For data sizes >2 the second write gets corrupted. +The patch has been created against 2.6.34-rc1, but all cp210x driver +revisions are affected. + +Signed-off-by: Michael Brunner <mibru@gmx.de> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/cp210x.c | 5 ----- + 1 file changed, 5 deletions(-) + +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -313,11 +313,6 @@ static int cp210x_set_config(struct usb_ + return -EPROTO; + } + +- /* Single data value */ +- result = usb_control_msg(serial->dev, +- usb_sndctrlpipe(serial->dev, 0), +- request, REQTYPE_HOST_TO_DEVICE, data[0], +- 0, NULL, 0, 300); + return 0; + } + diff --git a/usb.current/usb-fix-usb_fill_int_urb-for-superspeed-devices.patch b/usb.current/usb-fix-usb_fill_int_urb-for-superspeed-devices.patch new file mode 100644 index 00000000000000..b3a29a1cadf4a4 --- /dev/null +++ b/usb.current/usb-fix-usb_fill_int_urb-for-superspeed-devices.patch @@ -0,0 +1,85 @@ +From sarah.a.sharp@linux.intel.com Tue Mar 16 13:37:38 2010 +From: Matthew Wilcox <willy@linux.intel.com> +Date: Tue, 16 Mar 2010 12:55:44 -0700 +Subject: USB: Fix usb_fill_int_urb for SuperSpeed devices +To: Greg KH <gregkh@suse.de> +Cc: linux-usb@vger.kernel.org, Matthew Wilcox <willy@linux.intel.com> +Message-ID: <20100316195351.GA28341@xanatos> +Content-Disposition: inline + + +From: Matthew Wilcox <willy@linux.intel.com> + +USB 3 and Wireless USB specify a logarithmic encoding of the endpoint +interval that matches the USB 2 specification. usb_fill_int_urb() didn't +know that and was filling in the interval as if it was USB 1.1. Fix +usb_fill_int_urb() for SuperSpeed devices, but leave the wireless case +alone, because David Vrabel wants to keep the old encoding. + +Update the struct urb kernel doc to note that SuperSpeed URBs must have +urb->interval specified in microframes. + +Add a missing break statement in the usb_submit_urb() interrupt URB +checking, since wireless USB and SuperSpeed USB encode urb->interval +differently. This allows xHCI roothubs to actually register with khubd. + +Signed-off-by: Matthew Wilcox <willy@linux.intel.com> +Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/urb.c | 1 + + include/linux/usb.h | 18 +++++++++++++----- + 2 files changed, 14 insertions(+), 5 deletions(-) + +--- a/drivers/usb/core/urb.c ++++ b/drivers/usb/core/urb.c +@@ -453,6 +453,7 @@ int usb_submit_urb(struct urb *urb, gfp_ + if (urb->interval > (1 << 15)) + return -EINVAL; + max = 1 << 15; ++ break; + case USB_SPEED_WIRELESS: + if (urb->interval > 16) + return -EINVAL; +--- a/include/linux/usb.h ++++ b/include/linux/usb.h +@@ -1055,7 +1055,8 @@ typedef void (*usb_complete_t)(struct ur + * @number_of_packets: Lists the number of ISO transfer buffers. + * @interval: Specifies the polling interval for interrupt or isochronous + * transfers. The units are frames (milliseconds) for full and low +- * speed devices, and microframes (1/8 millisecond) for highspeed ones. ++ * speed devices, and microframes (1/8 millisecond) for highspeed ++ * and SuperSpeed devices. + * @error_count: Returns the number of ISO transfers that reported errors. + * @context: For use in completion functions. This normally points to + * request-specific driver context. +@@ -1286,9 +1287,16 @@ static inline void usb_fill_bulk_urb(str + * + * Initializes a interrupt urb with the proper information needed to submit + * it to a device. +- * Note that high speed interrupt endpoints use a logarithmic encoding of +- * the endpoint interval, and express polling intervals in microframes +- * (eight per millisecond) rather than in frames (one per millisecond). ++ * ++ * Note that High Speed and SuperSpeed interrupt endpoints use a logarithmic ++ * encoding of the endpoint interval, and express polling intervals in ++ * microframes (eight per millisecond) rather than in frames (one per ++ * millisecond). ++ * ++ * Wireless USB also uses the logarithmic encoding, but specifies it in units of ++ * 128us instead of 125us. For Wireless USB devices, the interval is passed ++ * through to the host controller, rather than being translated into microframe ++ * units. + */ + static inline void usb_fill_int_urb(struct urb *urb, + struct usb_device *dev, +@@ -1305,7 +1313,7 @@ static inline void usb_fill_int_urb(stru + urb->transfer_buffer_length = buffer_length; + urb->complete = complete_fn; + urb->context = context; +- if (dev->speed == USB_SPEED_HIGH) ++ if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER) + urb->interval = 1 << (interval - 1); + else + urb->interval = interval; diff --git a/usb.current/usb-gadget-multi-cdc_do_config-remove-redundant-check.patch b/usb.current/usb-gadget-multi-cdc_do_config-remove-redundant-check.patch new file mode 100644 index 00000000000000..08531419dee7db --- /dev/null +++ b/usb.current/usb-gadget-multi-cdc_do_config-remove-redundant-check.patch @@ -0,0 +1,29 @@ +From jacmet@sunsite.dk Tue Mar 16 13:35:06 2010 +From: Peter Korsgaard <jacmet@sunsite.dk> +Date: Fri, 12 Mar 2010 12:33:15 +0100 +Subject: USB: gadget/multi: cdc_do_config: remove redundant check +To: m.nazarewicz@samsung.com, gregkh@suse.de, linux-usb@vger.kernel.org +Cc: Peter Korsgaard <jacmet@sunsite.dk> +Message-ID: <1268393595-19744-1-git-send-email-jacmet@sunsite.dk> + + +cdc_do_config() had a double ret check after fsg_add(). + +Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/multi.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/usb/gadget/multi.c ++++ b/drivers/usb/gadget/multi.c +@@ -211,8 +211,6 @@ static int __init cdc_do_config(struct u + ret = fsg_add(c->cdev, c, fsg_common); + if (ret < 0) + return ret; +- if (ret < 0) +- return ret; + + return 0; + } diff --git a/usb.current/usb-r8a66597-hcd-fix-removed-from-an-attached-hub.patch b/usb.current/usb-r8a66597-hcd-fix-removed-from-an-attached-hub.patch new file mode 100644 index 00000000000000..e871a573b60d5b --- /dev/null +++ b/usb.current/usb-r8a66597-hcd-fix-removed-from-an-attached-hub.patch @@ -0,0 +1,74 @@ +From shimoda.yoshihiro@renesas.com Tue Mar 16 13:38:39 2010 +From: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> +Date: Tue, 16 Mar 2010 12:29:35 +0900 +Subject: usb: r8a66597-hcd: fix removed from an attached hub +To: Paul Mundt <lethal@linux-sh.org>, "Pietrek, Markus" <Markus.Pietrek@emtrion.de> +Cc: Alan Stern <stern@rowland.harvard.edu>, linux-sh@vger.kernel.org, USB list <linux-usb@vger.kernel.org> +Message-ID: <4B9EFB1F.3090201@renesas.com> + + +fix the problem that when a USB hub is attached to the r8a66597-hcd and +a device is removed from that hub, it's likely that a kernel panic follows. + +Reported-by: Markus Pietrek <Markus.Pietrek@emtrion.de> +Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/r8a66597-hcd.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +--- a/drivers/usb/host/r8a66597-hcd.c ++++ b/drivers/usb/host/r8a66597-hcd.c +@@ -418,7 +418,7 @@ static u8 alloc_usb_address(struct r8a66 + + /* this function must be called with interrupt disabled */ + static void free_usb_address(struct r8a66597 *r8a66597, +- struct r8a66597_device *dev) ++ struct r8a66597_device *dev, int reset) + { + int port; + +@@ -430,7 +430,13 @@ static void free_usb_address(struct r8a6 + dev->state = USB_STATE_DEFAULT; + r8a66597->address_map &= ~(1 << dev->address); + dev->address = 0; +- dev_set_drvdata(&dev->udev->dev, NULL); ++ /* ++ * Only when resetting USB, it is necessary to erase drvdata. When ++ * a usb device with usb hub is disconnect, "dev->udev" is already ++ * freed on usb_desconnect(). So we cannot access the data. ++ */ ++ if (reset) ++ dev_set_drvdata(&dev->udev->dev, NULL); + list_del(&dev->device_list); + kfree(dev); + +@@ -1069,7 +1075,7 @@ static void r8a66597_usb_disconnect(stru + struct r8a66597_device *dev = r8a66597->root_hub[port].dev; + + disable_r8a66597_pipe_all(r8a66597, dev); +- free_usb_address(r8a66597, dev); ++ free_usb_address(r8a66597, dev, 0); + + start_root_hub_sampling(r8a66597, port, 0); + } +@@ -2085,7 +2091,7 @@ static void update_usb_address_map(struc + spin_lock_irqsave(&r8a66597->lock, flags); + dev = get_r8a66597_device(r8a66597, addr); + disable_r8a66597_pipe_all(r8a66597, dev); +- free_usb_address(r8a66597, dev); ++ free_usb_address(r8a66597, dev, 0); + put_child_connect_map(r8a66597, addr); + spin_unlock_irqrestore(&r8a66597->lock, flags); + } +@@ -2228,7 +2234,7 @@ static int r8a66597_hub_control(struct u + rh->port |= (1 << USB_PORT_FEAT_RESET); + + disable_r8a66597_pipe_all(r8a66597, dev); +- free_usb_address(r8a66597, dev); ++ free_usb_address(r8a66597, dev, 1); + + r8a66597_mdfy(r8a66597, USBRST, USBRST | UACT, + get_dvstctr_reg(port)); diff --git a/usb.current/usb-xhci-make-endpoint-interval-debugging-clearer.patch b/usb.current/usb-xhci-make-endpoint-interval-debugging-clearer.patch new file mode 100644 index 00000000000000..312bdf8f28c273 --- /dev/null +++ b/usb.current/usb-xhci-make-endpoint-interval-debugging-clearer.patch @@ -0,0 +1,40 @@ +From sarah.a.sharp@linux.intel.com Tue Mar 16 13:38:12 2010 +From: Sarah Sharp <sarah.a.sharp@linux.intel.com> +Date: Tue, 16 Mar 2010 12:59:24 -0700 +Subject: USB: xhci: Make endpoint interval debugging clearer. +To: Greg KH <gregkh@suse.de> +Cc: linux-usb@vger.kernel.org, Matthew Wilcox <willy@linux.intel.com> +Message-ID: <20100316195924.GA28421@xanatos> +Content-Disposition: inline + + +The xHCI hardware can only handle polling intervals that are a power of +two. When we add a new endpoint during a bandwidth allocation, and the +polling interval is rounded down to a power of two, print the original +polling interval in the endpoint descriptor. + +Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/xhci-mem.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/drivers/usb/host/xhci-mem.c ++++ b/drivers/usb/host/xhci-mem.c +@@ -566,8 +566,13 @@ static inline unsigned int xhci_get_endp + if (interval < 3) + interval = 3; + if ((1 << interval) != 8*ep->desc.bInterval) +- dev_warn(&udev->dev, "ep %#x - rounding interval to %d microframes\n", +- ep->desc.bEndpointAddress, 1 << interval); ++ dev_warn(&udev->dev, ++ "ep %#x - rounding interval" ++ " to %d microframes, " ++ "ep desc says %d microframes\n", ++ ep->desc.bEndpointAddress, ++ 1 << interval, ++ 8*ep->desc.bInterval); + } + break; + default: diff --git a/usb/usb-f_mass_storage-dynamic-buffers-for-better-alignment.patch b/usb/usb-f_mass_storage-dynamic-buffers-for-better-alignment.patch new file mode 100644 index 00000000000000..3a7fbb3b009f74 --- /dev/null +++ b/usb/usb-f_mass_storage-dynamic-buffers-for-better-alignment.patch @@ -0,0 +1,83 @@ +From m.nazarewicz@samsung.com Tue Mar 16 13:36:53 2010 +From: Michal Nazarewicz <m.nazarewicz@samsung.com> +Date: Mon, 15 Mar 2010 21:38:31 +0100 +Subject: USB: f_mass_storage: dynamic buffers for better alignment +To: linux-usb@vger.kernel.org, David Brownell <dbrownell@users.sourceforge.net> +Cc: gregkh@suse.de, linux-kernel@vger.kernel.org, Marek Szyprowski <m.szyprowski@samsung.com>, Felipe Balbi <me@felipebalbi.com>, Michal Nazarewicz <m.nazarewicz@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com> +Message-ID: <99772ee77bb5e3bf56f115bd0b28786218e08662.1268682738.git.mina86@mina86.com> + + +"Static" buffers in fsg_buffhd structure (ie. fields which are arrays +rather then pointers to dynamically allocated memory) are not aligned +to any "big" power of two which may lead to poor DMA performance +(copying "by hand" of head or tail) or no DMA at all even if otherwise +hardware supports it. + +Therefore, this patch makes mass storage function use kmalloc()ed +buffers which are (because of their size) page aligned (which should +be enough for any hardware). + +Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> +Cc: Kyungmin Park <kyungmin.park@samsung.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/f_mass_storage.c | 23 ++++++++++++++++++----- + 1 file changed, 18 insertions(+), 5 deletions(-) + +--- a/drivers/usb/gadget/f_mass_storage.c ++++ b/drivers/usb/gadget/f_mass_storage.c +@@ -302,7 +302,6 @@ static const char fsg_string_interface[] + + + #define FSG_NO_INTR_EP 1 +-#define FSG_BUFFHD_STATIC_BUFFER 1 + #define FSG_NO_DEVICE_STRINGS 1 + #define FSG_NO_OTG 1 + #define FSG_NO_INTR_EP 1 +@@ -2762,13 +2761,19 @@ static struct fsg_common *fsg_common_ini + + + /* Data buffers cyclic list */ +- /* Buffers in buffhds are static -- no need for additional +- * allocation. */ + bh = common->buffhds; +- i = FSG_NUM_BUFFERS - 1; ++ i = FSG_NUM_BUFFERS; ++ goto buffhds_first_it; + do { + bh->next = bh + 1; +- } while (++bh, --i); ++ ++bh; ++buffhds_first_it: ++ bh->buf = kmalloc(FSG_BUFLEN, GFP_KERNEL); ++ if (unlikely(!bh->buf)) { ++ rc = -ENOMEM; ++ goto error_release; ++ } ++ } while (--i); + bh->next = common->buffhds; + + +@@ -2871,6 +2876,7 @@ static void fsg_common_release(struct kr + container_of(ref, struct fsg_common, ref); + unsigned i = common->nluns; + struct fsg_lun *lun = common->luns; ++ struct fsg_buffhd *bh; + + /* If the thread isn't already dead, tell it to exit now */ + if (common->state != FSG_STATE_TERMINATED) { +@@ -2892,6 +2898,13 @@ static void fsg_common_release(struct kr + } + + kfree(common->luns); ++ ++ i = FSG_NUM_BUFFERS; ++ bh = common->buffhds; ++ do { ++ kfree(bh->buf); ++ } while (++bh, --i); ++ + if (common->free_storage_on_release) + kfree(common); + } diff --git a/usb/usb-musb-add-debugfs-support.patch b/usb/usb-musb-add-debugfs-support.patch new file mode 100644 index 00000000000000..e2632f4439aee7 --- /dev/null +++ b/usb/usb-musb-add-debugfs-support.patch @@ -0,0 +1,375 @@ +From felipe.balbi@nokia.com Tue Mar 16 13:34:12 2010 +From: Felipe Balbi <felipe.balbi@nokia.com> +Date: Fri, 12 Mar 2010 10:29:11 +0200 +Subject: usb: musb: add debugfs support +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Felipe Balbi <felipe.balbi@nokia.com> +Message-ID: <1268382553-23836-7-git-send-email-felipe.balbi@nokia.com> + + +for now only a simple register dump entry (which can +be rather useful on debugging) and a way to start +test modes. + +Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/Makefile | 4 + drivers/usb/musb/musb_core.c | 5 + drivers/usb/musb/musb_debug.h | 13 + + drivers/usb/musb/musb_debugfs.c | 295 ++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 317 insertions(+) + +--- a/drivers/usb/musb/Makefile ++++ b/drivers/usb/musb/Makefile +@@ -42,6 +42,10 @@ ifeq ($(CONFIG_USB_MUSB_HDRC_HCD),y) + musb_hdrc-objs += musb_virthub.o musb_host.o + endif + ++ifeq ($(CONFIG_DEBUG_FS),y) ++ musb_hdrc-objs += musb_debugfs.o ++endif ++ + # the kconfig must guarantee that only one of the + # possible I/O schemes will be enabled at a time ... + # PIO only, or DMA (several potential schemes). +--- a/drivers/usb/musb/musb_core.c ++++ b/drivers/usb/musb/musb_core.c +@@ -2062,6 +2062,10 @@ bad_config: + + } + ++ status = musb_init_debugfs(musb); ++ if (status < 0) ++ goto fail2; ++ + #ifdef CONFIG_SYSFS + status = sysfs_create_group(&musb->controller->kobj, &musb_attr_group); + #endif +@@ -2147,6 +2151,7 @@ static int __exit musb_remove(struct pla + * - Peripheral mode: peripheral is deactivated (or never-activated) + * - OTG mode: both roles are deactivated (or never-activated) + */ ++ musb_exit_debugfs(musb); + musb_shutdown(pdev); + #ifdef CONFIG_USB_MUSB_HDRC_HCD + if (musb->board_mode == MUSB_HOST) +--- a/drivers/usb/musb/musb_debug.h ++++ b/drivers/usb/musb/musb_debug.h +@@ -59,4 +59,17 @@ static inline int _dbg_level(unsigned l) + + extern const char *otg_state_string(struct musb *); + ++#ifdef CONFIG_DEBUG_FS ++extern int musb_init_debugfs(struct musb *musb); ++extern void musb_exit_debugfs(struct musb *musb); ++#else ++static inline int musb_init_debugfs(struct musb *musb) ++{ ++ return 0; ++} ++static inline void musb_exit_debugfs(struct musb *musb) ++{ ++} ++#endif ++ + #endif /* __MUSB_LINUX_DEBUG_H__ */ +--- /dev/null ++++ b/drivers/usb/musb/musb_debugfs.c +@@ -0,0 +1,295 @@ ++/* ++ * MUSB OTG driver debugfs support ++ * ++ * Copyright 2010 Nokia Corporation ++ * Contact: Felipe Balbi <felipe.balbi@nokia.com> ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ++ * 02110-1301 USA ++ * ++ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED ++ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN ++ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ++ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ++ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ * ++ */ ++ ++#include <linux/module.h> ++#include <linux/kernel.h> ++#include <linux/sched.h> ++#include <linux/slab.h> ++#include <linux/init.h> ++#include <linux/list.h> ++#include <linux/kobject.h> ++#include <linux/platform_device.h> ++#include <linux/io.h> ++#include <linux/debugfs.h> ++#include <linux/seq_file.h> ++ ++#ifdef CONFIG_ARM ++#include <mach/hardware.h> ++#include <mach/memory.h> ++#include <asm/mach-types.h> ++#endif ++ ++#include <asm/uaccess.h> ++ ++#include "musb_core.h" ++#include "musb_debug.h" ++ ++#ifdef CONFIG_ARCH_DAVINCI ++#include "davinci.h" ++#endif ++ ++struct musb_register_map { ++ char *name; ++ unsigned offset; ++ unsigned size; ++}; ++ ++static const struct musb_register_map musb_regmap[] = { ++ { "FAddr", 0x00, 8 }, ++ { "Power", 0x01, 8 }, ++ { "Frame", 0x0c, 16 }, ++ { "Index", 0x0e, 8 }, ++ { "Testmode", 0x0f, 8 }, ++ { "TxMaxPp", 0x10, 16 }, ++ { "TxCSRp", 0x12, 16 }, ++ { "RxMaxPp", 0x14, 16 }, ++ { "RxCSR", 0x16, 16 }, ++ { "RxCount", 0x18, 16 }, ++ { "ConfigData", 0x1f, 8 }, ++ { "DevCtl", 0x60, 8 }, ++ { "MISC", 0x61, 8 }, ++ { "TxFIFOsz", 0x62, 8 }, ++ { "RxFIFOsz", 0x63, 8 }, ++ { "TxFIFOadd", 0x64, 16 }, ++ { "RxFIFOadd", 0x66, 16 }, ++ { "VControl", 0x68, 32 }, ++ { "HWVers", 0x6C, 16 }, ++ { "EPInfo", 0x78, 8 }, ++ { "RAMInfo", 0x79, 8 }, ++ { "LinkInfo", 0x7A, 8 }, ++ { "VPLen", 0x7B, 8 }, ++ { "HS_EOF1", 0x7C, 8 }, ++ { "FS_EOF1", 0x7D, 8 }, ++ { "LS_EOF1", 0x7E, 8 }, ++ { "SOFT_RST", 0x7F, 8 }, ++ { "DMA_CNTLch0", 0x204, 16 }, ++ { "DMA_ADDRch0", 0x208, 16 }, ++ { "DMA_COUNTch0", 0x20C, 16 }, ++ { "DMA_CNTLch1", 0x214, 16 }, ++ { "DMA_ADDRch1", 0x218, 16 }, ++ { "DMA_COUNTch1", 0x21C, 16 }, ++ { "DMA_CNTLch2", 0x224, 16 }, ++ { "DMA_ADDRch2", 0x228, 16 }, ++ { "DMA_COUNTch2", 0x22C, 16 }, ++ { "DMA_CNTLch3", 0x234, 16 }, ++ { "DMA_ADDRch3", 0x238, 16 }, ++ { "DMA_COUNTch3", 0x23C, 16 }, ++ { "DMA_CNTLch4", 0x244, 16 }, ++ { "DMA_ADDRch4", 0x248, 16 }, ++ { "DMA_COUNTch4", 0x24C, 16 }, ++ { "DMA_CNTLch5", 0x254, 16 }, ++ { "DMA_ADDRch5", 0x258, 16 }, ++ { "DMA_COUNTch5", 0x25C, 16 }, ++ { "DMA_CNTLch6", 0x264, 16 }, ++ { "DMA_ADDRch6", 0x268, 16 }, ++ { "DMA_COUNTch6", 0x26C, 16 }, ++ { "DMA_CNTLch7", 0x274, 16 }, ++ { "DMA_ADDRch7", 0x278, 16 }, ++ { "DMA_COUNTch7", 0x27C, 16 }, ++ { } /* Terminating Entry */ ++}; ++ ++static struct dentry *musb_debugfs_root; ++ ++static int musb_regdump_show(struct seq_file *s, void *unused) ++{ ++ struct musb *musb = s->private; ++ unsigned i; ++ ++ seq_printf(s, "MUSB (M)HDRC Register Dump\n"); ++ ++ for (i = 0; i < ARRAY_SIZE(musb_regmap); i++) { ++ switch (musb_regmap[i].size) { ++ case 8: ++ seq_printf(s, "%-12s: %02x\n", musb_regmap[i].name, ++ musb_readb(musb->mregs, musb_regmap[i].offset)); ++ break; ++ case 16: ++ seq_printf(s, "%-12s: %04x\n", musb_regmap[i].name, ++ musb_readw(musb->mregs, musb_regmap[i].offset)); ++ break; ++ case 32: ++ seq_printf(s, "%-12s: %08x\n", musb_regmap[i].name, ++ musb_readl(musb->mregs, musb_regmap[i].offset)); ++ break; ++ } ++ } ++ ++ return 0; ++} ++ ++static int musb_regdump_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, musb_regdump_show, inode->i_private); ++} ++ ++static int musb_test_mode_show(struct seq_file *s, void *unused) ++{ ++ struct musb *musb = s->private; ++ unsigned test; ++ ++ test = musb_readb(musb->mregs, MUSB_TESTMODE); ++ ++ if (test & MUSB_TEST_FORCE_HOST) ++ seq_printf(s, "force host\n"); ++ ++ if (test & MUSB_TEST_FIFO_ACCESS) ++ seq_printf(s, "fifo access\n"); ++ ++ if (test & MUSB_TEST_FORCE_FS) ++ seq_printf(s, "force full-speed\n"); ++ ++ if (test & MUSB_TEST_FORCE_HS) ++ seq_printf(s, "force high-speed\n"); ++ ++ if (test & MUSB_TEST_PACKET) ++ seq_printf(s, "test packet\n"); ++ ++ if (test & MUSB_TEST_K) ++ seq_printf(s, "test K\n"); ++ ++ if (test & MUSB_TEST_J) ++ seq_printf(s, "test J\n"); ++ ++ if (test & MUSB_TEST_SE0_NAK) ++ seq_printf(s, "test SE0 NAK\n"); ++ ++ return 0; ++} ++ ++static const struct file_operations musb_regdump_fops = { ++ .open = musb_regdump_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = single_release, ++}; ++ ++static int musb_test_mode_open(struct inode *inode, struct file *file) ++{ ++ file->private_data = inode->i_private; ++ ++ return single_open(file, musb_test_mode_show, inode->i_private); ++} ++ ++static ssize_t musb_test_mode_write(struct file *file, ++ const char __user *ubuf, size_t count, loff_t *ppos) ++{ ++ struct musb *musb = file->private_data; ++ u8 test = 0; ++ char buf[18]; ++ ++ memset(buf, 0x00, sizeof(buf)); ++ ++ if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) ++ return -EFAULT; ++ ++ if (!strncmp(buf, "force host", 9)) ++ test = MUSB_TEST_FORCE_HOST; ++ ++ if (!strncmp(buf, "fifo access", 11)) ++ test = MUSB_TEST_FIFO_ACCESS; ++ ++ if (!strncmp(buf, "force full-speed", 15)) ++ test = MUSB_TEST_FORCE_FS; ++ ++ if (!strncmp(buf, "force high-speed", 15)) ++ test = MUSB_TEST_FORCE_HS; ++ ++ if (!strncmp(buf, "test packet", 10)) { ++ test = MUSB_TEST_PACKET; ++ musb_load_testpacket(musb); ++ } ++ ++ if (!strncmp(buf, "test K", 6)) ++ test = MUSB_TEST_K; ++ ++ if (!strncmp(buf, "test J", 6)) ++ test = MUSB_TEST_J; ++ ++ if (!strncmp(buf, "test SE0 NAK", 12)) ++ test = MUSB_TEST_SE0_NAK; ++ ++ musb_writeb(musb->mregs, MUSB_TESTMODE, test); ++ ++ return count; ++} ++ ++static const struct file_operations musb_test_mode_fops = { ++ .open = musb_test_mode_open, ++ .write = musb_test_mode_write, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = single_release, ++}; ++ ++int __init musb_init_debugfs(struct musb *musb) ++{ ++ struct dentry *root; ++ struct dentry *file; ++ int ret; ++ ++ root = debugfs_create_dir("musb", NULL); ++ if (IS_ERR(root)) { ++ ret = PTR_ERR(root); ++ goto err0; ++ } ++ ++ file = debugfs_create_file("regdump", S_IRUGO, root, musb, ++ &musb_regdump_fops); ++ if (IS_ERR(file)) { ++ ret = PTR_ERR(file); ++ goto err1; ++ } ++ ++ file = debugfs_create_file("testmode", S_IRUGO | S_IWUSR, ++ root, musb, &musb_test_mode_fops); ++ if (IS_ERR(file)) { ++ ret = PTR_ERR(file); ++ goto err1; ++ } ++ ++ musb_debugfs_root = root; ++ ++ return 0; ++ ++err1: ++ debugfs_remove_recursive(root); ++ ++err0: ++ return ret; ++} ++ ++void __exit musb_exit_debugfs(struct musb *musb) ++{ ++ debugfs_remove_recursive(musb_debugfs_root); ++} diff --git a/usb/usb-musb-add-omap4-support-in-musb-driver.patch b/usb/usb-musb-add-omap4-support-in-musb-driver.patch new file mode 100644 index 00000000000000..0f8c3bbe56bba6 --- /dev/null +++ b/usb/usb-musb-add-omap4-support-in-musb-driver.patch @@ -0,0 +1,70 @@ +From felipe.balbi@nokia.com Tue Mar 16 13:33:39 2010 +From: Felipe Balbi <felipe.balbi@nokia.com> +Date: Fri, 12 Mar 2010 10:29:09 +0200 +Subject: USB: MUSB: Add OMAP4 support in MUSB driver +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Maulik Mankad <x0082077@ti.com>, Greg Kroah-Hartman <gregkh@suse.de>, David Brownell <david-b@pacbell.net>, Sergei Shtylyov <sshtylyov@mvista.com>, Olof Johansson <olof@lixom.net>, Felipe Balbi <felipe.balbi@nokia.com> +Message-ID: <1268382553-23836-5-git-send-email-felipe.balbi@nokia.com> + + +From: Maulik Mankad <x0082077@ti.com> + +This patch adds CONFIG_ARCH_OMAP4 macro within +MUSB driver. + +Signed-off-by: Maulik Mankad <x0082077@ti.com> +Cc: David Brownell <david-b@pacbell.net> +Cc: Sergei Shtylyov <sshtylyov@mvista.com> +Cc: Olof Johansson <olof@lixom.net> +Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/musb_core.c | 6 ++++-- + drivers/usb/musb/musb_core.h | 6 ++++-- + 2 files changed, 8 insertions(+), 4 deletions(-) + +--- a/drivers/usb/musb/musb_core.c ++++ b/drivers/usb/musb/musb_core.c +@@ -987,7 +987,8 @@ static void musb_shutdown(struct platfor + * more than selecting one of a bunch of predefined configurations. + */ + #if defined(CONFIG_USB_TUSB6010) || \ +- defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) ++ defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) \ ++ || defined(CONFIG_ARCH_OMAP4) + static ushort __initdata fifo_mode = 4; + #else + static ushort __initdata fifo_mode = 2; +@@ -1458,7 +1459,8 @@ static int __init musb_core_init(u16 mus + + /*-------------------------------------------------------------------------*/ + +-#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430) ++#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430) || \ ++ defined(CONFIG_ARCH_OMAP4) + + static irqreturn_t generic_interrupt(int irq, void *__hci) + { +--- a/drivers/usb/musb/musb_core.h ++++ b/drivers/usb/musb/musb_core.h +@@ -213,7 +213,8 @@ enum musb_g_ep0_state { + */ + + #if defined(CONFIG_ARCH_DAVINCI) || defined(CONFIG_ARCH_OMAP2430) \ +- || defined(CONFIG_ARCH_OMAP3430) || defined(CONFIG_BLACKFIN) ++ || defined(CONFIG_ARCH_OMAP3430) || defined(CONFIG_BLACKFIN) \ ++ || defined(CONFIG_ARCH_OMAP4) + /* REVISIT indexed access seemed to + * misbehave (on DaVinci) for at least peripheral IN ... + */ +@@ -596,7 +597,8 @@ extern void musb_hnp_stop(struct musb *m + extern int musb_platform_set_mode(struct musb *musb, u8 musb_mode); + + #if defined(CONFIG_USB_TUSB6010) || defined(CONFIG_BLACKFIN) || \ +- defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) ++ defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ ++ defined(CONFIG_ARCH_OMAP4) + extern void musb_platform_try_idle(struct musb *musb, unsigned long timeout); + #else + #define musb_platform_try_idle(x, y) do {} while (0) diff --git a/usb/usb-musb-allow-board-to-pass-down-fifo-mode.patch b/usb/usb-musb-allow-board-to-pass-down-fifo-mode.patch new file mode 100644 index 00000000000000..447c90ddfddea2 --- /dev/null +++ b/usb/usb-musb-allow-board-to-pass-down-fifo-mode.patch @@ -0,0 +1,188 @@ +From felipe.balbi@nokia.com Tue Mar 16 13:32:34 2010 +From: Felipe Balbi <felipe.balbi@nokia.com> +Date: Fri, 12 Mar 2010 10:29:06 +0200 +Subject: usb: musb: allow board to pass down fifo mode +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Felipe Balbi <felipe.balbi@nokia.com> +Message-ID: <1268382553-23836-2-git-send-email-felipe.balbi@nokia.com> + + +boards might want to optimize their fifo configuration +to the particular needs of that specific board. Allow +that by moving all related data structures to +<linux/usb/musb.h> + +Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/musb_core.c | 36 ++++++++++++++++-------------------- + include/linux/usb/musb.h | 35 +++++++++++++++++++++++++++++++++++ + 2 files changed, 51 insertions(+), 20 deletions(-) + +--- a/drivers/usb/musb/musb_core.c ++++ b/drivers/usb/musb/musb_core.c +@@ -997,24 +997,13 @@ static ushort __initdata fifo_mode = 2; + module_param(fifo_mode, ushort, 0); + MODULE_PARM_DESC(fifo_mode, "initial endpoint configuration"); + +- +-enum fifo_style { FIFO_RXTX, FIFO_TX, FIFO_RX } __attribute__ ((packed)); +-enum buf_mode { BUF_SINGLE, BUF_DOUBLE } __attribute__ ((packed)); +- +-struct fifo_cfg { +- u8 hw_ep_num; +- enum fifo_style style; +- enum buf_mode mode; +- u16 maxpacket; +-}; +- + /* + * tables defining fifo_mode values. define more if you like. + * for host side, make sure both halves of ep1 are set up. + */ + + /* mode 0 - fits in 2KB */ +-static struct fifo_cfg __initdata mode_0_cfg[] = { ++static struct musb_fifo_cfg __initdata mode_0_cfg[] = { + { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, + { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, + { .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, }, +@@ -1023,7 +1012,7 @@ static struct fifo_cfg __initdata mode_0 + }; + + /* mode 1 - fits in 4KB */ +-static struct fifo_cfg __initdata mode_1_cfg[] = { ++static struct musb_fifo_cfg __initdata mode_1_cfg[] = { + { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, }, + { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, }, + { .hw_ep_num = 2, .style = FIFO_RXTX, .maxpacket = 512, .mode = BUF_DOUBLE, }, +@@ -1032,7 +1021,7 @@ static struct fifo_cfg __initdata mode_1 + }; + + /* mode 2 - fits in 4KB */ +-static struct fifo_cfg __initdata mode_2_cfg[] = { ++static struct musb_fifo_cfg __initdata mode_2_cfg[] = { + { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, + { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, + { .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, +@@ -1042,7 +1031,7 @@ static struct fifo_cfg __initdata mode_2 + }; + + /* mode 3 - fits in 4KB */ +-static struct fifo_cfg __initdata mode_3_cfg[] = { ++static struct musb_fifo_cfg __initdata mode_3_cfg[] = { + { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, .mode = BUF_DOUBLE, }, + { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, .mode = BUF_DOUBLE, }, + { .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, +@@ -1052,7 +1041,7 @@ static struct fifo_cfg __initdata mode_3 + }; + + /* mode 4 - fits in 16KB */ +-static struct fifo_cfg __initdata mode_4_cfg[] = { ++static struct musb_fifo_cfg __initdata mode_4_cfg[] = { + { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, + { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, + { .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, +@@ -1083,7 +1072,7 @@ static struct fifo_cfg __initdata mode_4 + }; + + /* mode 5 - fits in 8KB */ +-static struct fifo_cfg __initdata mode_5_cfg[] = { ++static struct musb_fifo_cfg __initdata mode_5_cfg[] = { + { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, }, + { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, }, + { .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, }, +@@ -1121,7 +1110,7 @@ static struct fifo_cfg __initdata mode_5 + */ + static int __init + fifo_setup(struct musb *musb, struct musb_hw_ep *hw_ep, +- const struct fifo_cfg *cfg, u16 offset) ++ const struct musb_fifo_cfg *cfg, u16 offset) + { + void __iomem *mbase = musb->mregs; + int size = 0; +@@ -1192,17 +1181,23 @@ fifo_setup(struct musb *musb, struct mus + return offset + (maxpacket << ((c_size & MUSB_FIFOSZ_DPB) ? 1 : 0)); + } + +-static struct fifo_cfg __initdata ep0_cfg = { ++static struct musb_fifo_cfg __initdata ep0_cfg = { + .style = FIFO_RXTX, .maxpacket = 64, + }; + + static int __init ep_config_from_table(struct musb *musb) + { +- const struct fifo_cfg *cfg; ++ const struct musb_fifo_cfg *cfg; + unsigned i, n; + int offset; + struct musb_hw_ep *hw_ep = musb->endpoints; + ++ if (musb->config->fifo_cfg) { ++ cfg = musb->config->fifo_cfg; ++ n = musb->config->fifo_cfg_size; ++ goto done; ++ } ++ + switch (fifo_mode) { + default: + fifo_mode = 0; +@@ -1237,6 +1232,7 @@ static int __init ep_config_from_table(s + musb_driver_name, fifo_mode); + + ++done: + offset = fifo_setup(musb, hw_ep, &ep0_cfg, 0); + /* assert(offset > 0) */ + +--- a/include/linux/usb/musb.h ++++ b/include/linux/usb/musb.h +@@ -22,12 +22,47 @@ enum musb_mode { + + struct clk; + ++enum musb_fifo_style { ++ FIFO_RXTX, ++ FIFO_TX, ++ FIFO_RX ++} __attribute__ ((packed)); ++ ++enum musb_buf_mode { ++ BUF_SINGLE, ++ BUF_DOUBLE ++} __attribute__ ((packed)); ++ ++struct musb_fifo_cfg { ++ u8 hw_ep_num; ++ enum musb_fifo_style style; ++ enum musb_buf_mode mode; ++ u16 maxpacket; ++}; ++ ++#define MUSB_EP_FIFO(ep, st, m, pkt) \ ++{ \ ++ .hw_ep_num = ep, \ ++ .style = st, \ ++ .mode = m, \ ++ .maxpacket = pkt, \ ++} ++ ++#define MUSB_EP_FIFO_SINGLE(ep, st, pkt) \ ++ MUSB_EP_FIFO(ep, st, BUF_SINGLE, pkt) ++ ++#define MUSB_EP_FIFO_DOUBLE(ep, st, pkt) \ ++ MUSB_EP_FIFO(ep, st, BUF_DOUBLE, pkt) ++ + struct musb_hdrc_eps_bits { + const char name[16]; + u8 bits; + }; + + struct musb_hdrc_config { ++ struct musb_fifo_cfg *fifo_cfg; /* board fifo configuration */ ++ unsigned fifo_cfg_size; /* size of the fifo configuration */ ++ + /* MUSB configuration-specific details */ + unsigned multipoint:1; /* multipoint device */ + unsigned dyn_fifo:1 __deprecated; /* supports dynamic fifo sizing */ diff --git a/usb/usb-musb-allow-the-blackfin-vrsel-gpio-to-be-active-low.patch b/usb/usb-musb-allow-the-blackfin-vrsel-gpio-to-be-active-low.patch new file mode 100644 index 00000000000000..846bb1bfe0faa2 --- /dev/null +++ b/usb/usb-musb-allow-the-blackfin-vrsel-gpio-to-be-active-low.patch @@ -0,0 +1,51 @@ +From felipe.balbi@nokia.com Tue Mar 16 13:33:56 2010 +From: Felipe Balbi <felipe.balbi@nokia.com> +Date: Fri, 12 Mar 2010 10:29:10 +0200 +Subject: USB: musb: allow the Blackfin vrsel gpio to be active low +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Cliff Cai <cliff.cai@analog.com>, Mike Frysinger <vapier@gentoo.org>, Felipe Balbi <felipe.balbi@nokia.com> +Message-ID: <1268382553-23836-6-git-send-email-felipe.balbi@nokia.com> + + +From: Cliff Cai <cliff.cai@analog.com> + +Rather than hardcoding the gpio levels for vrsel, allow the platform +resources to handle this so boards can be active high or low. + +Signed-off-by: Cliff Cai <cliff.cai@analog.com> +Signed-off-by: Mike Frysinger <vapier@gentoo.org> +Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/blackfin.c | 8 ++++---- + include/linux/usb/musb.h | 1 + + 2 files changed, 5 insertions(+), 4 deletions(-) + +--- a/drivers/usb/musb/blackfin.c ++++ b/drivers/usb/musb/blackfin.c +@@ -245,10 +245,10 @@ static void bfin_vbus_power(struct musb + + static void bfin_set_vbus(struct musb *musb, int is_on) + { +- if (is_on) +- gpio_set_value(musb->config->gpio_vrsel, 1); +- else +- gpio_set_value(musb->config->gpio_vrsel, 0); ++ int value = musb->config->gpio_vrsel_active; ++ if (!is_on) ++ value = !value; ++ gpio_set_value(musb->config->gpio_vrsel, value); + + DBG(1, "VBUS %s, devctl %02x " + /* otg %3x conf %08x prcm %08x */ "\n", +--- a/include/linux/usb/musb.h ++++ b/include/linux/usb/musb.h +@@ -88,6 +88,7 @@ struct musb_hdrc_config { + #ifdef CONFIG_BLACKFIN + /* A GPIO controlling VRSEL in Blackfin */ + unsigned int gpio_vrsel; ++ unsigned int gpio_vrsel_active; + #endif + + }; diff --git a/usb/usb-musb-build-musb-driver-for-omap4.patch b/usb/usb-musb-build-musb-driver-for-omap4.patch new file mode 100644 index 00000000000000..8867eb74c5d7f2 --- /dev/null +++ b/usb/usb-musb-build-musb-driver-for-omap4.patch @@ -0,0 +1,69 @@ +From felipe.balbi@nokia.com Tue Mar 16 13:33:10 2010 +From: Felipe Balbi <felipe.balbi@nokia.com> +Date: Fri, 12 Mar 2010 10:29:08 +0200 +Subject: USB: MUSB: Build MUSB driver for OMAP4 +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Maulik Mankad <x0082077@ti.com>, Greg Kroah-Hartman <gregkh@suse.de>, David Brownell <david-b@pacbell.net>, Sergei Shtylyov <sshtylyov@mvista.com>, Olof Johansson <olof@lixom.net>, Felipe Balbi <felipe.balbi@nokia.com> +Message-ID: <1268382553-23836-4-git-send-email-felipe.balbi@nokia.com> + + +From: Maulik Mankad <x0082077@ti.com> + +This patch updates the Makefile to build the +MUSB driver for OMAP4. It also sets the Kconfig +options for OMAP4. + +Signed-off-by: Maulik Mankad <x0082077@ti.com> +Cc: David Brownell <david-b@pacbell.net> +Cc: Sergei Shtylyov <sshtylyov@mvista.com> +Cc: Olof Johansson <olof@lixom.net> +Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/Kconfig | 6 +++++- + drivers/usb/musb/Makefile | 4 ++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +--- a/drivers/usb/musb/Kconfig ++++ b/drivers/usb/musb/Kconfig +@@ -38,6 +38,7 @@ config USB_MUSB_SOC + default y if ARCH_DAVINCI + default y if ARCH_OMAP2430 + default y if ARCH_OMAP3 ++ default y if ARCH_OMAP4 + default y if (BF54x && !BF544) + default y if (BF52x && !BF522 && !BF523) + +@@ -50,6 +51,9 @@ comment "OMAP 243x high speed USB suppor + comment "OMAP 343x high speed USB support" + depends on USB_MUSB_HDRC && ARCH_OMAP3 + ++comment "OMAP 44xx high speed USB support" ++ depends on USB_MUSB_HDRC && ARCH_OMAP4 ++ + comment "Blackfin high speed USB Support" + depends on USB_MUSB_HDRC && ((BF54x && !BF544) || (BF52x && !BF522 && !BF523)) + +@@ -153,7 +157,7 @@ config MUSB_PIO_ONLY + config USB_INVENTRA_DMA + bool + depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY +- default ARCH_OMAP2430 || ARCH_OMAP3 || BLACKFIN ++ default ARCH_OMAP2430 || ARCH_OMAP3 || BLACKFIN || ARCH_OMAP4 + help + Enable DMA transfers using Mentor's engine. + +--- a/drivers/usb/musb/Makefile ++++ b/drivers/usb/musb/Makefile +@@ -22,6 +22,10 @@ ifeq ($(CONFIG_ARCH_OMAP3430),y) + musb_hdrc-objs += omap2430.o + endif + ++ifeq ($(CONFIG_ARCH_OMAP4),y) ++ musb_hdrc-objs += omap2430.o ++endif ++ + ifeq ($(CONFIG_BF54x),y) + musb_hdrc-objs += blackfin.o + endif diff --git a/usb/usb-musb-gadget-support-musb-specific-test-modes.patch b/usb/usb-musb-gadget-support-musb-specific-test-modes.patch new file mode 100644 index 00000000000000..63c8e9a4e578f3 --- /dev/null +++ b/usb/usb-musb-gadget-support-musb-specific-test-modes.patch @@ -0,0 +1,54 @@ +From felipe.balbi@nokia.com Tue Mar 16 13:34:29 2010 +From: Felipe Balbi <felipe.balbi@nokia.com> +Date: Fri, 12 Mar 2010 10:29:12 +0200 +Subject: usb: musb: gadget: support musb-specific test modes +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Felipe Balbi <felipe.balbi@nokia.com> +Message-ID: <1268382553-23836-8-git-send-email-felipe.balbi@nokia.com> + + +we can support the musb-specific test modes on the +vendor specific range of test selector as stated +on USB Specification Table 9-7 Test Mode Selectors. + +Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/musb_gadget_ep0.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +--- a/drivers/usb/musb/musb_gadget_ep0.c ++++ b/drivers/usb/musb/musb_gadget_ep0.c +@@ -351,6 +351,31 @@ __acquires(musb->lock) + musb->test_mode_nr = + MUSB_TEST_PACKET; + break; ++ ++ case 0xc0: ++ /* TEST_FORCE_HS */ ++ pr_debug("TEST_FORCE_HS\n"); ++ musb->test_mode_nr = ++ MUSB_TEST_FORCE_HS; ++ break; ++ case 0xc1: ++ /* TEST_FORCE_FS */ ++ pr_debug("TEST_FORCE_FS\n"); ++ musb->test_mode_nr = ++ MUSB_TEST_FORCE_FS; ++ break; ++ case 0xc2: ++ /* TEST_FIFO_ACCESS */ ++ pr_debug("TEST_FIFO_ACCESS\n"); ++ musb->test_mode_nr = ++ MUSB_TEST_FIFO_ACCESS; ++ break; ++ case 0xc3: ++ /* TEST_FORCE_HOST */ ++ pr_debug("TEST_FORCE_HOST\n"); ++ musb->test_mode_nr = ++ MUSB_TEST_FORCE_HOST; ++ break; + default: + goto stall; + } diff --git a/usb/usb-musb-hsdma-use-musb_read-writel.patch b/usb/usb-musb-hsdma-use-musb_read-writel.patch new file mode 100644 index 00000000000000..47fe92288b758e --- /dev/null +++ b/usb/usb-musb-hsdma-use-musb_read-writel.patch @@ -0,0 +1,51 @@ +From felipe.balbi@nokia.com Tue Mar 16 13:34:44 2010 +From: Felipe Balbi <felipe.balbi@nokia.com> +Date: Fri, 12 Mar 2010 10:29:13 +0200 +Subject: usb: musb: hsdma: use musb_read/writel +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Felipe Balbi <felipe.balbi@nokia.com> +Message-ID: <1268382553-23836-9-git-send-email-felipe.balbi@nokia.com> + + +... and simplify the was we read/write from/to +DMA COUNT register. + +Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/musbhsdma.h | 16 +++------------- + 1 file changed, 3 insertions(+), 13 deletions(-) + +--- a/drivers/usb/musb/musbhsdma.h ++++ b/drivers/usb/musb/musbhsdma.h +@@ -102,26 +102,16 @@ static inline void musb_write_hsdma_addr + + static inline u32 musb_read_hsdma_count(void __iomem *mbase, u8 bchannel) + { +- u32 count = musb_readw(mbase, ++ return musb_readl(mbase, + MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH)); +- +- count = count << 16; +- +- count |= musb_readw(mbase, +- MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_LOW)); +- +- return count; + } + + static inline void musb_write_hsdma_count(void __iomem *mbase, + u8 bchannel, u32 len) + { +- musb_writew(mbase, +- MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_LOW), +- ((u16)((u32) len & 0xFFFF))); +- musb_writew(mbase, ++ musb_writel(mbase, + MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH), +- ((u16)(((u32) len >> 16) & 0xFFFF))); ++ len); + } + + #endif /* CONFIG_BLACKFIN */ diff --git a/usb/usb-musb-set-transceiver-interface-type.patch b/usb/usb-musb-set-transceiver-interface-type.patch new file mode 100644 index 00000000000000..762d13718661ed --- /dev/null +++ b/usb/usb-musb-set-transceiver-interface-type.patch @@ -0,0 +1,118 @@ +From felipe.balbi@nokia.com Tue Mar 16 13:32:54 2010 +From: Felipe Balbi <felipe.balbi@nokia.com> +Date: Fri, 12 Mar 2010 10:29:07 +0200 +Subject: usb: musb: Set transceiver interface type +To: Greg KH <greg@kroah.com> +Cc: linux-usb@vger.kernel.org, Maulik Mankad <x0082077@ti.com>, David Brownell <david-b@pacbell.net>, Greg Kroah-Hartman <gregkh@suse.de>, Sergei Shtylyov <sshtylyov@mvista.com>, Olof Johansson <olof@lixom.net>, Felipe Balbi <felipe.balbi@nokia.com> +Message-ID: <1268382553-23836-3-git-send-email-felipe.balbi@nokia.com> + + +From: Maulik Mankad <x0082077@ti.com> + +Program the OTG_INTERFSEL register based on +transcevier type passed from board file. + +Adapt signature of musb_platform_init() function +for davinci, blackfin and tusb6010. + +Signed-off-by: Maulik Mankad <x0082077@ti.com> +Cc: David Brownell <david-b@pacbell.net> +Cc: Sergei Shtylyov <sshtylyov@mvista.com> +Cc: Olof Johansson <olof@lixom.net> +Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/usb/musb/blackfin.c | 2 +- + drivers/usb/musb/davinci.c | 2 +- + drivers/usb/musb/musb_core.c | 2 +- + drivers/usb/musb/musb_core.h | 2 +- + drivers/usb/musb/omap2430.c | 13 +++++++++++-- + drivers/usb/musb/tusb6010.c | 2 +- + 6 files changed, 16 insertions(+), 7 deletions(-) + +--- a/drivers/usb/musb/blackfin.c ++++ b/drivers/usb/musb/blackfin.c +@@ -277,7 +277,7 @@ int musb_platform_set_mode(struct musb * + return -EIO; + } + +-int __init musb_platform_init(struct musb *musb) ++int __init musb_platform_init(struct musb *musb, void *board_data) + { + + /* +--- a/drivers/usb/musb/davinci.c ++++ b/drivers/usb/musb/davinci.c +@@ -377,7 +377,7 @@ int musb_platform_set_mode(struct musb * + return -EIO; + } + +-int __init musb_platform_init(struct musb *musb) ++int __init musb_platform_init(struct musb *musb, void *board_data) + { + void __iomem *tibase = musb->ctrl_base; + u32 revision; +--- a/drivers/usb/musb/musb_core.c ++++ b/drivers/usb/musb/musb_core.c +@@ -1949,7 +1949,7 @@ bad_config: + * isp1504, non-OTG, etc) mostly hooking up through ULPI. + */ + musb->isr = generic_interrupt; +- status = musb_platform_init(musb); ++ status = musb_platform_init(musb, plat->board_data); + + if (status < 0) + goto fail; +--- a/drivers/usb/musb/musb_core.h ++++ b/drivers/usb/musb/musb_core.h +@@ -608,7 +608,7 @@ extern int musb_platform_get_vbus_status + #define musb_platform_get_vbus_status(x) 0 + #endif + +-extern int __init musb_platform_init(struct musb *musb); ++extern int __init musb_platform_init(struct musb *musb, void *board_data); + extern int musb_platform_exit(struct musb *musb); + + #endif /* __MUSB_CORE_H__ */ +--- a/drivers/usb/musb/omap2430.c ++++ b/drivers/usb/musb/omap2430.c +@@ -200,9 +200,10 @@ int musb_platform_set_mode(struct musb * + return 0; + } + +-int __init musb_platform_init(struct musb *musb) ++int __init musb_platform_init(struct musb *musb, void *board_data) + { + u32 l; ++ struct omap_musb_board_data *data = board_data; + + #if defined(CONFIG_ARCH_OMAP2430) + omap_cfg_reg(AE5_2430_USB0HS_STP); +@@ -236,7 +237,15 @@ int __init musb_platform_init(struct mus + musb_writel(musb->mregs, OTG_SYSCONFIG, l); + + l = musb_readl(musb->mregs, OTG_INTERFSEL); +- l |= ULPI_12PIN; ++ ++ if (data->interface_type == MUSB_INTERFACE_UTMI) { ++ /* OMAP4 uses Internal PHY GS70 which uses UTMI interface */ ++ l &= ~ULPI_12PIN; /* Disable ULPI */ ++ l |= UTMI_8BIT; /* Enable UTMI */ ++ } else { ++ l |= ULPI_12PIN; ++ } ++ + musb_writel(musb->mregs, OTG_INTERFSEL, l); + + pr_debug("HS USB OTG: revision 0x%x, sysconfig 0x%02x, " +--- a/drivers/usb/musb/tusb6010.c ++++ b/drivers/usb/musb/tusb6010.c +@@ -1091,7 +1091,7 @@ err: + return -ENODEV; + } + +-int __init musb_platform_init(struct musb *musb) ++int __init musb_platform_init(struct musb *musb, void *board_data) + { + struct platform_device *pdev; + struct resource *mem; diff --git a/usb/usb-remove-bogus-usb_port_feat_-_speed-symbols.patch b/usb/usb-remove-bogus-usb_port_feat_-_speed-symbols.patch index 8b642826e639fb..ec47310783b9f8 100644 --- a/usb/usb-remove-bogus-usb_port_feat_-_speed-symbols.patch +++ b/usb/usb-remove-bogus-usb_port_feat_-_speed-symbols.patch @@ -135,7 +135,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c -@@ -1052,12 +1052,11 @@ static void r8a66597_usb_connect(struct +@@ -1058,12 +1058,11 @@ static void r8a66597_usb_connect(struct u16 speed = get_rh_usb_speed(r8a66597, port); struct r8a66597_root_hub *rh = &r8a66597->root_hub[port]; diff --git a/usb/usb-straighten-out-port-feature-vs.-port-status-usage.patch b/usb/usb-straighten-out-port-feature-vs.-port-status-usage.patch index 50b8bd727090cb..e2576d55169f5d 100644 --- a/usb/usb-straighten-out-port-feature-vs.-port-status-usage.patch +++ b/usb/usb-straighten-out-port-feature-vs.-port-status-usage.patch @@ -265,7 +265,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> if (status & ~0xffff) /* only if wPortChange is interesting */ --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c -@@ -1011,10 +1011,10 @@ static void start_root_hub_sampling(stru +@@ -1017,10 +1017,10 @@ static void start_root_hub_sampling(stru rh->old_syssts = r8a66597_read(r8a66597, get_syssts_reg(port)) & LNST; rh->scount = R8A66597_MAX_SAMPLING; if (connect) @@ -279,7 +279,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> r8a66597_root_hub_start_polling(r8a66597); } -@@ -1058,8 +1058,8 @@ static void r8a66597_usb_connect(struct +@@ -1064,8 +1064,8 @@ static void r8a66597_usb_connect(struct else if (speed == LSMODE) rh->port |= USB_PORT_STAT_LOW_SPEED; @@ -290,7 +290,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> } /* this function must be called with interrupt disabled */ -@@ -1698,7 +1698,7 @@ static void r8a66597_root_hub_control(st +@@ -1704,7 +1704,7 @@ static void r8a66597_root_hub_control(st u16 tmp; struct r8a66597_root_hub *rh = &r8a66597->root_hub[port]; @@ -299,7 +299,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> unsigned long dvstctr_reg = get_dvstctr_reg(port); tmp = r8a66597_read(r8a66597, dvstctr_reg); -@@ -1710,7 +1710,7 @@ static void r8a66597_root_hub_control(st +@@ -1716,7 +1716,7 @@ static void r8a66597_root_hub_control(st r8a66597_usb_connect(r8a66597, port); } @@ -308,7 +308,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> r8a66597_write(r8a66597, ~ATTCH, get_intsts_reg(port)); r8a66597_bset(r8a66597, ATTCHE, get_intenb_reg(port)); } -@@ -2178,7 +2178,7 @@ static int r8a66597_hub_control(struct u +@@ -2184,7 +2184,7 @@ static int r8a66597_hub_control(struct u switch (wValue) { case USB_PORT_FEAT_ENABLE: @@ -317,7 +317,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> break; case USB_PORT_FEAT_SUSPEND: break; -@@ -2219,12 +2219,12 @@ static int r8a66597_hub_control(struct u +@@ -2225,12 +2225,12 @@ static int r8a66597_hub_control(struct u break; case USB_PORT_FEAT_POWER: r8a66597_port_power(r8a66597, port, 1); @@ -331,8 +331,8 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + rh->port |= USB_PORT_STAT_RESET; disable_r8a66597_pipe_all(r8a66597, dev); - free_usb_address(r8a66597, dev); -@@ -2262,12 +2262,12 @@ static int r8a66597_bus_suspend(struct u + free_usb_address(r8a66597, dev, 1); +@@ -2268,12 +2268,12 @@ static int r8a66597_bus_suspend(struct u struct r8a66597_root_hub *rh = &r8a66597->root_hub[port]; unsigned long dvstctr_reg = get_dvstctr_reg(port); @@ -347,7 +347,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> if (rh->dev->udev->do_remote_wakeup) { msleep(3); /* waiting last SOF */ -@@ -2293,12 +2293,12 @@ static int r8a66597_bus_resume(struct us +@@ -2299,12 +2299,12 @@ static int r8a66597_bus_resume(struct us struct r8a66597_root_hub *rh = &r8a66597->root_hub[port]; unsigned long dvstctr_reg = get_dvstctr_reg(port); |
