[PATCH] usb: host: ehci-generic: Handle DM_RESET=n case

Xavier Drudis Ferran xdrudis at tinet.cat
Tue Jan 24 09:32:08 CET 2023


El Tue, Jan 24, 2023 at 09:07:58AM +0100, Patrice CHOTARD deia:
> Hi Marek
> 
> On 1/23/23 23:32, Marek Vasut wrote:
> > In case CONFIG_DM_RESET=n, reset_get_bulk() returns -ENOTSUPP.
> > Do not fail in that case either. This is a valid use case, e.g.
> > in case the reset driver is a no-op and would only waste space
> > in the build.
> > 
> > Fixes: 81755b8c20f ("usb: host: ehci-generic: Make resets and clocks optional")
> > Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
> > ---
> > Cc: Andre Przywara <andre.przywara at arm.com>
> > Cc: Patrice Chotard <patrice.chotard at foss.st.com>
> > ---
> >  drivers/usb/host/ehci-generic.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
> > index a765a307a32..83fe701ff67 100644
> > --- a/drivers/usb/host/ehci-generic.c
> > +++ b/drivers/usb/host/ehci-generic.c
> > @@ -81,7 +81,7 @@ static int ehci_usb_probe(struct udevice *dev)
> >  	}
> >  
> >  	err = reset_get_bulk(dev, &priv->resets);
> > -	if (err && err != -ENOENT) {
> > +	if (err && err != -ENOENT && err != -ENOTSUPP) {
> >  		dev_err(dev, "Failed to get resets (err=%d)\n", err);
> >  		goto clk_err;
> >  	}
> 
> A similar patch can be applied for testing return value of clk_get_bulk() ?
> In case CONFIG_CLK is not set, clk_get_bulk() can return -ENOSYS.
>

I thought without CONFIG_CLK the USB port wouldn't work in general ?
Is there a case where it works ? (a board with the clocks enabled
before U-Boot or something?)  I once sent a patch[1] allowing some of
the clocks to fail to be got, but it still returned error if they all
failed.

[1] https://patchwork.ozlabs.org/project/uboot/patch/Y44+ayJfUlI08ptM@localhost/



More information about the U-Boot mailing list