usb: dwc2: Init desc_before_addr
PATCH 1/1 usb: dwc2: Init desc_before_addr
Initialize desc_before_addr, otherwise the USB core won't send the first 64B Get Device Descriptor request in common/usb.c function usb_setup_descriptor() . There are some USB devices which expect this sequence and otherwise can misbehave.
--- drivers/usb/host/dwc2.c | 3 +++ 1 file changed, 3 insertions(+)
---
NOTE: I checked this with TotalPhase Beagle USB480 and it does what it is
supposed to do now. It would be wonderful to get this into rc3.
drivers/usb/host/dwc2.c +3 -0
@@ -1182,6 +1182,9 @@ static int dwc2_usb_ofdata_to_platdata(struct udevice *dev)static int dwc2_usb_probe (struct udevice *dev) {struct dwc2_priv *priv =dev_get_priv (dev); +struct usb_bus_priv *bus_priv =dev_get_uclass_priv (dev); + + bus_priv->desc_before_addr = true;return dwc2_init_common (priv); }
Signature · 1 line
2.7.0
PATCH 1/1 usb: dwc2: Init desc_before_addr
Quoted 8 lines · Marek Vasut
Initialize
desc_before_addr, otherwise the USB core won't send the first 64B Get Device Descriptor request incommon/usb.cfunctionusb_setup_descriptor(). There are some USB devices which expect this sequence and otherwise can misbehave.Signed-off-by Marek Vasut <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Tom Rini <[email protected]>
Quoted 6 lines
--- drivers/usb/host/dwc2.c | 3 +++ 1 file changed, 3 insertions(+)---
NOTE: I checked this with TotalPhase Beagle USB480 and it does what it is
supposed to do now. It would be wonderful to get this into rc3.
Oh, before anyone asks if this fixes USB problem on SoCFPGA, no, it does not. There is more weird stuff to go, I have certain hypothesis, but let's see.
Quoted 15 lines
drivers/usb/host/dwc2.c +3
-0@@ -1182,6 +1182,9 @@ static int dwc2_usb_ofdata_to_platdata(struct udevice *dev)static int dwc2_usb_probe (struct udevice *dev) {struct dwc2_priv *priv =dev_get_priv (dev); +struct usb_bus_priv *bus_priv =dev_get_uclass_priv (dev); + + bus_priv->desc_before_addr = true;return dwc2_init_common (priv); }
Signature · 2 lines
Best regards, Marek Vasut
PATCH 1/1 usb: dwc2: Init desc_before_addr
In reply to Marek VasutQuoted 21 lines · Marek Vasut
Initialize
desc_before_addr, otherwise the USB core won't send the first 64B Get Device Descriptor request incommon/usb.cfunctionusb_setup_descriptor(). There are some USB devices which expect this sequence and otherwise can misbehave.Signed-off-by Marek Vasut <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Tom Rini <[email protected]>--- drivers/usb/host/dwc2.c | 3 +++ 1 file changed, 3 insertions(+)---
NOTE: I checked this with TotalPhase Beagle USB480 and it does what it is
supposed to do now. It would be wonderful to get this into rc3.drivers/usb/host/dwc2.c +0
-0
drivers/usb/host/dwc2.c static int dwc2_usb_ofdata_to_platdata(struct udevice *dev) · line 1190
Quoted 9 lines
drivers/usb/host/dwc2.c +3
-0@@ -1182,6 +1182,9 @@ static int dwc2_usb_ofdata_to_platdata(struct udevice *dev)static int dwc2_usb_probe (struct udevice *dev) {struct dwc2_priv *priv =dev_get_priv (dev); +struct usb_bus_priv *bus_priv =dev_get_uclass_priv (dev); + + bus_priv->desc_before_addr = true;return dwc2_init_common (priv); }
With this patch, I no longer have to revert commit "c998da0d67091 usb:
Change power-on / scanning timeout handling" for my problematic Kingston USB stick to work.
So feel free to add:
Dinh
PATCH 1/1 usb: dwc2: Init desc_before_addr
Quoted 36 lines · Dinh Nguyen
Quoted 21 lines · Marek Vasut
Initialize
desc_before_addr, otherwise the USB core won't send the first 64B Get Device Descriptor request incommon/usb.cfunctionusb_setup_descriptor(). There are some USB devices which expect this sequence and otherwise can misbehave.Signed-off-by Marek Vasut <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Tom Rini <[email protected]>--- drivers/usb/host/dwc2.c | 3 +++ 1 file changed, 3 insertions(+)---
NOTE: I checked this with TotalPhase Beagle USB480 and it does what it is
supposed to do now. It would be wonderful to get this into rc3.drivers/usb/host/dwc2.c +0
-0drivers/usb/host/dwc2.c static int dwc2_usb_ofdata_to_platdata(struct udevice *dev) · line 1190
Quoted 9 lines
drivers/usb/host/dwc2.c +3
-0@@ -1182,6 +1182,9 @@ static int dwc2_usb_ofdata_to_platdata(struct udevice *dev)static int dwc2_usb_probe (struct udevice *dev) {struct dwc2_priv *priv =dev_get_priv (dev); +struct usb_bus_priv *bus_priv =dev_get_uclass_priv (dev); + + bus_priv->desc_before_addr = true;return dwc2_init_common (priv); }With this patch, I no longer have to revert commit "
c998da0d67091usb:
Change power-on / scanning timeout handling" for my problematic Kingston USB stick to work.
Quoted 3 lines
So feel free to add:
Tested-by Dinh Nguyen <[email protected]>
Good for you, bad for me ;-) If we don't fix this USB horror before ELCE, you can expect a nice gift :)
Quoted 2 lines
Dinh
Signature · 2 lines
Best regards, Marek Vasut
PATCH 1/1 usb: dwc2: Init desc_before_addr
In reply to Marek VasutQuoted 8 lines · Marek Vasut
Initialize
desc_before_addr, otherwise the USB core won't send the first 64B Get Device Descriptor request incommon/usb.cfunctionusb_setup_descriptor(). There are some USB devices which expect this sequence and otherwise can misbehave.Signed-off-by Marek Vasut <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Tom Rini <[email protected]>
Thanks,
Stefan
Marek Vasut
AppliedPATCH 1/1 usb: dwc2: Init desc_before_addr
Quoted 6 lines · Stefan Roese
Quoted 5 lines · Marek Vasut
Initialize
desc_before_addr, otherwise the USB core won't send the first 64B Get Device Descriptor request incommon/usb.cfunctionusb_setup_descriptor(). There are some USB devices which expect this sequence and otherwise can misbehave.
Quoted 8 lines
Quoted 3 lines
Signed-off-by Marek Vasut <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Tom Rini <[email protected]>Tested-by Stefan Roese <[email protected]>Thanks,
Stefan
Applied.
Signature · 2 lines
Best regards, Marek Vasut