aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)Author
2013-08-27USB storage: audit sysfs attribute permissionsGreg Kroah-Hartman
Convert the usbsorage sysfs attribute to use the _RW macro to make it easier to determine the permissions for the file. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27usb: musb: ux500: Add check for NULL board dataLee Jones
Dan Carpenter's automatic Smatch checker found an anomaly in the ux500 MUSB driver, whereby board data was checked before use in all but one occasion. It is believed that it needs to be checked every time. Smatch complaint: drivers/usb/musb/ux500_dma.c:335 ux500_dma_controller_start() error: we previously assumed 'data' could be null (see line 313) Cc: Felipe Balbi <balbi@ti.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-usb@vger.kernel.org Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: gadget: double unlocks on error in atmel_usba_start()Dan Carpenter
The "goto out" statements were wrong. We aren't holding any locks at that point so we should return directly. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: phy: signedness bugs in suspend/resume functionsDan Carpenter
"ret" needs to be signed for the error handling to work. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: gadget: gadgetfs: potential use after free in unbind()Dan Carpenter
ffs_data_put() can sometimes free "ffs" so I have moved the call down a line below the dereference. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: gadget: gadgetfs: use after free in dev_release()Dan Carpenter
The call to put_dev() releases "dev". Hopefully, we don't need to set the state to STATE_DEV_DISABLED anyway so I have removed those lines. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27Merge tag 'for-usb-next-2013-08-27' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-next Sarah writes: xhci: Bug fixes for 3.12. Hi Greg, Here's three low-priority bug fixes that should be queued for 3.12. They disable runtime PM for hosts that need the XHCI_RESET_ON_RESUME quirk, fix USB 2.0 Link PM on hosts that don't have BESL support, and prevent a bunch of log spam. Please pull into usb-next for 3.12. Sarah Sharp
2013-08-27usb: dwc3: Remove duplicate inclusion of otg.hSachin Kamat
otg.h header file was included twice. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: phy: fix build breakageAnatolij Gustschin
Commit 94ae9843 (usb: phy: rename all phy drivers to phy-$name-usb.c) renamed drivers/usb/phy/otg_fsm.h to drivers/usb/phy/phy-fsm-usb.h but changed drivers/usb/phy/phy-fsm-usb.c to include not existing "phy-otg-fsm.h" instead of new "phy-fsm-usb.h". This breaks building: ... drivers/usb/phy/phy-fsm-usb.c:32:25: fatal error: phy-otg-fsm.h: No such file or directory compilation terminated. make[3]: *** [drivers/usb/phy/phy-fsm-usb.o] Error 1 This commit also missed to modify drivers/usb/phy/phy-fsl-usb.h to include new "phy-fsm-usb.h" instead of "otg_fsm.h" resulting in another build breakage: ... In file included from drivers/usb/phy/phy-fsl-usb.c:46:0: drivers/usb/phy/phy-fsl-usb.h:18:21: fatal error: otg_fsm.h: No such file or directory compilation terminated. make[3]: *** [drivers/usb/phy/phy-fsl-usb.o] Error 1 Fix both issues. Signed-off-by: Anatolij Gustschin <agust@denx.de> Cc: stable@vger.kernel.org Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27USB: gadget: audit sysfs attribute permissionsGreg Kroah-Hartman
Convert all USB gadget sysfs attributes to use the _RO or _RW variants, to make them easier to audit and ensure that the permissions are correct. Note, two are left using the DEVICE_ATTR() macro, as there is no DEVICE_ATTR_WO() in Linus's tree, that will happen after 3.12-rc1 is out, a follow-on patch will be sent then. Reviewed-by: Felipe Balbi <balbi@ti.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -- drivers/usb/gadget/composite.c | 8 +++----- drivers/usb/gadget/dummy_hcd.c | 8 ++++---- drivers/usb/gadget/f_mass_storage.c | 14 ++++++-------- drivers/usb/gadget/net2272.c | 4 ++-- drivers/usb/gadget/net2280.c | 18 +++++++++--------- drivers/usb/gadget/storage_common.c | 25 ++++++++++++------------- drivers/usb/gadget/udc-core.c | 14 +++++++------- 7 files changed, 43 insertions(+), 48 deletions(-)
2013-08-27usb: musb: am335x-evm: Do not remove the session bit HOST-only modeSebastian Andrzej Siewior
This is what I observe: On the first connect, the musb starts with DEVCTL.Session set. On disconnect, musb_core calls try_idle. That functions removes the Session bit signalizing that the session is over (something that only in OTG is required). A new device, that is plugged, is no longer recognized. I've setup a timer and checked the DEVCTL register and I haven't seen a change in VBus and I saw the B-Device bit set. After setting the IDDIG into A mode and forcing the device to behave like a A device, I didn't see a change. Neither VBUS goes to 0b11 nor does a session start request comes. In the TI-v3.2 kernel they skip to call musb_platform_try_idle() in the OTG_STATE_A_WAIT_BCON state while not in OTG mode. Since the second port hast a standard A plug the patch changes the port to run in host mode only and skips the timer which would remove DEVCTL.Session so we can reconnect to another device later. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: musb: dsps: do not set is_active on the first drvbus interruptSebastian Andrzej Siewior
Quite early on init there is an vbus / drvvbus interrupt comming and the dsps code sets is_active to one. As a result we see a lot of |musb_bus_suspend 2459: trying to suspend as a_wait_bcon while active until a device is plugged in with pm_runtime enabled in the kernel. After checking davinci, am35, da8xx I noticed that dsps is actually the only one doing this. So remove it and we won't flooded with mesages and the idle port can be suspended. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: usb: dsps: update code according to the binding documentSebastian Andrzej Siewior
This relfects the code and dts requires changes due to recent .dts binding updates: - use mg prefix for the Metor Graphics specific attributes - use power in mA not in mA/2 as specifed in the USB2.0 specification - remove the child node for USB. This is driver specific on won't be reflected in the device tree - use the "mentor" prefix instead of "mg". - use "dr_mode" istead of "mg,port-mode" for the port mode. The former is used by a few other drivers. Cc: Rob Herring <rob.herring@calxeda.com> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: devicetree@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: musb: only remove host/udc if it has been addedSebastian Andrzej Siewior
musb_shutdown() removes always USB host and device. musb_init_controller() adds host and device depending on port_mode. If port mode is set to HOST then the removal of UDC leads only to: |(NULL device *): gadget not registered. and nothing else happens. If port mode is set to DEVICE and we remove the host then we oops in usb_remove_hcd(). This patch ensures that we only remove host in OTG/host mode and device only in OTG/device mode to avoid any trouble. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: musb: dsps: fix devm_ioremap_resource error detection codeJulia Lawall
devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure. Furthermore, the value returned by devm_ioremap_resource should be tested. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e,e1; statement S; @@ *e = devm_ioremap_resource(...); if (!e1) S // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: gadget: USB_NET2272_DMA should depend on HAS_DMAGeert Uytterhoeven
If NO_DMA=y: drivers/built-in.o: In function `net2272_done': drivers/usb/gadget/net2272.c:386: undefined reference to `usb_gadget_unmap_request' drivers/built-in.o: In function `net2272_queue': drivers/usb/gadget/net2272.c:848: undefined reference to `usb_gadget_map_request' Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: gadget: USB_R8A66597 should depend on HAS_DMAGeert Uytterhoeven
If NO_DMA=y: drivers/built-in.o: In function `sudmac_free_channel': drivers/usb/gadget/r8a66597-udc.c:676: undefined reference to `usb_gadget_unmap_request' drivers/built-in.o: In function `sudmac_alloc_channel': drivers/usb/gadget/r8a66597-udc.c:666: undefined reference to `usb_gadget_map_request' Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: gadget: USB_FUSB300 should depend on HAS_DMAGeert Uytterhoeven
If NO_DMA=y: drivers/built-in.o: In function `fusb300_set_idma': drivers/usb/gadget/fusb300_udc.c:946: undefined reference to `usb_gadget_map_request' drivers/usb/gadget/fusb300_udc.c:958: undefined reference to `usb_gadget_unmap_request' Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: musb: avoid null pointer dereference in debug loggingMaarten ter Huurne
Since commit 511f3c53 (usb: gadget: udc-core: fix a regression during gadget driver unbinding) usb_gadget_remove_driver will pass NULL for the driver argument. Signed-off-by: Maarten ter Huurne <maarten@treewalker.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: musb: cppi41: fix missing unlock on error in cppi41_dma_callback()Wei Yongjun
Add the missing unlock before return from function cppi41_dma_callback() in the error handling case. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: phy: am335x-control: make it compile withSebastian Andrzej Siewior
Randy reported this |drivers/usb/phy/phy-am335x-control.c:45:3: error: implicit declaration |of function '__WARN' [-Werror=implicit-function-declaration] and left it as an excercice to figure out that this happens only with CONFIG_BUG=n. As a fix I replace it with WARN_ON(). And there is a space before return so fix this, too. Reported-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: musb: honour the return value of dma_map_single()Sebastian Andrzej Siewior
Since dma_map_single() may fail it is good to actually check the return code to see if it succeeded. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27usb: gadget: configfs: keep a function if it is not successfully addedAndrzej Pietrasiewicz
If usb_add_function() fails then the currently processed function is already not in the list in struct config_usb_cfg, and neither is it in the list in struct usb_configuration. At the err_purge_funcs label the purge_config_funcs() is called, which iterates over all configurations, and in each configuration it iterates over all _successfully_ added functions, and moves them back from the list in struct usb_configuration to the list in struct config_usb_cfg. BUT the function which has just failed adding and caused the unwind process is not taken care of and is effectively lost. This patch modifies the configfs_composite_bind() function so that if the usb_add_function() fails, then the currently processed function is returned to the list in struct config_usb_cfg. It would be tempting to delay the list_del() in question after usb_add_function() invocation, but a struct list_head (&f->list) cannot be stored in more than one list at the same time, so the list_del() must be called before usb_add_function(). Hence, the solution is to list_add() after usb_add_function() in case of error. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-08-27xhci:prevent "callbacks suppressed" when debug is not enabledDmitry Kasatkin
When debug is not enabled and dev_dbg() will expand to nothing, log might be flooded with "callbacks suppressed". If it was not done on purpose, better to use dev_dbg_ratelimited() instead. Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
2013-08-27xhci: fix port BESL LPM capability checkingMathias Nyman
Wrong capability bit was checked for best effort service latency. bit 20 indicate port is BESL LPM capable (BLC), bit 19 is hardware LPM capable (HLC) This patch should be backported to kernels as old as 3.11, that contain the commit a558ccdcc71c7770c5e80c926a31cfe8a3892a09 "usb: xhci: add USB2 Link power management BESL support" Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Reported-by: Steve Cotton <steve@s.cotton.clara.co.uk> Cc: stable@vger.kernel.org
2013-08-27usb: xhci: Disable runtime PM suspend for quirky controllersShawn Nematbakhsh
If a USB controller with XHCI_RESET_ON_RESUME goes to runtime suspend, a reset will be performed upon runtime resume. Any previously suspended devices attached to the controller will be re-enumerated at this time. This will cause problems, for example, if an open system call on the device triggered the resume (the open call will fail). Note that this change is only relevant when persist_enabled is not set for USB devices. This patch should be backported to kernels as old as 3.0, that contain the commit c877b3b2ad5cb9d4fe523c5496185cc328ff3ae9 "xhci: Add reset on resume quirk for asrock p67 host". Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable@vger.kernel.org
2013-08-26USB: OHCI: fix build error related to ohci_suspend/resumeAlan Stern
Commit 9a11899c5e69 (USB: OHCI: add missing PCI PM callbacks to ohci-pci.c) added missing ohci_suspend and ohci_resume callback pointers, but forgot that these callbacks are declared and defined only when CONFIG_PM is enabled. This patch adds a preprocessor conditional to avoid build errors when PM is disabled. Reported-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Guenter Roeck <linux@roeck-us.net> Reported-by: Meelis Roos <mroos@linux.ee>, Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-25USB: serial: clean up attribute permissionsGreg Kroah-Hartman
Clean up the DEVICE_ATTR usage in the USB serial drivers, making them more obvious as to the permissions that the sysfs files should be. Note: ftdi_sio.c still has a DEVICE_ATTR() used, that will have to wait until after 3.12-rc1 comes out when DEVICE_ATTR_WO() shows up in Linus's tree. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-25USB: usbtmc: fix up attribute permissionsGreg Kroah-Hartman
In auditing the usbtmc sysfs files, a bunch of them were being created as "read only", yet they have logic to handle writing to. So fix them up by setting the permissions properly. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-25USB: core: be specific about attribute permissionsGreg Kroah-Hartman
Instead of having to audit all sysfs attributes, to ensure we get them right, use the default macros the driver core provides us (read-only, read-write) to make the code simpler, and to prevent any mistakes from ever happening. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23USB: core: use DRIVER_ATTR_RW()Greg Kroah-Hartman
Use DRIVER_ATTR_RW() to make it easier to audit sysfs file permissions. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23USB: serial: convert bus code to use drv_groupsGreg Kroah-Hartman
The drv_attrs field of struct bus_type is going away soon, drv_groups should be used instead. This converts the USB serial bus code to use the correct field. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23usb: don't use bNbrPorts after initializationKrzysztof Mazur
After successful initialization hub->descriptor->bNbrPorts and hub->hdev->maxchild are equal, but using hub->hdev->maxchild is preferred because that value is explicitly used for initialization of hub->ports[]. Signed-off-by: Krzysztof Mazur <krzysiek@podlesie.net> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23usb: fail on usb_hub_create_port_device() errorsKrzysztof Mazur
Ignoring usb_hub_create_port_device() errors cause later NULL pointer deference when uninitialized hub->ports[i] entries are dereferenced after port memory allocation error. Signed-off-by: Krzysztof Mazur <krzysiek@podlesie.net> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23usb: fix cleanup after failure in hub_configure()Krzysztof Mazur
If the hub_configure() fails after setting the hdev->maxchild the hub->ports might be NULL or point to uninitialized kzallocated memory causing NULL pointer dereference in hub_quiesce() during cleanup. Now after such error the hdev->maxchild is set to 0 to avoid cleanup of uninitialized ports. Signed-off-by: Krzysztof Mazur <krzysiek@podlesie.net> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23usb: ehci-mxc: check for pdata before dereferencingDaniel Mack
Commit 7e8d5cd93fac ("USB: Add EHCI support for MX27 and MX31 based boards") introduced code that could potentially lead to a NULL pointer dereference on driver removal. Fix this by checking for the value of pdata before dereferencing it. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable <stable@vger.kernel.org> # 2.6.33+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23usb: phy: fix build breakageAnatolij Gustschin
Commit 94ae9843 (usb: phy: rename all phy drivers to phy-$name-usb.c) renamed drivers/usb/phy/otg_fsm.h to drivers/usb/phy/phy-fsm-usb.h but changed drivers/usb/phy/phy-fsm-usb.c to include not existing "phy-otg-fsm.h" instead of new "phy-fsm-usb.h". This breaks building: ... drivers/usb/phy/phy-fsm-usb.c:32:25: fatal error: phy-otg-fsm.h: No such file or directory compilation terminated. make[3]: *** [drivers/usb/phy/phy-fsm-usb.o] Error 1 This commit also missed to modify drivers/usb/phy/phy-fsl-usb.h to include new "phy-fsm-usb.h" instead of "otg_fsm.h" resulting in another build breakage: ... In file included from drivers/usb/phy/phy-fsl-usb.c:46:0: drivers/usb/phy/phy-fsl-usb.h:18:21: fatal error: otg_fsm.h: No such file or directory compilation terminated. make[3]: *** [drivers/usb/phy/phy-fsl-usb.o] Error 1 Fix both issues. Signed-off-by: Anatolij Gustschin <agust@denx.de> Cc: stable <stable@vger.kernel.org> # 3.10+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23USB: OHCI: add missing PCI PM callbacks to ohci-pci.cAlan Stern
Commit c1117afb8589 (USB: OHCI: make ohci-pci a separate driver) neglected to preserve the entries for the pci_suspend and pci_resume driver callbacks. As a result, OHCI controllers don't work properly during suspend and after hibernation. This patch adds the missing callbacks to the driver. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-and-tested-by: Steve Cotton <steve@s.cotton.clara.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23USB: fsl-mph-dr-of: cleanup clock API useGerhard Sittig
use devm_get_clk() for automatic put upon device release, check for and propagate errors when enabling clocks, must prepare clocks before they can get enabled, unprepare after disable need to use the _parent_ of the platform device for clock lookup, since this one is associated with the respective device tree node; this change remains neutral as long as a "globally" provided "usb%d_clk" item gets provided by either the PPC_CLOCK implementation or clkdev_register'ed aliases, using the correct devide and thus referencing the right DT node becomes essential when clock lookup will become based on device tree when common clock support will get introduced Signed-off-by: Gerhard Sittig <gsi@denx.de> Signed-off-by: Anatolij Gustschin <agust@denx.de>
2013-08-19USB: mos7720: fix big-endian control requestsJohan Hovold
Fix endianess bugs in parallel-port code which caused corrupt control-requests to be issued on big-endian machines. Reported-by: kbuild test robot <fengguang.wu@intel.com> Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-19USB: mos7720: use GFP_ATOMIC under spinlockDan Carpenter
The write_parport_reg_nonblock() function shouldn't sleep because it's called with spinlocks held. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable@vger.kernel.org Acked-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-19usb:gadget Fix comment for pointer to configfsPhilippe De Swert
The documentation for the USB gadget fs is actually in Documentation/usb/gadget_configfs.txt. Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-19Merge tag 'for-usb-2013-08-15-step-2' of ↵Greg Kroah-Hartman
ra.kernel.org:/pub/scm/linux/kernel/git/sarah/xhci into work-next Sarah writes: xhci: Step 2 to fix usb-linus and usb-next. Hi Greg, This is the first of two steps to fix your usb-linus and usb-next trees. As I mentioned, commit 4fae6f0fa86f92e6bc7429371b1e177ad0aaac66 "USB: handle LPM errors during device suspend correctly" was incorrectly added to usb-next when it should have been added to usb-linus and marked for stable. Two port power off bug fixes touch the same code that patch touches, but it's not easy to simply move commit 4fae6f0f patch to usb-linus because commit 28e861658e23ca94692f98e245d254c75c8088a7 "USB: refactor code for enabling/disabling remote wakeup" also touched those code sections. I propose a two step process to fix this: 1. Pull these four patches into usb-linus. 2. Revert commit 28e861658e23ca94692f98e245d254c75c8088a7 from usb-next. Merge usb-linus into usb-next, and resolve the conflicts. I will be sending pull requests for these steps. This pull request is step two. Sarah Sharp
2013-08-18Merge 3.11-rc6 into char-misc-nextGreg Kroah-Hartman
We want these fixes in this tree. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-18Merge 3.11-rc6 into usb-nextGreg Kroah-Hartman
We want these USB fixes in this branch as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-18USB: serial: fix stringify operator in usb-serial-simpleYann Droneaud
usb-serial-simple uses an unknown stringify macro that make all drivers being named "stringify(vendor)". This can be a problem when two drivers have the same (wrong) name: kernel: usbcore: registered new interface driver usb_serial_simple kernel: usbserial: USB Serial support registered for stringify(vendor) kernel Error: Driver 'stringify(vendor)' is already registered, aborting... kernel: usbserial: problem -16 when registering driver stringify(vendor) kernel: usbserial: USB Serial deregistering driver stringify(vendor) kernel: usbcore: deregistering interface driver usb_serial_simple Before the fix: $ strings drivers/usb/serial/usb-serial-simple.o usb_serial_simple stringify(vendor) After the fix: $ strings drivers/usb/serial/usb-serial-simple.o usb_serial_simple funsoft flashloader vivopay moto_modem hp4x suunto siemens_mpi This patch makes usb-serial-simple use the correct stringify operator. Signed-off-by: Yann Droneaud <ydroneaud@opteya.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-15Merge tag 'for-usb-2013-08-15-step-1' into for-usb-nextSarah Sharp
xhci: Step 1 to fix usb-linus and usb-next. Hi Greg, This is the first of three steps to fix your usb-linus and usb-next trees. As I mentioned, commit 4fae6f0fa86f92e6bc7429371b1e177ad0aaac66 "USB: handle LPM errors during device suspend correctly" was incorrectly added to usb-next when it should have been added to usb-linus and marked for stable. Two port power off bug fixes touch the same code that patch touches, but it's not easy to simply move commit 4fae6f0f patch to usb-linus because commit 28e861658e23ca94692f98e245d254c75c8088a7 "USB: refactor code for enabling/disabling remote wakeup" also touched those code sections. I propose a two step process to fix this: 1. Pull these four patches into usb-linus. 2. Revert commit 28e861658e23ca94692f98e245d254c75c8088a7 from usb-next. Merge usb-linus into usb-next, and resolve the conflicts. I will be sending pull requests for these steps. This pull request is step one, and contains the backported version of commit 4fae6f0fa86f92e6bc7429371b1e177ad0aaac66, the two port power off fixes, and an unrelated xhci-plat bug fix. Sarah Sharp Resolved conflicts: drivers/usb/core/hub.c
2013-08-15USB: WUSBCORE: Use usb_init_urb instead of creating the URB manuallyThomas Pugliese
In wa_seg_init, use usb_init_urb to init the URB object contained in the transfer segment instead of initializing it manually. Use kmalloc to allocate the memory for segment instead of kzalloc and then use memset to set the non-URB portion of the transfer segment struct to 0 since that was already done by usb_init_urb. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-15USB: WUSBCORE: fix leak of urb in wa_xfer_destroy.Thomas Pugliese
The check to free the URB was the opposite of the correct case. This patch removes the check altogether since the ptr will be NULL if the URB was not allocated. Also use usb_free_urb instead of usb_put_urb. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-15USB: WUSBCORE: fix resource cleanup in error path in __wa_xfer_setup_segsThomas Pugliese
Use usb_free_urb instead of kfree in error path and point to the correct URB. Also remember to clean up the sg list for the URB if it was allocated. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>