2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/usb/cdns3
Pawel Laszczak f4ecdc3526 usb: cdnsp: Fix issue with detecting command completion event
In some cases, there is a small-time gap in which CMD_RING_BUSY can be
cleared by controller but adding command completion event to event ring
will be delayed. As the result driver will return error code.

This behavior has been detected on usbtest driver (test 9) with
configuration including ep1in/ep1out bulk and ep2in/ep2out isoc
endpoint.

Probably this gap occurred because controller was busy with adding some
other events to event ring.

The CMD_RING_BUSY is cleared to '0' when the Command Descriptor has been
executed and not when command completion event has been added to event
ring.

To fix this issue for this test the small delay is sufficient less than
10us) but to make sure the problem doesn't happen again in the future
the patch introduces 10 retries to check with delay about 20us before
returning error code.

Fixes: 3d82904559 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Pawel Laszczak <pawell@cadence.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/PH7PR07MB9538AA45362ACCF1B94EE9B7DD96A@PH7PR07MB9538.namprd07.prod.outlook.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-05-21 13:12:10 +02:00
..
cdns3-debug.h usb: cdns3: change trace event cdns3_ring() operation 2023-03-09 15:35:03 +01:00
cdns3-ep0.c usb: cdns3: Fixed incorrect gadget state 2021-07-29 14:13:02 +08:00
cdns3-gadget.c usb: cdns3: Fix deadlock when using NCM gadget 2025-04-11 16:20:59 +02:00
cdns3-gadget.h usb: cdns3: fix iso transfer error when mult is not zero 2024-01-04 16:01:44 +01:00
cdns3-imx.c usb: Switch back to struct platform_driver::remove() 2024-10-04 15:13:03 +02:00
cdns3-pci-wrap.c usb: cdns3: Synchronise PCI IDs via common data base 2024-11-13 07:16:31 +01:00
cdns3-plat.c usb: cdns3: Remove the invalid comment 2025-04-11 16:08:33 +02:00
cdns3-starfive.c usb: Switch back to struct platform_driver::remove() 2024-10-04 15:13:03 +02:00
cdns3-ti.c usb: cdns3-ti: run HW init at resume() if HW was reset 2025-03-14 09:18:02 +01:00
cdns3-trace.c usb: cdns3: Change file names for cdns3 driver. 2020-12-29 12:36:13 +08:00
cdns3-trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
cdnsp-debug.h usb: cdnsp: Replace snprintf() with the safer scnprintf() variant 2023-12-04 22:25:17 +09:00
cdnsp-ep0.c usb: cdnsp: Fixes error: uninitialized symbol 'len' 2023-04-05 19:55:04 +02:00
cdnsp-gadget.c usb: cdnsp: Fix issue with detecting command completion event 2025-05-21 13:12:10 +02:00
cdnsp-gadget.h usb: cdnsp: Fix issue with detecting USB 3.2 speed 2025-05-21 13:11:59 +02:00
cdnsp-mem.c usb: cdnsp: Fix a NULL pointer dereference in cdnsp_endpoint_init() 2021-12-03 13:57:45 +01:00
cdnsp-pci.c usb: cdnsp: Fix issue with resuming from L1 2025-05-01 17:36:12 +02:00
cdnsp-ring.c usb: cdnsp: fix L1 resume issue for RTL_REVISION_NEW_LPM version 2025-05-01 17:40:21 +02:00
cdnsp-trace.c usb: cdnsp: Add tracepoints for CDNSP driver 2020-12-29 12:36:13 +08:00
cdnsp-trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
core.c usb: cdns3: call cdns_power_is_lost() only once in cdns_resume() 2025-03-14 09:18:02 +01:00
core.h usb: cdnsp: Fix issue with resuming from L1 2025-05-01 17:36:12 +02:00
drd.c usb: cdns3: Add quirk flag to enable suspend residency 2024-06-04 15:41:10 +02:00
drd.h usb: cdns3: Add quirk flag to enable suspend residency 2024-06-04 15:41:10 +02:00
gadget-export.h usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver 2020-12-29 12:36:13 +08:00
host-export.h usb: cdns3: Removes xhci_cdns3_suspend_quirk from host-export.h 2020-12-29 12:36:13 +08:00
host.c usb: host: cdns3: forward lost power information to xhci 2025-03-14 09:18:03 +01:00
Kconfig usb: cdns3: Add StarFive JH7110 USB driver 2023-05-29 15:52:11 +01:00
Makefile usb: cdns3: Add StarFive JH7110 USB driver 2023-05-29 15:52:11 +01:00