summaryrefslogtreecommitdiffstats
path: root/drivers/usb
Commit message (Collapse)AuthorAgeFilesLines
...
* | usb: host: ehci-sys: delete useless bus_to_hcd conversionPeter Chen2015-08-181-4/+4
| | | | | | | | | | | | | | | | | | | | The ehci platform device's drvdata is the pointer of struct usb_hcd already, so we doesn't need to call bus_to_hcd conversion again. Cc: <stable@vger.kernel.org> Signed-off-by: Peter Chen <peter.chen@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Revert "usb: interface authorization: Introduces the default interface ↵Greg Kroah-Hartman2015-08-182-48/+0
| | | | | | | | | | | | | | | | | | | | authorization" This reverts commit 1d958bef45030acfc5578263e9de3bb07032b8da as the signed-off-by address is invalid. Cc: Stefan Koch <stefan.koch10@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Revert "usb: interface authorization: Control interface probing and claiming"Greg Kroah-Hartman2015-08-181-8/+0
| | | | | | | | | | | | | | | | This reverts commit de7718bd9c4d3db96991a98c2a0cb38258a04e47 as the signed-off-by address is invalid. Cc: Stefan Koch <stefan.koch10@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Revert "usb: interface authorization: Introduces the USB interface ↵Greg Kroah-Hartman2015-08-182-40/+0
| | | | | | | | | | | | | | | | | | | | authorization" This reverts commit ef0909c50fe63be3f9aa09bdf4db7efaa5919be9 as the signed-off-by address is invalid. Cc: Stefan Koch <stefan.koch10@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Revert "usb: interface authorization: SysFS part of USB interface authorization"Greg Kroah-Hartman2015-08-181-36/+0
| | | | | | | | | | | | | | | | This reverts commit 187b3d75bbfba45a38b5d1d3656c0f11f6f6f2d0 as the signed-off-by address is invalid. Cc: Stefan Koch <stefan.koch10@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Revert "usb: interface authorization: Use a flag for the default device ↵Greg Kroah-Hartman2015-08-182-22/+11
| | | | | | | | | | | | | | | | | | | | authorization" This reverts commit 3cf1fc80655d3af7083ea4b3615e5f8532543be7 as the signed-off-by address is invalid. Cc: Stefan Koch <stefan.koch10@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Merge tag 'usb-serial-4.3-rc1' of ↵Greg Kroah-Hartman2015-08-173-76/+240
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial updates for v4.3-rc1 Here's a fix for a long-standing issue with the pl2303 divisor calculations that affects some non-standard baudrates that were enabled in v3.18. Adding support for newer Edgeport devices and firmware required changes to the io_ti driver and also exposed some issues with the driver's current firmware handling. Included is also a URL comment-typo fix. Signed-off-by: Johan Hovold <johan@kernel.org>
| * | USB: io_ti: Add heartbeat to keep idle EP/416 ports from disconnectingPeter E. Berger2015-07-311-1/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using Edgeport/416 models with newer firmware (sometime after firmware version 4.80.0), idle ports are automatically bounced (disconnected and then reconnected) approximately every 60 seconds. This breaks programs (e.g: minicom) where idle periods are common, normal and expected. I confirmed with the manufacturer (Digi International) that Edgeport/416 models now ship from the factory with firmware that expects periodic "heartbeat" queries from the driver to keep idle ports alive. This patch implements heartbeat support using the mechanism Digi suggested (periodically requesting an I2C descriptor address) that appears effective on Edgeports running the newer firmware (that require it) and benign on Edgeport devices running older firmware. Since we know that Edgeport firmware version 4.80 (the version distributed in /lib/firmware/down3.bin and used for Edgeports that are either running still older versions or have no onboard non-volatile firmware image) does not require heartbeat support, this patch schedules heartbeats only on Edgeport/416 devices, and only if they are running firmware versions newer than 4.80. Signed-off-by: Peter E. Berger <pberger@brimson.com> [johan: minor style changes ] Signed-off-by: Johan Hovold <johan@kernel.org>
| * | USB: io_ti: Add firmware image sanity checksPeter E. Berger2015-07-311-4/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do what we can to verify that the driver's firmware image is valid (before attempting to download it to the Edgeport) by adding a new function, check_fw_sanity(), and a call to it in in download_fw(). Note: It looks like some Edgeports (models like the EP/416 with on-board E2PROM) may be able to function even if the on-disk firmware image is bad or missing, iff their local E2PROM versions are valid. But most Edgeport models (I've tried EP/1 and EP/8) do not appear to have this capability and they always rely on the on-disk firmware image. I tested an implementation that calls the new check_fw_sanity() function at the top of download_fw() and, rather than simply returning an error if the firmware image is bad or missing, it saves the result and defers the decision until later when it may find that it is running on a E2PROM-equipped device with a valid image. But I think this is messier than it is worth (adding still more messiness to the already very messy download_fw()) for such a marginal possible benefit. So, at least for now, I have chosen the much simpler approach of returning an error whenever edge_startup() fails to load an on-disk firmware image, or check_fw_sanity() indicates that it is unusable. Signed-off-by: Peter E. Berger <pberger@brimson.com> [johan: drop redundant checksum mask ] Signed-off-by: Johan Hovold <johan@kernel.org>
| * | USB: io_ti: Fix firmware version handlingPeter E. Berger2015-07-311-49/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The io_ti driver fails to download firmware to Edgeport devices such as the EP/416, even when the on-disk firmware image (/lib/firmware/edgeport/down3.bin) is more current than the version on the EP/416. The current download code is broken in a few ways. Notably it mis-uses global variables OperationalMajorVersion and OperationalMinorVersion (reading their values before they've been properly initialized and subsequently initializing them multiple times without synchronization). This patch drops the global variables and replaces the redundant calls to request_firmware()/release_firmware() in download_fw() with a single call pair in edge_startup(); the firmware image pointer is then passed to download_fw() and build_i2c_fw_hdr(). Signed-off-by: Peter E. Berger <pberger@brimson.com> Signed-off-by: Johan Hovold <johan@kernel.org>
| * | USB: io_ti: Increase insufficient timeout for firmware downloadsPeter E. Berger2015-07-311-16/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The io_ti driver fails to download firmware to Edgeport devices such as the EP/416 and EP/421 (devices with on-board E2PROM). One of the problems is that the default 1 second timeout in ti_vsend_sync() is insufficient for download operations. This patch increases the download timeout to 10 seconds. Signed-off-by: Peter E. Berger <pberger@brimson.com> Signed-off-by: Johan Hovold <johan@kernel.org>
| * | USB: pl2303: fix baud-rate divisor calculationsMichał Pecio2015-07-301-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes the following issues: 1. The 9th bit of buf was believed to be the LSB of divisor's exponent, but the hardware interprets it as MSB (9th bit) of the mantissa. The exponent is actually one bit shorter and applies to base 4, not 2 as previously believed. 2. Loop iterations doubled the exponent instead of incrementing. 3. The exponent wasn't checked for overflow. 4. The function returned requested rate instead of actual rate. Due to issue #2, the old code deviated from the wrong formula described in #1 and actually yielded correct rates when divisor was lower than 4096 by using exponents of 0, 2 or 4 base-2, interpreted as 0, 1, 2 base-4 with the 9th mantissa bit clear. However, at 93.75 kbaud or less the rate turned out too slow due to #2 or too fast due to #2 and #3. I tested this patch by sending and validating 0x00,0x01,..,0xff to an FTDI dongle at 234, 987, 2401, 9601, 31415, 115199, 250k, 500k, 750k, 1M, 1.5M, 3M+1 baud. All rates passed. I also used pv to check speed at some rates unsupported by FTDI: 45 (the lowest possible), 2M, 4M, 5M and 6M-1. Looked sane. Signed-off-by: Michal Pecio <michal.pecio@gmail.com> Fixes: 399aa9a75ad3 ("USB: pl2303: use divisors for unsupported baud rates") Cc: stable <stable@vger.kernel.org> # v3.18 [johan: update summary ] Signed-off-by: Johan Hovold <johan@kernel.org>
| * | USB: serial: ftdi_sio: Fix broken URL in commentNik Nyby2015-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | This fixes a typo in the URL: http://zeitcontrol.de/ Signed-off-by: Nik Nyby <nikolas@gnu.org> Signed-off-by: Johan Hovold <johan@kernel.org>
* | | usb: core: hub: Removed some warnings generated by checkpatch.plChase Metzger2015-08-141-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | Removed some checkpatch.pl warnings saying there was an unwanted space between function names and their arguments. Signed-off-by: Chase Metzger <chasemetzger15@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | USB: host: ohci-at91: merge loops in ohci_hcd_at91_drv_probeAlexandre Belloni2015-08-141-18/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | ohci_hcd_at91_drv_probe() has four at91_for_each_port. They can be merged into two loops without changing the driver behaviour. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | USB: host: ohci-at91: merge ohci_at91_of_init in ohci_hcd_at91_drv_probeAlexandre Belloni2015-08-141-82/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | As device tree support is now mandatory, merge ohci_at91_of_init() in ohci_hcd_at91_drv_probe(). Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | USB: host: ohci-at91: depend on OFAlexandre Belloni2015-08-142-12/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the driver depend on CONFIG_OF and remove the now useless #ifdef Also, fix the Kconfig indentation. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | USB: host: ohci-at91: move at91_usbh_data definition in c fileAlexandre Belloni2015-08-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move struct at91_usbh_data back in ohci-at91.c as this is the only user left after switching all at91 platforms to DT only. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | usb: interface authorization: Use a flag for the default device authorizationStefan Koch2015-08-142-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | With this patch a flag instead of a variable is used for the default device authorization. Signed-off-by: Stefan Koch <skoch@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | usb: interface authorization: SysFS part of USB interface authorizationStefan Koch2015-08-141-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces an attribute for each interface to authorize (1) or deauthorize (0) it: /sys/bus/usb/devices/INTERFACE/authorized Signed-off-by: Stefan Koch <skoch@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | usb: interface authorization: Introduces the USB interface authorizationStefan Koch2015-08-142-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The kernel supports the device authorization because of wireless USB. These is usable for wired USB devices, too. These new interface authorization allows to enable or disable individual interfaces instead a whole device. If a deauthorized interface will be authorized so the driver probing must be triggered manually by writing INTERFACE to /sys/bus/usb/drivers_probe Signed-off-by: Stefan Koch <skoch@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | usb: interface authorization: Control interface probing and claimingStefan Koch2015-08-141-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | Driver probings and interface claims get rejected if an interface is not authorized. Signed-off-by: Stefan Koch <skoch@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | usb: interface authorization: Introduces the default interface authorizationStefan Koch2015-08-142-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | Interfaces are allowed per default. This can disabled or enabled (again) by writing 0 or 1 to /sys/bus/usb/devices/usbX/interface_authorized_default Signed-off-by: Stefan Koch <skoch@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | usb: hub: remove assignment from if conditionKris Borer2015-08-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix one occurrence of the checkpatch.pl error: ERROR: do not use assignment in if condition The semantic patch that makes this change is: // <smpl> @@ identifier i; expression E, E2, E3; statement S1, S2; binary operator b; @@ + i = E; if ( - (i = E) + i b ... && E2 && E3 ) S1 else S2 // </smpl> Signed-off-by: Kris Borer <kborer@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | usb: gadget: atmel: remove useless includeAlexandre Belloni2015-08-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Definitions from linux/platform_data/atmel.h are not used, remove the include. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | usb: endpoint: convert spaces to tabsKris Borer2015-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix one occurrence of the checkpatch error: ERROR: code indent should use tabs where possible Signed-off-by: Kris Borer <kborer@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | usb: otg_whitelist: remove whitespaceKris Borer2015-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix one occurrence of the checkpatch error: ERROR: space prohibited before open square bracket '[' Signed-off-by: Kris Borer <kborer@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | drivers: usb: fsl: Workaround for USB erratum-A005275Nikhil Badola2015-08-144-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Incoming packets in high speed are randomly corrupted by h/w resulting in multiple errors. This workaround makes FS as default mode in all affected socs by disabling HS chirp signalling.This errata does not affect FS and LS mode. Forces all HS devices to connect in FS mode for all socs affected by this erratum: P3041 and P2041 rev 1.0 and 1.1 P5020 and P5010 rev 1.0 and 2.0 P5040, P1010 and T4240 rev 1.0 Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com> Signed-off-by: Nikhil Badola <nikhil.badola@freescale.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | Merge tag 'usb-ci-v4.3-rc1' of ↵Greg Kroah-Hartman2015-08-149-31/+169
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-next Peter writes: USB: chipidea updates for v4.3-rc1 The main changes are adding several system interfaces for tuning performance, and each vendors can adjust them according to their design configurations. Others are tiny improvements, like more well siTD supports, USB_DEVICE_A_HNP_SUPPORT supports, etc.
| * | | usb: chipidea: add tx/rx burst size configuration interfacePeter Chen2015-08-143-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | The user can adjust it through dts or platform data Signed-off-by: Peter Chen <peter.chen@freescale.com>
| * | | usb: chipidea: usbmisc_imx: add non-burst setting for imx6Peter Chen2015-08-141-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this setting and AHBBRST at SBUSCFG as "Incremental burst of unspecified length", each non-burst size can be taken as single transfer. It is benefit for non-burst size transfer. Signed-off-by: Peter Chen <peter.chen@freescale.com>
| * | | usb: chipidea: add ahb burst configuration interfacePeter Chen2015-08-142-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The users can change it through dts or platform data if they want to change the default value. Signed-off-by: Peter Chen <peter.chen@freescale.com>
| * | | usb: chipidea: imx: add stream mode enable for device mode at imx6sl/imx6sxPeter Chen2015-08-141-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stream mode enable is known for better performance, this stream mode enable patch has been passed with stress tests at device mode for imx6sl and imx6sx, and no issue is found. Signed-off-by: Peter Chen <peter.chen@freescale.com>
| * | | usb: chipidea: define stream mode disable for both rolesPeter Chen2015-08-141-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The system bus and chipidea IP have different limitations for both host and device mode. For example, with below errata, we need to enable SDIS(Stream Disable Mode) at host mode. But we don't want it for device mode at the same system. TAR 9000378958 Title: Non-Double Word Aligned Buffer Address Sometimes Causes Host to Hang on OUT Retry Impacted Configuration: Host mode, all transfer types Description: The host core operating in streaming mode may under run while sending the data packet of an OUT transaction. This under run can occur if there are unexpected system delays in fetching the remaining packet data from memory. The host forces a bad CRC on the packet, the device detects the error and discards the packet. The host then retries a Bulk, Interrupt, or Control transfer if an under run occurs according to the USB specification. During simulations, it was found that the host does not issue the retry of the failed bulk OUT. It does not issue any other transactions except SOF packets that have incorrect frame numbers. The second failure mode occurs if the under run occurs on an ISO OUT transaction and the next ISO transaction is a zero byte packet. The host does not issue any transactions (including SOFs). The device detects a Suspend condition, reverts to full speed, and waits for resume signaling. A third failure mode occurs when the host under runs on an ISO OUT and the next ISO in the schedule is an ISO OUT with two max packets of 1024 bytes each. The host should issue MDATA for the first OUT followed by DATA1 for the second. However, it drops the MDATA transaction, and issues the DATA1 transaction. The system impact of this bug is the same regardless of the failure mode observed. The host core hangs, the ehci_ctrl state machine waits for the protocol engine to send the completion status for the corrupted transaction, which never occurs. No indication is sent to the host controller driver, no register bits change and no interrupts occur. Eventually the requesting application times out. Detailed internal behavior: The EHCI control state machine (ehci_ctrl) in the DMA block is responsible for parsing the schedules and initiating all transactions. The ehci_ctrl state machine passes the transaction details to the protocol block by writing the transaction information in to the TxFIFO. It then asserts the pe_hst_run_pkt signal to inform the host protocol state machine (pe_hst_state) that there is a packet in the TxFIFO. A tag of 0x0 indicates a start of packet with the data providing the following information: 35:32 Tag 31:30 Reserved 29:23 Endpoint (lowest 4 bits) 22:16 Address 15:10 Reserved 9:8 Endpoint speed 7:6 Endpoint type 5:6 Data Toggle 3:0 PID The pe_hst_state reads the packet information and constructs the packet and issues it to the PHY interface. The ehci_ctrl state machine writes the start transaction information in to the TxFIFO as 0x03002910c for the OUT packet that had the under run error. However, it writes 0xC3002910C for the retry of the Out transaction, which is incorrect. The pe_hst_state enters a bus timeout state after sending the bad CRC for the packet that under ran. It then purges any data that was back filled in to the TxFIFO for the packet that under ran. The pe_hst_state machine stops purging the TxFIFO when it is empty or if it reads a location that has a tag of 0x0, indicating a start of packet command. The pe_hst_state reads 0xC3002910C and discards it as it does not decode to a start of packet command. It continues to purge the OUT data that has been pre-buffered for the OUT retry . The pe_hst_state detects the hst_packet_run signal and attempts to read the PID and address information from the TxFIFO. This location has packet data and so does not decode to a valid PID and so falls through to the PE_HST_SOF_LOAD state where the frame_num_counter is updated. The frame_num_counter is updated with the data in the TxFIFO. In this case, the data is incorrect as the ehci_ctrl state machine did not initiate the load. The hst_pe_state machine detects the SOF request signal and sends an SOF with the bad frame number. Meanwhile, the ehci_ctrl state machine waits indefinitely in the run_pkt state waiting for the completion status from pe_hst_state machine, which will never happen. The ISO failure case is similar except that there is no retry for ISO. The ehci_ctrl state machine moves to the next transfer in the periodic schedule. If the under run occurs on the last entry of the periodic list then it moves to the Async schedule. In the case of ISO OUT simulations, the next ISO is a zero byte OUT and again the start of packet command gets corrupted. The TxFIFO is empty when the hst_pe_state attempts to read the Address and PID information as the transaction is a zero byte packet. This results in the hst_pe_state machine staying in the GET_PID state, which means that it does not issue any transactions (including SOFs). The device detects a Suspend condition and reverts to full speed mode and waits for a Resume or Reset signal. The EHCI specification allows a Non-DoubleWord (32 bits) offset to be used as a current offset for Buffer Pointer Page 0 of the qTD. In Non-DoubleWord aligned cases, the core reads the packet data from the AHB memory, performs the alignment operation before writing it in to the TxFIFO as a 32 bit data word. An End Of Packet tag (EOP) is written to the TxFIFO after all the packet data has been written in to the TxFIFO. The alignment function is reset to Idle by the EOP tag. The corruption of the start of packet command arises because the packet buffer for the OUT transaction that under ran is not aligned to a DoubleWord, and hence no EOP tag is written to the TxFIFO. The alignment function is still active when the start packet information is written in to the TxFIFO for the retry of the bulk packet or for the next transaction in the case of an under run on an ISO. This results in the corruption of the start tag and the transaction information. Click for waveform showing the command 0x 0000300291 being written in to the TX FIFO for the Out that under ran. Click for waveform showing the command 0xC3002910C written to the TxFIFO instead of 0x 0000300291 Versions affected: Versions 2.10a and previous versions How discovered: Customer simulation Workaround: 1- The EHCI specification allows a non-DoubleWord offset to be used as a current offset for Buffer Pointer Page 0 of the qTD. However, if a DoubleWord offset is used then this issue does not arise. 2- Use non streaming mode to eliminate under runs. Resolution: The fix involves changes to the traffic state machine in the vusb_hs_dma_traf block. The ehci_ctrl state machine updates the context information by encoding the transaction results on the hst_op_context_update signals at the end of a transaction. The signal hst_op_context_update is added to the traffic state machine, and the tx_fifo_under_ran_r signal is generated if the transaction results in an under run error. Click for waveform The traffic state machine then traverses to the do_eop states if the tx_fifo_under_ran error is asserted. Thus an EOP tag is written in to the TxFIFO as shown in this waveform . The EOP tag resets the align state machine to the Idle state ensuring that the next command written by the echi_ctrl state machine does not get corrupted. File(s) modified: RTL code fixed: ….. Method of reproducing: This failure cannot be reproduced in the current test bench. Date Found: March 2010 Date Fixed: June 2010 Update information: Added the RTL code fix Signed-off-by: Peter Chen <peter.chen@freescale.com>
| * | | usb: chipidea: udc: zero-length packet is only needed for TXPeter Chen2015-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The zero-length packet is the sendor tells the receiver that there is no more data, so it is only needed at the TX side. Signed-off-by: Peter Chen <peter.chen@freescale.com>
| * | | usb: chipidea: host: override hcd reset APIPeter Chen2015-08-141-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The system configuration API should be called before the controller run, otherwise, undefined results may occur. So, we override hcd reset API, and add system configuration API after controller reset. Cc: Li Jun <peter.chen@freescale.com> Cc: Alan Stern <stern@rowland.harvard.edu> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Peter Chen <peter.chen@freescale.com>
| * | | usb: chipidea: imx: properly check for usbmiscTomeu Vizoso2015-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If usbmisc hasn't probed yet, defer the probe. It's not enough to check if the platform device for the OF node of the usbmisc has been registered, but it also needs to have been probed already before we can call imx_usbmisc_init(). This can happen if the order in which devices are probed change due to async probing or on-demand probing of dependencies. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
| * | | usb: chipidea: debug: add runtime pm for register accessLi Jun2015-08-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Add runtime pm operations for registers access to avoid system hang. Signed-off-by: Li Jun <jun.li@freescale.com>
| * | | usb:chipidea:Make the function hw_alloc_repmap have a return type of voidNicholas Krause2015-08-141-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the function hw_alloc_repmap be declared to have a return type of void now due to this particular function never returning a error code to its caller due to this function always running successfully to completion nor it's caller putting the return value into a variable in order to check if a error code is passed from the function hw_alloc_repmap when calling this function. Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
| * | | usb: chipidea: host: delete the redundancy ci_hdrc structPeter Chen2015-08-141-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The struct ci_hdrc is the drvdata for hcd device, so we don't need to introduce extra ci_hdrc structure for ehci. Signed-off-by: Peter Chen <peter.chen@freescale.com>
| * | | usb: chipidea: introduce ITC tuning interfacePeter Chen2015-08-141-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ITC (Interrupt Threshold Control) is used to set the maximum rate at which the host/device controller will issue interrupts. The default value is 8 (1ms) for it. EHCI core will modify it to 1, but device mode keeps it as default value. In some use cases like Android ADB, it only has one usb request for each direction, and maximum payload data is only 4KB, so the speed is 4MB/s at most, it needs controller to trigger interrupt as fast as possible to increase the speed. The USB performance will be better if the interrupt can be triggered faster. Reduce ITC value is benefit for USB performance, but the interrupt number is increased at the same time, it may increase cpu utilization too. Most of use case cares about performance, but some may care about cpu utilization, so, we leave a platform interface for user. We set ITC as 1 (1 micro-frame) as default value which is aligned with ehci core default value. Signed-off-by: Peter Chen <peter.chen@freescale.com>
| * | | usb: chipidea: introduce ci_platform_configurePeter Chen2015-08-143-18/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is used to configure controller parameters according to platform data, like speed, stream mode, etc, both host and device's initialization need it, most of code are the same for both roles, with this new interface, it can reduce the duplicated code and be easy to maintain in future. Signed-off-by: Peter Chen <peter.chen@freescale.com>
| * | | usb: chipidea: otg_fsm: delete the duplicated reset controller operationPeter Chen2015-08-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | At host_stop, it will call usb_remove_hcd, and reset controller later. Signed-off-by: Peter Chen <peter.chen@freescale.com>
| * | | usb: chipidea: udc: add USB_DEVICE_A_HNP_SUPPORT request supportPeter Chen2015-08-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We can support USB OTG 1.3 USB_DEVICE_A_HNP_SUPPORT request when the driver supports OTG FSM mode. Signed-off-by: Peter Chen <peter.chen@freescale.com>
| * | | usb: chipidea: imx: enable CI_HDRC_SET_NON_ZERO_TTHAPeter Chen2015-08-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For i.mx platform, set ttctrl.ttha with non-zero value only affects sitd, and ehci core makes sure the schedule is not full when accepts new request, so it will not occur the transaction which will acorss the SoF. Signed-off-by: Peter Chen <peter.chen@freescale.com>
| * | | usb: chipidea: add ttctrl.ttha control interfacePeter Chen2015-08-144-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The register of ttctrl.ttha describes like below: - Internal TT Hub Address Representation - RW - Default = 0000000b This field is used to match against the Hub Address field in QH & siTD to determine if the packet is routed to the internal TT for directly attached FS/LS devices. If the Hub Address in the QH or siTD does not match this address then the packet will be broadcast on the High Speed ports destined for a downstream High Speed hub with the address in the QH/siTD. In silicon RTL, this entry only affects QH and siTD, and the hub.addr at both QH and siTD are 0 in ehci core for chipidea (with hcd->has_tt = 1). So, for QH, if the "usage_tt" flag at RTL is 0, set CI_HDRC_SET_NON_ZERO_TTHA will not affect QH (with non-hs device); for siTD, set this flag will change remaining space requirement for the last transaction from 1023 bytes to 188 bytes, it can increase the number of transactions within one frame, ehci periodic schedule code will not queue the packet if the frame space is full, so it is safe to set this flag for siTD. With this flag, it can fix the problem Alan Stern reported below: http://www.spinics.net/lists/linux-usb/msg123125.html And may fix Michael Tessier's problem too. http://www.spinics.net/lists/linux-usb/msg118679.html CC: stern@rowland.harvard.edu CC: michael.tessier@axiontech.ca Signed-off-by: Peter Chen <peter.chen@freescale.com>
* | | | Merge tag 'usb-for-v4.3' of ↵Greg Kroah-Hartman2015-08-1498-1032/+3032
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: patches for v4.3 merge window New support for Allwinne SoC on the MUSB driver has been added to the list of glue layers. MUSB also got support for building all DMA engines in one binary; this will be great for distros. DWC3 now has no trace of dev_dbg()/dev_vdbg() usage. We will rely solely on tracing to debug DWC3. There was also a fix for memory corruption with EP0 when maxpacket size transfers are > 512 bytes. Robert's EP capabilities flags is making EP selection a lot simpler. UDCs are now required to set these flags up when adding endpoints to the framework. Other than these, we have the usual set of miscelaneous cleanups and minor fixes. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: musb: gadget: fix build break by adding missing 'break'Robert Baldyga2015-08-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add missing break after 'default' label to fix compilation error. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: legacy: nokia: add CONFIG_BLOCK dependencyFelipe Balbi2015-08-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | g_nokia now has mass_storage function, so it should depend on CONFIG_BLOCK. Signed-off-by: Felipe Balbi <balbi@ti.com>
| * | | usb: gadget: f_mass_storage: add mising <linux/uaccess.h>Felipe Balbi2015-08-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <linux/uaccess.h> was originally being pulled indirectly through some other header, however it's not anymore, so we need to include it directly Reported-by: Jim Davis <jim.epost@gmail.com> Suggested-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Felipe Balbi <balbi@ti.com>
OpenPOWER on IntegriCloud