From: Orgad Shaneh <orgads@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/3] usb: octeon-hcd: fail the probe when the USB core does not respond
Date: Tue, 1 Sep 2026 19:30:28 +0000 [thread overview]
Message-ID: <20260901193100.1352110-2-orgads@gmail.com> (raw)
In-Reply-To: <20260901193100.1352110-1-orgads@gmail.com>
If the USBN clock/PHY setup did not actually bring the core up (wrong
board reference-clock configuration, for instance), every USBC CSR
reads as all-ones and initialization marches on programming garbage,
ending in timeouts or a wedge deep in the FIFO flush.
Read GHWCFG3 - a hardwired configuration register that can be neither
0 nor all-ones on a live core - right before core initialization, and
give up cleanly if the core is not answering.
Assisted-by: Claude:claude-opus-5
Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---
v2: no code change; added the Assisted-by tag for the AI assistance used
(Documentation/process/coding-assistants.rst).
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
@@ -853,6 +853,14 @@
* USBC_GAHBCFG[PTXFEMPLVL]
* Global interrupt mask, USBC_GAHBCFG[GLBLINTRMSK] = 1
*/
+ usbcx_gahbcfg.u32 = cvmx_usb_read_csr32(usb,
+ CVMX_USBCX_GHWCFG3(usb->index));
+ if (usbcx_gahbcfg.u32 == 0xffffffff || usbcx_gahbcfg.u32 == 0) {
+ dev_err(dev, "USB core is not responding (GHWCFG3=0x%08x)\n",
+ usbcx_gahbcfg.u32);
+ return -ENODEV;
+ }
+
usbcx_gahbcfg.u32 = 0;
usbcx_gahbcfg.s.dmaen = !(usb->init_flags &
CVMX_USB_INITIALIZE_FLAGS_NO_DMA);
--
2.47.0
next prev parent reply other threads:[~2026-09-01 19:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Orgad Shaneh [this message]
2026-09-01 19:30 ` [PATCH v2 3/3] usb: octeon-hcd: sleep on an hrtimer for far-off periodic transfers Orgad Shaneh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260901193100.1352110-2-orgads@gmail.com \
--to=orgads@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox