All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] usb: octeon-hcd: fix the FIFO-flush timeout computation
@ 2026-08-27 17:57 Orgad Shaneh
  2026-08-27 17:57 ` [PATCH 2/3] usb: octeon-hcd: fail the probe when the USB core does not respond Orgad Shaneh
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Orgad Shaneh @ 2026-08-27 17:57 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, linux-kernel, Orgad Shaneh, stable

cvmx_wait_tx_rx() computes its 100us deadline from
(u64)octeon_get_clock_rate - the address of the function, not its
return value; the parentheses have been missing since the
CVMX_WAIT_FOR_FIELD32 macro became a function. The cast makes it
compile silently, and the resulting deadline is effectively infinite.

On a healthy controller the flush bit clears on the first read and
nothing is noticed. On a controller whose PHY did not come up (for
example when the reference-clock configuration is wrong for the board),
txfflsh/rxfflsh never clear and probe spins forever in __delay() -
observed as a hard hang with a soft-lockup splat on a CN5020 board,
where the board watchdog then resets the system with no console output.

Call the function, restoring the 100us timeout the code always
intended.

Fixes: 3e195a80e096 ("Staging: octeon-usb: Replaces CVMX_WAIT_FOR_FIELD32 macro with a function")
Cc: stable@vger.kernel.org
Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---

diff --git a/drivers/usb/host/octeon-hcd.c b/drivers/usb/host/octeon-hcd.c
--- a/drivers/usb/host/octeon-hcd.c
+++ b/drivers/usb/host/octeon-hcd.c
@@ -578,7 +578,7 @@
 	int result;
 	u64 address = CVMX_USBCX_GRSTCTL(usb->index);
 	u64 done = cvmx_get_cycle() + 100 *
-		   (u64)octeon_get_clock_rate / 1000000;
+		   (u64)octeon_get_clock_rate() / 1000000;
 	union cvmx_usbcx_grstctl c;
 
 	while (1) {
-- 
2.47.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-09-01 19:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27 17:57 [PATCH 1/3] usb: octeon-hcd: fix the FIFO-flush timeout computation Orgad Shaneh
2026-08-27 17:57 ` [PATCH 2/3] usb: octeon-hcd: fail the probe when the USB core does not respond Orgad Shaneh
2026-08-27 17:57 ` [PATCH 3/3] usb: octeon-hcd: sleep on an hrtimer for far-off periodic transfers Orgad Shaneh
2026-09-01 14:48 ` [PATCH 1/3] usb: octeon-hcd: fix the FIFO-flush timeout computation Greg KH
2026-09-01 19:19   ` Orgad Shaneh
2026-09-01 19:30 ` [PATCH v2 " Orgad Shaneh
2026-09-01 19:30   ` [PATCH v2 2/3] usb: octeon-hcd: fail the probe when the USB core does not respond Orgad Shaneh
2026-09-01 19:30   ` [PATCH v2 3/3] usb: octeon-hcd: sleep on an hrtimer for far-off periodic transfers Orgad Shaneh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.