From: sashiko-bot@kernel.org
To: "Xinsheng Zhu" <xinsheng.zhu.ny@gmail.com>, linux-usb@vger.kernel.org
Subject: Re: [PATCH usb-next v4] usb: gadget: pxa27x_udc: fix request completion locking on PREEMPT_RT
Date: Sat, 05 Dec 2026 23:36:28 +0000 [thread overview]
Message-ID: <sashiko-outbox-251993@kernel.org> (raw)
In-Reply-To: <20261205232247.38270-1-xinsheng.zhu.ny@gmail.com>
> req_done() explicitly disables local interrupts around
> usb_gadget_giveback_request(). The completion callback may acquire
> spinlocks, which become sleeping locks on PREEMPT_RT and cannot be
> acquired with interrupts disabled.
>
> Use spin_unlock() and spin_lock() around the giveback, following
> the locking pattern introduced in commit 8d63c83d8eb9
> ("USB: gadget: dummy-hcd: Fix locking bug in RT-enabled kernels")
> and commit 09bf21bf5249 ("usbip: Fix locking bug in RT-enabled kernels").
> This keeps interrupts disabled during the giveback on non-RT kernels
> without explicitly disabling them on PREEMPT_RT.
>
> Require ep->lock to be held when calling req_done(),
> ep_end_in_req() and ep_end_out_req(). Acquire the lock in the
> previously unlocked EP0 completion paths to protect both request
> removal and endpoint statistics updates.
>
> pxa_ep_dequeue() drops ep->lock after finding the request but
> before removing it from the queue. A concurrent completion may
> retire and free the request in this window. Keep ep->lock held
> across the request lookup and removal.
>
> Remove the now unnecessary pflags parameter from the completion
> helpers, update their kernel-doc and add lockdep_assert_held()
> to req_done() to check its locking contract.
>
> Fixes: 5e23e90f3388 ("USB: pxa27x_udc: Fix deadlocks on request queueing")
> Signed-off-by: Xinsheng Zhu <xinsheng.zhu.ny@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261205232247.38270-1-xinsheng.zhu.ny@gmail.com?part=1
prev parent reply other threads:[~2026-12-05 23:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-05 23:22 [PATCH usb-next v4] usb: gadget: pxa27x_udc: fix request completion locking on PREEMPT_RT Xinsheng Zhu
2026-12-05 23:36 ` 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-251993@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=xinsheng.zhu.ny@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 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.