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