Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vladyslav Tymoshchuk" <tvlad744@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v2] usb: dwc3: qcom: Defer VBUS override update during system suspend
Date: Thu, 22 Oct 2026 22:52:38 +0000	[thread overview]
Message-ID: <sashiko-outbox-182136@kernel.org> (raw)
In-Reply-To: <20261022224220.480-1-tvlad744@gmail.com>

> dwc3_qcom_set_role_notifier() updates the VBUS override in QSCRATCH
> synchronously, from the context of the usb_role_switch_set_role()
> caller. The glue assumes that role switches only happen from a
> freezable workqueue, but that holds for the dwc3 core's mode switch,
> not for this notifier: the UCSI connector work, for one, runs on the
> non-freezable system workqueue.
> 
> On SM8750, when the USB cable is unplugged while the system is in
> s2idle, the UCSI connector work for the change runs before the devices
> have resumed. It switches the role to USB_ROLE_NONE, and the notifier
> accesses QSCRATCH while the glue clocks are still off, before
> dwc3_qcom_pm_resume() turns them back on. The access does not complete
> and the SoC resets. pm_runtime_resume_and_get() does not prevent this:
> runtime PM is disabled at that point and the device is still marked
> active, so it returns success without resuming anything.
> 
> While the glue is suspended for system sleep, only record the VBUS
> override update and apply it from dwc3_qcom_pm_resume() once the
> clocks are on. Apply it after the core has resumed, since resuming the
> gadget enables the override and the role switch is the more recent
> event. Serialize the notifier against the system suspend and resume
> callbacks with a mutex, so that a role switch can't run while the
> core or the glue is being suspended or resumed.
> 
> Fixes: 21188e8d6d75 ("usb: dwc3: qcom: Implement glue callbacks to facilitate runtime suspend")
> Cc: stable@vger.kernel.org
> Signed-off-by: Vladyslav Tymoshchuk <tvlad744@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261022224220.480-1-tvlad744@gmail.com?part=1


      reply	other threads:[~2026-10-22 22:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 22:42 [PATCH v2] usb: dwc3: qcom: Defer VBUS override update during system suspend Vladyslav Tymoshchuk
2026-10-22 22:52 ` sashiko-bot [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=sashiko-outbox-182136@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tvlad744@gmail.com \
    /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