From: sashiko-bot@kernel.org
To: "Yuming Hu" <huyuming@kylinos.cn>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH] USB: dwc2: shut down the wakeup timer before removing the HCD
Date: Tue, 24 Nov 2026 02:53:55 +0000 [thread overview]
Message-ID: <sashiko-outbox-230427@kernel.org> (raw)
In-Reply-To: <20261124024516.2621743-1-huyuming@kylinos.cn>
> The wakeup timer is armed from hardirq context (WKUPINT, 71 ms) and its
> callback dwc2_wakeup_detected() ends up calling
> usb_hcd_resume_root_hub(hsotg->priv) when the port is suspended.
>
> dwc2_hcd_remove() invokes usb_remove_hcd() and clears hsotg->priv before
> it reaches dwc2_hcd_release(), where fd772af9512c ("USB: dwc2: shut down
> wakeup timer before freeing HCD state") performs the
> timer_shutdown_sync(). If the timer expires inside that window, or its
> callback is in flight while hsotg->priv is being cleared,
> dwc2_hcd_rem_wakeup() passes the NULL hcd to
> usb_hcd_resume_root_hub(), which dereferences it without a NULL check
> and oopses in softirq context.
>
> Shut the timer down before usb_remove_hcd(), so that an in-flight
> callback always observes a valid hsotg->priv and any later rearm attempt
> is ignored by the timer core. The timer_shutdown_sync() call in
> dwc2_hcd_release() is idempotent and keeps covering the probe error
> path.
>
> Fixes: 7359d482eb4d ("staging: HCD files for the DWC2 driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yuming Hu <huyuming@kylinos.cn>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261124024516.2621743-1-huyuming@kylinos.cn?part=1
prev parent reply other threads:[~2026-11-24 2:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 2:45 [PATCH] USB: dwc2: shut down the wakeup timer before removing the HCD Yuming Hu
2026-11-24 2:53 ` 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-230427@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=huyuming@kylinos.cn \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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