All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] usb: udc-uclass: Fixed problem when no alias is defined in DT
@ 2019-01-24 14:44 Jean-Jacques Hiblot
  2019-02-26  9:37 ` Vignesh R
  0 siblings, 1 reply; 3+ messages in thread
From: Jean-Jacques Hiblot @ 2019-01-24 14:44 UTC (permalink / raw)
  To: u-boot

commit 801f1fa442 "dm: usb: udc: Use SEQ_ALIAS to index the USB gadget
ports" changed the way the udevice if found. It uses the alias to find
a udevice for a given USB port number. In the commit log it was stated
that if no alias is provided, the bind order will be used instead. However
it doesn't work. Fixing this by adding a call to uclass_get_device() if
uclass_get_device_by_seq() fails.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
---
 drivers/usb/gadget/udc/udc-uclass.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/udc-uclass.c b/drivers/usb/gadget/udc/udc-uclass.c
index 8d7864797a..3053ccf7d9 100644
--- a/drivers/usb/gadget/udc/udc-uclass.c
+++ b/drivers/usb/gadget/udc/udc-uclass.c
@@ -23,8 +23,11 @@ int usb_gadget_initialize(int index)
 		return 0;
 	ret = uclass_get_device_by_seq(UCLASS_USB_GADGET_GENERIC, index, &dev);
 	if (!dev || ret) {
-		pr_err("No USB device found\n");
-		return -ENODEV;
+		ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, index, &dev);
+		if (!dev || ret) {
+			pr_err("No USB device found\n");
+			return -ENODEV;
+		}
 	}
 	dev_array[index] = dev;
 	return 0;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] usb: udc-uclass: Fixed problem when no alias is defined in DT
  2019-01-24 14:44 [U-Boot] [PATCH] usb: udc-uclass: Fixed problem when no alias is defined in DT Jean-Jacques Hiblot
@ 2019-02-26  9:37 ` Vignesh R
  2019-02-26 10:15   ` Lukasz Majewski
  0 siblings, 1 reply; 3+ messages in thread
From: Vignesh R @ 2019-02-26  9:37 UTC (permalink / raw)
  To: u-boot

Hi Lukasz,

On 24/01/19 8:14 PM, Jean-Jacques Hiblot wrote:
> commit 801f1fa442 "dm: usb: udc: Use SEQ_ALIAS to index the USB gadget
> ports" changed the way the udevice if found. It uses the alias to find
> a udevice for a given USB port number. In the commit log it was stated
> that if no alias is provided, the bind order will be used instead. However
> it doesn't work. Fixing this by adding a call to uclass_get_device() if
> uclass_get_device_by_seq() fails.
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> ---

This fixes DFU gadget failing to find USB device on DRA7xx/AM57xx
platforms. Since, this patch fixes a regression, could this be picked up
for next -rc?

Tested-by: Vignesh R <vigneshr@ti.com>

>  drivers/usb/gadget/udc/udc-uclass.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/udc-uclass.c b/drivers/usb/gadget/udc/udc-uclass.c
> index 8d7864797a..3053ccf7d9 100644
> --- a/drivers/usb/gadget/udc/udc-uclass.c
> +++ b/drivers/usb/gadget/udc/udc-uclass.c
> @@ -23,8 +23,11 @@ int usb_gadget_initialize(int index)
>  		return 0;
>  	ret = uclass_get_device_by_seq(UCLASS_USB_GADGET_GENERIC, index, &dev);
>  	if (!dev || ret) {
> -		pr_err("No USB device found\n");
> -		return -ENODEV;
> +		ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, index, &dev);
> +		if (!dev || ret) {
> +			pr_err("No USB device found\n");
> +			return -ENODEV;
> +		}
>  	}
>  	dev_array[index] = dev;
>  	return 0;
> 

-- 
Regards
Vignesh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] usb: udc-uclass: Fixed problem when no alias is defined in DT
  2019-02-26  9:37 ` Vignesh R
@ 2019-02-26 10:15   ` Lukasz Majewski
  0 siblings, 0 replies; 3+ messages in thread
From: Lukasz Majewski @ 2019-02-26 10:15 UTC (permalink / raw)
  To: u-boot

Hi Vignesh,

> Hi Lukasz,
> 
> On 24/01/19 8:14 PM, Jean-Jacques Hiblot wrote:
> > commit 801f1fa442 "dm: usb: udc: Use SEQ_ALIAS to index the USB
> > gadget ports" changed the way the udevice if found. It uses the
> > alias to find a udevice for a given USB port number. In the commit
> > log it was stated that if no alias is provided, the bind order will
> > be used instead. However it doesn't work. Fixing this by adding a
> > call to uclass_get_device() if uclass_get_device_by_seq() fails.
> > 
> > Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> > ---  
> 
> This fixes DFU gadget failing to find USB device on DRA7xx/AM57xx
> platforms. Since, this patch fixes a regression, could this be picked
> up for next -rc?

Yes, I will pick it up. Sorry for delay.

> 
> Tested-by: Vignesh R <vigneshr@ti.com>
> 
> >  drivers/usb/gadget/udc/udc-uclass.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/gadget/udc/udc-uclass.c
> > b/drivers/usb/gadget/udc/udc-uclass.c index 8d7864797a..3053ccf7d9
> > 100644 --- a/drivers/usb/gadget/udc/udc-uclass.c
> > +++ b/drivers/usb/gadget/udc/udc-uclass.c
> > @@ -23,8 +23,11 @@ int usb_gadget_initialize(int index)
> >  		return 0;
> >  	ret = uclass_get_device_by_seq(UCLASS_USB_GADGET_GENERIC,
> > index, &dev); if (!dev || ret) {
> > -		pr_err("No USB device found\n");
> > -		return -ENODEV;
> > +		ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC,
> > index, &dev);
> > +		if (!dev || ret) {
> > +			pr_err("No USB device found\n");
> > +			return -ENODEV;
> > +		}
> >  	}
> >  	dev_array[index] = dev;
> >  	return 0;
> >   
> 




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190226/42ff546c/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-26 10:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-24 14:44 [U-Boot] [PATCH] usb: udc-uclass: Fixed problem when no alias is defined in DT Jean-Jacques Hiblot
2019-02-26  9:37 ` Vignesh R
2019-02-26 10:15   ` Lukasz Majewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.