Re: [PATCH v5 2/6] usb: typec: Add support for Parade PS8830 Type-C Retimer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux