From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796513789; b=GdYuTKKbI8b5dTvNSv4bNpEw+kxmu/ZvEqmZ/ytTTksfiNcUUq1ihxfereUcBbaVzyZb phqH40UfJQWbvmPaWIgUkahGr8edPU/0EH+2j7RumHtlN0lT/cEu1IoWb6BGH6XhaYS+n Trr/dpC0JQ8gz3rs0NGDMFU5vMZohNjgiirK21IAhOidpvt1LXfrEm4nJCXvG2Fg0FkVn 5ZKfpIwqenweec1UOfzYD0y/Bb2ikrvBv++ziFqy6fHvVZzjIMSJWIDx2qCbZO2j3Crew ij89TbDIx5lCop5mMrT7gjAOdrSUieI9pz7t25u4wAP753pr3oKdhRVssDdH45KL2ZA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796513789; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=NOz/VrSsFy6jH2D8c1bFiYqkPO3y55bTSHa3v2bgKbM=; b=WsHqfMxs2YPT8NrowtmqJEdmIa5TvMg3xawuI7dCtou5UFW0rixYex925Oz0zKL76aIq 7bjbMEaENjO7ZPrWY9fZlUVeBRnX8JT572qBB1OZQyymiiiz+osTpGclAQpe1n9usDFjm 7D66K7E/hTpvt8BBuI5YkfbK4TmiPuUIe3RflWT9RkoiWN8tNoTpV8SdlHJenpoFnIDWo yq+kfTLgnE0CJBtFYQ47gtF5mR/HcgYaGS2v/ld3HAFAr0bWV6hw1PNjA5KhuSGNU+xQJ KYry2m5RSHkgwRBxkr5tnIUjxr9f5wgWhp7UTuavDUdU/Ez9cNBtk8au/llsfVrL73Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="kYM/2TGE"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DE7E606A31F for ; Sat, 5 Dec 2026 23:36:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kYM/2TGE Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7AE81F0092B; Sat, 5 Dec 2026 23:36:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796513789; bh=NOz/VrSsFy6jH2D8c1bFiYqkPO3y55bTSHa3v2bgKbM=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=kYM/2TGEVxPCWnUEKILZumNt4g+ebyHfR1nJm4Qr/lXk7fvPtC+hvdH25KZaXwzvF JuY1xcp8i0zkxjPc4hpQlZ5gRx9WOXsdG8subjPfszwjaC6i+VanLvbdZzALIM3PCu OIgSYPCrxxnHQunyB8WaXqgR/DC9jHFG0fK/VXM1B/klTkEMNfdnHfRG26G914BB3r GzbUMqYyBgnidirVBbRgDrkK0IgOQEe6YfaSRh5SRZUNnr2842D/KbA3gLgDL9XSGi 4LmtTNaPGlwDsxD6g8dDPapg+if6igaLFV/WhUkoalRAdrFvTCl3G28F7m/jWs30jj FrvvID/m2QjdQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH usb-next v4] usb: gadget: pxa27x_udc: fix request completion locking on PREEMPT_RT Reply-To: sashiko-reviews@lists.linux.dev To: "Xinsheng Zhu" , linux-usb@vger.kernel.org In-Reply-To: <20261205232247.38270-1-xinsheng.zhu.ny@gmail.com> References: <20261205232247.38270-1-xinsheng.zhu.ny@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 23:36:28 +0000 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > 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. >=20 > 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. >=20 > 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. >=20 > 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. >=20 > 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. >=20 > Fixes: 5e23e90f3388 ("USB: pxa27x_udc: Fix deadlocks on request queueing") > Signed-off-by: Xinsheng Zhu Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261205232247.3827= 0-1-xinsheng.zhu.ny@gmail.com?part=3D1