aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-03-13Merge tag 'usb-3.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbLinus Torvalds36-216/+528
Pull USB fixes from Greg Kroah-Hartman: "Here are a number of tiny USB fixes and new USB device ids for your 3.9 tree. The "largest" one here is a revert of a usb-storage patch that turned out to be incorrect, breaking existing users, which is never a good thing. Everything else is pretty simple and small" * tag 'usb-3.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (43 commits) USB: quatech2: only write to the tty if the port is open. qcserial: bind to DM/DIAG port on Gobi 1K devices USB: cdc-wdm: fix buffer overflow usb: serial: Add Rigblaster Advantage to device table qcaux: add Franklin U600 usb: musb: core: fix possible build error with randconfig usb: cp210x new Vendor/Device IDs usb: gadget: pxa25x: fix disconnect reporting usb: dwc3: ep0: fix sparc64 build usb: c67x00 RetryCnt value in c67x00 TD should be 3 usb: Correction to c67x00 TD data length mask usb: Makefile: fix drivers/usb/phy/ Makefile entry USB: added support for Cinterion's products AH6 and PLS8 usb: gadget: fix omap_udc build errors USB: storage: fix Huawei mode switching regression USB: storage: in-kernel modeswitching is deprecated tools: usb: ffs-test: Fix build failure USB: option: add Huawei E5331 usb: musb: omap2430: fix sparse warning usb: musb: omap2430: fix omap_musb_mailbox glue check again ...
2013-03-13USB: quatech2: only write to the tty if the port is open.Bill Pemberton1-2/+5
The commit 2e124b4a390ca85325fae75764bef92f0547fa25 removed the checks that prevented qt2_process_read_urb() from trying to put chars into ttys that weren't actually opened. This resulted in 'tty is NULL' warnings from flush_to_ldisc() when the device was used. The devices use just one read urb for all ports. As a result qt2_process_read_urb() may be called with the current port set to a port number that has not been opened. Add a check if the port is open before calling tty_flip_buffer_push(). Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-13qcserial: bind to DM/DIAG port on Gobi 1K devicesDan Williams1-2/+5
Turns out we just need altsetting 1 and then we can talk to it. Signed-off-by: Dan Williams <dcbw@redhat.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-12USB: cdc-wdm: fix buffer overflowOliver Neukum1-3/+20
The buffer for responses must not overflow. If this would happen, set a flag, drop the data and return an error after user space has read all remaining data. Signed-off-by: Oliver Neukum <oliver@neukum.org> CC: stable@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-12usb: serial: Add Rigblaster Advantage to device tableSteve Conklin1-0/+1
The Rigblaster Advantage is an amateur radio interface sold by West Mountain Radio. It contains a cp210x serial interface but the device ID is not in the driver. Signed-off-by: Steve Conklin <sconklin@canonical.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11qcaux: add Franklin U600Dan Williams1-0/+1
4 ports; AT/PPP is standard CDC-ACM. The other three (added by this patch) are QCDM/DIAG, possibly GPS, and unknown. Signed-off-by: Dan Williams <dcbw@redhat.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11usb: musb: core: fix possible build error with randconfigFelipe Balbi1-4/+0
when making commit e574d57 (usb: musb: fix compile warning) I forgot to git add this part of the patch which ended up introducing a possible build error. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11usb: cp210x new Vendor/Device IDsMatwey V. Kornilov1-0/+19
This patch adds support for the Lake Shore Cryotronics devices to the CP210x driver. These lines are ported from cp210x driver distributed by Lake Shore web site: http://www.lakeshore.com/Documents/Lake%20Shore%20cp210x-3.0.0.tar.gz and licensed under the terms of GPLv2. Moreover, I've tested this changes with Lake Shore 335 in my labs. Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11Merge tag 'fixes-for-v3.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linusGreg Kroah-Hartman6-18/+17
Felipe writes: usb: fixes for v3.9-rc3 Most fixes are on 'musb' driver. There's a sparse warning fix which marks omap2430_glue as static, a build warning fix which was found with randconfig, a fix for omap_musb_mailbox check and removal of 'select' from musb's Kconfig to prevent Kconfig warnings. Other than that, pxa25x got a fix which was introduced by the latest conversion to udc_start/udc_stop patchset, kernel-doc warnings for composite layer and dwc3 got a build fix on sparc64. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11usb: gadget: pxa25x: fix disconnect reportingFelipe Balbi1-0/+4
when commit 6166c24 (usb: gadget: pxa25x_udc: convert to udc_start/udc_stop) converted this driver to udc_start/udc_stop, it failed to consider the fact that stop_activity() is called from disconnect interrupt. Fix the problem so that gadget drivers know about proper disconnect sequences. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-09Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespaceLinus Torvalds2-0/+2
Pull namespace bugfixes from Eric Biederman: "This is three simple fixes against 3.9-rc1. I have tested each of these fixes and verified they work correctly. The userns oops in key_change_session_keyring and the BUG_ON triggered by proc_ns_follow_link were found by Dave Jones. I am including the enhancement for mount to only trigger requests of filesystem modules here instead of delaying this for the 3.10 merge window because it is both trivial and the kind of change that tends to bit-rot if left untouched for two months." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: proc: Use nd_jump_link in proc_ns_follow_link fs: Limit sys_mount to only request filesystem modules (Part 2). fs: Limit sys_mount to only request filesystem modules. userns: Stop oopsing in key_change_session_keyring
2013-03-08usb: dwc3: ep0: fix sparc64 buildAndrew Morton1-3/+4
drivers/usb/dwc3/ep0.c: In function `__dwc3_ep0_do_control_data': drivers/usb/dwc3/ep0.c:905: error: `typeof' applied to a bit-field Looks like a gcc-3.4.5/sparc64 bug. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-07usb: c67x00 RetryCnt value in c67x00 TD should be 3Dave Tubbs1-1/+1
RetryCnt value in c67x00 TD should be 3 (both bits set to 1). Reference Cypress Semiconductor BIOS User's Manual 1.2, page 3-14 Signed-off-by: Dave Tubbs <dave.tubbs@portalislc.com> Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-07usb: Correction to c67x00 TD data length maskDave Tubbs1-1/+1
TD data length is 10 bits, correct TD_PORTLENMASK_DL. Reference Cypress Semiconductor BIOS User's Manual 1.2, page 3-10 Signed-off-by: Dave Tubbs <dave.tubbs@portalislc.com> Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-07usb: Makefile: fix drivers/usb/phy/ Makefile entryFelipe Balbi1-1/+1
drivers/usb/phy/ should be compiled everytime we have CONFIG_USB_OTG_UTILS enabled. phy/ should've been part of the build process based on CONFIG_USB_OTG_UTILS, don't know where I had my head when I allowed CONFIG_USB_COMMON there. In fact commit c6156328dec52a55f90688cbfad21c83f8711d84 tried to fix a previous issue but it made things even worse. The real solution is to compile phy/ based on CONFIG_USB_OTG_UTILS which gets selected by all PHY drivers. I only triggered the error recently after accepting a patch which moved a bunch of code from otg/otg.c to phy/phy.c and running 100 randconfig cycles. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-07USB: added support for Cinterion's products AH6 and PLS8Christian Schmiedl1-0/+4
add support for Cinterion's products AH6 and PLS8 by adding Product IDs and USB_DEVICE tuples. Signed-off-by: Christian Schmiedl <christian.schmiedl@gemalto.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-07usb: gadget: fix omap_udc build errorsArnd Bergmann1-1/+2
1bf0cf6040 "usb: gadget: omap_udc: convert to udc_start/udc_stop" made some trivial changes but was missing a ';' character. 8c4cc00552 "ARM: OMAP1: DMA: Moving OMAP1 DMA channel definitions to mach-omap1" added a definition for OMAP_DMA_USB_W2FC_TX0 to the driver while making the header file it was defined in unavailable for drivers, but this driver actually needs OMAP_DMA_USB_W2FC_RX0 as well. Both changes appear trivial, so let's add the missing semicolon and the macro definition. Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-07USB: storage: fix Huawei mode switching regressionBjørn Mork3-78/+331
This reverts commit 200e0d99 ("USB: storage: optimize to match the Huawei USB storage devices and support new switch command" and the followup bugfix commit cd060956 ("USB: storage: properly handle the endian issues of idProduct"). The commit effectively added a large number of Huawei devices to the deprecated usb-storage mode switching logic. Many of these devices have been in use and supported by the userspace usb_modeswitch utility for years. Forcing the switching inside the kernel causes a number of regressions as a result of ignoring existing onfigurations, and also completely takes away the ability to configure mode switching per device/system/user. Known regressions caused by this: - Some of the devices support multiple modes, using different switching commands. There are existing configurations taking advantage of this. - There is a real use case for disabling mode switching and instead mounting the exposed storage device. This becomes impossible with switching logic inside the usb-storage driver. - At least on device fail as a result of the usb-storage switching command, becoming completely unswitchable. This is possibly a firmware bug, but still a regression because the device work as expected using usb_modeswitch defaults. In-kernel mode switching was deprecated years ago with the development of the more user friendly userspace alternatives. The existing list of devices in usb-storage was only kept to prevent breaking already working systems. The long term plan is to remove the list, not to add to it. Ref: http://permalink.gmane.org/gmane.linux.usb.general/28543 Cc: <fangxiaozhi@huawei.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-07USB: storage: in-kernel modeswitching is deprecatedBjørn Mork1-0/+8
Acked-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-07USB: option: add Huawei E5331Bjørn Mork1-0/+1
Another device using CDC ACM with vendor specific protocol to mark serial functions. Cc: stable <stable@vger.kernel.org> Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-05usb: musb: omap2430: fix sparse warningAaro Koskinen1-1/+1
Fix the following sparse warning: drivers/usb/musb/omap2430.c:54:33: warning: symbol '_glue' was not \ declared. Should it be static? Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-05usb: musb: omap2430: fix omap_musb_mailbox glue check againAaro Koskinen1-3/+7
Commit 80ab72e1 (usb: musb: omap2430: fix the readiness check in omap_musb_mailbox) made the check incorrect, as we will lose the glue/link status during the normal built-in probe order (twl4030_usb is probed after musb omap2430, but before musb core is ready). As a result, if you boot with USB cable on and load g_ether, the connection does not work as the code thinks the cable is off and the phy gets powered down immediately. This is a major regression in 3.9-rc1. So the proper check should be: exit if _glue is NULL, but if it's initialized we memorize the status, and then check if the musb core is ready. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-05usb: musb: fix compile warningFelipe Balbi1-2/+0
When running 100 randconfig iterations, I found the following warning: drivers/usb/musb/musb_core.c: In function ‘musb_init_controller’: drivers/usb/musb/musb_core.c:1981:1: warning: label ‘fail5’ defined \ but not used [-Wunused-label] this patch fixes it by removing the unnecessary ifdef CONFIG_SYSFS. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-05usb: musb: remove all 'select' from KconfigFelipe Balbi1-5/+0
those are quite unnecessary, the only thing we need to be careful about is USB_OTG_UTILS which get properly selected by PHY drivers. For now, MUSB will select only USB_OTG_UTILS until we add stubs for the cases when PHY layer isn't enabled. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-05usb: gadget: composite: fix kernel-doc warningsNishanth Menon1-4/+1
A few trivial fixes for composite driver: Warning(include/linux/usb/composite.h:165): No description found for parameter 'fs_descriptors' Warning(include/linux/usb/composite.h:165): Excess struct/union/enum/typedef member 'descriptors' description in 'usb_function' Warning(include/linux/usb/composite.h:321): No description found for parameter 'gadget_driver' Warning(drivers/usb/gadget/composite.c:1777): Excess function parameter 'bind' description in 'usb_composite_probe' Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Kosina <trivial@kernel.org> Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-05USB: EHCI: don't check DMA values in QH overlaysAlan Stern1-5/+13
This patch (as1661) fixes a rather obscure bug in ehci-hcd. In a couple of places, the driver compares the DMA address stored in a QH's overlay region with the address of a particular qTD, in order to see whether that qTD is the one currently being processed by the hardware. (If it is then the status in the QH's overlay region is more up-to-date than the status in the qTD, and if it isn't then the overlay's value needs to be adjusted when the QH is added back to the active schedule.) However, DMA address in the overlay region isn't always valid. It sometimes will contain a stale value, which may happen by coincidence to be equal to a qTD's DMA address. Instead of checking the DMA address, we should check whether the overlay region is active and valid. The patch tests the ACTIVE bit in the overlay, and clears this bit when the overlay becomes invalid (which happens when the currently-executing URB is unlinked). This is the second part of a fix for the regression reported at: https://bugs.launchpad.net/bugs/1088733 Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Joseph Salisbury <joseph.salisbury@canonical.com> Reported-and-tested-by: Stephen Thirlwall <sdt@dr.com> CC: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-05USB: EHCI: work around silicon bug in Intel's EHCI controllersAlan Stern2-8/+16
This patch (as1660) works around a hardware problem present in some (if not all) Intel EHCI controllers. After a QH has been unlinked from the async schedule and the corresponding IAA interrupt has occurred, the controller is not supposed access the QH and its qTDs. There certainly shouldn't be any more DMA writes to those structures. Nevertheless, Intel's controllers have been observed to perform a final writeback to the QH's overlay region and to the most recent qTD. For more information and a test program to determine whether this problem is present in a particular controller, see http://marc.info/?l=linux-usb&m=135492071812265&w=2 http://marc.info/?l=linux-usb&m=136182570800963&w=2 This patch works around the problem by always waiting for two IAA cycles when unlinking an async QH. The extra IAA delay gives the controller time to perform its final writeback. Surprisingly enough, the effects of this silicon bug have gone undetected until quite recently. More through luck than anything else, it hasn't caused any apparent problems. However, it does interact badly with the path that follows this one, so it needs to be addressed. This is the first part of a fix for the regression reported at: https://bugs.launchpad.net/bugs/1088733 Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Stephen Thirlwall <sdt@dr.com> CC: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-04ACPI / glue: Add .match() callback to struct acpi_bus_typeRafael J. Wysocki1-2/+7
USB uses the .find_bridge() callback from struct acpi_bus_type incorrectly, because as a result of the way it is used by USB every device in the system that doesn't have a bus type or parent is passed to usb_acpi_find_device() for inspection. What USB actually needs, though, is to call usb_acpi_find_device() for USB ports that don't have a bus type defined, but have usb_port_device_type as their device type, as well as for USB devices. To fix that replace the struct bus_type pointer in struct acpi_bus_type used for matching devices to specific subsystems with a .match() callback to be used for this purpose and update the users of struct acpi_bus_type, including USB, accordingly. Define the .match() callback routine for USB, usb_acpi_bus_match(), in such a way that it will cover both USB devices and USB ports and remove the now redundant .find_bridge() callback pointer from usb_acpi_bus. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Yinghai Lu <yinghai@kernel.org> Acked-by: Jeff Garzik <jgarzik@pobox.com>
2013-03-04usb: gadget: u_uac1: NULL dereference on error pathDan Carpenter1-0/+3
We should return here with an error code instead of continuing. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: gadget: f_uac1: silence an info leak warningDan Carpenter1-0/+1
Smatch complains that "len" could be larger than the sizeof(value) so we could be copying garbage here. I have changed this to match how things are done in composite_setup(). The call tree looks like: composite_setup() --> f_audio_setup() --> audio_get_intf_req() composite_setup() expects the return value to be set to sizeof(value). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: phy: omap-control-usb: Convert to devm_ioremap_resource()Sachin Kamat1-15/+9
Use the newly introduced devm_ioremap_resource() instead of devm_request_and_ioremap() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages; so all explicit error messages can be removed from the failure code paths. Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: phy: omap-usb3: Convert to devm_ioremap_resource()Sachin Kamat1-5/+3
Use the newly introduced devm_ioremap_resource() instead of devm_request_and_ioremap() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages; so all explicit error messages can be removed from the failure code paths. Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: phy: samsung: Convert to devm_ioremap_resource()Sachin Kamat1-5/+3
Use the newly introduced devm_ioremap_resource() instead of devm_request_and_ioremap() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages; so all explicit error messages can be removed from the failure code paths. Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: otg: use try_module_get in all usb_get_phy functions and add missing module_putMarc Kleine-Budde1-3/+7
In patch "5d3c28b usb: otg: add device tree support to otg library" devm_usb_get_phy_by_phandle() was added. It uses try_module_get() to lock the phy driver in memory. The corresponding module_put() is missing in that patch. This patch adds try_module_get() to usb_get_phy() and usb_get_phy_dev(). Further the missing module_put() is added to usb_put_phy(). Tested-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: musb: correct Kconfig in order to avoid non compilable selectionPeter Ujfalusi1-2/+2
Currently it is possible to have: USB_MUSB_OMAP2PLUS=m TWL4030_USB=y which would result compile time error due to missing symbols. With this change USB_MUSB_OMAP2PLUS and TWL4030_USB will be in sync. Reported-by: Vincent Stehle <v-stehle@ti.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: gadget: s3c2410: fix build breakageFelipe Balbi1-1/+1
add missing semicolon to fix compile breakage. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: gadget: imx_udc: fix gadget->dev registrationFelipe Balbi1-12/+8
Whenever ->udc_start() gets called, gadget driver has already being bound to the udc controller, which means that gadget->dev had to be already initialized and added to driver model. This patch fixes imx_udc mistake. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: gadget: pxa25x: fix gadget->dev registrationFelipe Balbi1-9/+11
Whenever ->udc_start() gets called, gadget driver has already being bound to the udc controller, which means that gadget->dev had to be already initialized and added to driver model. This patch fixes pxa25x mistake. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: gadget: s3c2410: fix gadget->dev registrationFelipe Balbi1-15/+11
Whenever ->udc_start() gets called, gadget driver has already being bound to the udc controller, which means that gadget->dev had to be already initialized and added to driver model. This patch fixes s3c2410 mistake. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: gadget: make usb functions to load before gadget driverKishon Vijay Abraham I1-6/+6
The current ordering in makefile makes gadget drivers be loaded before usb functions which causes usb_get_function_instance() to fail when gadget modules are statically linked to the kernel binary. Changed the ordering here so that USB functions are loaded before gadget drivers. Note that this is only a temporary solution and a more robust fix is needed in the long run. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: gadget: pxa27x: fix gadget->dev registrationFelipe Balbi1-6/+12
Whenever ->udc_start() gets called, gadget driver has already being bound to the udc controller, which means that gadget->dev had to be already initialized and added to driver model. This patch fixes pxa27x mistake. Tested-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: chipidea: register debugging sysfs on our deviceFelipe Balbi1-3/+3
Don't register anything non-generic under the gadget's device as we don't really *own* it. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: dwc3: gadget: remove unnecessary codeFelipe Balbi1-3/+0
the params variables on dwc3_gadget_conndone_interrupt() is only memset() to zero but never used in that function, so we can safely drop the variable and memset() call. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: dwc3: glue layers shouldn't know about the core IPFelipe Balbi3-6/+0
remove inclusion of "core.h" from all glue layers as they don't need to know details about the core IP. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: dwc3: omap: fix a typo on of_device_idFelipe Balbi1-3/+3
s/matach/match No functional changes Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-04usb: dwc3: core: don't forget to free coherent memoryFelipe Balbi1-0/+1
commit 3921426 (usb: dwc3: core: move event buffer allocation out of dwc3_core_init()) introduced a memory leak of the coherent memory we use as event buffers on dwc3 driver. If the driver is compiled as a dynamically loadable module and use constantly loads and unloads the driver, we will continue to leak the coherent memory allocated during ->probe() because dwc3_free_event_buffers() is never called during ->remove(). Cc: <stable@vger.kernel.org> # v3.7 v3.8 Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-03-03fs: Limit sys_mount to only request filesystem modules.Eric W. Biederman2-0/+2
Modify the request_module to prefix the file system type with "fs-" and add aliases to all of the filesystems that can be built as modules to match. A common practice is to build all of the kernel code and leave code that is not commonly needed as modules, with the result that many users are exposed to any bug anywhere in the kernel. Looking for filesystems with a fs- prefix limits the pool of possible modules that can be loaded by mount to just filesystems trivially making things safer with no real cost. Using aliases means user space can control the policy of which filesystem modules are auto-loaded by editing /etc/modprobe.d/*.conf with blacklist and alias directives. Allowing simple, safe, well understood work-arounds to known problematic software. This also addresses a rare but unfortunate problem where the filesystem name is not the same as it's module name and module auto-loading would not work. While writing this patch I saw a handful of such cases. The most significant being autofs that lives in the module autofs4. This is relevant to user namespaces because we can reach the request module in get_fs_type() without having any special permissions, and people get uncomfortable when a user specified string (in this case the filesystem type) goes all of the way to request_module. After having looked at this issue I don't think there is any particular reason to perform any filtering or permission checks beyond making it clear in the module request that we want a filesystem module. The common pattern in the kernel is to call request_module() without regards to the users permissions. In general all a filesystem module does once loaded is call register_filesystem() and go to sleep. Which means there is not much attack surface exposed by loading a filesytem module unless the filesystem is mounted. In a user namespace filesystems are not mounted unless .fs_flags = FS_USERNS_MOUNT, which most filesystems do not set today. Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Acked-by: Kees Cook <keescook@chromium.org> Reported-by: Kees Cook <keescook@google.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2013-03-03Merge tag 'usb-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbLinus Torvalds1-15/+14
Pull USB patch revert from Greg Kroah-Hartman: "Here is one remaining USB patch for 3.9-rc1, it reverts a 3.8 patch that has caused a lot of regressions for some VIA EHCI controllers." * tag 'usb-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: EHCI: revert "remove ASS/PSS polling timeout"
2013-02-26Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfsLinus Torvalds7-13/+13
Pull vfs pile (part one) from Al Viro: "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent locking violations, etc. The most visible changes here are death of FS_REVAL_DOT (replaced with "has ->d_weak_revalidate()") and a new helper getting from struct file to inode. Some bits of preparation to xattr method interface changes. Misc patches by various people sent this cycle *and* ocfs2 fixes from several cycles ago that should've been upstream right then. PS: the next vfs pile will be xattr stuff." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits) saner proc_get_inode() calling conventions proc: avoid extra pde_put() in proc_fill_super() fs: change return values from -EACCES to -EPERM fs/exec.c: make bprm_mm_init() static ocfs2/dlm: use GFP_ATOMIC inside a spin_lock ocfs2: fix possible use-after-free with AIO ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero target: writev() on single-element vector is pointless export kernel_write(), convert open-coded instances fs: encode_fh: return FILEID_INVALID if invalid fid_type kill f_vfsmnt vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op nfsd: handle vfs_getattr errors in acl protocol switch vfs_getattr() to struct path default SET_PERSONALITY() in linux/elf.h ceph: prepopulate inodes only when request is aborted d_hash_and_lookup(): export, switch open-coded instances 9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate() 9p: split dropping the acls from v9fs_set_create_acl() ...
2013-02-26USB: EHCI: revert "remove ASS/PSS polling timeout"Alan Stern1-15/+14
This patch (as1649) reverts commit 55bcdce8a8228223ec4d17d8ded8134ed265d2c5 (USB: EHCI: remove ASS/PSS polling timeout). That commit was written under the assumption that some controllers may take a very long time to turn off their async and periodic schedules. It now appears that in fact the schedules do get turned off reasonably quickly, but some controllers occasionally leave the schedules' status bits turned on and consequently ehci-hcd can't tell that the schedules are off. VIA controllers in particular have this problem. ehci-hcd tells the hardware to turn off the async schedule, the schedule does get turned off, but the status bit remains on. Since the EHCI spec requires that the schedules not be re-enabled until the previous disable has taken effect, with an unlimited timeout the async schedule never gets turned back on. The resulting symptom is that the system is unable to communicate with USB devices. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-and-tested-by: Ronald <ronald645@gmail.com> Reported-and-tested-by: Paul Hartman <paul.hartman@gmail.com> Reported-and-tested-by: Dieter Nützel <dieter@nuetzel-hh.de> Reported-and-tested-by: Jean Delvare <khali@linux-fr.org> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>