aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)AuthorFilesLines
2020-05-25usb: cdns3: gadget: assign interrupt number to USB gadget structurePeter Chen1-0/+1
Assign interrupt number to USB gadget structure. Reviewed-by: Jun Li <[email protected]> Signed-off-by: Peter Chen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: core: sync interrupt before unbind the udcPeter Chen1-0/+2
The threaded interrupt handler may still be called after the usb_gadget_disconnect is called, it causes the structures used at interrupt handler was freed before it uses, eg the usb_request. This issue usually occurs we remove the udc function during the transfer. Below is the example when doing stress test for android switch function, the EP0's request is freed by .unbind (configfs_composite_unbind -> composite_dev_cleanup), but the threaded handler accesses this request during handling setup packet request. In fact, there is no protection between unbind the udc and udc interrupt handling, so we have to avoid the interrupt handler is occurred or scheduled during the .unbind flow. init: Sending signal 9 to service 'adbd' (pid 18077) process group... android_work: did not send uevent (0 0 000000007bec2039) libprocessgroup: Successfully killed process cgroup uid 0 pid 18077 in 6ms init: Service 'adbd' (pid 18077) received signal 9 init: Sending signal 9 to service 'adbd' (pid 18077) process group... libprocessgroup: Successfully killed process cgroup uid 0 pid 18077 in 0ms init: processing action (init.svc.adbd=stopped) from (/init.usb.configfs.rc:14) init: Received control message 'start' for 'adbd' from pid: 399 (/vendor/bin/hw/android.hardware.usb@1. init: starting service 'adbd'... read descriptors read strings Unable to handle kernel read from unreadable memory at virtual address 000000000000002a android_work: sent uevent USB_STATE=CONNECTED Mem abort info: ESR = 0x96000004 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 Data abort info: ISV = 0, ISS = 0x00000004 CM = 0, WnR = 0 user pgtable: 4k pages, 48-bit VAs, pgdp=00000000e97f1000 using random self ethernet address [000000000000002a] pgd=0000000000000000 Internal error: Oops: 96000004 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 232 Comm: irq/68-5b110000 Not tainted 5.4.24-06075-g94a6b52b5815 #92 Hardware name: Freescale i.MX8QXP MEK (DT) pstate: 00400085 (nzcv daIf +PAN -UAO) using random host ethernet address pc : composite_setup+0x5c/0x1730 lr : android_setup+0xc0/0x148 sp : ffff80001349bba0 x29: ffff80001349bba0 x28: ffff00083a50da00 x27: ffff8000124e6000 x26: ffff800010177950 x25: 0000000000000040 x24: ffff000834e18010 x23: 0000000000000000 x22: 0000000000000000 x21: ffff00083a50da00 x20: ffff00082e75ec40 x19: 0000000000000000 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000001 x11: ffff80001180fb58 x10: 0000000000000040 x9 : ffff8000120fc980 x8 : 0000000000000000 x7 : ffff00083f98df50 x6 : 0000000000000100 x5 : 00000307e8978431 x4 : ffff800011386788 x3 : 0000000000000000 x2 : ffff800012342000 x1 : 0000000000000000 x0 : ffff800010c6d3a0 Call trace: composite_setup+0x5c/0x1730 android_setup+0xc0/0x148 cdns3_ep0_delegate_req+0x64/0x90 cdns3_check_ep0_interrupt_proceed+0x384/0x738 cdns3_device_thread_irq_handler+0x124/0x6e0 cdns3_thread_irq+0x94/0xa0 irq_thread_fn+0x30/0xa0 irq_thread+0x150/0x248 kthread+0xfc/0x128 ret_from_fork+0x10/0x18 Code: 910e8000 f9400693 12001ed7 79400f79 (3940aa61) ---[ end trace c685db37f8773fba ]--- Kernel panic - not syncing: Fatal exception SMP: stopping secondary CPUs Kernel Offset: disabled CPU features: 0x0002,20002008 Memory Limit: none Rebooting in 5 seconds.. Reviewed-by: Jun Li <[email protected]> Signed-off-by: Peter Chen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: udc: atmel: Don't use DT to configure end pointGregory CLEMENT2-40/+84
The endpoint configuration used to be stored in the device tree, however the configuration depend on the "version" of the controller itself. This information is already documented by the compatible string. It then possible to just rely on the compatible string and completely remove the full ep configuration done in the device tree as it was already the case for all the other USB device controller. Acked-by: Cristian Birsan <[email protected]> Signed-off-by: Gregory CLEMENT <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: gadget: Use SET_EP_PRIME for NoStreamThinh Nguyen2-3/+13
DWC_usb32 v1.00a and later can use SET_EP_PRIME command to reinitiate a stream. Use the command to handle NoStream rejection instead of ending and restarting the endpoint. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: gadget: Handle stream transfersThinh Nguyen3-3/+104
Overview of stream transfer requirement: * A transfer will have a set of TRBs of the same stream ID. * A transfer is started with a stream ID in START_TRANSFER command. * A new stream will only start when the previous completes. Overview of stream events: * A "prime" from host indicates that its endpoints are active (buffers prepared and ready to receive/transmit data). The controller automatically initiates stream if it sees this. * A "NoStream" rejection event indicates that the host isn't ready. Host will put the endpoint back to idle state. Device may need to reinitiate the stream to start transfer again. * A Stream Found event means host accepted device initiated stream. Nothing needs to be done from driver. To initiate a stream, the driver will issue START_TRANSFER command with a stream ID. To reinitiate the stream, the driver must issue END_TRANSFER and restart the transfer with START_TRANSFER command with the same stream ID. This implementation handles device-initated streams (e.g. UASP driver). It also handles some hosts' quirky behavior where they only prime each endpoint once. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: gadget: Don't prepare beyond a transferThinh Nguyen1-0/+8
Don't prepare TRBs beyond a transfer. In DWC_usb32, its transfer burst capability may try to read and use TRBs beyond the active transfer. For other controllers, they don't process the next transfer TRBs until the current transfer is completed. Explicitly prevent preparing TRBs ahead for all controllers. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: gadget: Wait for transfer completionThinh Nguyen2-1/+9
If a transfer is in-progress, any new request should not kick off another transfer. The driver needs to wait for the current transfer to complete before starting off the next transfer. Introduce a new flag DWC3_EP_WAIT_TRANSFER_COMPLETE for this. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: gadget: Handle XferComplete for streamsThinh Nguyen1-6/+28
In DWC3, to prepare TRBs for streams, all the TRBs of a transfer will use the same stream ID. To start a new stream, the driver needs to wait for the current transfer to complete or ended (by END_TRANFER command). As a result, inform the controller of the last TRB of a transfer so that it knows when a transfer completes and start a new transfer of a new stream. Even though the transfer completion handling can be applied for other non-isoc endpoints, only do it for streams due to its requirement. It's better to keep the controller's TRB cache full than waiting for transfer completion and starting a new transfer. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: gadget: Enable XferComplete eventThinh Nguyen1-0/+1
To switch from one stream to another, this requires the driver to start a new transfer with a specific stream ID. For a transfer to complete, the driver needs to indicate the last TRB of a transfer, and it needs to enable XferComplete event to handle completed TRBs of a transfer. Let's enable this event only for stream capable endpoints. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: gadget: Refactor TRB completion handlerThinh Nguyen1-19/+26
To prepare for handling of XferComplete event, let's refactor and split up dwc3_gadget_endpoint_transfer_in_progress() to handle TRBs completion for different events. The handling of TRBs completion will be the same, but the status of XferComplete event is different than XferInProgress. No functional change in this commit. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: gadget: Check for in-progress END_TRANSFERThinh Nguyen1-0/+4
While handling TRBs completion, if a END_TRANSFER command isn't completed, don't kick new transfer or issue END_TRANSFER command. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: f_tcm: Inform last stream requestThinh Nguyen1-0/+3
Set the request->is_last to each stream request to indicate that the request is the last stream request of a transfer. The DWC3 controller needs to know this info to properly switch streams. The current implementation of f_tcm uses a single request per transfer, so every stream request is the last of its stream. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: Get MDWIDTH for DWC_usb32Thinh Nguyen3-2/+22
DWC_usb32 supports MDWIDTH value larger than 255 and up to 1023. The field HWPARAMS6[9:8] stores the upper 2-bit values of the DWC_usb32's MDWIDTH. Check that parameter and properly get the MDWIDTH for DWC_usb32. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: Add support for DWC_usb32 IPThinh Nguyen4-97/+97
Synopsys introduces a new controller DWC_usb32. It supports dual-lane and speed up to 20 Gbps, and the DWC3 driver will drive this controller. Currently the driver uses a single field dwc->revision to ID both DWC_usb3 and DWC_usb31 and their version number. This was sufficient for two IPs, but this method doesn't work with additional IPs. As a result, let's separate the dwc->revision field to 2 separate fields: ip and revision. The ip field now stores the ID of the controller's IP while the revision field stores the controller's version number. This new scheme enforces DWC3 to compare the revision within the same IP only. As a result, we must update all the revision check of the controller to check its corresponding IP. To help with this enforcement, we create a few macros to help with the common version checks: DWC3_IP_IS(IP) DWC3_VER_IS(IP, VERSION) DWC3_VER_IS_PRIOR(IP, VERSION) DWC3_VER_IS_WITHIN(IP, LOWER_VERSION, UPPER_VERSION) DWC3_VER_TYPE_IS_WITHIN(IP, VERSION, LOWER_VERSION_TYPE, UPPER_VERSION_TYPE) The DWC_usb32 controller operates using the same programming model and with very similar configurations as its previous controllers. Please note that the various IP and revision checks in this patch match the current checks for DWC_usb31 version 1.90a. Additional configurations that are unique to DWC_usb32 are applied separately. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: tegra-xudc: add port_speed_quirkNagarjuna Kristam1-0/+106
OTG port on Tegra194 supports GEN1 speeds when in device mode and GEN2 speeds when in host mode. dd port_speed_quirk that configures port to GEN1/GEN2 speds, corresponding to the mode. Based on work by WayneChang <[email protected]> Signed-off-by: Nagarjuna Kristam <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: tegra-xudc: Add Tegra194 supportNagarjuna Kristam1-0/+17
This commit adds support for XUSB device mode controller support on Tegra194 SoC. This is very similar to the existing Tegra186 XUDC, with lpm support added in addition. Signed-off-by: Nagarjuna Kristam <[email protected]> Acked-by: Thierry Reding <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25USB: dummy-hcd: Add missing annotation for set_link_state()Jules Irenge1-0/+1
Sparse reports a warning at set_link_state() warning: context imbalance in set_link_state() - unexpected unlock The root cause is the missing annotation at set_link_state() Add the missing __must_hold(&dum->lock) Signed-off-by: Jules Irenge <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: Add missing annotation for xudc_handle_setup()Jules Irenge1-0/+1
Sparse reports a warning at xudc_handle_setup() warning: context imbalance in xudc_handle_setup() - unexpected unlock The root cause is the missing annotation at xudc_handle_setup() Add the missing __must_hold(&udc->lock) annotation Signed-off-by: Jules Irenge <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: mass_storage: use module_usb_composite_driver to simplify the codeWei Yongjun1-12/+2
module_usb_composite_driver() makes the code simpler by eliminating boilerplate code. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: omap_udc: remove unneeded semicolonJason Yan1-1/+1
Fix the following coccicheck warning: drivers/usb/gadget/udc/omap_udc.c:2579:2-3: Unneeded semicolon Signed-off-by: Jason Yan <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: udc: remove comparison to bool in mv_u3d_core.cJason Yan1-1/+1
Fix the following coccicheck warning: drivers/usb/gadget/udc/mv_u3d_core.c:1551:5-13: WARNING: Comparison to bool Signed-off-by: Jason Yan <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: net2272: use false for 'use_dma'Jason Yan1-1/+1
Fix the following coccicheck warning: drivers/usb/gadget/udc/net2272.c:57:12-19: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: use true,false for dwc->otg_restart_hostJason Yan1-2/+2
Fix the following coccicheck warning: drivers/usb/dwc3/drd.c:85:3-24: WARNING: Assignment of 0/1 to bool variable drivers/usb/dwc3/drd.c:59:2-23: WARNING: Assignment of 0/1 to bool variable Signed-off-by: Jason Yan <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: function: remove redundant assignment to variable 'status'Colin Ian King1-2/+0
The variable status is being assigned a value that is never read and it is being updated later with a new value. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25USB: gadget: udc: s3c2410_udc: Remove pointless NULL check in s3c2410_udc_nukeNathan Chancellor1-4/+0
Clang warns: drivers/usb/gadget/udc/s3c2410_udc.c:255:11: warning: comparison of address of 'ep->queue' equal to a null pointer is always false [-Wtautological-pointer-compare] if (&ep->queue == NULL) ~~~~^~~~~ ~~~~ 1 warning generated. It is not wrong, queue is not a pointer so if ep is not NULL, the address of queue cannot be NULL. No other driver does a check like this and this check has been around since the driver was first introduced, presumably with no issues so it does not seem like this check should be something else. Just remove it. Commit afe956c577b2d ("kbuild: Enable -Wtautological-compare") exposed this but it is not the root cause of the warning. Fixes: 3fc154b6b8134 ("USB Gadget driver for Samsung s3c2410 ARM SoC") Link: https://github.com/ClangBuiltLinux/linux/issues/1004 Reviewed-by: Nick Desaulniers <[email protected]> Reported-by: kbuild test robot <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: f_acm: add suspend resume callbacksFabrice Gasnier1-0/+16
Add suspend resume callbacks to notify u_serial of the bus suspend/resume state. Signed-off-by: Fabrice Gasnier <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: f_serial: add suspend resume callbacksFabrice Gasnier1-0/+16
Add suspend resume callbacks to notify u_serial of the bus suspend/resume state. Signed-off-by: Fabrice Gasnier <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: u_serial: add suspend resume callbacksFabrice Gasnier2-8/+51
Add suspend resume callbacks to handle the case seen when the bus is suspended by the HOST, and the device opens the port (cat /dev/ttyGS0). Gadget controller (like DWC2) doesn't accept usb requests to be queued in this case (when in L2 state), from the gs_open() call. Error log is printed - configfs-gadget gadget: acm ttyGS0 can't notify serial state, -11 If the HOST resumes (opens) the bus, the port still isn't functional. Use suspend/resume callbacks to monitor the gadget suspended state by using 'suspended' flag. In case the port gets opened (cat /dev/ttyGS0), the I/O stream will be delayed until the bus gets resumed by the HOST. Signed-off-by: Fabrice Gasnier <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc2: gadget: move gadget resume after the core is in L0 stateFabrice Gasnier1-2/+5
When the remote wakeup interrupt is triggered, lx_state is resumed from L2 to L0 state. But when the gadget resume is called, lx_state is still L2. This prevents the resume callback to queue any request. Any attempt to queue a request from resume callback will result in: - "submit request only in active state" debug message to be issued - dwc2_hsotg_ep_queue() returns -EAGAIN Call the gadget resume routine after the core is in L0 state. Fixes: f81f46e1f530 ("usb: dwc2: implement hibernation during bus suspend/resume") Acked-by: Minas Harutyunyan <[email protected]> Signed-off-by: Fabrice Gasnier <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: uvc_video: add worker to handle the frame pumpingMichael Grzeschik4-65/+19
This patch changes the function uvc_video_pump to be a separate scheduled worker. This way the completion handler of each usb request and every direct caller of the pump has only to schedule the worker instead of doing the request handling by itself. Moving the request handling to one thread solves the locking problems between the three queueing cases in the completion handler, v4l2_qbuf and video_enable. Many drivers handle the completion handlers directly in their interrupt handlers. This patch also reduces the workload on each interrupt. Signed-off-by: Michael Grzeschik <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: renesas_usbhs: Use the correct style for SPDX License IdentifierNishad Kamdar7-7/+7
This patch corrects the SPDX License Identifier style in header files related to Renesas USBHS Controller Drivers. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Reviewed-by: Yoshihiro Shimoda <[email protected]> Suggested-by: Joe Perches <[email protected]> Signed-off-by: Nishad Kamdar <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: f_fs: remove unneeded semicolon in __ffs_data_got_descs()Jason Yan1-1/+1
Fix the following coccicheck warning: drivers/usb/gadget/function/f_fs.c:2507:2-3: Unneeded semicolon Reported-by: Hulk Robot <[email protected]> Signed-off-by: Jason Yan <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: of-simple: remove Amlogic GXL and AXG compatiblesMartin Blumenstingl1-24/+6
There is now a dedicated driver for these SoCs making the old compatible obsolete. Signed-off-by: Martin Blumenstingl <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: meson-g12a: add support for GXL and GXM SoCsNeil Armstrong1-1/+101
In order to add support for the Amlogic GXL/GXM USB Glue, this adds the corresponding : - PHY names - clock names - USB2 PHY init and mode set - regmap setup Reviewed-by: Martin Blumenstingl <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: meson-g12a: support the GXL/GXM DWC3 host phy disconnectNeil Armstrong1-0/+35
On the Amlogic GXL/GXM SoCs, the OTG PHY status signals are always connected to the DWC3 controller, thus crashing the controller when switching to OTG mode when port is not populated with a device/cable to Host. Amlogic added a bit to disconnect the OTG PHY status signals from the DWC3 to be used when switching the OTG PHY as Device to the DWC2 controller. The drawback is that it makes the DWC3 port state machine stall and needs a full reset of the DWC3 controller to get connect status to the port connected to the OTG PHY, but not the other one. Reviewed-by: Martin Blumenstingl <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: meson-g12a: refactor usb initNeil Armstrong1-15/+37
Refactor the USB init code patch to handle the Amlogic GXL/GXM needing to initialize the OTG port as Peripheral mode for the DWC2 IP to probe correctly. A secondary, post_init callback is added to setup the OTG PHY mode after powering up the PHYs and before probing the DWC2 and DWC3 controllers. Reviewed-by: Martin Blumenstingl <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: udc: remove unused 'driver_desc'Jason Yan1-1/+0
Fix the following gcc warning: drivers/usb/gadget/udc/gr_udc.c:51:19: warning: ‘driver_desc’ defined but not used [-Wunused-const-variable=] static const char driver_desc[] = DRIVER_DESC; ^~~~~~~~~~~ Reported-by: Hulk Robot <[email protected]> Signed-off-by: Jason Yan <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: max3420: Add a missing '\n' in a log messageChristophe JAILLET1-1/+1
Message logged by 'dev_xxx()' or 'pr_xxx()' should end with a '\n'. Fixes: 48ba02b2e2b1 ("usb: gadget: add udc driver for max3420") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25USB: mtu3: Use the correct style for SPDX License IdentifierNishad Kamdar6-6/+6
This patch corrects the SPDX License Identifier style in header files related to MediaTek USB3 Dual Role controller. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Reviewed-by: Chunfeng Yun <[email protected]> Suggested-by: Joe Perches <[email protected]> Signed-off-by: Nishad Kamdar <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: cdns3: change dev_info to dev_dbg for debug messagePeter Chen2-3/+3
During device mode initialization, lots of device information are printed to console, see below. Change them as debug message. cdns-usb3 5b130000.cdns3: Initialized ep0 support: cdns-usb3 5b130000.cdns3: Initialized ep1out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep2out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep3out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep4out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep5out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep6out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep7out support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep1in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep2in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep3in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep4in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep5in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep6in support: BULK, INT ISO cdns-usb3 5b130000.cdns3: Initialized ep7in support: BULK, INT ISO Reviewed-by: Roger Quadros <[email protected]> Signed-off-by: Peter Chen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: cdns3: change "cdsn3" to"cdns3"Peter Chen1-5/+3
And delete cdsn3_hw_role_state_machine declare which doesn't be needed. Reviewed-by: Roger Quadros <[email protected]> Signed-off-by: Peter Chen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: cdns3: delete role_overridePeter Chen2-39/+0
In short, we have three kinds of role switches: - Based on SoC: ID and VBUS - Based on external connnctor, eg, Type-C or GPIO Connector - Based on user choices through sysfs Since HW handling and usb-role-switch handling are at different places, we do not need role_override any more, and this flag could not judge external connector case well. With role_override deleted, We use cdns3_hw_role_switch for the 1st use case, and usb-role-switch for the 2nd and 3rd cases. Reviewed-by: Roger Quadros <[email protected]> Signed-off-by: Peter Chen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: cdns3: core: get role switch node from firmwarePeter Chen1-0/+2
After that, the role switch device (eg, Type-C device) could call cdns3_role_set to finish the role switch. Reviewed-by: Roger Quadros <[email protected]> Signed-off-by: Peter Chen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: dwc3: gadget: Continue to process pending requestsThinh Nguyen1-3/+21
If there are still pending requests because no TRB was available, prepare more when started requests are completed. Introduce dwc3_gadget_ep_should_continue() to check for incomplete and pending requests to resume updating new TRBs to the controller's TRB cache. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-25usb: gadget: tegra-xudc: Add vbus_draw supportNagarjuna Kristam1-0/+17
Register vbus_draw to gadget ops and update corresponding vbus draw current to usb_phy. Signed-off-by: Nagarjuna Kristam <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-21usb: typec: Ensure USB_ROLE_SWITCH is set as a dependency for tps6598xBryan O'Donoghue1-1/+2
When I switched on USB role switching for the tps6598x I completely forgot to add the Kconfig dependency. Ensure USB_ROLE_SWITCH is selected to prevent the typs6598x driver being compiled in but the role-switch driver being compiled as a module, leading to link error. Suggested-by: Heikki Krogerus <[email protected]> Signed-off-by: Bryan O'Donoghue <[email protected]> Acked-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-05-19USB: host: ehci-mxc: Add error handling in ehci_mxc_drv_probe()Tang Bin1-0/+2
The function ehci_mxc_drv_probe() does not perform sufficient error checking after executing platform_get_irq(), thus fix it. Fixes: 7e8d5cd93fac ("USB: Add EHCI support for MX27 and MX31 based boards") Signed-off-by: Zhang Shengju <[email protected]> Signed-off-by: Tang Bin <[email protected]> Reviewed-by: Peter Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-05-19USB: EHCI: ehci-mv: fix less than zero comparison of an unsigned intColin Ian King1-4/+3
The comparison of hcd->irq to less than zero for an error check will never be true because hcd->irq is an unsigned int. Fix this by assigning the int retval to the return of platform_get_irq and checking this for the -ve error condition and assigning hcd->irq to retval. Addresses-Coverity: ("Unsigned compared against 0") Fixes: c856b4b0fdb5 ("USB: EHCI: ehci-mv: fix error handling in mv_ehci_probe()") Signed-off-by: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-05-19usb: xhci: make symbols staticVinod Koul1-3/+3
When renesas module is not built, we get compiler warning on xhci driver with W=1 CC [M] drivers/usb/host/xhci-rcar.o drivers/usb/host/xhci-pci.h:13:5: warning: no previous prototype for ‘renesas_xhci_check_request_fw’ [-Wmissing-prototypes] int renesas_xhci_check_request_fw(struct pci_dev *dev, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/usb/host/xhci-pci.h:19:6: warning: no previous prototype for ‘renesas_xhci_pci_exit’ [-Wmissing-prototypes] void renesas_xhci_pci_exit(struct pci_dev *dev) { }; ^~~~~~~~~~~~~~~~~~~~~ We have defined these symbols when CONFIG_USB_XHCI_PCI_RENESAS is not defined, but missed making then static. Reported-by: kbuild test robot <[email protected]> Fixes: 8bd5741e3145 ("usb: renesas-xhci: Add the renesas xhci driver") Signed-off-by: Vinod Koul <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-05-19USB: serial: usb_wwan: do not resubmit rx urb on fatal errorsBin Liu1-0/+4
usb_wwan_indat_callback() shouldn't resubmit rx urb if the previous urb status is a fatal error. Or the usb controller would keep processing the new urbs then run into interrupt storm, and has no chance to recover. Fixes: 6c1ee66a0b2b ("USB-Serial: Fix error handling of usb_wwan") Cc: [email protected] Signed-off-by: Bin Liu <[email protected]> Signed-off-by: Johan Hovold <[email protected]>