diff options
9 files changed, 758 insertions, 0 deletions
@@ -21,6 +21,7 @@ tty.current/tty-fix-tty_line-must-not-be-equal-to-number-of-allocated-tty-pointe # after patches sent to linus tty.current/serial-amba-pl010-fix-set_ldisc.patch +tty.current/serial-mfd-fix-bug-in-serial_hsu_remove.patch ################################# @@ -44,6 +45,11 @@ usb.current/usb-cdc-acm-add-pseudo-modem-without-at-command-capabilities.patch usb.current/usb-cdc-acm-fixing-crash-when-acm-probing-interfaces-with-no-endpoint-descriptors.patch usb.current/usb-ftdi_sio-added-custom-pids-for-chamsys-products.patch +# after patches sent to linus +usb.current/usb-musb_debugfs-don-t-use-the-struct-file-private_data-field-with-seq_files.patch +usb.current/usb-ehci-disable-langwell-penwell-lpm-capability.patch +usb.current/usb-otg-twl4030-fix-phy-initialization-v1.patch + ################################# @@ -64,6 +70,7 @@ staging.current/staging-wlan-ng-explicitly-set-some-fields-in-cfg80211-interface # after patches sent to linus staging.current/revert-staging-batman-adv-adding-netfilter-bridge-hooks.patch +staging.current/staging-vt6655-fix-buffer-overflow.patch ##################################################################### @@ -108,6 +115,7 @@ tty/serial-core-skip-call-set_termios-console_start-when-no_console_suspend.patc tty/serial-core-restore-termios-settings-when-resume-console-ports.patch tty/add-ttyprintk-driver.patch tty/char-mxser-call-pci_disable_device-from-probe-remove.patch +tty/tty_io-check-return-code-of-tty_register_device.patch ################################### @@ -140,6 +148,9 @@ 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 usb/usb-langwell-remove-unnecessary-return-s-from-void-functions.patch usb/usb-g_file_storage-don-t-generate-automatic-serial-string.patch +usb/usb-kconfig-fix-typos-in-usb_functionfs-description.patch +usb/usb-ehci-tdi-let-s-tdi_reset-set-host-mode.patch # staging stuff for next is now in the staging-next tree on git.kernel.org + diff --git a/staging.current/staging-vt6655-fix-buffer-overflow.patch b/staging.current/staging-vt6655-fix-buffer-overflow.patch new file mode 100644 index 00000000000000..9415947a8c365f --- /dev/null +++ b/staging.current/staging-vt6655-fix-buffer-overflow.patch @@ -0,0 +1,50 @@ +From error27@gmail.com Tue Sep 7 00:45:09 2010 +From: Dan Carpenter <error27@gmail.com> +Date: Mon, 6 Sep 2010 14:32:30 +0200 +Subject: Staging: vt6655: fix buffer overflow +To: Greg Kroah-Hartman <gregkh@suse.de> +Cc: Charles Cl�ment <caratorn@gmail.com>, Jim Lieb <lieb@canonical.com>, devel@driverdev.osuosl.org, kernel-janitors@vger.kernel.org +Message-ID: <20100906123230.GB2764@bicker> +Content-Disposition: inline + + +"param->u.wpa_associate.wpa_ie_len" comes from the user. We should +check it so that the copy_from_user() doesn't overflow the buffer. + +Also further down in the function, we assume that if +"param->u.wpa_associate.wpa_ie_len" is set then "abyWPAIE[0]" is +initialized. To make that work, I changed the test here to say that if +"wpa_ie_len" is set then "wpa_ie" has to be a valid pointer or we return +-EINVAL. + +Oddly, we only use the first element of the abyWPAIE[] array. So I +suspect there may be some other issues in this function. + +Signed-off-by: Dan Carpenter <error27@gmail.com> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/vt6655/wpactl.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +--- a/drivers/staging/vt6655/wpactl.c ++++ b/drivers/staging/vt6655/wpactl.c +@@ -766,9 +766,14 @@ static int wpa_set_associate(PSDevice pD + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wpa_ie_len = %d\n", param->u.wpa_associate.wpa_ie_len); + + +- if (param->u.wpa_associate.wpa_ie && +- copy_from_user(&abyWPAIE[0], param->u.wpa_associate.wpa_ie, param->u.wpa_associate.wpa_ie_len)) +- return -EINVAL; ++ if (param->u.wpa_associate.wpa_ie_len) { ++ if (!param->u.wpa_associate.wpa_ie) ++ return -EINVAL; ++ if (param->u.wpa_associate.wpa_ie_len > sizeof(abyWPAIE)) ++ return -EINVAL; ++ if (copy_from_user(&abyWPAIE[0], param->u.wpa_associate.wpa_ie, param->u.wpa_associate.wpa_ie_len)) ++ return -EFAULT; ++ } + + if (param->u.wpa_associate.mode == 1) + pMgmt->eConfigMode = WMAC_CONFIG_IBSS_STA; diff --git a/tty.current/serial-mfd-fix-bug-in-serial_hsu_remove.patch b/tty.current/serial-mfd-fix-bug-in-serial_hsu_remove.patch new file mode 100644 index 00000000000000..5678f5606ace43 --- /dev/null +++ b/tty.current/serial-mfd-fix-bug-in-serial_hsu_remove.patch @@ -0,0 +1,59 @@ +From alan@linux.intel.com Tue Sep 7 00:48:03 2010 +From: Feng Tang <feng.tang@intel.com> +Date: Mon, 06 Sep 2010 13:41:02 +0100 +Subject: serial: mfd: fix bug in serial_hsu_remove() +To: greg@kroah.com, linux-serial@vger.kernel.org +Message-ID: <20100906124102.1596.96288.stgit@localhost.localdomain> + + +From: Feng Tang <feng.tang@intel.com> + +Medfield HSU driver deal with 4 pci devices(3 uart ports + 1 dma controller), +so in pci remove func, we need handle them differently + +Signed-off-by: Feng Tang <feng.tang@intel.com> +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/serial/mfd.c | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +--- a/drivers/serial/mfd.c ++++ b/drivers/serial/mfd.c +@@ -1423,7 +1423,6 @@ static void hsu_global_init(void) + } + + phsu = hsu; +- + hsu_debugfs_init(hsu); + return; + +@@ -1435,18 +1434,20 @@ err_free_region: + + static void serial_hsu_remove(struct pci_dev *pdev) + { +- struct hsu_port *hsu; +- int i; ++ void *priv = pci_get_drvdata(pdev); ++ struct uart_hsu_port *up; + +- hsu = pci_get_drvdata(pdev); +- if (!hsu) ++ if (!priv) + return; + +- for (i = 0; i < 3; i++) +- uart_remove_one_port(&serial_hsu_reg, &hsu->port[i].port); ++ /* For port 0/1/2, priv is the address of uart_hsu_port */ ++ if (pdev->device != 0x081E) { ++ up = priv; ++ uart_remove_one_port(&serial_hsu_reg, &up->port); ++ } + + pci_set_drvdata(pdev, NULL); +- free_irq(hsu->irq, hsu); ++ free_irq(pdev->irq, priv); + pci_disable_device(pdev); + } + diff --git a/tty/tty_io-check-return-code-of-tty_register_device.patch b/tty/tty_io-check-return-code-of-tty_register_device.patch new file mode 100644 index 00000000000000..19565ac31ae899 --- /dev/null +++ b/tty/tty_io-check-return-code-of-tty_register_device.patch @@ -0,0 +1,64 @@ +From segooon@gmail.com Tue Sep 7 00:46:50 2010 +From: Kulikov Vasiliy <segooon@gmail.com> +Date: Sun, 5 Sep 2010 22:32:22 +0400 +Subject: tty_io: check return code of tty_register_device +To: kernel-janitors@vger.kernel.org +Cc: Vasiliy Kulikov <segooon@gmail.com>, Greg Kroah-Hartman <gregkh@suse.de>, Alan Cox <alan@linux.intel.com>, Arnd Bergmann <arnd@arndb.de>, Al Viro <viro@zeniv.linux.org.uk>, Nick Piggin <npiggin@kernel.dk>, linux-kernel@vger.kernel.org +Message-ID: <1283711542-7164-1-git-send-email-segooon@gmail.com> + + +From: Vasiliy Kulikov <segooon@gmail.com> + +Function tty_register_device may return ERR_PTR(...). Check for it. + +Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/char/tty_io.c | 24 ++++++++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) + +--- a/drivers/char/tty_io.c ++++ b/drivers/char/tty_io.c +@@ -3004,6 +3004,7 @@ int tty_register_driver(struct tty_drive + int i; + dev_t dev; + void **p = NULL; ++ struct device *d; + + if (!(driver->flags & TTY_DRIVER_DEVPTS_MEM) && driver->num) { + p = kzalloc(driver->num * 2 * sizeof(void *), GFP_KERNEL); +@@ -3051,12 +3052,31 @@ int tty_register_driver(struct tty_drive + mutex_unlock(&tty_mutex); + + if (!(driver->flags & TTY_DRIVER_DYNAMIC_DEV)) { +- for (i = 0; i < driver->num; i++) +- tty_register_device(driver, i, NULL); ++ for (i = 0; i < driver->num; i++) { ++ d = tty_register_device(driver, i, NULL); ++ if (IS_ERR(d)) { ++ error = PTR_ERR(d); ++ goto err; ++ } ++ } + } + proc_tty_register_driver(driver); + driver->flags |= TTY_DRIVER_INSTALLED; + return 0; ++ ++err: ++ for (i--; i >= 0; i--) ++ tty_unregister_device(driver, i); ++ ++ mutex_lock(&tty_mutex); ++ list_del(&driver->tty_drivers); ++ mutex_unlock(&tty_mutex); ++ ++ unregister_chrdev_region(dev, driver->num); ++ driver->ttys = NULL; ++ driver->termios = NULL; ++ kfree(p); ++ return error; + } + + EXPORT_SYMBOL(tty_register_driver); diff --git a/usb.current/usb-ehci-disable-langwell-penwell-lpm-capability.patch b/usb.current/usb-ehci-disable-langwell-penwell-lpm-capability.patch new file mode 100644 index 00000000000000..de57de40b10f93 --- /dev/null +++ b/usb.current/usb-ehci-disable-langwell-penwell-lpm-capability.patch @@ -0,0 +1,36 @@ +From alan@linux.intel.com Tue Sep 7 00:49:05 2010 +From: Alek Du <alek.du@intel.com> +Date: Mon, 06 Sep 2010 14:50:57 +0100 +Subject: USB: EHCI: Disable langwell/penwell LPM capability +To: linux-usb@vger.kernel.org +Message-ID: <20100906135040.4591.72919.stgit@localhost.localdomain> + + +From: Alek Du <alek.du@intel.com> + +We have to do so due to HW limitation. + +Signed-off-by: Alek Du <alek.du@intel.com> +Signed-off-by: Alan Cox <alan@linux.intel.com> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/host/ehci-pci.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/usb/host/ehci-pci.c ++++ b/drivers/usb/host/ehci-pci.c +@@ -119,6 +119,11 @@ static int ehci_pci_setup(struct usb_hcd + ehci->broken_periodic = 1; + ehci_info(ehci, "using broken periodic workaround\n"); + } ++ if (pdev->device == 0x0806 || pdev->device == 0x0811 ++ || pdev->device == 0x0829) { ++ ehci_info(ehci, "disable lpm for langwell/penwell\n"); ++ ehci->has_lpm = 0; ++ } + break; + case PCI_VENDOR_ID_TDI: + if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { diff --git a/usb.current/usb-musb_debugfs-don-t-use-the-struct-file-private_data-field-with-seq_files.patch b/usb.current/usb-musb_debugfs-don-t-use-the-struct-file-private_data-field-with-seq_files.patch new file mode 100644 index 00000000000000..6864da9be83596 --- /dev/null +++ b/usb.current/usb-musb_debugfs-don-t-use-the-struct-file-private_data-field-with-seq_files.patch @@ -0,0 +1,41 @@ +From mathias.nyman@nokia.com Tue Sep 7 00:45:41 2010 +From: Mathias Nyman <mathias.nyman@nokia.com> +Date: Mon, 6 Sep 2010 13:52:01 +0300 +Subject: usb: musb_debugfs: don't use the struct file private_data field with seq_files +To: linux-usb@vger.kernel.org +Cc: Mathias Nyman <mathias.nyman@nokia.com> +Message-ID: <1283770321-16903-1-git-send-email-mathias.nyman@nokia.com> + + +seq_files use the private_data field of a file struct for storing a seq_file structure, +data should be stored in seq_file's own private field (e.g. file->private_data->private) +Otherwise seq_release() will free the private data when the file is closed. + +Signed-off-by: Mathias Nyman <mathias.nyman@nokia.com> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/musb/musb_debugfs.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/drivers/usb/musb/musb_debugfs.c ++++ b/drivers/usb/musb/musb_debugfs.c +@@ -195,15 +195,14 @@ static const struct file_operations musb + + 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; ++ struct seq_file *s = file->private_data; ++ struct musb *musb = s->private; + u8 test = 0; + char buf[18]; + diff --git a/usb.current/usb-otg-twl4030-fix-phy-initialization-v1.patch b/usb.current/usb-otg-twl4030-fix-phy-initialization-v1.patch new file mode 100644 index 00000000000000..2dc026f5ebdbe2 --- /dev/null +++ b/usb.current/usb-otg-twl4030-fix-phy-initialization-v1.patch @@ -0,0 +1,287 @@ +From tom.leiming@gmail.com Tue Sep 7 00:49:51 2010 +From: tom.leiming@gmail.com +Date: Mon, 6 Sep 2010 23:27:09 +0800 +Subject: USB: otg: twl4030: fix phy initialization(v1) +To: greg@kroah.com +Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Ming Lei <tom.leiming@gmail.com>, David Brownell <dbrownell@users.sourceforge.net>, Felipe Balbi <me@felipebalbi.com>, Anand Gadiyar <gadiyar@ti.com>, Mike Frysinger <vapier@gentoo.org>, Sergei Shtylyov <sshtylyov@ru.mvista.com> +Message-ID: <1283786829-3564-1-git-send-email-tom.leiming@gmail.com> + + +From: Ming Lei <tom.leiming@gmail.com> + +Commit 461c317705eca5cac09a360f488715927fd0a927(into 2.6.36-v3) +is put forward to power down phy if no usb cable is connected, +but does introduce the two issues below: + +1), phy is not into work state if usb cable is connected +with PC during poweron, so musb device mode is not usable +in such case, follows the reasons: + -twl4030_phy_resume is not called, so + regulators are not enabled + i2c access are not enabled + usb mode not configurated + +2), The kernel warings[1] of regulators 'unbalanced disables' +is caused if poweron without usb cable connected +with PC or b-device. + +This patch fixes the two issues above: + -power down phy only if no usb cable is connected with PC +and b-device + -do phy initialization(via __twl4030_phy_resume) if usb cable +is connected with PC(vbus event) or another b-device(ID event) in +twl4030_usb_probe. + +This patch also doesn't put VUSB3V1 LDO into active mode in +twl4030_usb_ldo_init until VBUS/ID change detected, so we can +save more power consumption than before. + +This patch is verified OK on Beagle board either connected with +usb cable or not when poweron. + +[1]. warnings of 'unbalanced disables' of regulators. +[root@OMAP3EVM /]# dmesg +------------[ cut here ]------------ +WARNING: at drivers/regulator/core.c:1357 _regulator_disable+0x38/0x128() +unbalanced disables for VUSB1V8 +Modules linked in: +Backtrace: +[<c0030c48>] (dump_backtrace+0x0/0x110) from [<c034f5a8>] (dump_stack+0x18/0x1c) + r7:c78179d8 r6:c01ed6b8 r5:c0410822 r4:0000054d +[<c034f590>] (dump_stack+0x0/0x1c) from [<c0057da8>] (warn_slowpath_common+0x54/0x6c) +[<c0057d54>] (warn_slowpath_common+0x0/0x6c) from [<c0057e64>] (warn_slowpath_fmt+0x38/0x40) + r9:00000000 r8:00000000 r7:c78e6608 r6:00000000 r5:fffffffb + r4:c78e6c00 +[<c0057e2c>] (warn_slowpath_fmt+0x0/0x40) from [<c01ed6b8>] (_regulator_disable+0x38/0x128) + r3:c0410e53 r2:c0410ad5 +[<c01ed680>] (_regulator_disable+0x0/0x128) from [<c01ed87c>] (regulator_disable+0x24/0x38) + r7:c78e6608 r6:00000000 r5:c78e6c40 r4:c78e6c00 +[<c01ed858>] (regulator_disable+0x0/0x38) from [<c02382dc>] (twl4030_phy_power+0x15c/0x17c) + r5:c78595c0 r4:00000000 +[<c0238180>] (twl4030_phy_power+0x0/0x17c) from [<c023831c>] (twl4030_phy_suspend+0x20/0x2c) + r6:00000000 r5:c78595c0 r4:c78595c0 +[<c02382fc>] (twl4030_phy_suspend+0x0/0x2c) from [<c0238638>] (twl4030_usb_irq+0x11c/0x16c) + r5:c78595c0 r4:00000040 +[<c023851c>] (twl4030_usb_irq+0x0/0x16c) from [<c034ec18>] (twl4030_usb_probe+0x2c4/0x32c) + r6:00000000 r5:00000000 r4:c78595c0 +[<c034e954>] (twl4030_usb_probe+0x0/0x32c) from [<c02152a0>] (platform_drv_probe+0x20/0x24) + r7:00000000 r6:c047d49c r5:c78e6608 r4:c047d49c +[<c0215280>] (platform_drv_probe+0x0/0x24) from [<c0214244>] (driver_probe_device+0xd0/0x190) +[<c0214174>] (driver_probe_device+0x0/0x190) from [<c02143d4>] (__device_attach+0x44/0x48) + r7:00000000 r6:c78e6608 r5:c78e6608 r4:c047d49c +[<c0214390>] (__device_attach+0x0/0x48) from [<c0213694>] (bus_for_each_drv+0x50/0x90) + r5:c0214390 r4:00000000 +[<c0213644>] (bus_for_each_drv+0x0/0x90) from [<c0214474>] (device_attach+0x70/0x94) + r6:c78e663c r5:c78e6608 r4:c78e6608 +[<c0214404>] (device_attach+0x0/0x94) from [<c02134fc>] (bus_probe_device+0x2c/0x48) + r7:00000000 r6:00000002 r5:c78e6608 r4:c78e6600 +[<c02134d0>] (bus_probe_device+0x0/0x48) from [<c0211e48>] (device_add+0x340/0x4b4) +[<c0211b08>] (device_add+0x0/0x4b4) from [<c021597c>] (platform_device_add+0x110/0x16c) +[<c021586c>] (platform_device_add+0x0/0x16c) from [<c0220cb0>] (add_numbered_child+0xd8/0x118) + r7:00000000 r6:c045f15c r5:c78e6600 r4:00000000 +[<c0220bd8>] (add_numbered_child+0x0/0x118) from [<c001c618>] (twl_probe+0x3a4/0x72c) +[<c001c274>] (twl_probe+0x0/0x72c) from [<c02601ac>] (i2c_device_probe+0x7c/0xa4) +[<c0260130>] (i2c_device_probe+0x0/0xa4) from [<c0214244>] (driver_probe_device+0xd0/0x190) + r5:c7856e20 r4:c047c860 +[<c0214174>] (driver_probe_device+0x0/0x190) from [<c02143d4>] (__device_attach+0x44/0x48) + r7:c7856e04 r6:c7856e20 r5:c7856e20 r4:c047c860 +[<c0214390>] (__device_attach+0x0/0x48) from [<c0213694>] (bus_for_each_drv+0x50/0x90) + r5:c0214390 r4:00000000 +[<c0213644>] (bus_for_each_drv+0x0/0x90) from [<c0214474>] (device_attach+0x70/0x94) + r6:c7856e54 r5:c7856e20 r4:c7856e20 +[<c0214404>] (device_attach+0x0/0x94) from [<c02134fc>] (bus_probe_device+0x2c/0x48) + r7:c7856e04 r6:c78fd048 r5:c7856e20 r4:c7856e20 +[<c02134d0>] (bus_probe_device+0x0/0x48) from [<c0211e48>] (device_add+0x340/0x4b4) +[<c0211b08>] (device_add+0x0/0x4b4) from [<c0211fd8>] (device_register+0x1c/0x20) +[<c0211fbc>] (device_register+0x0/0x20) from [<c0260aa8>] (i2c_new_device+0xec/0x150) + r5:c7856e00 r4:c7856e20 +[<c02609bc>] (i2c_new_device+0x0/0x150) from [<c0260dc0>] (i2c_register_adapter+0xa0/0x1c4) + r7:00000000 r6:c78fd078 r5:c78fd048 r4:c781d5c0 +[<c0260d20>] (i2c_register_adapter+0x0/0x1c4) from [<c0260f80>] (i2c_add_numbered_adapter+0x9c/0xb4) + r7:00000a28 r6:c04600a8 r5:c78fd048 r4:00000000 +[<c0260ee4>] (i2c_add_numbered_adapter+0x0/0xb4) from [<c034efa4>] (omap_i2c_probe+0x324/0x3e8) + r5:00000000 r4:c78fd000 +[<c034ec80>] (omap_i2c_probe+0x0/0x3e8) from [<c02152a0>] (platform_drv_probe+0x20/0x24) +[<c0215280>] (platform_drv_probe+0x0/0x24) from [<c0214244>] (driver_probe_device+0xd0/0x190) +[<c0214174>] (driver_probe_device+0x0/0x190) from [<c021436c>] (__driver_attach+0x68/0x8c) + r7:c78b2140 r6:c047e214 r5:c04600e4 r4:c04600b0 +[<c0214304>] (__driver_attach+0x0/0x8c) from [<c021399c>] (bus_for_each_dev+0x50/0x84) + r7:c78b2140 r6:c047e214 r5:c0214304 r4:00000000 +[<c021394c>] (bus_for_each_dev+0x0/0x84) from [<c0214068>] (driver_attach+0x20/0x28) + r6:c047e214 r5:c047e214 r4:c00270d0 +[<c0214048>] (driver_attach+0x0/0x28) from [<c0213274>] (bus_add_driver+0xa8/0x228) +[<c02131cc>] (bus_add_driver+0x0/0x228) from [<c02146a4>] (driver_register+0xb0/0x13c) +[<c02145f4>] (driver_register+0x0/0x13c) from [<c0215744>] (platform_driver_register+0x4c/0x60) + r9:00000000 r8:c001f688 r7:00000013 r6:c005b6fc r5:c00083dc +r4:c00270d0 +[<c02156f8>] (platform_driver_register+0x0/0x60) from [<c001f69c>] (omap_i2c_init_driver+0x14/0x1c) +[<c001f688>] (omap_i2c_init_driver+0x0/0x1c) from [<c002c460>] (do_one_initcall+0xd0/0x1a4) +[<c002c390>] (do_one_initcall+0x0/0x1a4) from [<c0008478>] (kernel_init+0x9c/0x154) +[<c00083dc>] (kernel_init+0x0/0x154) from [<c005b6fc>] (do_exit+0x0/0x688) + r5:c00083dc r4:00000000 +---[ end trace 1b75b31a2719ed1d ]--- + +Signed-off-by: Ming Lei <tom.leiming@gmail.com> +Cc: David Brownell <dbrownell@users.sourceforge.net> +Cc: Felipe Balbi <me@felipebalbi.com> +Cc: Anand Gadiyar <gadiyar@ti.com> +Cc: Mike Frysinger <vapier@gentoo.org> +Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/otg/twl4030-usb.c | 78 +++++++++++++++++++++++++++--------------- + 1 file changed, 51 insertions(+), 27 deletions(-) + +--- a/drivers/usb/otg/twl4030-usb.c ++++ b/drivers/usb/otg/twl4030-usb.c +@@ -347,11 +347,20 @@ static void twl4030_i2c_access(struct tw + } + } + +-static void twl4030_phy_power(struct twl4030_usb *twl, int on) ++static void __twl4030_phy_power(struct twl4030_usb *twl, int on) + { +- u8 pwr; ++ u8 pwr = twl4030_usb_read(twl, PHY_PWR_CTRL); ++ ++ if (on) ++ pwr &= ~PHY_PWR_PHYPWD; ++ else ++ pwr |= PHY_PWR_PHYPWD; + +- pwr = twl4030_usb_read(twl, PHY_PWR_CTRL); ++ WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0); ++} ++ ++static void twl4030_phy_power(struct twl4030_usb *twl, int on) ++{ + if (on) { + regulator_enable(twl->usb3v1); + regulator_enable(twl->usb1v8); +@@ -365,15 +374,13 @@ static void twl4030_phy_power(struct twl + twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, + VUSB_DEDICATED2); + regulator_enable(twl->usb1v5); +- pwr &= ~PHY_PWR_PHYPWD; +- WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0); ++ __twl4030_phy_power(twl, 1); + twl4030_usb_write(twl, PHY_CLK_CTRL, + twl4030_usb_read(twl, PHY_CLK_CTRL) | + (PHY_CLK_CTRL_CLOCKGATING_EN | + PHY_CLK_CTRL_CLK32K_EN)); +- } else { +- pwr |= PHY_PWR_PHYPWD; +- WARN_ON(twl4030_usb_write_verify(twl, PHY_PWR_CTRL, pwr) < 0); ++ } else { ++ __twl4030_phy_power(twl, 0); + regulator_disable(twl->usb1v5); + regulator_disable(twl->usb1v8); + regulator_disable(twl->usb3v1); +@@ -387,19 +394,25 @@ static void twl4030_phy_suspend(struct t + + twl4030_phy_power(twl, 0); + twl->asleep = 1; ++ dev_dbg(twl->dev, "%s\n", __func__); + } + +-static void twl4030_phy_resume(struct twl4030_usb *twl) ++static void __twl4030_phy_resume(struct twl4030_usb *twl) + { +- if (!twl->asleep) +- return; +- + twl4030_phy_power(twl, 1); + twl4030_i2c_access(twl, 1); + twl4030_usb_set_mode(twl, twl->usb_mode); + if (twl->usb_mode == T2_USB_MODE_ULPI) + twl4030_i2c_access(twl, 0); ++} ++ ++static void twl4030_phy_resume(struct twl4030_usb *twl) ++{ ++ if (!twl->asleep) ++ return; ++ __twl4030_phy_resume(twl); + twl->asleep = 0; ++ dev_dbg(twl->dev, "%s\n", __func__); + } + + static int twl4030_usb_ldo_init(struct twl4030_usb *twl) +@@ -408,8 +421,8 @@ static int twl4030_usb_ldo_init(struct t + twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0xC0, PROTECT_KEY); + twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0x0C, PROTECT_KEY); + +- /* put VUSB3V1 LDO in active state */ +- twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2); ++ /* Keep VUSB3V1 LDO in sleep state until VBUS/ID change detected*/ ++ /*twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2);*/ + + /* input to VUSB3V1 LDO is from VBAT, not VBUS */ + twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x14, VUSB_DEDICATED1); +@@ -502,6 +515,26 @@ static irqreturn_t twl4030_usb_irq(int i + return IRQ_HANDLED; + } + ++static void twl4030_usb_phy_init(struct twl4030_usb *twl) ++{ ++ int status; ++ ++ status = twl4030_usb_linkstat(twl); ++ if (status >= 0) { ++ if (status == USB_EVENT_NONE) { ++ __twl4030_phy_power(twl, 0); ++ twl->asleep = 1; ++ } else { ++ __twl4030_phy_resume(twl); ++ twl->asleep = 0; ++ } ++ ++ blocking_notifier_call_chain(&twl->otg.notifier, status, ++ twl->otg.gadget); ++ } ++ sysfs_notify(&twl->dev->kobj, NULL, "vbus"); ++} ++ + static int twl4030_set_suspend(struct otg_transceiver *x, int suspend) + { + struct twl4030_usb *twl = xceiv_to_twl(x); +@@ -550,7 +583,6 @@ static int __devinit twl4030_usb_probe(s + struct twl4030_usb_data *pdata = pdev->dev.platform_data; + struct twl4030_usb *twl; + int status, err; +- u8 pwr; + + if (!pdata) { + dev_dbg(&pdev->dev, "platform_data not available\n"); +@@ -569,10 +601,7 @@ static int __devinit twl4030_usb_probe(s + twl->otg.set_peripheral = twl4030_set_peripheral; + twl->otg.set_suspend = twl4030_set_suspend; + twl->usb_mode = pdata->usb_mode; +- +- pwr = twl4030_usb_read(twl, PHY_PWR_CTRL); +- +- twl->asleep = (pwr & PHY_PWR_PHYPWD); ++ twl->asleep = 1; + + /* init spinlock for workqueue */ + spin_lock_init(&twl->lock); +@@ -610,15 +639,10 @@ static int __devinit twl4030_usb_probe(s + return status; + } + +- /* The IRQ handler just handles changes from the previous states +- * of the ID and VBUS pins ... in probe() we must initialize that +- * previous state. The easy way: fake an IRQ. +- * +- * REVISIT: a real IRQ might have happened already, if PREEMPT is +- * enabled. Else the IRQ may not yet be configured or enabled, +- * because of scheduling delays. ++ /* Power down phy or make it work according to ++ * current link state. + */ +- twl4030_usb_irq(twl->irq, twl); ++ twl4030_usb_phy_init(twl); + + dev_info(&pdev->dev, "Initialized TWL4030 USB module\n"); + return 0; diff --git a/usb/usb-ehci-tdi-let-s-tdi_reset-set-host-mode.patch b/usb/usb-ehci-tdi-let-s-tdi_reset-set-host-mode.patch new file mode 100644 index 00000000000000..d2906fe4d1f1c9 --- /dev/null +++ b/usb/usb-ehci-tdi-let-s-tdi_reset-set-host-mode.patch @@ -0,0 +1,157 @@ +From matthieu.castet@parrot.com Tue Sep 7 00:48:29 2010 +From: Matthieu CASTET <matthieu.castet@parrot.com> +Date: Mon, 6 Sep 2010 18:26:56 +0200 +Subject: USB: ehci tdi : let's tdi_reset set host mode +To: Alan Stern <stern@rowland.harvard.edu> +Message-ID: <4C851650.50300@parrot.com> + + +tdi_reset is already taking care of setting host mode for tdi devices. +Don't duplicate code in platform driver. + +Make ehci_halt a nop if the controller is not in host mode (otherwise it +will fail), and let's ehci_reset do the tdi_reset. +We need to move hcd->has_tt flags before ehci_halt, in order ehci_halt +knows we are a tdi device. + + +Before the setup routine was doing : +- put controller in host mode +- ehci_halt +- ehci_init +- hcd->has_tt = 1; +- ehci_reset + +Now we do : +- hcd->has_tt = 1; +- ehci_halt +- ehci_init +- ehci_reset + +PS : now we handle correctly the device -> host transition. + +Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com> +Cc: Alan Stern <stern@rowland.harvard.edu> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/ehci-fsl.c | 6 ++---- + drivers/usb/host/ehci-fsl.h | 1 - + drivers/usb/host/ehci-hcd.c | 15 +++++++++++++++ + drivers/usb/host/ehci-mxc.c | 13 +++---------- + 4 files changed, 20 insertions(+), 15 deletions(-) + +--- a/drivers/usb/host/ehci-fsl.c ++++ b/drivers/usb/host/ehci-fsl.c +@@ -233,8 +233,6 @@ static void mpc83xx_usb_setup(struct usb + mpc83xx_setup_phy(ehci, pdata->phy_mode, 1); + } + +- /* put controller in host mode. */ +- ehci_writel(ehci, 0x00000003, non_ehci + FSL_SOC_USB_USBMODE); + #ifdef CONFIG_PPC_85xx + out_be32(non_ehci + FSL_SOC_USB_PRICTRL, 0x00000008); + out_be32(non_ehci + FSL_SOC_USB_AGECNTTHRSH, 0x00000080); +@@ -270,6 +268,8 @@ static int ehci_fsl_setup(struct usb_hcd + /* cache this readonly data; minimize chip reads */ + ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); + ++ hcd->has_tt = 1; ++ + retval = ehci_halt(ehci); + if (retval) + return retval; +@@ -279,8 +279,6 @@ static int ehci_fsl_setup(struct usb_hcd + if (retval) + return retval; + +- hcd->has_tt = 1; +- + ehci->sbrn = 0x20; + + ehci_reset(ehci); +--- a/drivers/usb/host/ehci-fsl.h ++++ b/drivers/usb/host/ehci-fsl.h +@@ -27,7 +27,6 @@ + #define PORT_PTS_SERIAL (3<<30) + #define PORT_PTS_PTW (1<<28) + #define FSL_SOC_USB_PORTSC2 0x188 +-#define FSL_SOC_USB_USBMODE 0x1a8 + #define FSL_SOC_USB_SNOOP1 0x400 /* NOTE: big-endian */ + #define FSL_SOC_USB_SNOOP2 0x404 /* NOTE: big-endian */ + #define FSL_SOC_USB_AGECNTTHRSH 0x408 /* NOTE: big-endian */ +--- a/drivers/usb/host/ehci-hcd.c ++++ b/drivers/usb/host/ehci-hcd.c +@@ -194,6 +194,17 @@ static int handshake (struct ehci_hcd *e + return -ETIMEDOUT; + } + ++/* check TDI/ARC silicon is in host mode */ ++static int tdi_in_host_mode (struct ehci_hcd *ehci) ++{ ++ u32 __iomem *reg_ptr; ++ u32 tmp; ++ ++ reg_ptr = (u32 __iomem *)(((u8 __iomem *)ehci->regs) + USBMODE); ++ tmp = ehci_readl(ehci, reg_ptr); ++ return (tmp & 3) == USBMODE_CM_HC; ++} ++ + /* force HC to halt state from unknown (EHCI spec section 2.3) */ + static int ehci_halt (struct ehci_hcd *ehci) + { +@@ -202,6 +213,10 @@ static int ehci_halt (struct ehci_hcd *e + /* disable any irqs left enabled by previous code */ + ehci_writel(ehci, 0, &ehci->regs->intr_enable); + ++ if (ehci_is_TDI(ehci) && tdi_in_host_mode(ehci) == 0) { ++ return 0; ++ } ++ + if ((temp & STS_HALT) != 0) + return 0; + +--- a/drivers/usb/host/ehci-mxc.c ++++ b/drivers/usb/host/ehci-mxc.c +@@ -26,9 +26,6 @@ + #include <mach/mxc_ehci.h> + + #define ULPI_VIEWPORT_OFFSET 0x170 +-#define PORTSC_OFFSET 0x184 +-#define USBMODE_OFFSET 0x1a8 +-#define USBMODE_CM_HOST 3 + + struct ehci_mxc_priv { + struct clk *usbclk, *ahbclk; +@@ -51,6 +48,8 @@ static int ehci_mxc_setup(struct usb_hcd + /* cache this readonly data; minimize chip reads */ + ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); + ++ hcd->has_tt = 1; ++ + retval = ehci_halt(ehci); + if (retval) + return retval; +@@ -60,8 +59,6 @@ static int ehci_mxc_setup(struct usb_hcd + if (retval) + return retval; + +- hcd->has_tt = 1; +- + ehci->sbrn = 0x20; + + ehci_reset(ehci); +@@ -191,12 +188,8 @@ static int ehci_mxc_drv_probe(struct pla + clk_enable(priv->ahbclk); + } + +- /* set USBMODE to host mode */ +- temp = readl(hcd->regs + USBMODE_OFFSET); +- writel(temp | USBMODE_CM_HOST, hcd->regs + USBMODE_OFFSET); +- + /* set up the PORTSCx register */ +- writel(pdata->portsc, hcd->regs + PORTSC_OFFSET); ++ ehci_writel(ehci, pdata->portsc, &ehci->regs->port_status[0]); + mdelay(10); + + /* setup specific usb hw */ diff --git a/usb/usb-kconfig-fix-typos-in-usb_functionfs-description.patch b/usb/usb-kconfig-fix-typos-in-usb_functionfs-description.patch new file mode 100644 index 00000000000000..eb5816b6de6987 --- /dev/null +++ b/usb/usb-kconfig-fix-typos-in-usb_functionfs-description.patch @@ -0,0 +1,53 @@ +From mika@grml.org Tue Sep 7 00:47:25 2010 +From: Michael Prokop <mika@grml.org> +Date: Mon, 6 Sep 2010 09:53:48 +0200 +Subject: USB: Kconfig: fix typos in USB_FUNCTIONFS* description +To: Greg Kroah-Hartman <gregkh@suse.de>, Michael Prokop <mika@grml.org> +Cc: Michael Prokop <mika@grml.org> +Message-ID: <1283759628-20198-1-git-send-email-mika@grml.org> + + +It's spelled "Function Filesystem" / "FunctionFS". This patch +fixes some typos (FunctioFS->FunctionFS, Funcion->Function, +funcion->function, redundant "as") in the Kconfig description of +USB_FUNCTIONFS*. + +Signed-off-by: Michael Prokop <mika@grml.org> +Acked-by: From: Michal Nazarewicz <m.nazarewicz@samsung.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/Kconfig | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/usb/gadget/Kconfig ++++ b/drivers/usb/gadget/Kconfig +@@ -716,8 +716,8 @@ config USB_FUNCTIONFS + depends on EXPERIMENTAL + select USB_FUNCTIONFS_GENERIC if !(USB_FUNCTIONFS_ETH || USB_FUNCTIONFS_RNDIS) + help +- The Function Filesystem (FunctioFS) lets one create USB +- composite functions in user space in the same way as GadgetFS ++ The Function Filesystem (FunctionFS) lets one create USB ++ composite functions in user space in the same way GadgetFS + lets one create USB gadgets in user space. This allows creation + of composite gadgets such that some of the functions are + implemented in kernel space (for instance Ethernet, serial or +@@ -733,14 +733,14 @@ config USB_FUNCTIONFS_ETH + bool "Include configuration with CDC ECM (Ethernet)" + depends on USB_FUNCTIONFS && NET + help +- Include a configuration with CDC ECM funcion (Ethernet) and the +- Funcion Filesystem. ++ Include a configuration with CDC ECM function (Ethernet) and the ++ Function Filesystem. + + config USB_FUNCTIONFS_RNDIS + bool "Include configuration with RNDIS (Ethernet)" + depends on USB_FUNCTIONFS && NET + help +- Include a configuration with RNDIS funcion (Ethernet) and the Filesystem. ++ Include a configuration with RNDIS function (Ethernet) and the Filesystem. + + config USB_FUNCTIONFS_GENERIC + bool "Include 'pure' configuration" |
