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=1796354532; b=CbOzKiPwUVLari/9QNEcuc0TaGbTGHWJuWAw6LJWhOXipKLSQ1qAjC9E4i/GBbrz5je5 HSzuCGiDm0fabJC0PvZ1LL5DSSPMPTtN1oscfmX1Xg6XNx6Ehp0qn4+MrgZ6LJdbL66mD jmlQnocAXlNBQkkdKTyiZZUY8fmaRF7sCxtbPA/zXcey+l1vMLE4NpVxakUluvBl4Cmn6 bmhcpgsg8U0nL//eHVhCw+FxDBPaowhVdedtAU0ZTxqHTbmnhpY7J4M/5SUfuWLaznzi3 qO04I+RdhtUAK/TwNBd808zZf8njJOs9T7TgX4v5ymrCjHm2waTPvzFx1eujdhrYwdg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796354532; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=8h5x4XydBmC4yWPcqRdUciuWmuriYXJLN2lRcdVByyo=; b=NNVvEVWMkD1nOEUNvYBOyppWiCBTw4Z1d71cl4YHav6JDbgulO5cUXa7mzp7zA60DJqy rryBQJzumPUh3XFs2irg+jGNwV6R5bMtJg17y2xPBlkC+Yu0/4+rg4h61SMoXVrRnYEjo aXp4vaLXx9hPC5hyPKZUuhvEbusuFGG1TX4MQgr9V/r9KM/VfKFwnXO/S64Pejuf5lSv7 pC+GEf5Xekqs5t3+eXGAPm5R9eV6Jx6caEJ5fdRXFfWDVFyvqJFFn4DKV/7uobgMKjKVR 1CCMUp0TW5XAdKxzeH1D1cqvZ0Ddp6DBDrSVxcewuGU1THx9uDkhzUPXECm/0HJd9Dw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=LWgU2C13; 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 AFBD6606A322; Fri, 4 Dec 2026 03:22:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=LWgU2C13 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14B9B1F000CE; Fri, 4 Dec 2026 03:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796354532; bh=8h5x4XydBmC4yWPcqRdUciuWmuriYXJLN2lRcdVByyo=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=LWgU2C13DnSRlSTwRPsMrnIJ8RAhjjrv7vz6p8MoGZFBS+QrbRwL4NuqGAvGZBswP jNIzf5qdXXe8CRIbvFtF33h2t7nEqEIx13lJ/XEyqjL6mP8YvRqLQ0P0ynH8yTVBGe +4fNl0sGryM4MO9F48nO6yMQFeufZnp0cGxUKSVs= Date: Thu, 3 Dec 2026 17:48:53 +0100 From: Greg Kroah-Hartman To: Sebastian Reichel Cc: Thinh Nguyen , Heiko Stuebner , Vinod Koul , Neil Armstrong , Manivannan Sadhasivam , Manivannan Sadhasivam , Krishna Kurapati , Chaoyi Chen , Igor Paunovic , Alexey Charkov , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org, kernel@collabora.com Subject: Re: [PATCH v19 5/6] usb: dwc3: core: only access GUSB3PIPECTL under lock Message-ID: <2026120340-designing-playroom-0d07@gregkh> References: <20261114-b4-rockchip-dwc3-rockchip-glue-v19-0-b79fb5f4b42a@collabora.com> <20261114-b4-rockchip-dwc3-rockchip-glue-v19-5-b79fb5f4b42a@collabora.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261114-b4-rockchip-dwc3-rockchip-glue-v19-5-b79fb5f4b42a@collabora.com> On Sat, Nov 14, 2026 at 02:02:04AM +0100, Sebastian Reichel wrote: > Update dwc3_enable_susphy() to take dwc->lock while updating > GUSB3PIPECTL to protect the read-modify-write cycle from other users > accessing the same register, which is soon introduced. > > Note: technically there is already dwc3_ss_phy_setup() as a second user, > but it runs and finishes before any call to dwc3_enable_susphy() should > happen. > > Signed-off-by: Sebastian Reichel > --- > drivers/usb/dwc3/core.c | 19 +++++++++++++++---- > drivers/usb/dwc3/glue.h | 2 +- > 2 files changed, 16 insertions(+), 5 deletions(-) > > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c > index daf5aec07fbf..0cb1b33a7c98 100644 > --- a/drivers/usb/dwc3/core.c > +++ b/drivers/usb/dwc3/core.c > @@ -108,11 +108,13 @@ static int dwc3_get_dr_mode(struct dwc3 *dwc) > return 0; > } > > -void dwc3_enable_susphy(struct dwc3 *dwc, bool enable) > +static void __dwc3_enable_susphy(struct dwc3 *dwc, bool enable) > { > u32 reg; > int i; > > + lockdep_assert_held(&dwc->lock); Can't you also use __must_hold()?