aboutsummaryrefslogtreecommitdiffstats
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2010-02-01 14:36:23 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2010-02-01 14:36:23 -0800
commitdf953944fb5fa26a6371538ba70c9a265b2fe677 (patch)
treede9a5d9ac044ce06423be1f93f958effff51ad6d
parent912ae66b952e249f66eef23a545e572263f989b8 (diff)
downloadpatches-df953944fb5fa26a6371538ba70c9a265b2fe677.tar.gz
driver core, usb, and tty patches
-rw-r--r--driver-core/driver-core-make-struct-platform_driver.id_table-const.patch16
-rw-r--r--driver-core/drivers-base-convert-sema.patch512
-rw-r--r--driver-core/msi-laptop-add-resume-method-for-set-the-scm-load-again.patch67
-rw-r--r--driver-core/msi-laptop-detect-3g-device-exists-by-standard-ec-command.patch112
-rw-r--r--series7
-rw-r--r--tty/serial-bcm63xx_uart-allow-more-than-one-uart-to-be-registered.patch46
-rw-r--r--tty/serial-bcm63xx_uart-don-t-use-kfree-on-non-kmalloced-area.patch27
-rw-r--r--usb.current/usb-r8a66597-hdc-disable-interrupts-fix.patch1
-rw-r--r--usb/isp1760-flush-the-d-cache-for-the-pipe-in-transfer-buffers.patch58
-rw-r--r--usb/usb-gadgetfs-convert-semaphore-to-mutex.patch181
-rw-r--r--usb/usb-musb-disable-double-buffering-for-older-rtl-versions.patch35
-rw-r--r--usb/usb-musb-set-version-of-blackfin-version.patch62
12 files changed, 1092 insertions, 32 deletions
diff --git a/driver-core/driver-core-make-struct-platform_driver.id_table-const.patch b/driver-core/driver-core-make-struct-platform_driver.id_table-const.patch
index b248d5881d8e4b..c5618d7b38b2e2 100644
--- a/driver-core/driver-core-make-struct-platform_driver.id_table-const.patch
+++ b/driver-core/driver-core-make-struct-platform_driver.id_table-const.patch
@@ -20,8 +20,9 @@ Acked-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
- drivers/base/platform.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ drivers/base/platform.c | 2 +-
+ include/linux/platform_device.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -34,3 +35,14 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
struct platform_device *pdev)
{
while (id->name[0]) {
+--- a/include/linux/platform_device.h
++++ b/include/linux/platform_device.h
+@@ -62,7 +62,7 @@ struct platform_driver {
+ int (*suspend)(struct platform_device *, pm_message_t state);
+ int (*resume)(struct platform_device *);
+ struct device_driver driver;
+- struct platform_device_id *id_table;
++ const struct platform_device_id *id_table;
+ };
+
+ extern int platform_driver_register(struct platform_driver *);
diff --git a/driver-core/drivers-base-convert-sema.patch b/driver-core/drivers-base-convert-sema.patch
new file mode 100644
index 00000000000000..7d16f4bb416ceb
--- /dev/null
+++ b/driver-core/drivers-base-convert-sema.patch
@@ -0,0 +1,512 @@
+From tglx@linutronix.de Mon Feb 1 14:20:39 2010
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Fri, 29 Jan 2010 20:39:02 -0000
+Subject: drivers/base: Convert dev->sem to mutex
+Cc: Christoph Hellwig <hch@infradead.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@elte.hu>, Greg Kroah-Hartman <gregkh@suse.de>
+Message-ID: <20100129203613.665951035@linutronix.de>
+Content-Disposition: inline; filename=drivers-base-convert-sema.patch
+
+
+The semaphore is semantically a mutex. Convert it to a real mutex and
+clean up all users outside of drivers/base as well.
+
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/base/bus.c | 20 ++++++++++----------
+ drivers/base/core.c | 3 +--
+ drivers/base/dd.c | 38 +++++++++++++++++++-------------------
+ drivers/base/power/main.c | 20 ++++++++++----------
+ drivers/firewire/core-device.c | 4 ++--
+ drivers/ieee1394/nodemgr.c | 4 ++--
+ drivers/net/mlx4/mlx4.h | 1 +
+ drivers/pci/bus.c | 4 ++--
+ drivers/pci/pci.c | 4 ++--
+ drivers/pcmcia/ds.c | 8 ++++----
+ drivers/usb/core/driver.c | 4 ++--
+ drivers/usb/core/usb.c | 2 +-
+ drivers/uwb/umc-bus.c | 4 ++--
+ drivers/uwb/uwb-internal.h | 4 ++--
+ include/linux/device.h | 5 ++---
+ include/linux/usb.h | 6 +++---
+ 16 files changed, 65 insertions(+), 66 deletions(-)
+
+--- a/drivers/base/bus.c
++++ b/drivers/base/bus.c
+@@ -173,10 +173,10 @@ static ssize_t driver_unbind(struct devi
+ dev = bus_find_device_by_name(bus, NULL, buf);
+ if (dev && dev->driver == drv) {
+ if (dev->parent) /* Needed for USB */
+- down(&dev->parent->sem);
++ mutex_lock(&dev->parent->mutex);
+ device_release_driver(dev);
+ if (dev->parent)
+- up(&dev->parent->sem);
++ mutex_unlock(&dev->parent->mutex);
+ err = count;
+ }
+ put_device(dev);
+@@ -200,12 +200,12 @@ static ssize_t driver_bind(struct device
+ dev = bus_find_device_by_name(bus, NULL, buf);
+ if (dev && dev->driver == NULL && driver_match_device(drv, dev)) {
+ if (dev->parent) /* Needed for USB */
+- down(&dev->parent->sem);
+- down(&dev->sem);
++ mutex_lock(&dev->parent->mutex);
++ mutex_lock(&dev->mutex);
+ err = driver_probe_device(drv, dev);
+- up(&dev->sem);
++ mutex_unlock(&dev->mutex);
+ if (dev->parent)
+- up(&dev->parent->sem);
++ mutex_unlock(&dev->parent->mutex);
+
+ if (err > 0) {
+ /* success */
+@@ -744,10 +744,10 @@ static int __must_check bus_rescan_devic
+
+ if (!dev->driver) {
+ if (dev->parent) /* Needed for USB */
+- down(&dev->parent->sem);
++ mutex_lock(&dev->parent->mutex);
+ ret = device_attach(dev);
+ if (dev->parent)
+- up(&dev->parent->sem);
++ mutex_unlock(&dev->parent->mutex);
+ }
+ return ret < 0 ? ret : 0;
+ }
+@@ -779,10 +779,10 @@ int device_reprobe(struct device *dev)
+ {
+ if (dev->driver) {
+ if (dev->parent) /* Needed for USB */
+- down(&dev->parent->sem);
++ mutex_lock(&dev->parent->mutex);
+ device_release_driver(dev);
+ if (dev->parent)
+- up(&dev->parent->sem);
++ mutex_unlock(&dev->parent->mutex);
+ }
+ return bus_rescan_devices_helper(dev, NULL);
+ }
+--- a/drivers/base/core.c
++++ b/drivers/base/core.c
+@@ -20,7 +20,6 @@
+ #include <linux/notifier.h>
+ #include <linux/genhd.h>
+ #include <linux/kallsyms.h>
+-#include <linux/semaphore.h>
+ #include <linux/mutex.h>
+ #include <linux/async.h>
+
+@@ -559,7 +558,7 @@ void device_initialize(struct device *de
+ dev->kobj.kset = devices_kset;
+ kobject_init(&dev->kobj, &device_ktype);
+ INIT_LIST_HEAD(&dev->dma_pools);
+- init_MUTEX(&dev->sem);
++ mutex_init(&dev->mutex);
+ spin_lock_init(&dev->devres_lock);
+ INIT_LIST_HEAD(&dev->devres_head);
+ device_init_wakeup(dev, 0);
+--- a/drivers/base/dd.c
++++ b/drivers/base/dd.c
+@@ -85,7 +85,7 @@ static void driver_sysfs_remove(struct d
+ * for before calling this. (It is ok to call with no other effort
+ * from a driver's probe() method.)
+ *
+- * This function must be called with @dev->sem held.
++ * This function must be called with @dev->mutex held.
+ */
+ int device_bind_driver(struct device *dev)
+ {
+@@ -190,8 +190,8 @@ EXPORT_SYMBOL_GPL(wait_for_device_probe)
+ * This function returns -ENODEV if the device is not registered,
+ * 1 if the device is bound successfully and 0 otherwise.
+ *
+- * This function must be called with @dev->sem held. When called for a
+- * USB interface, @dev->parent->sem must be held as well.
++ * This function must be called with @dev->mutex held. When called for a
++ * USB interface, @dev->parent->mutex must be held as well.
+ */
+ int driver_probe_device(struct device_driver *drv, struct device *dev)
+ {
+@@ -233,13 +233,13 @@ static int __device_attach(struct device
+ * 0 if no matching driver was found;
+ * -ENODEV if the device is not registered.
+ *
+- * When called for a USB interface, @dev->parent->sem must be held.
++ * When called for a USB interface, @dev->parent->mutex must be held.
+ */
+ int device_attach(struct device *dev)
+ {
+ int ret = 0;
+
+- down(&dev->sem);
++ mutex_lock(&dev->mutex);
+ if (dev->driver) {
+ ret = device_bind_driver(dev);
+ if (ret == 0)
+@@ -253,7 +253,7 @@ int device_attach(struct device *dev)
+ ret = bus_for_each_drv(dev->bus, NULL, dev, __device_attach);
+ pm_runtime_put_sync(dev);
+ }
+- up(&dev->sem);
++ mutex_unlock(&dev->mutex);
+ return ret;
+ }
+ EXPORT_SYMBOL_GPL(device_attach);
+@@ -276,13 +276,13 @@ static int __driver_attach(struct device
+ return 0;
+
+ if (dev->parent) /* Needed for USB */
+- down(&dev->parent->sem);
+- down(&dev->sem);
++ mutex_lock(&dev->parent->mutex);
++ mutex_lock(&dev->mutex);
+ if (!dev->driver)
+ driver_probe_device(drv, dev);
+- up(&dev->sem);
++ mutex_unlock(&dev->mutex);
+ if (dev->parent)
+- up(&dev->parent->sem);
++ mutex_unlock(&dev->parent->mutex);
+
+ return 0;
+ }
+@@ -303,8 +303,8 @@ int driver_attach(struct device_driver *
+ EXPORT_SYMBOL_GPL(driver_attach);
+
+ /*
+- * __device_release_driver() must be called with @dev->sem held.
+- * When called for a USB interface, @dev->parent->sem must be held as well.
++ * __device_release_driver() must be called with @dev->mutex held.
++ * When called for a USB interface, @dev->parent->mutex must be held as well.
+ */
+ static void __device_release_driver(struct device *dev)
+ {
+@@ -343,7 +343,7 @@ static void __device_release_driver(stru
+ * @dev: device.
+ *
+ * Manually detach device from driver.
+- * When called for a USB interface, @dev->parent->sem must be held.
++ * When called for a USB interface, @dev->parent->mutex must be held.
+ */
+ void device_release_driver(struct device *dev)
+ {
+@@ -352,9 +352,9 @@ void device_release_driver(struct device
+ * within their ->remove callback for the same device, they
+ * will deadlock right here.
+ */
+- down(&dev->sem);
++ mutex_lock(&dev->mutex);
+ __device_release_driver(dev);
+- up(&dev->sem);
++ mutex_unlock(&dev->mutex);
+ }
+ EXPORT_SYMBOL_GPL(device_release_driver);
+
+@@ -381,13 +381,13 @@ void driver_detach(struct device_driver
+ spin_unlock(&drv->p->klist_devices.k_lock);
+
+ if (dev->parent) /* Needed for USB */
+- down(&dev->parent->sem);
+- down(&dev->sem);
++ mutex_lock(&dev->parent->mutex);
++ mutex_lock(&dev->mutex);
+ if (dev->driver == drv)
+ __device_release_driver(dev);
+- up(&dev->sem);
++ mutex_unlock(&dev->mutex);
+ if (dev->parent)
+- up(&dev->parent->sem);
++ mutex_unlock(&dev->parent->mutex);
+ put_device(dev);
+ }
+ }
+--- a/drivers/base/power/main.c
++++ b/drivers/base/power/main.c
+@@ -34,8 +34,8 @@
+ * because children are guaranteed to be discovered after parents, and
+ * are inserted at the back of the list on discovery.
+ *
+- * Since device_pm_add() may be called with a device semaphore held,
+- * we must never try to acquire a device semaphore while holding
++ * Since device_pm_add() may be called with a device mutex held,
++ * we must never try to acquire a device mutex while holding
+ * dpm_list_mutex.
+ */
+
+@@ -476,7 +476,7 @@ static int device_resume(struct device *
+ TRACE_DEVICE(dev);
+ TRACE_RESUME(0);
+
+- down(&dev->sem);
++ mutex_lock(&dev->mutex);
+
+ if (dev->bus) {
+ if (dev->bus->pm) {
+@@ -509,7 +509,7 @@ static int device_resume(struct device *
+ }
+ }
+ End:
+- up(&dev->sem);
++ mutex_unlock(&dev->mutex);
+
+ TRACE_RESUME(error);
+ return error;
+@@ -564,7 +564,7 @@ static void dpm_resume(pm_message_t stat
+ */
+ static void device_complete(struct device *dev, pm_message_t state)
+ {
+- down(&dev->sem);
++ mutex_lock(&dev->mutex);
+
+ if (dev->class && dev->class->pm && dev->class->pm->complete) {
+ pm_dev_dbg(dev, state, "completing class ");
+@@ -581,7 +581,7 @@ static void device_complete(struct devic
+ dev->bus->pm->complete(dev);
+ }
+
+- up(&dev->sem);
++ mutex_unlock(&dev->mutex);
+ }
+
+ /**
+@@ -740,7 +740,7 @@ static int device_suspend(struct device
+ {
+ int error = 0;
+
+- down(&dev->sem);
++ mutex_lock(&dev->mutex);
+
+ if (dev->class) {
+ if (dev->class->pm) {
+@@ -773,7 +773,7 @@ static int device_suspend(struct device
+ }
+ }
+ End:
+- up(&dev->sem);
++ mutex_unlock(&dev->mutex);
+
+ return error;
+ }
+@@ -828,7 +828,7 @@ static int device_prepare(struct device
+ {
+ int error = 0;
+
+- down(&dev->sem);
++ mutex_lock(&dev->mutex);
+
+ if (dev->bus && dev->bus->pm && dev->bus->pm->prepare) {
+ pm_dev_dbg(dev, state, "preparing ");
+@@ -852,7 +852,7 @@ static int device_prepare(struct device
+ suspend_report_result(dev->class->pm->prepare, error);
+ }
+ End:
+- up(&dev->sem);
++ mutex_unlock(&dev->mutex);
+
+ return error;
+ }
+--- a/drivers/firewire/core-device.c
++++ b/drivers/firewire/core-device.c
+@@ -762,9 +762,9 @@ static int update_unit(struct device *de
+ struct fw_driver *driver = (struct fw_driver *)dev->driver;
+
+ if (is_fw_unit(dev) && driver != NULL && driver->update != NULL) {
+- down(&dev->sem);
++ mutex_lock(&dev->mutex);
+ driver->update(unit);
+- up(&dev->sem);
++ mutex_unlock(&dev->mutex);
+ }
+
+ return 0;
+--- a/drivers/ieee1394/nodemgr.c
++++ b/drivers/ieee1394/nodemgr.c
+@@ -1397,9 +1397,9 @@ static int update_pdrv(struct device *de
+ pdrv = container_of(drv, struct hpsb_protocol_driver,
+ driver);
+ if (pdrv->update) {
+- down(&ud->device.sem);
++ mutex_lock(&ud->device.mutex);
+ error = pdrv->update(ud);
+- up(&ud->device.sem);
++ mutex_unlock(&ud->device.mutex);
+ }
+ if (error)
+ device_release_driver(&ud->device);
+--- a/drivers/net/mlx4/mlx4.h
++++ b/drivers/net/mlx4/mlx4.h
+@@ -40,6 +40,7 @@
+ #include <linux/mutex.h>
+ #include <linux/radix-tree.h>
+ #include <linux/timer.h>
++#include <linux/semaphore.h>
+ #include <linux/workqueue.h>
+
+ #include <linux/mlx4/device.h>
+--- a/drivers/pci/bus.c
++++ b/drivers/pci/bus.c
+@@ -240,9 +240,9 @@ void pci_walk_bus(struct pci_bus *top, i
+ next = dev->bus_list.next;
+
+ /* Run device routines with the device locked */
+- down(&dev->dev.sem);
++ mutex_lock(&dev->dev.mutex);
+ retval = cb(dev, userdata);
+- up(&dev->dev.sem);
++ mutex_unlock(&dev->dev.mutex);
+ if (retval)
+ break;
+ }
+--- a/drivers/pci/pci.c
++++ b/drivers/pci/pci.c
+@@ -2304,7 +2304,7 @@ static int pci_dev_reset(struct pci_dev
+ if (!probe) {
+ pci_block_user_cfg_access(dev);
+ /* block PM suspend, driver probe, etc. */
+- down(&dev->dev.sem);
++ mutex_lock(&dev->dev.mutex);
+ }
+
+ rc = pci_dev_specific_reset(dev, probe);
+@@ -2326,7 +2326,7 @@ static int pci_dev_reset(struct pci_dev
+ rc = pci_parent_bus_reset(dev, probe);
+ done:
+ if (!probe) {
+- up(&dev->dev.sem);
++ mutex_unlock(&dev->dev.mutex);
+ pci_unblock_user_cfg_access(dev);
+ }
+
+--- a/drivers/pcmcia/ds.c
++++ b/drivers/pcmcia/ds.c
+@@ -964,9 +964,9 @@ static int runtime_suspend(struct device
+ {
+ int rc;
+
+- down(&dev->sem);
++ mutex_lock(&dev->mutex);
+ rc = pcmcia_dev_suspend(dev, PMSG_SUSPEND);
+- up(&dev->sem);
++ mutex_unlock(&dev->mutex);
+ return rc;
+ }
+
+@@ -974,9 +974,9 @@ static void runtime_resume(struct device
+ {
+ int rc;
+
+- down(&dev->sem);
++ mutex_lock(&dev->mutex);
+ rc = pcmcia_dev_resume(dev);
+- up(&dev->sem);
++ mutex_unlock(&dev->mutex);
+ }
+
+ /************************ per-device sysfs output ***************************/
+--- a/drivers/usb/core/driver.c
++++ b/drivers/usb/core/driver.c
+@@ -470,10 +470,10 @@ void usb_driver_release_interface(struct
+ if (device_is_registered(dev)) {
+ device_release_driver(dev);
+ } else {
+- down(&dev->sem);
++ mutex_lock(&dev->mutex);
+ usb_unbind_interface(dev);
+ dev->driver = NULL;
+- up(&dev->sem);
++ mutex_unlock(&dev->mutex);
+ }
+ }
+ EXPORT_SYMBOL_GPL(usb_driver_release_interface);
+--- a/drivers/usb/core/usb.c
++++ b/drivers/usb/core/usb.c
+@@ -601,7 +601,7 @@ int usb_lock_device_for_reset(struct usb
+ iface->condition == USB_INTERFACE_UNBOUND))
+ return -EINTR;
+
+- while (usb_trylock_device(udev) != 0) {
++ while (!usb_trylock_device(udev)) {
+
+ /* If we can't acquire the lock after waiting one second,
+ * we're probably deadlocked */
+--- a/drivers/uwb/umc-bus.c
++++ b/drivers/uwb/umc-bus.c
+@@ -62,12 +62,12 @@ int umc_controller_reset(struct umc_dev
+ struct device *parent = umc->dev.parent;
+ int ret = 0;
+
+- if(down_trylock(&parent->sem))
++ if (!mutex_trylock(&parent->mutex))
+ return -EAGAIN;
+ ret = device_for_each_child(parent, parent, umc_bus_pre_reset_helper);
+ if (ret >= 0)
+ ret = device_for_each_child(parent, parent, umc_bus_post_reset_helper);
+- up(&parent->sem);
++ mutex_unlock(&parent->mutex);
+
+ return ret;
+ }
+--- a/drivers/uwb/uwb-internal.h
++++ b/drivers/uwb/uwb-internal.h
+@@ -366,12 +366,12 @@ struct dentry *uwb_dbg_create_pal_dir(st
+
+ static inline void uwb_dev_lock(struct uwb_dev *uwb_dev)
+ {
+- down(&uwb_dev->dev.sem);
++ mutex_lock(&uwb_dev->dev.mutex);
+ }
+
+ static inline void uwb_dev_unlock(struct uwb_dev *uwb_dev)
+ {
+- up(&uwb_dev->dev.sem);
++ mutex_unlock(&uwb_dev->dev.mutex);
+ }
+
+ #endif /* #ifndef __UWB_INTERNAL_H__ */
+--- a/include/linux/device.h
++++ b/include/linux/device.h
+@@ -22,7 +22,6 @@
+ #include <linux/types.h>
+ #include <linux/module.h>
+ #include <linux/pm.h>
+-#include <linux/semaphore.h>
+ #include <asm/atomic.h>
+ #include <asm/device.h>
+
+@@ -106,7 +105,7 @@ extern int bus_unregister_notifier(struc
+
+ /* All 4 notifers below get called with the target struct device *
+ * as an argument. Note that those functions are likely to be called
+- * with the device semaphore held in the core, so be careful.
++ * with the device mutex held in the core, so be careful.
+ */
+ #define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */
+ #define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */
+@@ -404,7 +403,7 @@ struct device {
+ const char *init_name; /* initial name of the device */
+ struct device_type *type;
+
+- struct semaphore sem; /* semaphore to synchronize calls to
++ struct mutex mutex; /* mutex to synchronize calls to
+ * its driver.
+ */
+
+--- a/include/linux/usb.h
++++ b/include/linux/usb.h
+@@ -527,9 +527,9 @@ extern struct usb_device *usb_get_dev(st
+ extern void usb_put_dev(struct usb_device *dev);
+
+ /* USB device locking */
+-#define usb_lock_device(udev) down(&(udev)->dev.sem)
+-#define usb_unlock_device(udev) up(&(udev)->dev.sem)
+-#define usb_trylock_device(udev) down_trylock(&(udev)->dev.sem)
++#define usb_lock_device(udev) mutex_lock(&(udev)->dev.mutex)
++#define usb_unlock_device(udev) mutex_unlock(&(udev)->dev.mutex)
++#define usb_trylock_device(udev) mutex_trylock(&(udev)->dev.mutex)
+ extern int usb_lock_device_for_reset(struct usb_device *udev,
+ const struct usb_interface *iface);
+
diff --git a/driver-core/msi-laptop-add-resume-method-for-set-the-scm-load-again.patch b/driver-core/msi-laptop-add-resume-method-for-set-the-scm-load-again.patch
new file mode 100644
index 00000000000000..b5dbda2c9dbb29
--- /dev/null
+++ b/driver-core/msi-laptop-add-resume-method-for-set-the-scm-load-again.patch
@@ -0,0 +1,67 @@
+>From f8a0814a4d4ec38816508be4f0252eb49605bc4d Mon Sep 17 00:00:00 2001
+From: Lee, Chun-Yi <jlee@novell.com>
+Date: Wed, 27 Jan 2010 00:13:45 +0800
+Subject: msi-laptop: Add resume method for set the SCM load again
+
+Implement the resume method for set the load SCM flag after system reusme.
+Without this patch, the wifi function key on SCM model will back to BIOS
+control mode then confuse with the userland software control.
+e.g. MSI N034
+
+Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
+Cc: Lennart Poettering <mzxreary@0pointer.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/platform/x86/msi-laptop.c | 26 +++++++++++++++++++++++++-
+ 1 file changed, 25 insertions(+), 1 deletion(-)
+
+--- a/drivers/platform/x86/msi-laptop.c
++++ b/drivers/platform/x86/msi-laptop.c
+@@ -77,6 +77,8 @@
+ #define MSI_STANDARD_EC_SCM_LOAD_ADDRESS 0x2d
+ #define MSI_STANDARD_EC_SCM_LOAD_MASK (1 << 0)
+
++static int msi_laptop_resume(struct platform_device *device);
++
+ static int force;
+ module_param(force, bool, 0);
+ MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
+@@ -395,7 +397,8 @@ static struct platform_driver msipf_driv
+ .driver = {
+ .name = "msi-laptop-pf",
+ .owner = THIS_MODULE,
+- }
++ },
++ .resume = msi_laptop_resume,
+ };
+
+ static struct platform_device *msipf_device;
+@@ -584,6 +587,27 @@ err_bluetooth:
+ return retval;
+ }
+
++static int msi_laptop_resume(struct platform_device *device)
++{
++ u8 data;
++ int result;
++
++ if (!load_scm_model)
++ return 0;
++
++ /* set load SCM to disable hardware control by fn key */
++ result = ec_read(MSI_STANDARD_EC_SCM_LOAD_ADDRESS, &data);
++ if (result < 0)
++ return result;
++
++ result = ec_write(MSI_STANDARD_EC_SCM_LOAD_ADDRESS,
++ data | MSI_STANDARD_EC_SCM_LOAD_MASK);
++ if (result < 0)
++ return result;
++
++ return 0;
++}
++
+ static int load_scm_model_init(struct platform_device *sdev)
+ {
+ u8 data;
diff --git a/driver-core/msi-laptop-detect-3g-device-exists-by-standard-ec-command.patch b/driver-core/msi-laptop-detect-3g-device-exists-by-standard-ec-command.patch
new file mode 100644
index 00000000000000..f564443cd48994
--- /dev/null
+++ b/driver-core/msi-laptop-detect-3g-device-exists-by-standard-ec-command.patch
@@ -0,0 +1,112 @@
+From de25bd283cbaaed3c3eaa4505f2c60fc7689c512 Mon Sep 17 00:00:00 2001
+From: Lee, Chun-Yi <jlee@novell.com>
+Date: Wed, 27 Jan 2010 12:23:00 +0800
+Subject: msi-laptop: Detect 3G device exists by standard ec command
+
+Detect 3G device exists by standard ec command. Driver will not create the threeg sysfs
+file and threeg rfkill interface if there have no internal 3G device in MSI notebook/netbook.
+
+Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
+Cc: Lennart Poettering <mzxreary@0pointer.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/platform/x86/msi-laptop.c | 44 +++++++++++++++++++++++++++++---------
+ 1 file changed, 34 insertions(+), 10 deletions(-)
+
+--- a/drivers/platform/x86/msi-laptop.c
++++ b/drivers/platform/x86/msi-laptop.c
+@@ -79,6 +79,8 @@
+
+ static int msi_laptop_resume(struct platform_device *device);
+
++#define MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS 0x2f
++
+ static int force;
+ module_param(force, bool, 0);
+ MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
+@@ -89,6 +91,7 @@ MODULE_PARM_DESC(auto_brightness, "Enabl
+
+ static bool old_ec_model;
+ static int wlan_s, bluetooth_s, threeg_s;
++static int threeg_exists;
+
+ /* Some MSI 3G netbook only have one fn key to control Wlan/Bluetooth/3G,
+ * those netbook will load the SCM (windows app) to disable the original
+@@ -224,6 +227,20 @@ static int get_wireless_state_ec_standar
+ return 0;
+ }
+
++static int get_threeg_exists(void)
++{
++ u8 rdata;
++ int result;
++
++ result = ec_read(MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS, &rdata);
++ if (result < 0)
++ return -1;
++
++ threeg_exists = !!(rdata & MSI_STANDARD_EC_3G_MASK);
++
++ return 0;
++}
++
+ /* Backlight device stuff */
+
+ static int bl_get_brightness(struct backlight_device *b)
+@@ -561,15 +578,17 @@ static int rfkill_init(struct platform_d
+ if (retval)
+ goto err_wlan;
+
+- rfk_threeg = rfkill_alloc("msi-threeg", &sdev->dev, RFKILL_TYPE_WWAN,
+- &rfkill_threeg_ops, NULL);
+- if (!rfk_threeg) {
+- retval = -ENOMEM;
+- goto err_threeg;
++ if (threeg_exists) {
++ rfk_threeg = rfkill_alloc("msi-threeg", &sdev->dev,
++ RFKILL_TYPE_WWAN, &rfkill_threeg_ops, NULL);
++ if (!rfk_threeg) {
++ retval = -ENOMEM;
++ goto err_threeg;
++ }
++ retval = rfkill_register(rfk_threeg);
++ if (retval)
++ goto err_threeg;
+ }
+- retval = rfkill_register(rfk_threeg);
+- if (retval)
+- goto err_threeg;
+
+ return 0;
+
+@@ -649,6 +668,9 @@ static int __init msi_init(void)
+ if (force || dmi_check_system(msi_dmi_table))
+ old_ec_model = 1;
+
++ if (!old_ec_model)
++ get_threeg_exists();
++
+ if (!old_ec_model && dmi_check_system(msi_load_scm_models_dmi_table))
+ load_scm_model = 1;
+
+@@ -694,7 +716,9 @@ static int __init msi_init(void)
+ goto fail_platform_device2;
+
+ if (!old_ec_model) {
+- ret = device_create_file(&msipf_device->dev, &dev_attr_threeg);
++ if (threeg_exists)
++ ret = device_create_file(&msipf_device->dev,
++ &dev_attr_threeg);
+ if (ret)
+ goto fail_platform_device2;
+ }
+@@ -733,7 +757,7 @@ static void __exit msi_cleanup(void)
+ {
+
+ sysfs_remove_group(&msipf_device->dev.kobj, &msipf_attribute_group);
+- if (!old_ec_model)
++ if (!old_ec_model && threeg_exists)
+ device_remove_file(&msipf_device->dev, &dev_attr_threeg);
+ platform_device_unregister(msipf_device);
+ platform_driver_unregister(&msipf_driver);
diff --git a/series b/series
index d6a7c393162a74..6170e65e990050 100644
--- a/series
+++ b/series
@@ -74,11 +74,14 @@ driver-core/howto-updates-on-subsystem-trees-patchwork-next-vs.-mm.patch
driver-core/sysdev-fix-up-the-probe-release-attributes.patch
driver-core/driver-core-constify-struct-sysfs_ops-in-struct-kobj_type.patch
driver-core/driver-core-make-struct-platform_driver.id_table-const.patch
+driver-core/drivers-base-convert-sema.patch
# sent to Lennart 01-15-2010
driver-core/msi-laptop-support-standard-ec-66-62-command-on-msi-notebook-and-nebook.patch
driver-core/msi-laptop-add-threeg-sysfs-file-for-support-query-3g-state-by-standard-66-62-ec-command.patch
driver-core/msi-laptop-support-some-msi-3g-netbook-that-is-need-load-scm.patch
+driver-core/msi-laptop-add-resume-method-for-set-the-scm-load-again.patch
+driver-core/msi-laptop-detect-3g-device-exists-by-standard-ec-command.patch
#####################################
# TTY patches for after 2.6.33 is out
@@ -106,6 +109,8 @@ tty/serial-bfin_5xx-remove-useless-gpio-handling-with-hard-flow-control.patch
tty/serial-bfin_5xx-need-to-disable-dma-tx-interrupt-too.patch
tty/serial-bfin_5xx-kgdboc-should-accept-gdb-break-only-when-it-is-active.patch
tty/serial-bfin_5xx-pull-in-linux-io.h-for-ioremap-prototypes.patch
+tty/serial-bcm63xx_uart-don-t-use-kfree-on-non-kmalloced-area.patch
+tty/serial-bcm63xx_uart-allow-more-than-one-uart-to-be-registered.patch
###################################
@@ -284,6 +289,8 @@ usb/usb-musb-set-version-of-blackfin-version.patch
usb/usb-musb-disable-double-buffering-for-older-rtl-versions.patch
usb/usb-mass_storage-eject-luns-on-thread-exit.patch
usb/usb-g_mass_storage-superfluous-and-missing-packets-fixed.patch
+usb/isp1760-flush-the-d-cache-for-the-pipe-in-transfer-buffers.patch
+usb/usb-gadgetfs-convert-semaphore-to-mutex.patch
#######################################
diff --git a/tty/serial-bcm63xx_uart-allow-more-than-one-uart-to-be-registered.patch b/tty/serial-bcm63xx_uart-allow-more-than-one-uart-to-be-registered.patch
new file mode 100644
index 00000000000000..bf79b367eef240
--- /dev/null
+++ b/tty/serial-bcm63xx_uart-allow-more-than-one-uart-to-be-registered.patch
@@ -0,0 +1,46 @@
+From mbizon@freebox.fr Mon Feb 1 14:28:41 2010
+From: Maxime Bizon <mbizon@freebox.fr>
+Date: Sat, 30 Jan 2010 18:42:57 +0100
+Subject: serial: bcm63xx_uart: allow more than one uart to be registered.
+To: Greg Kroah-Hartman <gregkh@suse.de>, linux-serial@vger.kernel.org
+Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org, Maxime Bizon <mbizon@freebox.fr>
+Message-ID: <1264873377-28479-3-git-send-email-mbizon@freebox.fr>
+
+
+The bcm6358 CPU has two uarts, make it possible to use the second one.
+
+Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/serial/bcm63xx_uart.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/drivers/serial/bcm63xx_uart.c
++++ b/drivers/serial/bcm63xx_uart.c
+@@ -35,7 +35,7 @@
+ #include <bcm63xx_regs.h>
+ #include <bcm63xx_io.h>
+
+-#define BCM63XX_NR_UARTS 1
++#define BCM63XX_NR_UARTS 2
+
+ static struct uart_port ports[BCM63XX_NR_UARTS];
+
+@@ -784,7 +784,7 @@ static struct uart_driver bcm_uart_drive
+ .dev_name = "ttyS",
+ .major = TTY_MAJOR,
+ .minor = 64,
+- .nr = 1,
++ .nr = BCM63XX_NR_UARTS,
+ .cons = BCM63XX_CONSOLE,
+ };
+
+@@ -826,6 +826,7 @@ static int __devinit bcm_uart_probe(stru
+ port->dev = &pdev->dev;
+ port->fifosize = 16;
+ port->uartclk = clk_get_rate(clk) / 2;
++ port->line = pdev->id;
+ clk_put(clk);
+
+ ret = uart_add_one_port(&bcm_uart_driver, port);
diff --git a/tty/serial-bcm63xx_uart-don-t-use-kfree-on-non-kmalloced-area.patch b/tty/serial-bcm63xx_uart-don-t-use-kfree-on-non-kmalloced-area.patch
new file mode 100644
index 00000000000000..b7292cc52862c7
--- /dev/null
+++ b/tty/serial-bcm63xx_uart-don-t-use-kfree-on-non-kmalloced-area.patch
@@ -0,0 +1,27 @@
+From mbizon@freebox.fr Mon Feb 1 14:30:29 2010
+From: Maxime Bizon <mbizon@freebox.fr>
+Date: Sat, 30 Jan 2010 18:42:56 +0100
+Subject: serial: bcm63xx_uart: don't use kfree() on non kmalloced area.
+To: Greg Kroah-Hartman <gregkh@suse.de>, linux-serial@vger.kernel.org
+Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org, Maxime Bizon <mbizon@freebox.fr>
+Message-ID: <1264873377-28479-2-git-send-email-mbizon@freebox.fr>
+
+
+Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/serial/bcm63xx_uart.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/serial/bcm63xx_uart.c
++++ b/drivers/serial/bcm63xx_uart.c
+@@ -830,7 +830,7 @@ static int __devinit bcm_uart_probe(stru
+
+ ret = uart_add_one_port(&bcm_uart_driver, port);
+ if (ret) {
+- kfree(port);
++ ports[pdev->id].membase = 0;
+ return ret;
+ }
+ platform_set_drvdata(pdev, port);
diff --git a/usb.current/usb-r8a66597-hdc-disable-interrupts-fix.patch b/usb.current/usb-r8a66597-hdc-disable-interrupts-fix.patch
index 9415bea64d3a1a..45a9d719c0a837 100644
--- a/usb.current/usb-r8a66597-hdc-disable-interrupts-fix.patch
+++ b/usb.current/usb-r8a66597-hdc-disable-interrupts-fix.patch
@@ -17,6 +17,7 @@ pending interrupts after kexec reboot.
Signed-off-by: Magnus Damm <damm@opensource.se>
Cc: stable <stable@kernel.org>
+Acked-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
diff --git a/usb/isp1760-flush-the-d-cache-for-the-pipe-in-transfer-buffers.patch b/usb/isp1760-flush-the-d-cache-for-the-pipe-in-transfer-buffers.patch
new file mode 100644
index 00000000000000..11a55ea15a41d8
--- /dev/null
+++ b/usb/isp1760-flush-the-d-cache-for-the-pipe-in-transfer-buffers.patch
@@ -0,0 +1,58 @@
+From catalin.marinas@arm.com Mon Feb 1 14:07:01 2010
+From: Catalin Marinas <catalin.marinas@arm.com>
+Date: Mon, 01 Feb 2010 17:29:14 +0000
+Subject: isp1760: Flush the D-cache for the pipe-in transfer buffers
+To: Matthew Dharm <mdharm-kernel@one-eyed-alien.net>
+Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>, Ming Lei <tom.leiming@gmail.com>, Sebastian Siewior <bigeasy@linutronix.de>, Greg KH <greg@kroah.com>
+Message-ID: <1265045354.25750.52.camel@pc1117.cambridge.arm.com>
+
+
+isp1760: Flush the D-cache for the pipe-in transfer buffers
+
+From: Catalin Marinas <catalin.marinas@arm.com>
+
+When the HDC driver writes the data to the transfer buffers it pollutes
+the D-cache (unlike DMA drivers where the device writes the data). If
+the corresponding pages get mapped into user space, there are no
+additional cache flushing operations performed and this causes random
+user space faults on architectures with separate I and D caches
+(Harvard) or those with aliasing D-cache.
+
+Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
+Cc: Matthew Dharm <mdharm-kernel@one-eyed-alien.net>
+Cc: Sebastian Siewior <bigeasy@linutronix.de>
+Cc: Mike Frysinger <vapier@gentoo.org>
+Cc: Harvey Harrison <harvey.harrison@gmail.com>
+Cc: Ming Lei <tom.leiming@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/host/isp1760-hcd.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/usb/host/isp1760-hcd.c
++++ b/drivers/usb/host/isp1760-hcd.c
+@@ -18,6 +18,8 @@
+ #include <linux/uaccess.h>
+ #include <linux/io.h>
+ #include <asm/unaligned.h>
++#include <asm/cacheflush.h>
++#include <asm/memory.h>
+
+ #include "../core/hcd.h"
+ #include "isp1760-hcd.h"
+@@ -904,6 +906,14 @@ __acquires(priv->lock)
+ status = 0;
+ }
+
++ if (usb_pipein(urb->pipe) && usb_pipetype(urb->pipe) == PIPE_BULK) {
++ void *ptr;
++ for (ptr = urb->transfer_buffer;
++ ptr < urb->transfer_buffer + urb->transfer_buffer_length;
++ ptr += PAGE_SIZE)
++ flush_dcache_page(virt_to_page(ptr));
++ }
++
+ /* complete() can reenter this HCD */
+ usb_hcd_unlink_urb_from_ep(priv_to_hcd(priv), urb);
+ spin_unlock(&priv->lock);
diff --git a/usb/usb-gadgetfs-convert-semaphore-to-mutex.patch b/usb/usb-gadgetfs-convert-semaphore-to-mutex.patch
new file mode 100644
index 00000000000000..ef35b5a1c57747
--- /dev/null
+++ b/usb/usb-gadgetfs-convert-semaphore-to-mutex.patch
@@ -0,0 +1,181 @@
+From tglx@linutronix.de Mon Feb 1 14:34:47 2010
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Fri, 29 Jan 2010 20:38:59 -0000
+Subject: usb: gadgetfs: Convert semaphore to mutex
+Cc: Christoph Hellwig <hch@infradead.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@elte.hu>, Greg Kroah-Hartman <gregkh@suse.de>
+Message-ID: <20100129203613.628793121@linutronix.de>
+
+
+The semaphore data->lock is semantically a mutex. Convert it to a real
+mutex.
+
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Cc: David Brownell <dbrownell@users.sourceforge.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/gadget/inode.c | 39 +++++++++++++++++++++------------------
+ 1 file changed, 21 insertions(+), 18 deletions(-)
+
+--- a/drivers/usb/gadget/inode.c
++++ b/drivers/usb/gadget/inode.c
+@@ -194,7 +194,7 @@ enum ep_state {
+ };
+
+ struct ep_data {
+- struct semaphore lock;
++ struct mutex lock;
+ enum ep_state state;
+ atomic_t count;
+ struct dev_data *dev;
+@@ -298,10 +298,10 @@ get_ready_ep (unsigned f_flags, struct e
+ int val;
+
+ if (f_flags & O_NONBLOCK) {
+- if (down_trylock (&epdata->lock) != 0)
++ if (!mutex_trylock(&epdata->lock))
+ goto nonblock;
+ if (epdata->state != STATE_EP_ENABLED) {
+- up (&epdata->lock);
++ mutex_unlock(&epdata->lock);
+ nonblock:
+ val = -EAGAIN;
+ } else
+@@ -309,7 +309,8 @@ nonblock:
+ return val;
+ }
+
+- if ((val = down_interruptible (&epdata->lock)) < 0)
++ val = mutex_lock_interruptible(&epdata->lock);
++ if (val < 0)
+ return val;
+
+ switch (epdata->state) {
+@@ -323,7 +324,7 @@ nonblock:
+ // FALLTHROUGH
+ case STATE_EP_UNBOUND: /* clean disconnect */
+ val = -ENODEV;
+- up (&epdata->lock);
++ mutex_unlock(&epdata->lock);
+ }
+ return val;
+ }
+@@ -393,7 +394,7 @@ ep_read (struct file *fd, char __user *b
+ if (likely (data->ep != NULL))
+ usb_ep_set_halt (data->ep);
+ spin_unlock_irq (&data->dev->lock);
+- up (&data->lock);
++ mutex_unlock(&data->lock);
+ return -EBADMSG;
+ }
+
+@@ -411,7 +412,7 @@ ep_read (struct file *fd, char __user *b
+ value = -EFAULT;
+
+ free1:
+- up (&data->lock);
++ mutex_unlock(&data->lock);
+ kfree (kbuf);
+ return value;
+ }
+@@ -436,7 +437,7 @@ ep_write (struct file *fd, const char __
+ if (likely (data->ep != NULL))
+ usb_ep_set_halt (data->ep);
+ spin_unlock_irq (&data->dev->lock);
+- up (&data->lock);
++ mutex_unlock(&data->lock);
+ return -EBADMSG;
+ }
+
+@@ -455,7 +456,7 @@ ep_write (struct file *fd, const char __
+ VDEBUG (data->dev, "%s write %zu IN, status %d\n",
+ data->name, len, (int) value);
+ free1:
+- up (&data->lock);
++ mutex_unlock(&data->lock);
+ kfree (kbuf);
+ return value;
+ }
+@@ -466,7 +467,8 @@ ep_release (struct inode *inode, struct
+ struct ep_data *data = fd->private_data;
+ int value;
+
+- if ((value = down_interruptible(&data->lock)) < 0)
++ value = mutex_lock_interruptible(&data->lock);
++ if (value < 0)
+ return value;
+
+ /* clean up if this can be reopened */
+@@ -476,7 +478,7 @@ ep_release (struct inode *inode, struct
+ data->hs_desc.bDescriptorType = 0;
+ usb_ep_disable(data->ep);
+ }
+- up (&data->lock);
++ mutex_unlock(&data->lock);
+ put_ep (data);
+ return 0;
+ }
+@@ -507,7 +509,7 @@ static long ep_ioctl(struct file *fd, un
+ } else
+ status = -ENODEV;
+ spin_unlock_irq (&data->dev->lock);
+- up (&data->lock);
++ mutex_unlock(&data->lock);
+ return status;
+ }
+
+@@ -673,7 +675,7 @@ fail:
+ value = -ENODEV;
+ spin_unlock_irq(&epdata->dev->lock);
+
+- up(&epdata->lock);
++ mutex_unlock(&epdata->lock);
+
+ if (unlikely(value)) {
+ kfree(priv);
+@@ -765,7 +767,8 @@ ep_config (struct file *fd, const char _
+ u32 tag;
+ int value, length = len;
+
+- if ((value = down_interruptible (&data->lock)) < 0)
++ value = mutex_lock_interruptible(&data->lock);
++ if (value < 0)
+ return value;
+
+ if (data->state != STATE_EP_READY) {
+@@ -854,7 +857,7 @@ fail:
+ data->desc.bDescriptorType = 0;
+ data->hs_desc.bDescriptorType = 0;
+ }
+- up (&data->lock);
++ mutex_unlock(&data->lock);
+ return value;
+ fail0:
+ value = -EINVAL;
+@@ -870,7 +873,7 @@ ep_open (struct inode *inode, struct fil
+ struct ep_data *data = inode->i_private;
+ int value = -EBUSY;
+
+- if (down_interruptible (&data->lock) != 0)
++ if (mutex_lock_interruptible(&data->lock) != 0)
+ return -EINTR;
+ spin_lock_irq (&data->dev->lock);
+ if (data->dev->state == STATE_DEV_UNBOUND)
+@@ -885,7 +888,7 @@ ep_open (struct inode *inode, struct fil
+ DBG (data->dev, "%s state %d\n",
+ data->name, data->state);
+ spin_unlock_irq (&data->dev->lock);
+- up (&data->lock);
++ mutex_unlock(&data->lock);
+ return value;
+ }
+
+@@ -1631,7 +1634,7 @@ static int activate_ep_files (struct dev
+ if (!data)
+ goto enomem0;
+ data->state = STATE_EP_DISABLED;
+- init_MUTEX (&data->lock);
++ mutex_init(&data->lock);
+ init_waitqueue_head (&data->wait);
+
+ strncpy (data->name, ep->name, sizeof (data->name) - 1);
diff --git a/usb/usb-musb-disable-double-buffering-for-older-rtl-versions.patch b/usb/usb-musb-disable-double-buffering-for-older-rtl-versions.patch
index 065ae5e65e78ad..edd5ef3f170408 100644
--- a/usb/usb-musb-disable-double-buffering-for-older-rtl-versions.patch
+++ b/usb/usb-musb-disable-double-buffering-for-older-rtl-versions.patch
@@ -1,10 +1,10 @@
-From vapier@gentoo.org Thu Jan 28 09:54:08 2010
-From: Cliff Cai <cliff.cai@analog.com>
-Date: Wed, 27 Jan 2010 20:40:04 -0500
+From vapier@gentoo.org Mon Feb 1 14:33:09 2010
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 28 Jan 2010 20:44:18 -0500
Subject: USB: musb: disable double buffering for older RTL versions
To: linux-usb@vger.kernel.org, Felipe Balbi <felipe.balbi@nokia.com>
-Cc: uclinux-dist-devel@blackfin.uclinux.org, Cliff Cai <cliff.cai@analog.com>
-Message-ID: <1264642804-2093-2-git-send-email-vapier@gentoo.org>
+Cc: uclinux-dist-devel@blackfin.uclinux.org, Greg Kroah-Hartman <gregkh@suse.de>, Cliff Cai <cliff.cai@analog.com>
+Message-ID: <1264729458-22105-1-git-send-email-vapier@gentoo.org>
From: Cliff Cai <cliff.cai@analog.com>
@@ -14,13 +14,13 @@ infinite hangs or data corruption. So avoid them with older versions.
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-Cc: Felipe Balbi <felipe.balbi@nokia.com>
+Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/musb/musb_gadget.c | 17 +++++++++++++++--
- drivers/usb/musb/musb_host.c | 7 +++++++
- 2 files changed, 22 insertions(+), 2 deletions(-)
+ drivers/usb/musb/musb_host.c | 10 ++++++++--
+ 2 files changed, 23 insertions(+), 4 deletions(-)
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -29,8 +29,8 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* likewise high bandwidth periodic tx
*/
- musb_writew(regs, MUSB_TXMAXP, tmp);
-+ /* Set TXMAXP with the FIFO size of the endpoint to disable
-+ * double buffering mode. Currently, It seems that double
++ /* Set TXMAXP with the FIFO size of the endpoint
++ * to disable double buffering mode. Currently, It seems that double
+ * buffering has problem if musb RTL revision number < 2.0.
+ */
+ if (musb->hwvers < MUSB_HWVERS_2000)
@@ -57,19 +57,20 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
if (hw_ep->is_shared_fifo) {
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
-@@ -605,8 +605,15 @@ musb_rx_reinit(struct musb *musb, struct
+@@ -605,8 +605,14 @@ musb_rx_reinit(struct musb *musb, struct
musb_writeb(ep->regs, MUSB_RXTYPE, qh->type_reg);
musb_writeb(ep->regs, MUSB_RXINTERVAL, qh->intv_reg);
/* NOTE: bulk combining rewrites high bits of maxpacket */
-+#if defined(CONFIG_BLACKFIN) && ANOMALY_05000465
+- musb_writew(ep->regs, MUSB_RXMAXP,
+- qh->maxpacket | ((qh->hb_mult - 1) << 11));
+ /* Set RXMAXP with the FIFO size of the endpoint
+ * to disable double buffer mode.
+ */
-+ musb_writew(ep->regs, MUSB_RXMAXP, ep->max_packet_sz_rx);
-+#else
- musb_writew(ep->regs, MUSB_RXMAXP,
- qh->maxpacket | ((qh->hb_mult - 1) << 11));
-+#endif
++ if (musb->hwvers < MUSB_HWVERS_2000)
++ musb_writew(ep->regs, MUSB_RXMAXP, ep->max_packet_sz_rx);
++ else
++ musb_writew(ep->regs, MUSB_RXMAXP,
++ qh->maxpacket | ((qh->hb_mult - 1) << 11));
ep->rx_reinit = 0;
}
diff --git a/usb/usb-musb-set-version-of-blackfin-version.patch b/usb/usb-musb-set-version-of-blackfin-version.patch
index 9469975ea62b5a..78799b04d1a7f7 100644
--- a/usb/usb-musb-set-version-of-blackfin-version.patch
+++ b/usb/usb-musb-set-version-of-blackfin-version.patch
@@ -1,11 +1,10 @@
-From vapier@gentoo.org Thu Jan 28 09:54:35 2010
-From: Cliff Cai <cliff.cai@analog.com>
-Date: Wed, 27 Jan 2010 20:40:03 -0500
+From vapier@gentoo.org Mon Feb 1 14:32:47 2010
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 28 Jan 2010 20:43:44 -0500
Subject: USB: musb: set version of Blackfin version
To: linux-usb@vger.kernel.org, Felipe Balbi <felipe.balbi@nokia.com>
-Cc: uclinux-dist-devel@blackfin.uclinux.org, Cliff Cai <cliff.cai@analog.com>
-Message-ID: <1264642804-2093-1-git-send-email-vapier@gentoo.org>
-
+Cc: uclinux-dist-devel@blackfin.uclinux.org, Greg Kroah-Hartman <gregkh@suse.de>, Cliff Cai <cliff.cai@analog.com>, Felipe Balbi <felipe.balbi@nokia.com>
+Message-ID: <1264729424-22025-1-git-send-email-vapier@gentoo.org>
From: Cliff Cai <cliff.cai@analog.com>
@@ -13,26 +12,63 @@ All current Blackfin parts are using RTL v1.9, but they don't expose the
hardware registers to probe this dynamically. So hardcode the version to
v1.9 for now.
+Need to move the local hwvers related defines higher up in the header so
+that sub-musb headers may utilize them.
+
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-Cc: Felipe Balbi <felipe.balbi@nokia.com>
+Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
- drivers/usb/musb/musb_regs.h | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
+ drivers/usb/musb/musb_core.h | 16 +++++++++-------
+ drivers/usb/musb/musb_regs.h | 6 +++++-
+ 2 files changed, 14 insertions(+), 8 deletions(-)
+--- a/drivers/usb/musb/musb_core.h
++++ b/drivers/usb/musb/musb_core.h
+@@ -52,6 +52,15 @@ struct musb;
+ struct musb_hw_ep;
+ struct musb_ep;
+
++/* Helper defines for struct musb->hwvers */
++#define MUSB_HWVERS_MAJOR(x) ((x >> 10) & 0x1f)
++#define MUSB_HWVERS_MINOR(x) (x & 0x3ff)
++#define MUSB_HWVERS_RC 0x8000
++#define MUSB_HWVERS_1300 0x52C
++#define MUSB_HWVERS_1400 0x590
++#define MUSB_HWVERS_1800 0x720
++#define MUSB_HWVERS_1900 0x784
++#define MUSB_HWVERS_2000 0x800
+
+ #include "musb_debug.h"
+ #include "musb_dma.h"
+@@ -322,13 +331,6 @@ struct musb {
+ struct clk *clock;
+ irqreturn_t (*isr)(int, void *);
+ struct work_struct irq_work;
+-#define MUSB_HWVERS_MAJOR(x) ((x >> 10) & 0x1f)
+-#define MUSB_HWVERS_MINOR(x) (x & 0x3ff)
+-#define MUSB_HWVERS_RC 0x8000
+-#define MUSB_HWVERS_1300 0x52C
+-#define MUSB_HWVERS_1400 0x590
+-#define MUSB_HWVERS_1800 0x720
+-#define MUSB_HWVERS_2000 0x800
+ u16 hwvers;
+
+ /* this hub status bit is reserved by USB 2.0 and not seen by usbcore */
--- a/drivers/usb/musb/musb_regs.h
+++ b/drivers/usb/musb/musb_regs.h
-@@ -533,7 +533,10 @@ static inline u8 musb_read_configdata(vo
+@@ -533,7 +533,11 @@ static inline u8 musb_read_configdata(vo
static inline u16 musb_read_hwvers(void __iomem *mbase)
{
- return 0;
-+ /* This register is invisible on Blackfin, actually the MUSB
-+ * RTL version of Blackfin is 1.9, So just set it's value to 1.9.
++ /*
++ * This register is invisible on Blackfin, actually the MUSB
++ * RTL version of Blackfin is 1.9, so just harcode its value.
+ */
-+ return 1 << 10 | 9;
++ return MUSB_HWVERS_1900;
}
static inline void __iomem *musb_read_target_reg_base(u8 i, void __iomem *mbase)