summaryrefslogtreecommitdiffstats
path: root/drivers/usb
AgeCommit message (Collapse)AuthorFilesLines
2015-04-01Merge tag 'usb-serial-4.0-rc6' of ↵Greg Kroah-Hartman3-2/+16
git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for v4.0-rc6 Here are a few new device IDs. Signed-off-by: Johan Hovold <johan@kernel.org>
2015-03-25USB: ftdi_sio: Use jtag quirk for SNAP Connect E10Doug Goldstein1-2/+6
This patch uses the existing CALAO Systems ftdi_8u2232c_probe in order to avoid attaching a TTY to the JTAG port as this board is based on the CALAO Systems reference design and needs the same fix up. Signed-off-by: Doug Goldstein <cardoe@cardoe.com> CC: stable <stable@vger.kernel.org> [johan: clean up probe logic ] Signed-off-by: Johan Hovold <johan@kernel.org>
2015-03-24Merge tag 'fixes-for-v4.0-rc6' of ↵Greg Kroah-Hartman1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus Felipe writes: usb: fix for v4.0-rc6 Here's a single fix to isp1760 calling spin_unlock_irqsave() as we should have. Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-03-24usb: isp1760: fix spin unlock in the error path of isp1760_udc_startSudeep Holla1-1/+1
Commit a124820de5fd ("usb: isp1760: fix possible deadlock in isp1760_udc_irq") replaced spin_{un,}lock with spin_{un,}lock_irq{save,restore}. However it missed an error path resulting in the smatch warning as below: drivers/usb/isp1760/isp1760-udc.c:1230 isp1760_udc_start() warn: inconsistent returns 'irqsave:flags'. Locked on: line 1207 Unlocked on: line 1199 This patch fixes the spin unlock in the error path in isp1760_udc_start thereby removing the smatch warning mentioned above. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-03-23usb: xhci: apply XHCI_AVOID_BEI quirk to all Intel xHCI controllersLu Baolu1-1/+1
When a device with an isochronous endpoint is plugged into the Intel xHCI host controller, and the driver submits multiple frames per URB, the xHCI driver will set the Block Event Interrupt (BEI) flag on all but the last TD for the URB. This causes the host controller to place an event on the event ring, but not send an interrupt. When the last TD for the URB completes, BEI is cleared, and we get an interrupt for the whole URB. However, under Intel xHCI host controllers, if the event ring is full of events from transfers with BEI set, an "Event Ring is Full" event will be posted to the last entry of the event ring, but no interrupt is generated. Host will cease all transfer and command executions and wait until software completes handling the pending events in the event ring. That means xHC stops, but event of "event ring is full" is not notified. As the result, the xHC looks like dead to user. This patch is to apply XHCI_AVOID_BEI quirk to Intel xHC devices. And it should be backported to kernels as old as 3.0, that contains the commit 69e848c2090a ("Intel xhci: Support EHCI/xHCI port switching."). Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Tested-by: Alistair Grant <akgrant0710@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-23usb: xhci: handle Config Error Change (CEC) in xhci driverLu Baolu1-1/+8
Linux xHCI driver doesn't report and handle port cofig error change. If Port Configure Error for root hub port occurs, CEC bit in PORTSC would be set by xHC and remains 1. This happends when the root port fails to configure its link partner, e.g. the port fails to exchange port capabilities information using Port Capability LMPs. Then the Port Status Change Events will be blocked until all status change bits(CEC is one of the change bits) are cleared('0') (refer to xHCI spec 4.19.2). Otherwise, the port status change event for this root port will not be generated anymore, then root port would look like dead for user and can't be recovered until a Host Controller Reset(HCRST). This patch is to check CEC bit in PORTSC in xhci_get_port_status() and set a Config Error in the return status if CEC is set. This will cause a ClearPortFeature request, where CEC bit is cleared in xhci_clear_port_change_bit(). [The commit log is based on initial Marvell patch posted at http://marc.info/?l=linux-kernel&m=142323612321434&w=2] Reported-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Cc: stable <stable@vger.kernel.org> # v3.2+ Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-22Merge tag 'usb-4.0-rc5' of ↵Linus Torvalds16-653/+79
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB / PHY driver fixes from Greg KH: "Here's a number of USB and PHY driver fixes for 4.0-rc5. The largest thing here is a revert of a gadget function driver patch that removes 500 lines of code. Other than that, it's a number of reported bugs fixes and new quirk/id entries. All have been in linux-next for a while" * tag 'usb-4.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (33 commits) usb: common: otg-fsm: only signal connect after switching to peripheral uas: Add US_FL_NO_ATA_1X for Initio Corporation controllers / devices USB: ehci-atmel: rework clk handling MAINTAINERS: add entry for USB OTG FSM usb: chipidea: otg: add a_alt_hnp_support response for B device phy: omap-usb2: Fix missing clk_prepare call when using old dt name phy: ti/omap: Fix modalias phy: core: Fixup return value of phy_exit when !pm_runtime_enabled phy: miphy28lp: Convert to devm_kcalloc and fix wrong sizof phy: miphy365x: Convert to devm_kcalloc and fix wrong sizeof phy: twl4030-usb: Remove redundant assignment for twl->linkstat phy: exynos5-usbdrd: Fix off-by-one valid value checking for args->args[0] phy: Find the right match in devm_phy_destroy() phy: rockchip-usb: Fixup rockchip_usb_phy_power_on failure path phy: ti-pipe3: Simplify ti_pipe3_dpll_wait_lock implementation phy: samsung-usb2: Remove NULL terminating entry from phys array phy: hix5hd2-sata: Check return value of platform_get_resource phy: exynos-dp-video: Kill exynos_dp_video_phy_pwr_isol function Revert "usb: gadget: zero: Add support for interrupt EP" Revert "xhci: Clear the host side toggle manually when endpoint is 'soft reset'" ...
2015-03-21Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pendingLinus Torvalds1-3/+2
Pull SCSI target fixes from Nicholas Bellinger: "Here are current target-pending fixes for v4.0-rc5 code that have made their way into the queue over the last weeks. The fixes this round include: - Fix long-standing iser-target logout bug related to early conn_logout_comp completion, resulting in iscsi_conn use-after-tree OOpsen. (Sagi + nab) - Fix long-standing tcm_fc bug in ft_invl_hw_context() failure handing for DDP hw offload. (DanC) - Fix incorrect use of unprotected __transport_register_session() in tcm_qla2xxx + other single local se_node_acl fabrics. (Bart) - Fix reference leak in target_submit_cmd() -> target_get_sess_cmd() for ack_kref=1 failure path. (Bart) - Fix pSCSI backend ->get_device_type() statistics OOPs with un-configured device. (Olaf + nab) - Fix virtual LUN=0 target_configure_device failure OOPs at modprobe time. (Claudio + nab) - Fix FUA write false positive failure regression in v4.0-rc1 code. (Christophe Vu-Brugier + HCH)" * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: target: do not reject FUA CDBs when write cache is enabled but emulate_write_cache is 0 target: Fix virtual LUN=0 target_configure_device failure OOPs target/pscsi: Fix NULL pointer dereference in get_device_type tcm_fc: missing curly braces in ft_invl_hw_context() target: Fix reference leak in target_get_sess_cmd() error path loop/usb/vhost-scsi/xen-scsiback: Fix use of __transport_register_session tcm_qla2xxx: Fix incorrect use of __transport_register_session iscsi-target: Avoid early conn_logout_comp for iser connections Revert "iscsi-target: Avoid IN_LOGOUT failure case for iser-target" target: Disallow changing of WRITE cache/FUA attrs after export
2015-03-19loop/usb/vhost-scsi/xen-scsiback: Fix use of __transport_register_sessionBart Van Assche1-3/+2
This patch changes loopback, usb-gadget, vhost-scsi and xen-scsiback fabric code to invoke transport_register_session() instead of the unprotected flavour, to ensure se_tpg->session_lock is taken when adding new session list nodes to se_tpg->tpg_sess_list. Note that since these four fabric drivers already hold their own internal TPG mutexes when accessing se_tpg->tpg_sess_list, and consist of a single se_session created through configfs attribute access, no list corruption can currently occur. So for correctness sake, go ahead and use the se_tpg->session_lock protected version for these four fabric drivers. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2015-03-19USB: keyspan_pda: add new device idNathaniel W Filardo1-0/+3
Add USB VID/PID for Xircom PGMFHUB USB/serial component. (The hub and SCSI bridge on that hardware are recognized out of the box by existing drivers.) Tested VID/PID using new_id and loopback connection and was met with success, but that's all the testing done. Signed-off-by: Nathaniel Wesley Filardo <nwf@cs.jhu.edu> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2015-03-18usb: common: otg-fsm: only signal connect after switching to peripheralPeter Chen1-2/+2
We should signal connect (pull up dp) after we have already at peripheral mode, otherwise, the dp may be toggled due to we reset controller or do disconnect during the initialization for peripheral, then, the host may be confused during the enumeration, eg, it finds the reset can't succeed, but the device is still there, see below error message. hub 1-0:1.0: USB hub found hub 1-0:1.0: 1 port detected hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: Cannot enable port 1. Maybe the USB cable is bad? hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: Cannot enable port 1. Maybe the USB cable is bad? hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: Cannot enable port 1. Maybe the USB cable is bad? hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: cannot reset port 1 (err = -32) hub 1-0:1.0: Cannot enable port 1. Maybe the USB cable is bad? hub 1-0:1.0: unable to enumerate USB device on port 1 Fixes: the issue existed when the otg fsm code was added. Cc: <stable@vger.kernel.org> # v3.16+ Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18uas: Add US_FL_NO_ATA_1X for Initio Corporation controllers / devicesHans de Goede1-0/+7
A new uas compatible controller has shown up in some people's devices from the manufacturer Initio Corporation, this controller needs the US_FL_NO_ATA_1X quirk to work properly with uas, so add it to the uas quirks table. Reported-and-tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: stable@vger.kernel.org # 3.16 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18USB: ehci-atmel: rework clk handlingBoris Brezillon1-21/+9
The EHCI IP only needs the UTMI/UPLL (uclk) and the peripheral (iclk) clocks to work properly. Remove the useless system clock (fclk). Avoid calling set_rate on the fixed rate UTMI/IPLL clock and remove useless IS_ENABLED(CONFIG_COMMON_CLK) tests (all at91 platforms have been moved to the CCF). This patch also fixes a bug introduced by 3440ef1 (ARM: at91/dt: fix USB high-speed clock to select UTMI), which was leaving the usb clock uninitialized and preventing the OHCI driver from setting the usb clock rate to 48MHz. This bug was caused by several things: 1/ usb clock drivers set the CLK_SET_RATE_GATE flag, which means the rate cannot be changed once the clock is prepared 2/ The EHCI driver was retrieving and preparing/enabling the uhpck clock which was in turn preparing its parent clock (the usb clock), thus preventing any rate change because of 1/ Fixes: 3440ef169100 ("ARM: at91/dt: fix USB high-speed clock to select UTMI") Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16USB: ftdi_sio: Added custom PID for Synapse Wireless productDoug Goldstein2-0/+7
Synapse Wireless uses the FTDI VID with a custom PID of 0x9090 for their SNAP Stick 200 product. Signed-off-by: Doug Goldstein <cardoe@cardoe.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2015-03-15usb: chipidea: otg: add a_alt_hnp_support response for B deviceLi Jun1-0/+11
This patch adds response to a_alt_hnp_support set feature request from legacy A device, that is, B-device can provide a message to the user indicating that the user needs to connect the B-device to an alternate port on the A-device. A device sets this feature indicates to the B-device that it is connected to an A-device port that is not capable of HNP, but that the A-device does have an alternate port that is capable of HNP. [Peter] Without this patch, the OTG B device can't be enumerated on non-HNP port at A device, see below log: [ 2.287464] usb 1-1: Dual-Role OTG device on non-HNP port [ 2.293105] usb 1-1: can't set HNP mode: -32 [ 2.417422] usb 1-1: new high-speed USB device number 4 using ci_hdrc [ 2.460635] usb 1-1: Dual-Role OTG device on non-HNP port [ 2.466424] usb 1-1: can't set HNP mode: -32 [ 2.587464] usb 1-1: new high-speed USB device number 5 using ci_hdrc [ 2.630649] usb 1-1: Dual-Role OTG device on non-HNP port [ 2.636436] usb 1-1: can't set HNP mode: -32 [ 2.641003] usb usb1-port1: unable to enumerate USB device Cc: stable <stable@vger.kernel.org> Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-14Merge tag 'fixes-for-v4.0-rc3' of ↵Greg Kroah-Hartman9-536/+40
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus Felipe writes: usb: fixes for v4.0-rc3 Revert interrupt endpoint support from g_zero as it regresses musb. A possible deadlock in isp1760 udc irq has been fixed. A fix to dwc2 for disconnect IRQ handling. We also have a new device ID for isp1760. Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-03-13Merge branch 'gadget' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfsLinus Torvalds2-398/+272
Pull gadgetfs fixes from Al Viro: "Assorted fixes around AIO on gadgetfs: leaks, use-after-free, troubles caused by ->f_op flipping" * 'gadget' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: gadgetfs: really get rid of switching ->f_op gadgetfs: get rid of flipping ->f_op in ep_config() gadget: switch ep_io_operations to ->read_iter/->write_iter gadgetfs: use-after-free in ->aio_read() gadget/function/f_fs.c: switch to ->{read,write}_iter() gadget/function/f_fs.c: use put iov_iter into io_data gadget/function/f_fs.c: close leaks move iov_iter.c from mm/ to lib/ new helper: dup_iter()
2015-03-11Revert "usb: gadget: zero: Add support for interrupt EP"Felipe Balbi4-526/+22
This reverts commit ef11982dd7a657512c362242508bb4021e0d67b6. That commit creates a problem for some UDCs (at least musb) where it allocates an endpoints with a 64-byte FIFO, but later tries to use that same FIFO for 1024-byte packets. Before implementing this, composite framework needs to be modified so we only allocate endpoints after we know negotiated speed, however that needs quite a bit of extra work. Cc: <stable@vger.kernel.org> # v3.18+ Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-03-11Revert "xhci: Clear the host side toggle manually when endpoint is 'soft reset'"Mathias Nyman3-94/+10
This reverts commit 27082e2654dc ("xhci: Clear the host side toggle manually") Turns out this fix to enable soft resetting endpoints wasn't mature enough. It caused regression with some usb DVB-T devices and needs some more tuning to get the endpiont ring pointers set correctly. The original commit was tagged for stable 3.18, and should be reverted from there as well. Cc: stable <stable@vger.kernel.org> # v3.18 Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-10usb: phy: am335x-control: check return value of bus_find_deviceDavid Dueck1-0/+3
This fixes a potential null pointer dereference. Cc: <stable@vger.kernel.org> # v3.16+ Fixes: d4332013919a ("driver core: dev_get_drvdata: Don't check for NULL dev") Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: David Dueck <davidcdueck@googlemail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-03-10usb: dwc2: host: fix dwc2 disconnect bugYunzhi Li1-0/+3
When dwc2 controller detects a disconnect interrupt, dwc2_hcd_disconnect() should be called immediately to do clean-up jobs and set port_connect_status_change flag to notify usb hub driver disconnect status. Tested-by: Vincent Palatin <vpalatin@chromium.org> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Yunzhi Li <lyz@rock-chips.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-03-09usb: isp1760: add peripheral/device controller chip idSudeep Holla1-1/+1
As per the SAF1761 data sheet[0], the DcChipID register represents the hardware version number (0001h) and the chip ID (1582h) for the Peripheral Controller. However as per the ISP1761 data sheet[1], the DcChipID register represents the hardware version number (0015h) and the chip ID (8210h) for the Peripheral Controller. This patch adds support for both the chip ID values. [0] http://www.nxp.com/documents/data_sheet/SAF1761.pdf [1] http://pdf.datasheetcatalog.com/datasheets2/74/742102_1.pdf Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-03-09usb: isp1760: set IRQ flags properlyValentin Rothberg2-4/+3
The IRQF_DISABLED is a NOOP and scheduled to be removed. According to commit e58aa3d2d0cc ("genirq: Run irq handlers with interrupts disabled") running IRQ handlers with interrupts enabled can cause stack overflows when the interrupt line of the issuing device is still active. This patch removes using this deprecated flag and additionally removes redundantly setting IRQF_SHARED for isp1760_udc_register(). Signed-off-by: Valentin Rothberg <Valentin.Rothberg@lip6.fr> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-03-09usb: musb: fix Kconfig regressionArnd Bergmann1-1/+2
A recent bug fix I did that was marked for stable backports introduced a slightly wrong dependency on CONFIG_OMAP_CONTROL_PHY. I was missing the fact that the PHY driver already stubs out the omap_control_usb_set_mode, and we only need to add a dependency to prevent the musb-omap2430 driver from being built-in when the phy driver is a loadable module, but we should not prevent it from being built altogether when the phy driver is disabled. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: ca784be36cc725 ("usb: start using the control module driver") Cc: <stable@vger.kernel.org> # v3.9+ Acked-by: Acked-by: Pavel Machek <pavel@ucw.cz> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-03-09usb: isp1760: fix possible deadlock in isp1760_udc_irqSudeep Holla1-4/+6
Use spin_{un,}lock_irq{save,restore} in isp1760_udc_{start,stop} to prevent following potentially deadlock scenario between isp1760_udc_{start,stop} and isp1760_udc_irq : ================================= [ INFO: inconsistent lock state ] 4.0.0-rc2-00004-gf7bb2ef60173 #51 Not tainted --------------------------------- inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. in:imklog/2118 [HC1[1]:SC0[0]:HE0:SE1] takes: (&(&udc->lock)->rlock){?.+...}, at: [<c0397a93>] isp1760_udc_irq+0x367/0x9dc {HARDIRQ-ON-W} state was registered at: [<c05135b3>] _raw_spin_lock+0x23/0x30 [<c0396b87>] isp1760_udc_start+0x23/0xf8 [<c039dc21>] udc_bind_to_driver+0x71/0xb0 [<c039de4f>] usb_gadget_probe_driver+0x53/0x9c [<bf80d0df>] usb_composite_probe+0x8a/0xa4 [libcomposite] [<bf8311a7>] 0xbf8311a7 [<c00088c5>] do_one_initcall+0x8d/0x17c [<c050b92d>] do_init_module+0x49/0x148 [<c0087323>] load_module+0xb7f/0xbc4 [<c0087471>] SyS_finit_module+0x51/0x74 [<c000d8c1>] ret_fast_syscall+0x1/0x68 irq event stamp: 4966 hardirqs last enabled at (4965): [<c05137df>] _raw_spin_unlock_irq+0x1f/0x24 hardirqs last disabled at (4966): [<c00110b3>] __irq_svc+0x33/0x64 softirqs last enabled at (4458): [<c0023475>] __do_softirq+0x23d/0x2d0 softirqs last disabled at (4389): [<c002380b>] irq_exit+0xef/0x15c other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&(&udc->lock)->rlock); <Interrupt> lock(&(&udc->lock)->rlock); *** DEADLOCK *** 1 lock held by in:imklog/2118: #0: (&f->f_pos_lock){+.+.+.}, at: [<c010a101>] __fdget_pos+0x31/0x34 Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-03-08Merge tag 'usb-4.0-rc3' of ↵Linus Torvalds33-107/+373
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here's a round of USB fixes for 4.0-rc3. Nothing major, the usual gadget, xhci and usb-serial fixes and a few new device ids as well. All have been in linux-next successfully" * tag 'usb-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (36 commits) xhci: Workaround for PME stuck issues in Intel xhci xhci: fix reporting of 0-sized URBs in control endpoint usb: ftdi_sio: Add jtag quirk support for Cyber Cortex AV boards USB: ch341: set tty baud speed according to tty struct USB: serial: cp210x: Adding Seletek device id's USB: pl2303: disable break on shutdown USB: mxuport: fix null deref when used as a console USB: serial: clean up bus probe error handling USB: serial: fix port attribute-creation race USB: serial: fix tty-device error handling at probe USB: serial: fix potential use-after-free after failed probe USB: console: add dummy __module_get USB: ftdi_sio: add PIDs for Actisense USB devices Revert "USB: serial: make bulk_out_size a lower limit" cdc-acm: Add support for Denso cradle CU-321 usb-storage: support for more than 8 LUNs uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS539 USB: usbfs: don't leak kernel data in siginfo xhci: Clear the host side toggle manually when endpoint is 'soft reset' xhci: Allocate correct amount of scratchpad buffers ...
2015-03-08gadgetfs: really get rid of switching ->f_opAlan Stern1-19/+19
... for ep0 as well Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-03-08gadgetfs: get rid of flipping ->f_op in ep_config()Al Viro1-53/+37
Final methods start with get_ready_ep(), which will fail unless we have ->state == STATE_EP_ENABLED. So they'd be failing just fine until that first write() anyway. Let's do the following: * get_ready_ep() gets a new argument - true when called from ep_write_iter(), false otherwise. * make it quiet when it finds STATE_EP_READY (no printk, that is; the case won't be impossible after that change). * when that new argument is true, treat STATE_EP_READY the same way as STATE_EP_ENABLED (i.e. return zero and do not unlock). * in ep_write_iter(), after success of get_ready_ep() turn if (!usb_endpoint_dir_in(&epdata->desc)) { into if (epdata->state == STATE_EP_ENABLED && !usb_endpoint_dir_in(&epdata->desc)) { - that logics only applies after config. * have ep_config() take kernel-side buffer (i.e. use memcpy() instead of copy_from_user() in there) and in the "let's call ep_io or ep_aio" (again, in ep_write_iter()) add "... or ep_config() in case it's not configured yet" Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-03-07USB: serial: fix infinite wait_until_sent timeoutJohan Hovold1-2/+3
Make sure to handle an infinite timeout (0). Note that wait_until_sent is currently never called with a 0-timeout argument due to a bug in tty_wait_until_sent. Fixes: dcf010503966 ("USB: serial: add generic wait_until_sent implementation") Cc: stable <stable@vger.kernel.org> # v3.10 Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06xhci: Workaround for PME stuck issues in Intel xhciMathias Nyman2-0/+31
The xhci in Intel Sunrisepoint and Cherryview platforms need a driver workaround for a Stuck PME that might either block PME events in suspend, or create spurious PME events preventing runtime suspend. Workaround is to clear a internal PME flag, BIT(28) in a vendor specific PMCTRL register at offset 0x80a4, in both suspend resume callbacks Without this, xhci connected usb devices might never be able to wake up the system from suspend, or prevent device from going to suspend (xhci d3) Cc: <stable@vger.kernel.org> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06xhci: fix reporting of 0-sized URBs in control endpointAleksander Morgado2-2/+11
When a control transfer has a short data stage, the xHCI controller generates two transfer events: a COMP_SHORT_TX event that specifies the untransferred amount, and a COMP_SUCCESS event. But when the data stage is not short, only the COMP_SUCCESS event occurs. Therefore, xhci-hcd must set urb->actual_length to urb->transfer_buffer_length while processing the COMP_SUCCESS event, unless urb->actual_length was set already by a previous COMP_SHORT_TX event. The driver checks this by seeing whether urb->actual_length == 0, but this alone is the wrong test, as it is entirely possible for a short transfer to have an urb->actual_length = 0. This patch changes the xhci driver to rely on a new td->urb_length_set flag, which is set to true when a COMP_SHORT_TX event is received and the URB length updated at that stage. This fixes a bug which affected the HSO plugin, which relies on URBs with urb->actual_length == 0 to halt re-submitting the RX URB in the control endpoint. Cc: <stable@vger.kernel.org> Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-05Merge tag 'usb-serial-4.0-rc3' of ↵Greg Kroah-Hartman9-43/+105
git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for v4.0-rc3 Here are a few fixes for reported problems including a usb-debug device buffer overflow, potential use-after-free on failed probe, and a couple of issues with the USB console. Some new device IDs are also added. Signed-off-by: Johan Hovold <johan@kernel.org>
2015-03-03usb: ftdi_sio: Add jtag quirk support for Cyber Cortex AV boardsMax Mansfield2-0/+5
This patch integrates Cyber Cortex AV boards with the existing ftdi_jtag_quirk in order to use serial port 0 with JTAG which is required by the manufacturers' software. Steps: 2 [ftdi_sio_ids.h] 1. Defined the device PID [ftdi_sio.c] 2. Added a macro declaration to the ids array, in order to enable the jtag quirk for the device. Signed-off-by: Max Mansfield <max.m.mansfield@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2015-03-02USB: ch341: set tty baud speed according to tty structNicolas PLANEL1-9/+6
The ch341_set_baudrate() function initialize the device baud speed according to the value on priv->baud_rate. By default the ch341_open() set it to a hardcoded value (DEFAULT_BAUD_RATE 9600). Unfortunately, the tty_struct is not initialized with the same default value. (usually 56700) This means that the tty_struct and the device baud rate generator are not synchronized after opening the port. Fixup is done by calling ch341_set_termios() if tty exist. Remove unnecessary variable priv->baud_rate setup as it's already done by ch341_port_probe(). Remove unnecessary call to ch341_set_{handshake,baudrate}() in ch341_open() as there already called in ch341_configure() and ch341_set_termios() Signed-off-by: Nicolas PLANEL <nicolas.planel@enovance.com> Signed-off-by: Johan Hovold <johan@kernel.org>
2015-02-27USB: serial: cp210x: Adding Seletek device id'sMichiel vd Garde1-0/+2
These device ID's are not associated with the cp210x module currently, but should be. This patch allows the devices to operate upon connecting them to the usb bus as intended. Signed-off-by: Michiel van de Garde <mgparser@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2015-02-26USB: pl2303: disable break on shutdownJohan Hovold1-5/+13
Currently an enabled break state is not disabled on final close nor on re-open and has to be disabled manually. Fix this by disabling break on port shutdown. Reported-by: Jari Ruusu <jariruusu@users.sourceforge.net> Tested-by: Jari Ruusu <jariruusu@users.sourceforge.net> Signed-off-by: Johan Hovold <johan@kernel.org>
2015-02-26USB: mxuport: fix null deref when used as a consoleJohan Hovold1-1/+2
Fix null-pointer dereference at probe when the device is used as a console, in which case the tty argument to open will be NULL. Fixes: ee467a1f2066 ("USB: serial: add Moxa UPORT 12XX/14XX/16XX driver") Cc: stable <stable@vger.kernel.org> # v3.14 Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Greg Kroah-Hartman <greg@kroah.com>
2015-02-26USB: serial: clean up bus probe error handlingJohan Hovold1-11/+14
Clean up bus probe error handling by separating success and error paths. Signed-off-by: Johan Hovold <johan@kernel.org>
2015-02-26USB: serial: fix port attribute-creation raceJohan Hovold2-19/+16
Fix attribute-creation race with userspace by using the port device groups field to create the port attributes. Also use %u when printing the port number, which is unsigned, even though we do not currently support more than 128 ports per device. Reported-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Greg Kroah-Hartman <greg@kroah.com>
2015-02-26USB: serial: fix tty-device error handling at probeJohan Hovold1-1/+10
Add missing error handling when registering the tty device at port probe. This avoids trying to remove an uninitialised character device when the port device is removed. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Takashi Iwai <tiwai@suse.de> Cc: stable <stable@vger.kernel.org> # v2.6.12 Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Greg Kroah-Hartman <greg@kroah.com>
2015-02-26USB: serial: fix potential use-after-free after failed probeJohan Hovold1-1/+1
Fix return value in probe error path, which could end up returning success (0) on errors. This could in turn lead to use-after-free or double free (e.g. in port_remove) when the port device is removed. Fixes: c706ebdfc895 ("USB: usb-serial: call port_probe and port_remove at the right times") Cc: stable <stable@vger.kernel.org> # v2.6.31 Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Greg Kroah-Hartman <greg@kroah.com>
2015-02-26USB: console: add dummy __module_getJohan Hovold1-0/+2
Add call to __module_get when initialising the fake tty in usb_console_setup to match the module_put in release_one_tty. Note that the tty-driver (i.e. usb-serial core) must be compiled-in to enable the usb console so the __module_get is essentially a noop as driver->owner will be null. Reported-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Johan Hovold <johan@kernel.org>
2015-02-26USB: ftdi_sio: add PIDs for Actisense USB devicesMark Glover2-0/+37
These product identifiers (PID) all deal with marine NMEA format data used on motor boats and yachts. We supply the programmed devices to Chetco, for use inside their equipment. The PIDs are a direct copy of our Windows device drivers (FTDI drivers with altered PIDs). Signed-off-by: Mark Glover <mark@actisense.com> Cc: stable <stable@vger.kernel.org> [johan: edit commit message slightly ] Signed-off-by: Johan Hovold <johan@kernel.org>
2015-02-26Revert "USB: serial: make bulk_out_size a lower limit"Johan Hovold1-2/+3
This reverts commit 5083fd7bdfe6760577235a724cf6dccae13652c2. A bulk-out size smaller than the end-point size is indeed valid. The offending commit broke the usb-debug driver for EHCI debug devices, which use 8-byte buffers. Fixes: 5083fd7bdfe6 ("USB: serial: make bulk_out_size a lower limit") Reported-by: "Li, Elvin" <elvin.li@intel.com> Cc: stable <stable@vger.kernel.org> # v3.15 Signed-off-by: Johan Hovold <johan@kernel.org>
2015-02-24cdc-acm: Add support for Denso cradle CU-321Björn Gerhart1-0/+2
In order to support an older USB cradle by Denso, I added its vendor- and product-ID to the array of usb_device_id acm_ids. In this way cdc-acm feels responsible for this cradle. The related /dev/ttyACM node is being created properly, and the data transfer works. However, later cradle models by Denso do have proper descriptors, so the patch is not required for these. At the same time both the older and the later model have the same vendor- and product-ID, but they both work with the patched driver. Declaration of the Denso cradles I tested: - both models have the same IDs: vendorID 0x076d, productID 0x0006 - older model: Denso CU-321 (descriptors not properly set) - later model: Denso CU-821 (with proper descriptors) Signed-off-by: Bjoern Gerhart <oss@airbjorn.de> Acked-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-24usb-storage: support for more than 8 LUNsOliver Neukum1-0/+6
This is necessary to make some storage arrays work. Some storage devices have more than 8 LUNs. In addition you can hook up a WideSCSI bus to USB. In these cases even level 2 devices can have more than 8 LUNs. For them it is necessary to simply believe the class specific command and report its result back to the SCSI layer. Off by one Alan noticed is fixed. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-24uas: Add US_FL_NO_REPORT_OPCODES for JMicron JMS539Hans de Goede1-0/+7
Like the JMicron JMS567 enclosures with the JMS539 choke on report-opcodes, so avoid it. Tested-and-reported-by: Tom Arild Naess <tanaess@gmail.com> Cc: stable@vger.kernel.org # 3.16 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-24USB: usbfs: don't leak kernel data in siginfoAlan Stern1-0/+2
When a signal is delivered, the information in the siginfo structure is copied to userspace. Good security practice dicatates that the unused fields in this structure should be initialized to 0 so that random kernel stack data isn't exposed to the user. This patch adds such an initialization to the two places where usbfs raises signals. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Dave Mielke <dave@mielke.cc> CC: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-24xhci: Clear the host side toggle manually when endpoint is 'soft reset'Mathias Nyman3-10/+94
Main benefit of this is to get xhci connected USB scanners to work. Some devices use a clear endpoint halt request as a 'soft reset' even if the endpoint is not halted. This will clear the toggle and sequence on the device side. xHCI however refuses to reset a non-halted endpoint, so instead we need to issue a configure endpoint command on xHCI to clear its host side toggle and sequence, and get it in sync with the device side. Tested-by: Mike Mammarella <mikem@crystalorb.net> Cc: <stable@vger.kernel.org> # v3.18 Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-24xhci: Allocate correct amount of scratchpad buffersMathias Nyman1-2/+3
Include the high order bit fields for Max scratchpad buffers when calculating how many scratchpad buffers are needed. I'm suprised this hasn't caused more issues, we never allocated more than 32 buffers even if xhci needed more. Either we got lucky and xhci never really used past that area, or then we got enough zeroed dma memory anyway. Should be backported as far back as possible Reported-by: Tim Chen <tim.c.chen@linux.intel.com> Tested-by: Tim Chen <tim.c.chen@linux.intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Cc: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>