diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-09-01 15:50:45 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-09-01 15:50:45 -0700 |
| commit | 26c7e2f47241d049ca0c963cda1c987bbdd2687e (patch) | |
| tree | 66448d1774a1280fa29229b9c8f245f39d897005 | |
| parent | a673f25b4013b7b6484ef935ce5a63dc5a248a7e (diff) | |
| download | patches-26c7e2f47241d049ca0c963cda1c987bbdd2687e.tar.gz | |
more patches
9 files changed, 771 insertions, 1 deletions
diff --git a/driver-core/driver-core-platform_bus-allow-runtime-override-of-dev_pm_ops.patch b/driver-core/driver-core-platform_bus-allow-runtime-override-of-dev_pm_ops.patch new file mode 100644 index 00000000000000..27ec4472e8ee03 --- /dev/null +++ b/driver-core/driver-core-platform_bus-allow-runtime-override-of-dev_pm_ops.patch @@ -0,0 +1,97 @@ +From khilman@deeprootsystems.com Wed Sep 1 15:33:18 2010 +From: Kevin Hilman <khilman@deeprootsystems.com> +To: Grant Likely <grant.likely@secretlab.ca> +Cc: linux-kernel@vger.kernel.org, + Magnus Damm <magnus.damm@gmail.com>, + Greg Kroah-Hartman <gregkh@suse.de>, + Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= <u.kleine-koenig@pengutronix.de>, + Paul Mundt <lethal@linux-sh.org>, Magnus Damm <damm@opensource.se>, + Eric Miao <eric.y.miao@gmail.com>, netdev@vger.kernel.org +Subject: driver core: platform_bus: allow runtime override of dev_pm_ops +Date: Wed, 25 Aug 2010 12:50:00 -0700 +Message-ID: <871v9mfp5j.fsf@deeprootsystems.com> + +From: Kevin Hilman <khilman@ti.com> + +Currently, the platform_bus allows customization of several of the +busses dev_pm_ops methods by using weak symbols so that platform code +can override them. The weak-symbol approach is not scalable when +wanting to support multiple platforms in a single kernel binary. + +Instead, provide __init methods for platform code to customize the +dev_pm_ops methods at runtime. + +NOTE: after these dynamic methods are merged, the weak symbols should + be removed from drivers/base/platform.c. AFAIK, this will only + affect SH and sh-mobile which should be converted to use this + runtime approach instead of the weak symbols. After SH & + sh-mobile are converted, the weak symobols could be removed. + +Tested on OMAP3. + +Cc: Magnus Damm <magnus.damm@gmail.com> +Acked-by: Grant Likely <grant.likely@secretlab.ca> +Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/base/platform.c | 35 +++++++++++++++++++++++++++++++++++ + include/linux/platform_device.h | 3 +++ + 2 files changed, 38 insertions(+) + +--- a/drivers/base/platform.c ++++ b/drivers/base/platform.c +@@ -976,6 +976,41 @@ struct bus_type platform_bus_type = { + }; + EXPORT_SYMBOL_GPL(platform_bus_type); + ++/** ++ * platform_bus_get_pm_ops() - return pointer to busses dev_pm_ops ++ * ++ * This function can be used by platform code to get the current ++ * set of dev_pm_ops functions used by the platform_bus_type. ++ */ ++const struct dev_pm_ops * __init platform_bus_get_pm_ops(void) ++{ ++ return platform_bus_type.pm; ++} ++ ++/** ++ * platform_bus_set_pm_ops() - update dev_pm_ops for the platform_bus_type ++ * ++ * @pm: pointer to new dev_pm_ops struct to be used for platform_bus_type ++ * ++ * Platform code can override the dev_pm_ops methods of ++ * platform_bus_type by using this function. It is expected that ++ * platform code will first do a platform_bus_get_pm_ops(), then ++ * kmemdup it, then customize selected methods and pass a pointer to ++ * the new struct dev_pm_ops to this function. ++ * ++ * Since platform-specific code is customizing methods for *all* ++ * devices (not just platform-specific devices) it is expected that ++ * any custom overrides of these functions will keep existing behavior ++ * and simply extend it. For example, any customization of the ++ * runtime PM methods should continue to call the pm_generic_* ++ * functions as the default ones do in addition to the ++ * platform-specific behavior. ++ */ ++void __init platform_bus_set_pm_ops(const struct dev_pm_ops *pm) ++{ ++ platform_bus_type.pm = pm; ++} ++ + int __init platform_bus_init(void) + { + int error; +--- a/include/linux/platform_device.h ++++ b/include/linux/platform_device.h +@@ -138,6 +138,9 @@ extern struct platform_device *platform_ + struct resource *res, unsigned int n_res, + const void *data, size_t size); + ++extern const struct dev_pm_ops * platform_bus_get_pm_ops(void); ++extern void platform_bus_set_pm_ops(const struct dev_pm_ops *pm); ++ + /* early platform driver interface */ + struct early_platform_driver { + const char *class_str; @@ -32,6 +32,10 @@ usb.current/usb-cp210x-add-b-g-h3000-link-cable-id.patch usb.current/usb-cp210x-usb-driver-add-usb_device-for-pirelli-dp-l10-mobile.patch usb.current/usb-allow-drivers-to-use-allocated-bandwidth-until-unbound.patch usb.current/usb-ssu100-turn-off-debug-flag.patch +usb.current/usb-serial-mos7840-add-usb-id-to-support-the-b-b-electronics-usoptl4-2p.patch +usb.current/usb-cdc-acm-adding-second-acm-channel-support-for-various-nokia-and-one-samsung-phones.patch +usb.current/usb-serial-mos7840-add-usb-ids-to-support-more-b-b-usb-rs485-converters.patch +usb.current/usb-cxacru-use-a-bulk-int-urb-to-access-the-command-endpoint.patch ################################# @@ -63,6 +67,7 @@ driver-core/dynamic-debug-initialize-dynamic-debug-earlier-via-arch_initcall.pat driver-core/dynamic-debug-introduce-global-fake-module-param-module.ddebug.patch driver-core/driver-core-platform-use-drv-driver.bus-instead-of-assuming-platform_bus_type.patch driver-core/uio-do-not-use-pci-resources-before-pci_enable_device.patch +driver-core/driver-core-platform_bus-allow-runtime-override-of-dev_pm_ops.patch # can we really drop it? (nope, not yet...) #driver-core/driver-core-remove-config_sysfs_deprecated.patch @@ -87,6 +92,7 @@ tty/ioctl-use-asm-generic-ioctls-h-on-mn10300 tty/ioctl-use-asm-generic-ioctls-h-on-s390 tty/serial-core-skip-call-set_termios-console_start-when-no_console_suspend.patch tty/serial-core-restore-termios-settings-when-resume-console-ports.patch +tty/add-ttyprintk-driver.patch ################################### @@ -115,7 +121,8 @@ usb/usb-gadget-don-t-save-bind-callback-in-struct-usb_gadget_driver.patch usb/usb-gadget-don-t-save-bind-callback-in-struct-usb_composite_driver.patch usb/usb-gadget-don-t-save-bind-callback-in-struct-usb_configuration.patch usb/init.h-add-some-more-documentation-to-__ref-tags.patch +usb/usb-gadget-amd5536udc.c-remove-double-test.patch +usb/usb-output-an-error-message-when-the-pipe-type-doesn-t-match-the-endpoint-type.patch # staging stuff for next is now in the staging-next tree on git.kernel.org - diff --git a/tty/add-ttyprintk-driver.patch b/tty/add-ttyprintk-driver.patch new file mode 100644 index 00000000000000..8156324bce49bf --- /dev/null +++ b/tty/add-ttyprintk-driver.patch @@ -0,0 +1,299 @@ +From samo_pogacnik@t-2.net Wed Sep 1 15:35:26 2010 +Subject: add ttyprintk driver +From: Samo Pogacnik <samo_pogacnik@t-2.net> +To: linux kernel <linux-kernel@vger.kernel.org> +Cc: linux-embedded <linux-embedded@vger.kernel.org>, + Greg KH <gregkh@suse.de>, Alan Cox <alan@lxorguk.ukuu.org.uk>, + Kay Sievers <kay.sievers@vrfy.org> +Date: Wed, 25 Aug 2010 20:44:07 +0200 +Message-Id: <1282761847.5857.9.camel@itpsd6lap> + + +Ttyprintk is a pseudo TTY driver, which allows users to make printk +messages, via output to ttyprintk device. It is possible to store +"console" messages inline with kernel messages for better analyses of +the boot process, for example. + +Signed-off-by: Samo Pogacnik <samo_pogacnik@t-2.net> +Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + Documentation/devices.txt | 1 + drivers/char/Kconfig | 15 +++ + drivers/char/Makefile | 1 + drivers/char/ttyprintk.c | 225 ++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 242 insertions(+) + +--- a/Documentation/devices.txt ++++ b/Documentation/devices.txt +@@ -239,6 +239,7 @@ Your cooperation is appreciated. + 0 = /dev/tty Current TTY device + 1 = /dev/console System console + 2 = /dev/ptmx PTY master multiplex ++ 3 = /dev/ttyprintk User messages via printk TTY device + 64 = /dev/cua0 Callout device for ttyS0 + ... + 255 = /dev/cua191 Callout device for ttyS191 +--- a/drivers/char/Kconfig ++++ b/drivers/char/Kconfig +@@ -493,6 +493,21 @@ config LEGACY_PTY_COUNT + When not in use, each legacy PTY occupies 12 bytes on 32-bit + architectures and 24 bytes on 64-bit architectures. + ++config TTY_PRINTK ++ bool "TTY driver to output user messages via printk" ++ depends on EMBEDDED ++ default n ++ ---help--- ++ If you say Y here, the support for writing user messages (i.e. ++ console messages) via printk is available. ++ ++ The feature is useful to inline user messages with kernel ++ messages. ++ In order to use this feature, you should output user messages ++ to /dev/ttyprintk or redirect console to this TTY. ++ ++ If unsure, say N. ++ + config BRIQ_PANEL + tristate 'Total Impact briQ front panel driver' + depends on PPC_CHRP +--- a/drivers/char/Makefile ++++ b/drivers/char/Makefile +@@ -12,6 +12,7 @@ obj-y += mem.o random.o tty_io.o n_tty. + obj-y += tty_mutex.o + obj-$(CONFIG_LEGACY_PTYS) += pty.o + obj-$(CONFIG_UNIX98_PTYS) += pty.o ++obj-$(CONFIG_TTY_PRINTK) += ttyprintk.o + obj-y += misc.o + obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o selection.o keyboard.o + obj-$(CONFIG_BFIN_JTAG_COMM) += bfin_jtag_comm.o +--- /dev/null ++++ b/drivers/char/ttyprintk.c +@@ -0,0 +1,225 @@ ++/* ++ * linux/drivers/char/ttyprintk.c ++ * ++ * Copyright (C) 2010 Samo Pogacnik ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the smems of the GNU General Public License as published by ++ * the Free Software Foundation; version 2 of the License. ++ */ ++ ++/* ++ * This pseudo device allows user to make printk messages. It is possible ++ * to store "console" messages inline with kernel messages for better analyses ++ * of the boot process, for example. ++ */ ++ ++#include <linux/device.h> ++#include <linux/serial.h> ++#include <linux/tty.h> ++ ++struct ttyprintk_port { ++ struct tty_port port; ++ struct mutex port_write_mutex; ++}; ++ ++static struct ttyprintk_port tpk_port; ++ ++/* ++ * Our simple preformatting supports transparent output of (time-stamped) ++ * printk messages (also suitable for logging service): ++ * - any cr is replaced by nl ++ * - adds a ttyprintk source tag in front of each line ++ * - too long message is fragmeted, with '\'nl between fragments ++ * - TPK_STR_SIZE isn't really the write_room limiting factor, bcause ++ * it is emptied on the fly during preformatting. ++ */ ++#define TPK_STR_SIZE 508 /* should be bigger then max expected line length */ ++#define TPK_MAX_ROOM 4096 /* we could assume 4K for instance */ ++static const char *tpk_tag = "[U] "; /* U for User */ ++static int tpk_curr; ++ ++static int tpk_printk(const unsigned char *buf, int count) ++{ ++ static char tmp[TPK_STR_SIZE + 4]; ++ int i = tpk_curr; ++ ++ if (buf == NULL) { ++ /* flush tmp[] */ ++ if (tpk_curr > 0) { ++ /* non nl or cr terminated message - add nl */ ++ tmp[tpk_curr + 0] = '\n'; ++ tmp[tpk_curr + 1] = '\0'; ++ printk(KERN_INFO "%s%s", tpk_tag, tmp); ++ tpk_curr = 0; ++ } ++ return i; ++ } ++ ++ for (i = 0; i < count; i++) { ++ tmp[tpk_curr] = buf[i]; ++ if (tpk_curr < TPK_STR_SIZE) { ++ switch (buf[i]) { ++ case '\r': ++ /* replace cr with nl */ ++ tmp[tpk_curr + 0] = '\n'; ++ tmp[tpk_curr + 1] = '\0'; ++ printk(KERN_INFO "%s%s", tpk_tag, tmp); ++ tpk_curr = 0; ++ if (buf[i + 1] == '\n') ++ i++; ++ break; ++ case '\n': ++ tmp[tpk_curr + 1] = '\0'; ++ printk(KERN_INFO "%s%s", tpk_tag, tmp); ++ tpk_curr = 0; ++ break; ++ default: ++ tpk_curr++; ++ } ++ } else { ++ /* end of tmp buffer reached: cut the message in two */ ++ tmp[tpk_curr + 1] = '\\'; ++ tmp[tpk_curr + 2] = '\n'; ++ tmp[tpk_curr + 3] = '\0'; ++ printk(KERN_INFO "%s%s", tpk_tag, tmp); ++ tpk_curr = 0; ++ } ++ } ++ ++ return count; ++} ++ ++/* ++ * TTY operations open function. ++ */ ++static int tpk_open(struct tty_struct *tty, struct file *filp) ++{ ++ tty->driver_data = &tpk_port; ++ ++ return tty_port_open(&tpk_port.port, tty, filp); ++} ++ ++/* ++ * TTY operations close function. ++ */ ++static void tpk_close(struct tty_struct *tty, struct file *filp) ++{ ++ struct ttyprintk_port *tpkp = tty->driver_data; ++ ++ mutex_lock(&tpkp->port_write_mutex); ++ /* flush tpk_printk buffer */ ++ tpk_printk(NULL, 0); ++ mutex_unlock(&tpkp->port_write_mutex); ++ ++ tty_port_close(&tpkp->port, tty, filp); ++} ++ ++/* ++ * TTY operations write function. ++ */ ++static int tpk_write(struct tty_struct *tty, ++ const unsigned char *buf, int count) ++{ ++ struct ttyprintk_port *tpkp = tty->driver_data; ++ int ret; ++ ++ ++ /* exclusive use of tpk_printk within this tty */ ++ mutex_lock(&tpkp->port_write_mutex); ++ ret = tpk_printk(buf, count); ++ mutex_unlock(&tpkp->port_write_mutex); ++ ++ return ret; ++} ++ ++/* ++ * TTY operations write_room function. ++ */ ++static int tpk_write_room(struct tty_struct *tty) ++{ ++ return TPK_MAX_ROOM; ++} ++ ++/* ++ * TTY operations ioctl function. ++ */ ++static int tpk_ioctl(struct tty_struct *tty, struct file *file, ++ unsigned int cmd, unsigned long arg) ++{ ++ struct ttyprintk_port *tpkp = tty->driver_data; ++ ++ if (!tpkp) ++ return -EINVAL; ++ ++ switch (cmd) { ++ /* Stop TIOCCONS */ ++ case TIOCCONS: ++ return -EOPNOTSUPP; ++ default: ++ return -ENOIOCTLCMD; ++ } ++ return 0; ++} ++ ++static const struct tty_operations ttyprintk_ops = { ++ .open = tpk_open, ++ .close = tpk_close, ++ .write = tpk_write, ++ .write_room = tpk_write_room, ++ .ioctl = tpk_ioctl, ++}; ++ ++struct tty_port_operations null_ops = { }; ++ ++static struct tty_driver *ttyprintk_driver; ++ ++static int __init ttyprintk_init(void) ++{ ++ int ret = -ENOMEM; ++ void *rp; ++ ++ ttyprintk_driver = alloc_tty_driver(1); ++ if (!ttyprintk_driver) ++ return ret; ++ ++ ttyprintk_driver->owner = THIS_MODULE; ++ ttyprintk_driver->driver_name = "ttyprintk"; ++ ttyprintk_driver->name = "ttyprintk"; ++ ttyprintk_driver->major = TTYAUX_MAJOR; ++ ttyprintk_driver->minor_start = 3; ++ ttyprintk_driver->num = 1; ++ ttyprintk_driver->type = TTY_DRIVER_TYPE_CONSOLE; ++ ttyprintk_driver->init_termios = tty_std_termios; ++ ttyprintk_driver->init_termios.c_oflag = OPOST | OCRNL | ONOCR | ONLRET; ++ ttyprintk_driver->flags = TTY_DRIVER_RESET_TERMIOS | ++ TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; ++ tty_set_operations(ttyprintk_driver, &ttyprintk_ops); ++ ++ ret = tty_register_driver(ttyprintk_driver); ++ if (ret < 0) { ++ printk(KERN_ERR "Couldn't register ttyprintk driver\n"); ++ goto error; ++ } ++ ++ /* create our unnumbered device */ ++ rp = device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 3), NULL, ++ ttyprintk_driver->name); ++ if (IS_ERR(rp)) { ++ printk(KERN_ERR "Couldn't create ttyprintk device\n"); ++ ret = PTR_ERR(rp); ++ goto error; ++ } ++ ++ tty_port_init(&tpk_port.port); ++ tpk_port.port.ops = &null_ops; ++ mutex_init(&tpk_port.port_write_mutex); ++ ++ return 0; ++ ++error: ++ put_tty_driver(ttyprintk_driver); ++ ttyprintk_driver = NULL; ++ return ret; ++} ++module_init(ttyprintk_init); diff --git a/usb.current/usb-cdc-acm-adding-second-acm-channel-support-for-various-nokia-and-one-samsung-phones.patch b/usb.current/usb-cdc-acm-adding-second-acm-channel-support-for-various-nokia-and-one-samsung-phones.patch new file mode 100644 index 00000000000000..85054c7895039b --- /dev/null +++ b/usb.current/usb-cdc-acm-adding-second-acm-channel-support-for-various-nokia-and-one-samsung-phones.patch @@ -0,0 +1,68 @@ +From linux-usb-owner@vger.kernel.org Wed Sep 1 15:40:58 2010 +From: Toby Gray <toby.gray@realvnc.com> +To: Oliver Neukum <oliver@neukum.name> +Cc: linux-usb@vger.kernel.org, Toby Gray <toby.gray@realvnc.com> +Subject: USB: cdc-acm: Adding second ACM channel support for various Nokia and one Samsung phones +Date: Wed, 1 Sep 2010 16:01:19 +0100 +Message-Id: <1283353279-18679-1-git-send-email-toby.gray@realvnc.com> + +S60 phones from Nokia and Samsung expose two ACM channels. The first is a modem +with a standard AT-command interface, which is picked up correctly by CDC-ACM. + +The second ACM port is marked as having a vendor-specific protocol. This means +that the ACM driver will not claim the second channel by default. + +This adds support for the second ACM channel for the following devices: + Nokia E63 + Nokia E75 + Nokia 6760 Slide + Nokia E52 + Nokia E55 + Nokia E72 + Nokia X6 + Nokia N97 Mini + Nokia 5800 Xpressmusic + Nokia E90 + Samsung GTi8510 (INNOV8) + +Signed-off-by: Toby Gray <toby.gray@realvnc.com> +Cc: Oliver Neukum <oliver@neukum.name> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/class/cdc-acm.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -1481,6 +1481,11 @@ static int acm_reset_resume(struct usb_i + USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, \ + USB_CDC_ACM_PROTO_VENDOR) + ++#define SAMSUNG_PCSUITE_ACM_INFO(x) \ ++ USB_DEVICE_AND_INTERFACE_INFO(0x04e7, x, \ ++ USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, \ ++ USB_CDC_ACM_PROTO_VENDOR) ++ + /* + * USB driver structure. + */ +@@ -1591,6 +1596,17 @@ static const struct usb_device_id acm_id + { NOKIA_PCSUITE_ACM_INFO(0x0108), }, /* Nokia 5320 XpressMusic 2G */ + { NOKIA_PCSUITE_ACM_INFO(0x01f5), }, /* Nokia N97, RM-505 */ + { NOKIA_PCSUITE_ACM_INFO(0x02e3), }, /* Nokia 5230, RM-588 */ ++ { NOKIA_PCSUITE_ACM_INFO(0x0178), }, /* Nokia E63 */ ++ { NOKIA_PCSUITE_ACM_INFO(0x010e), }, /* Nokia E75 */ ++ { NOKIA_PCSUITE_ACM_INFO(0x02d9), }, /* Nokia 6760 Slide */ ++ { NOKIA_PCSUITE_ACM_INFO(0x01d0), }, /* Nokia E52 */ ++ { NOKIA_PCSUITE_ACM_INFO(0x0223), }, /* Nokia E72 */ ++ { NOKIA_PCSUITE_ACM_INFO(0x0275), }, /* Nokia X6 */ ++ { NOKIA_PCSUITE_ACM_INFO(0x026c), }, /* Nokia N97 Mini */ ++ { NOKIA_PCSUITE_ACM_INFO(0x0154), }, /* Nokia 5800 XpressMusic */ ++ { NOKIA_PCSUITE_ACM_INFO(0x04ce), }, /* Nokia E90 */ ++ { NOKIA_PCSUITE_ACM_INFO(0x01d4), }, /* Nokia E55 */ ++ { SAMSUNG_PCSUITE_ACM_INFO(0x6651), }, /* Samsung GTi8510 (INNOV8) */ + + /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */ + diff --git a/usb.current/usb-cxacru-use-a-bulk-int-urb-to-access-the-command-endpoint.patch b/usb.current/usb-cxacru-use-a-bulk-int-urb-to-access-the-command-endpoint.patch new file mode 100644 index 00000000000000..9aeeb8f2fc454a --- /dev/null +++ b/usb.current/usb-cxacru-use-a-bulk-int-urb-to-access-the-command-endpoint.patch @@ -0,0 +1,72 @@ +From simon@fire.lp0.eu Wed Sep 1 15:45:04 2010 +Message-ID: <4C7E8F48.3020501@simon.arlott.org.uk> +Date: Wed, 01 Sep 2010 18:37:12 +0100 +From: Simon Arlott <simon@fire.lp0.eu> +To: Greg KH <greg@kroah.com> +Subject: USB: cxacru: Use a bulk/int URB to access the command endpoint + +The command endpoint is either a bulk or interrupt endpoint, but using +the wrong type of transfer causes an error if CONFIG_USB_DEBUG is +enabled after commit f661c6f8c67bd55e93348f160d590ff9edf08904, which +checks for this mismatch. + +Detect which type of endpoint it is and use a bulk/int URB as +appropriate. There are other function calls specifying a bulk pipe, +but usb_clear_halt doesn't use the pipe type (only the endpoint) and +usb_bulk_msg auto-detects interrupt transfers. + +Signed-off-by: Simon Arlott <simon@fire.lp0.eu> +Cc: stable <stable@kernel.org> [.34 and newer] +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/atm/cxacru.c | 24 ++++++++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) + +--- a/drivers/usb/atm/cxacru.c ++++ b/drivers/usb/atm/cxacru.c +@@ -1127,6 +1127,7 @@ static int cxacru_bind(struct usbatm_dat + { + struct cxacru_data *instance; + struct usb_device *usb_dev = interface_to_usbdev(intf); ++ struct usb_host_endpoint *cmd_ep = usb_dev->ep_in[CXACRU_EP_CMD]; + int ret; + + /* instance init */ +@@ -1171,15 +1172,34 @@ static int cxacru_bind(struct usbatm_dat + goto fail; + } + +- usb_fill_int_urb(instance->rcv_urb, ++ if (!cmd_ep) { ++ dbg("cxacru_bind: no command endpoint"); ++ ret = -ENODEV; ++ goto fail; ++ } ++ ++ if ((cmd_ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ++ == USB_ENDPOINT_XFER_INT) { ++ usb_fill_int_urb(instance->rcv_urb, + usb_dev, usb_rcvintpipe(usb_dev, CXACRU_EP_CMD), + instance->rcv_buf, PAGE_SIZE, + cxacru_blocking_completion, &instance->rcv_done, 1); + +- usb_fill_int_urb(instance->snd_urb, ++ usb_fill_int_urb(instance->snd_urb, + usb_dev, usb_sndintpipe(usb_dev, CXACRU_EP_CMD), + instance->snd_buf, PAGE_SIZE, + cxacru_blocking_completion, &instance->snd_done, 4); ++ } else { ++ usb_fill_bulk_urb(instance->rcv_urb, ++ usb_dev, usb_rcvbulkpipe(usb_dev, CXACRU_EP_CMD), ++ instance->rcv_buf, PAGE_SIZE, ++ cxacru_blocking_completion, &instance->rcv_done); ++ ++ usb_fill_bulk_urb(instance->snd_urb, ++ usb_dev, usb_sndbulkpipe(usb_dev, CXACRU_EP_CMD), ++ instance->snd_buf, PAGE_SIZE, ++ cxacru_blocking_completion, &instance->snd_done); ++ } + + mutex_init(&instance->cm_serialize); + diff --git a/usb.current/usb-serial-mos7840-add-usb-id-to-support-the-b-b-electronics-usoptl4-2p.patch b/usb.current/usb-serial-mos7840-add-usb-id-to-support-the-b-b-electronics-usoptl4-2p.patch new file mode 100644 index 00000000000000..7aea088c251c8b --- /dev/null +++ b/usb.current/usb-serial-mos7840-add-usb-id-to-support-the-b-b-electronics-usoptl4-2p.patch @@ -0,0 +1,46 @@ +From dave.ludlow@bay.ws Wed Sep 1 15:40:28 2010 +From: Dave Ludlow <dave.ludlow@bay.ws> +To: gregkh@suse.de +Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, + Dave Ludlow <dave.ludlow@bay.ws> +Subject: usb: serial: mos7840: Add USB ID to support the B&B Electronics USOPTL4-2P. +Date: Tue, 31 Aug 2010 14:26:17 -0400 +Message-Id: <1283279177-14379-1-git-send-email-dave.ludlow@bay.ws> + +Add the USB ID needed to support B&B Electronic's 2-port, optically-isolated, +powered, USB to RS485 converter. + +Signed-off-by: Dave Ludlow <dave.ludlow@bay.ws> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/mos7840.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/usb/serial/mos7840.c ++++ b/drivers/usb/serial/mos7840.c +@@ -129,6 +129,7 @@ + #define BANDB_DEVICE_ID_USOPTL4_2 0xAC42 + #define BANDB_DEVICE_ID_USOPTL4_4 0xAC44 + #define BANDB_DEVICE_ID_USOPTL2_4 0xAC24 ++#define BANDB_DEVICE_ID_USOPTL4_2P 0xBC02 + + /* This driver also supports + * ATEN UC2324 device using Moschip MCS7840 +@@ -192,6 +193,7 @@ static const struct usb_device_id moschi + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)}, ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4P)}, + {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, + {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)}, + {} /* terminating entry */ +@@ -209,6 +211,7 @@ static const struct usb_device_id moschi + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)}, ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4P)}, + {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, + {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)}, + {} /* terminating entry */ diff --git a/usb.current/usb-serial-mos7840-add-usb-ids-to-support-more-b-b-usb-rs485-converters.patch b/usb.current/usb-serial-mos7840-add-usb-ids-to-support-more-b-b-usb-rs485-converters.patch new file mode 100644 index 00000000000000..1526f84314d9b9 --- /dev/null +++ b/usb.current/usb-serial-mos7840-add-usb-ids-to-support-more-b-b-usb-rs485-converters.patch @@ -0,0 +1,95 @@ +From linux-usb-owner@vger.kernel.org Wed Sep 1 15:43:07 2010 +From: Dave Ludlow <dave.ludlow@bay.ws> +To: gregkh@suse.de +Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, + Dave Ludlow <dave.ludlow@bay.ws> +Subject: usb: serial: mos7840: Add USB IDs to support more B&B USB/RS485 converters. +Date: Wed, 1 Sep 2010 12:33:30 -0400 +Message-Id: <1283358810-9702-1-git-send-email-dave.ludlow@bay.ws> + +Add the USB IDs needed to support the B&B USOPTL4-4P, USO9ML2-2P, and +USO9ML2-4P. This patch expands and corrects a typo in the patch sent +on 08-31-2010. + +Signed-off-by: Dave Ludlow <dave.ludlow@bay.ws> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/serial/mos7840.c | 35 ++++++++++++++++++++++------------- + 1 file changed, 22 insertions(+), 13 deletions(-) + +--- a/drivers/usb/serial/mos7840.c ++++ b/drivers/usb/serial/mos7840.c +@@ -119,17 +119,20 @@ + * by making a change here, in moschip_port_id_table, and in + * moschip_id_table_combined + */ +-#define USB_VENDOR_ID_BANDB 0x0856 +-#define BANDB_DEVICE_ID_USO9ML2_2 0xAC22 +-#define BANDB_DEVICE_ID_USO9ML2_4 0xAC24 +-#define BANDB_DEVICE_ID_US9ML2_2 0xAC29 +-#define BANDB_DEVICE_ID_US9ML2_4 0xAC30 +-#define BANDB_DEVICE_ID_USPTL4_2 0xAC31 +-#define BANDB_DEVICE_ID_USPTL4_4 0xAC32 +-#define BANDB_DEVICE_ID_USOPTL4_2 0xAC42 +-#define BANDB_DEVICE_ID_USOPTL4_4 0xAC44 +-#define BANDB_DEVICE_ID_USOPTL2_4 0xAC24 +-#define BANDB_DEVICE_ID_USOPTL4_2P 0xBC02 ++#define USB_VENDOR_ID_BANDB 0x0856 ++#define BANDB_DEVICE_ID_USO9ML2_2 0xAC22 ++#define BANDB_DEVICE_ID_USO9ML2_2P 0xBC00 ++#define BANDB_DEVICE_ID_USO9ML2_4 0xAC24 ++#define BANDB_DEVICE_ID_USO9ML2_4P 0xBC01 ++#define BANDB_DEVICE_ID_US9ML2_2 0xAC29 ++#define BANDB_DEVICE_ID_US9ML2_4 0xAC30 ++#define BANDB_DEVICE_ID_USPTL4_2 0xAC31 ++#define BANDB_DEVICE_ID_USPTL4_4 0xAC32 ++#define BANDB_DEVICE_ID_USOPTL4_2 0xAC42 ++#define BANDB_DEVICE_ID_USOPTL4_2P 0xBC02 ++#define BANDB_DEVICE_ID_USOPTL4_4 0xAC44 ++#define BANDB_DEVICE_ID_USOPTL4_4P 0xBC03 ++#define BANDB_DEVICE_ID_USOPTL2_4 0xAC24 + + /* This driver also supports + * ATEN UC2324 device using Moschip MCS7840 +@@ -185,15 +188,18 @@ static const struct usb_device_id moschi + {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, + {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)}, ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2P)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)}, ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4P)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2P)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4P)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)}, +- {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4P)}, + {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, + {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)}, + {} /* terminating entry */ +@@ -203,15 +209,18 @@ static const struct usb_device_id moschi + {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, + {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)}, ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2P)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)}, ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4P)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2P)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4P)}, + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)}, +- {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4P)}, + {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, + {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)}, + {} /* terminating entry */ diff --git a/usb/usb-gadget-amd5536udc.c-remove-double-test.patch b/usb/usb-gadget-amd5536udc.c-remove-double-test.patch new file mode 100644 index 00000000000000..c9faf776c4f9c0 --- /dev/null +++ b/usb/usb-gadget-amd5536udc.c-remove-double-test.patch @@ -0,0 +1,51 @@ +From julia@diku.dk Wed Sep 1 15:38:41 2010 +Date: Sat, 28 Aug 2010 18:48:56 +0200 (CEST) +From: Julia Lawall <julia@diku.dk> +To: Dan Carpenter <error27@gmail.com> +Cc: Thomas Dahlmann <dahlmann.thomas@arcor.de>, + kernel-janitors@vger.kernel.org, + David Brownell <dbrownell@users.sourceforge.net>, + Greg Kroah-Hartman <gregkh@suse.de>, linux-geode@lists.infradead.org, + linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org +Subject: USB: gadget: amd5536udc.c: Remove double test +Message-ID: <Pine.LNX.4.64.1008281846170.13508@ask.diku.dk> + +The same expression is tested twice and the result is the same each time. +Instead test for use_dma_ppb as in the test above. + +The sematic match that finds this problem is as follows: +(http://coccinelle.lip6.fr/) + +// <smpl> +@expression@ +expression E; +@@ + +( +* E + || ... || E +| +* E + && ... && E +) +// </smpl> + +Signed-off-by: Julia Lawall <julia@diku.dk> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/gadget/amd5536udc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/gadget/amd5536udc.c ++++ b/drivers/usb/gadget/amd5536udc.c +@@ -203,7 +203,7 @@ static void print_regs(struct udc *dev) + DBG(dev, "DMA mode = PPBNDU (packet per buffer " + "WITHOUT desc. update)\n"); + dev_info(&dev->pdev->dev, "DMA mode (%s)\n", "PPBNDU"); +- } else if (use_dma && use_dma_ppb_du && use_dma_ppb_du) { ++ } else if (use_dma && use_dma_ppb && use_dma_ppb_du) { + DBG(dev, "DMA mode = PPBDU (packet per buffer " + "WITH desc. update)\n"); + dev_info(&dev->pdev->dev, "DMA mode (%s)\n", "PPBDU"); diff --git a/usb/usb-output-an-error-message-when-the-pipe-type-doesn-t-match-the-endpoint-type.patch b/usb/usb-output-an-error-message-when-the-pipe-type-doesn-t-match-the-endpoint-type.patch new file mode 100644 index 00000000000000..197d3a88435309 --- /dev/null +++ b/usb/usb-output-an-error-message-when-the-pipe-type-doesn-t-match-the-endpoint-type.patch @@ -0,0 +1,35 @@ +From simon@fire.lp0.eu Wed Sep 1 15:39:53 2010 +Message-ID: <4C7C279C.507@simon.arlott.org.uk> +Date: Mon, 30 Aug 2010 22:50:20 +0100 +From: Simon Arlott <simon@fire.lp0.eu> +To: Greg KH <greg@kroah.com> +CC: Alan Stern <stern@rowland.harvard.edu> +Subject: USB: output an error message when the pipe type doesn't match the endpoint type + +Commit f661c6f8c67bd55e93348f160d590ff9edf08904 adds a check of the pipe type if +CONFIG_USB_DEBUG is enabled, but it doesn't output anything if this scenario +occurs. + +Signed-off-by: Simon Arlott <simon@fire.lp0.eu> +Cc: Alan Stern <stern@rowland.harvard.edu> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/urb.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/usb/core/urb.c ++++ b/drivers/usb/core/urb.c +@@ -401,8 +401,11 @@ int usb_submit_urb(struct urb *urb, gfp_ + }; + + /* Check that the pipe's type matches the endpoint's type */ +- if (usb_pipetype(urb->pipe) != pipetypes[xfertype]) ++ if (usb_pipetype(urb->pipe) != pipetypes[xfertype]) { ++ dev_err(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n", ++ usb_pipetype(urb->pipe), pipetypes[xfertype]); + return -EPIPE; /* The most suitable error code :-) */ ++ } + + /* enforce simple/standard policy */ + allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT | URB_DIR_MASK | |
