usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.
Subsystems (2)
PATCH 1/1 usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.
Add a condition of set_address and set_configuration to check if the request is standardized.
--- drivers/usb/host/xhci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/usb/host/xhci.c +4 -2
@@ -941,10 +941,12 @@ static int _xhci_submit_control_msg(struct usb_device *udev, unsigned long pipe,if (usb_pipedevice (pipe) == ctrl->rootdev)return xhci_submit_root (udev, pipe, buffer, setup); -if (setup->request ==USB_REQ_SET_ADDRESS ) +if (setup->request ==USB_REQ_SET_ADDRESS && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD )return xhci_address_device (udev, root_portnr); -if (setup->request ==USB_REQ_SET_CONFIGURATION ) { +if (setup->request ==USB_REQ_SET_CONFIGURATION && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD ) { ret =xhci_set_configuration (udev);if (ret) {puts ("Failed to configure xHCI endpoint\n" );
Signature · 1 line
1.7.9.5
PATCH 1/1 usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.
Add a condition of set_address and set_configuration to check if the request is standardized.
--- drivers/usb/host/xhci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/usb/host/xhci.c +4 -2
@@ -941,10 +941,12 @@ static int _xhci_submit_control_msg(struct usb_device *udev, unsigned long pipe,if (usb_pipedevice (pipe) == ctrl->rootdev)return xhci_submit_root (udev, pipe, buffer, setup); -if (setup->request ==USB_REQ_SET_ADDRESS ) +if (setup->request ==USB_REQ_SET_ADDRESS && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD )return xhci_address_device (udev, root_portnr); -if (setup->request ==USB_REQ_SET_CONFIGURATION ) { +if (setup->request ==USB_REQ_SET_CONFIGURATION && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD ) { ret =xhci_set_configuration (udev);if (ret) {puts ("Failed to configure xHCI endpoint\n" );
Signature · 1 line
1.7.9.5
PATCH 1/1 usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.
Hi Ted,
Quoted 28 lines · Ted Chen
Add a condition of
set_addressandset_configurationto check if the request is standardized.Signed-off-by Ted Chen <[email protected]>--- drivers/usb/host/xhci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/usb/host/xhci.c +4
-3@@ -941,10 +941,12 @@ static int _xhci_submit_control_msg(struct usb_device *udev, unsigned long pipe,if (usb_pipedevice (pipe) == ctrl->rootdev)return xhci_submit_root (udev, pipe, buffer, setup); -if (setup->request ==USB_REQ_SET_ADDRESS ) +if (setup->request ==USB_REQ_SET_ADDRESS && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD )return xhci_address_device (udev, root_portnr); -if (setup->request ==USB_REQ_SET_CONFIGURATION ) { +if (setup->request ==USB_REQ_SET_CONFIGURATION && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD ) { ret =xhci_set_configuration (udev);if (ret) {puts ("Failed to configure xHCI endpoint\n" ); --
Quoted 2 lines
1.7.9.5
Tested on Odroid-XU4 with Ethernet USB3.0 RT8153-VB.
-Anand Moon
PATCH 1/1 usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.
Hi Anand,
I have a odroid-xu4, but it doesn't detect the rtl8153:
U-Boot 2016.01-rc1-00441-g75507d5-dirty (Dec 07 2015 - 15:46:09 +0800) for ODROID-XU3
CPU: Exynos5422 @ 800 MHz Model: Odroid XU3 based on EXYNOS5422 Board: Odroid XU3 based on EXYNOS5422 Type: xu4 DRAM: 2 GiB
__of_translate_address: Bad cell count for gpx0
MMC: EXYNOS DWMMC: 0, EXYNOS DWMMC: 1
*** Warning - bad CRC, using default environment
In: serial Out: serial Err: serial Net: No ethernet found. Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
starting USB...
USB0: USB EHCI 1.00 USB1: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
USB2: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 2 USB Device(s) found
scanning bus 2 for devices... 2 USB Device(s) found
scanning usb for ethernet devices... Setup ERROR: address device
command for slot 1.
Unknown version 0x0000
Unknown Device
0 Ethernet Device(s) found
No ethernet found.
could you send me your odroid-xu3_defconfig? Thanks. BTW, I added "#define CONFIG_USB_ETHER_RTL8152" to include/configs/exynos5-common.h
Regards,
Joe
Quoted 46 lines · Anand Moon
Hi Ted,
drivers/usb/host/xhci.c static int _xhci_submit_control_msg(struct
Quoted 13 lines · Ted Chen
Add a condition of
set_addressandset_configurationto check if the request is standardized.Signed-off-by Ted Chen <[email protected]>--- drivers/usb/host/xhci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/usb/host/xhci.c +0
-0@@ -941,10 +941,12 @@ static int _xhci_submit_control_msg(struct
usb_device*udev, unsigned long pipe,Quoted 15 lines
drivers/usb/host/xhci.c +4
-3if (usb_pipedevice (pipe) == ctrl->rootdev)return xhci_submit_root (udev, pipe, buffer, setup); -if (setup->request ==USB_REQ_SET_ADDRESS ) +if (setup->request ==USB_REQ_SET_ADDRESS && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD )return xhci_address_device (udev, root_portnr); -if (setup->request ==USB_REQ_SET_CONFIGURATION ) { +if (setup->request ==USB_REQ_SET_CONFIGURATION && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD ) { ret =xhci_set_configuration (udev);if (ret) {puts ("Failed to configure xHCI endpoint\n" ); --Quoted 2 lines
1.7.9.5
Tested on Odroid-XU4 with Ethernet USB3.0 RT8153-VB.
Tested-by Anand Moon <[email protected]>Reviewed-by Anand Moon <[email protected]>-Anand Moon
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
PATCH 1/1 usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.
Oops, please ignore this message. The rtl8153 is detected :)
Quoted 101 lines · Joe Culler
Hi Anand,
I have a odroid-xu4, but it doesn't detect the rtl8153:
U-Boot 2016.01-rc1-00441-g75507d5-dirty (Dec 07 2015 - 15:46:09 +0800) for ODROID-XU3
CPU: Exynos5422 @ 800 MHz Model: Odroid XU3 based on EXYNOS5422 Board: Odroid XU3 based on EXYNOS5422 Type: xu4 DRAM: 2 GiB
__of_translate_address: Bad cell count for gpx0
MMC: EXYNOS DWMMC: 0, EXYNOS DWMMC: 1
*** Warning - bad CRC, using default environmentIn: serial Out: serial Err: serial Net: No ethernet found. Hit any key to stop autoboot: 0switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
starting USB...USB0: USB EHCI 1.00 USB1: Register 2000140 NbrPorts 2Starting the controller
USB XHCI 1.00
USB2: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 2 USB Device(s) found
scanning bus 2 for devices... 2 USB Device(s) found
scanning usb for ethernet devices... Setup ERROR: address device
command for slot 1.
Unknown version0x0000
Unknown Device
0 Ethernet Device(s) found
No ethernet found.could you send me your odroid-xu3_defconfig? Thanks. BTW, I added "#define
CONFIG_USB_ETHER_RTL8152" toinclude/configs/exynos5-common.hRegards,
JoeQuoted 46 lines · Anand Moon
Hi Ted,
drivers/usb/host/xhci.c static int _xhci_submit_control_msg(struct
Quoted 13 lines · Ted Chen
Add a condition of
set_addressandset_configurationto check if the request is standardized.Signed-off-by Ted Chen <[email protected]>--- drivers/usb/host/xhci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/usb/host/xhci.c +0
-0@@ -941,10 +941,12 @@ static int _xhci_submit_control_msg(struct
usb_device*udev, unsigned long pipe,Quoted 15 lines
drivers/usb/host/xhci.c +4
-3if (usb_pipedevice (pipe) == ctrl->rootdev)return xhci_submit_root (udev, pipe, buffer, setup); -if (setup->request ==USB_REQ_SET_ADDRESS ) +if (setup->request ==USB_REQ_SET_ADDRESS && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD )return xhci_address_device (udev, root_portnr); -if (setup->request ==USB_REQ_SET_CONFIGURATION ) { +if (setup->request ==USB_REQ_SET_CONFIGURATION && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD ) { ret =xhci_set_configuration (udev);if (ret) {puts ("Failed to configure xHCI endpoint\n" ); --Quoted 2 lines
1.7.9.5
Tested on Odroid-XU4 with Ethernet USB3.0 RT8153-VB.
Tested-by Anand Moon <[email protected]>Reviewed-by Anand Moon <[email protected]>-Anand Moon
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
PATCH 1/1 usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.
In reply to Ted ChenQuoted 13 lines · Ted Chen
Add a condition of
set_addressandset_configurationto check if the request is standardized.Signed-off-by Ted Chen <[email protected]>--- drivers/usb/host/xhci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/usb/host/xhci.c +0
-0
drivers/usb/host/xhci.c static int _xhci_submit_control_msg(struct usb_device · line 943
Quoted 3 lines
drivers/usb/host/xhci.c +0
-0@@ -941,10 +941,12 @@ static int _xhci_submit_control_msg(struct usb_device *udev, unsigned long pipe, if (usb_pipedevice(pipe) == ctrl->rootdev)return xhci_submit_root (udev, pipe, buffer, setup);
Hi!
What do you say we reorder the check a little:
if ((setup->requesttype & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
if (setup->request == USB_REQ_SET_ADDRESS)
return xhci_address_device(udev, root_portnr);
if (setup->request == USB_REQ_SET_CONFIGURATION)
...
}Also, I suspect this sort of fix needs to be applied to at least dwc3 ep0.c, r8a66597-hcd.c and musb_hcd.c as well.
Paging Hans so he can share his visdom too :)
drivers/usb/host/xhci.c static int _xhci_submit_control_msg(struct usb_device *udev, unsigned long pipe, · line 952
Quoted 11 lines
drivers/usb/host/xhci.c +4
-2-if (setup->request ==USB_REQ_SET_ADDRESS ) +if (setup->request ==USB_REQ_SET_ADDRESS && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD )return xhci_address_device (udev, root_portnr); -if (setup->request ==USB_REQ_SET_CONFIGURATION ) { +if (setup->request ==USB_REQ_SET_CONFIGURATION && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD ) { ret =xhci_set_configuration (udev);if (ret) {puts ("Failed to configure xHCI endpoint\n" );
Best regards,
Marek Vasut
PATCH 1/1 usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.
Hi Marek,
Quoted 41 lines
-----Original Message-----
From: Marek Vasut [mailto:marex at denx.de]
Sent: Thursday, November 26, 2015 9:25 AM
To: Ted
Cc: swarren at nvidia.com; u-boot at lists.denx.de; linux.amoon at gmail.com; Hans de Goede
Subject: Re: [PATCH] usb: xhci: Fix vendor command error if the request type isUSB_REQ_SET_ADDRESSorUSB_REQ_SET_CONFIGURATION.Quoted 1 line · Ted Chen
Add a condition of
set_addressandset_configurationtocheck if the
Review
Quoted 8 lines
request is standardized.
Signed-off-by Ted Chen <[email protected]>--- drivers/usb/host/xhci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/usb/host/xhci.cindexQuoted 5 lines
ca598aa..cb8a04b 100644
drivers/usb/host/xhci.c +0
-0@@ -941,10 +941,12 @@ static int _xhci_submit_control_msg(struct
usb_device*udev, unsigned long pipe, if(
usb_pipedevice(pipe)==ctrl->rootdev)Quoted 2 lines
return
xhci_submit_root(udev, pipe, buffer, setup);Hi!
What do you say we reorder the check a little:if ((setup->requesttype & USB_TYPE_MASK) == USB_TYPE_STANDARD) { if (setup->request == USB_REQ_SET_ADDRESS) return xhci_address_device(udev, root_portnr); if (setup->request == USB_REQ_SET_CONFIGURATION) ... }
Quoted 3 lines
Also, I suspect this sort of fix needs to be applied to at least dwc3
ep0.c,r8a66597-hcd.candmusb_hcd.cas well.
I don't have another board in my hand, so I can't verify the other xhci host controller.
But I have confirmed this patch in xhci.c actually can fix errors while the the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION in USB vendor command.
Quoted 1 line
Paging Hans so he can share his visdom too :)
Hi Hans,
Do you have any comments?
Thanks
Quoted 18 lines
drivers/usb/host/xhci.c static int _xhci_submit_control_msg(struct usb_device *udev, unsigned long pipe, · line 952
Quoted 12 lines
drivers/usb/host/xhci.c +4
-2-if (setup->request ==USB_REQ_SET_ADDRESS ) +if (setup->request ==USB_REQ_SET_ADDRESS && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD )return xhci_address_device (udev, root_portnr); -if (setup->request ==USB_REQ_SET_CONFIGURATION ) { +if (setup->request ==USB_REQ_SET_CONFIGURATION && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD ) { ret =xhci_set_configuration (udev);if (ret) {puts ("Failed to configure xHCI endpoint\n" );Best regards,
Marek Vasut------Please consider the environment before printing this e-mail.
PATCH 1/1 usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.
Quoted 1 line · Ted
Hi Marek,
Hi Ted,
Quoted 49 lines
Quoted 49 lines
-----Original Message-----
From: Marek Vasut [mailto:marex at denx.de]
Sent: Thursday, November 26, 2015 9:25 AM
To: Ted
Cc: swarren at nvidia.com; u-boot at lists.denx.de; linux.amoon at gmail.com; Hans de Goede
Subject: Re: [PATCH] usb: xhci: Fix vendor command error if the request type isUSB_REQ_SET_ADDRESSorUSB_REQ_SET_CONFIGURATION.Quoted 1 line · Ted Chen
Add a condition of
set_addressandset_configurationtocheck if the
Review
Quoted 9 lines
request is standardized.
Signed-off-by Ted Chen <[email protected]>---
drivers/usb/host/xhci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/usb/host/xhci.cindexQuoted 5 lines
ca598aa..cb8a04b 100644
drivers/usb/host/xhci.c +0
-0@@ -941,10 +941,12 @@ static int _xhci_submit_control_msg(struct
usb_device*udev, unsigned long pipe, if(
usb_pipedevice(pipe)==ctrl->rootdev)Quoted 1 line
return
xhci_submit_root(udev, pipe, buffer, setup);Hi!
What do you say we reorder the check a little:if ((
setup->requesttype&USB_TYPE_MASK) ==USB_TYPE_STANDARD) {if (setup->request == USB_REQ_SET_ADDRESS) return xhci_address_device(udev, root_portnr); if (setup->request == USB_REQ_SET_CONFIGURATION) ...
Quoted 7 lines
Quoted 4 lines
}
Also, I suspect this sort of fix needs to be applied to at least dwc3
ep0.c,r8a66597-hcd.candmusb_hcd.cas well.I don't have another board in my hand, so I can't verify the other xhci host controller.
That's fine, just fixing this problem everywhere is enough and the people who have the controller can test it themselves.
Quoted 3 lines
But I have confirmed this patch in
xhci.cactually can fix errors while the the request type isUSB_REQ_SET_ADDRESSorUSB_REQ_SET_CONFIGURATIONin USB vendor command.
Excellent.
Quoted 7 lines
Quoted 1 line
Paging Hans so he can share his visdom too :)
Hi Hans,
Do you have any comments?
Thanks
Thanks!
Quoted 19 lines
Quoted 19 lines
Quoted 4 lines
drivers/usb/host/xhci.c +2
-1-if (setup->request ==USB_REQ_SET_ADDRESS ) +if (setup->request ==USB_REQ_SET_ADDRESS && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD )drivers/usb/host/xhci.c static int _xhci_submit_control_msg(struct usb_device *udev, unsigned long pipe, · line 952
Quoted 10 lines
drivers/usb/host/xhci.c +2
-1return xhci_address_device (udev, root_portnr); -if (setup->request ==USB_REQ_SET_CONFIGURATION ) { +if (setup->request ==USB_REQ_SET_CONFIGURATION && + (setup->requesttype &USB_TYPE_MASK ) ==USB_TYPE_STANDARD ) { ret =xhci_set_configuration (udev);if (ret) {puts ("Failed to configure xHCI endpoint\n" );Best regards,
Marek Vasut------Please consider the environment before printing this e-mail.