[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z3z39Z_BH1stsO0c@hovoldconsulting.com>
Date: Tue, 7 Jan 2025 10:46:29 +0100
From: Johan Hovold <johan@...nel.org>
To: Abel Vesa <abel.vesa@...aro.org>
Cc: Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>,
Rajendra Nayak <quic_rjendra@...cinc.com>,
Sibi Sankar <quic_sibis@...cinc.com>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Trilok Soni <quic_tsoni@...cinc.com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v5 2/6] usb: typec: Add support for Parade PS8830 Type-C
Retimer
On Mon, Jan 06, 2025 at 04:14:39PM +0200, Abel Vesa wrote:
> On 24-12-04 17:24:54, Johan Hovold wrote:
> > On Tue, Nov 12, 2024 at 07:01:11PM +0200, Abel Vesa wrote:
> > > + /* skip resetting if already configured */
> > > + if (regmap_test_bits(retimer->regmap, REG_USB_PORT_CONN_STATUS_0,
> > > + CONN_STATUS_0_CONNECTION_PRESENT))
> > > + return 0;
> >
> > What if the device is held in reset? This looks like it only works if
> > the boot firmware has already enabled the retimer. Otherwise you may
> > return success from probe here with the retimer still in reset.
>
> Please correct me if I'm wrong, but if the read above fails or reads
> anything else than "connection present", then below we go through the
> resetting sequence. If it reads "connection present", then retimer can't
> be in reset.
regmap_test_bits() returns a negative errno if the read fails, so you
need to check that the return value is 1 here to avoid returning success
from probe on failure.
Johan
Powered by blists - more mailing lists