From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Votokina Victoria <Victoria.Votokina@kaspersky.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"lvc-project@linuxtesting.org" <lvc-project@linuxtesting.org>,
"rogerq@kernel.org" <rogerq@kernel.org>
Subject: Re: [PATCH] usb: dwc3: am62: handle usb2_refclk enable failures
Date: Sat, 14 Feb 2026 00:07:22 +0000 [thread overview]
Message-ID: <20260214000716.cnreguzwzbc6j4me@synopsys.com> (raw)
In-Reply-To: <20260210093659.2268056-1-Victoria.Votokina@kaspersky.com>
On Tue, Feb 10, 2026, Votokina Victoria wrote:
> Thinh,
>
> This was reported by static analysis (SVACE), not from a runtime
> failure I could reproduce. The analyzer flagged that
> clk_prepare_enable() return value is ignored in dwc3_ti_init().
> Since clk_prepare_enable() can legitimately fail (incl. -EPROBE_DEFER)
Can clk_prepare_enable() actually return -EPROBE_DEFER in this context?
Have you verified the AM62 platform implementation to determine if there
are any dependencies that could cause deferral even after successfully
obtaining the refclk handle? What other error codes might be returned?
> and the driver continues to touch controller/PHY registers afterwards,
> this can lead to operating the IP in an undefined state.
> Many drivers treat “enable clock failed” as a hard error/deferral
> and bail out; that’s why the checker considers the pattern suspicious.
Suspicion alone is insufficient justification. I need you to provide a
definitive analysis of the possible error conditions by auditing the
AM62 platform's clk_prepare_enable() implementation.
>
> Regarding dwc3_ti_resume_common(): you’re right — returning
> dwc3_ti_init() directly changes the current logic and is not correct
> as-is. The intent was only to check and propagate the error from
> dwc3_ti_init() when power/context was lost, while keeping the remaining
> resume steps (e.g. wakeup handling) intact.
> I’ll respin this so it becomes:
>
> ret = dwc3_ti_init(am62); if (ret) return ret;
> and then continue with the existing flow.
>
> I also suggest enabling usb2_refclk before touching USBSS_DEBUG_CFG.
> Accessing USBSS/DWC3 registers assumes the refclk is active;
> if clk_prepare_enable() fails (e.g. -EPROBE_DEFER), returning early
> avoids partially programming the block while clocks are off.
> This follows the usual “clock first, registers second” ordering used
> across drivers.
>
> I tested compile/build only; I don’t have AM62 hardware to validate
> runtime behavior. If you prefer, I can drop any changes beyond
> return-value checking and keep the patch minimal.
>
For submissions based solely on compilation testing, I cannot accept
changes founded on incomplete analysis, especially patches carrying a
"Fixes" tag, which require thorough investigation and concrete evidence
of the issue being addressed.
BR,
Thinh
prev parent reply other threads:[~2026-02-14 0:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 14:11 [PATCH] usb: dwc3: am62: handle usb2_refclk enable failures Votokina Victoria
2026-02-10 0:30 ` Thinh Nguyen
2026-02-10 9:36 ` Votokina Victoria
2026-02-10 10:15 ` Greg KH
2026-02-14 0:07 ` Thinh Nguyen [this message]
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=20260214000716.cnreguzwzbc6j4me@synopsys.com \
--to=thinh.nguyen@synopsys.com \
--cc=Victoria.Votokina@kaspersky.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=rogerq@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