All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [U-Boot v3] usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.
@ 2016-03-18  7:26 Anand Moon
  2016-03-18 11:29 ` Marek Vasut
  0 siblings, 1 reply; 2+ messages in thread
From: Anand Moon @ 2016-03-18  7:26 UTC (permalink / raw)
  To: u-boot

From: Ted Chen <tedchen@realtek.com>

Add test into xhci_submit_control_message for usb requesttype in USB
vendor request being of standardized type. This fixes detection of
certain USB fixes, for example Ethernet, USB 3.0 port. Non standardized
requesttype in USB vendor request will be ignored.

Signed-off-by: Ted Chen <tedchen@realtek.com>
Tested-by: Anand Moon <linux.amoon@gmail.com>
---
Changes logs:
v3: Fixed the commit message and bad format of the patch.
    core changes none.
v2: Resend this patch it some how got missed.
    core changes none.

Tested on Odroid-XU4 with R8153 Ethernet port.
---
 drivers/usb/host/xhci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index ca598aa..cb8a04b 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -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");
-- 
1.9.1

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

* [U-Boot] [U-Boot v3] usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION.
  2016-03-18  7:26 [U-Boot] [U-Boot v3] usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION Anand Moon
@ 2016-03-18 11:29 ` Marek Vasut
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2016-03-18 11:29 UTC (permalink / raw)
  To: u-boot

On 03/18/2016 08:26 AM, Anand Moon wrote:
> From: Ted Chen <tedchen@realtek.com>
> 
> Add test into xhci_submit_control_message for usb requesttype in USB
> vendor request being of standardized type. This fixes detection of
> certain USB fixes, for example Ethernet, USB 3.0 port. Non standardized
> requesttype in USB vendor request will be ignored.
> 
> Signed-off-by: Ted Chen <tedchen@realtek.com>
> Tested-by: Anand Moon <linux.amoon@gmail.com>

Applied, thanks!

Best regards,
Marek Vasut

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

end of thread, other threads:[~2016-03-18 11:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-18  7:26 [U-Boot] [U-Boot v3] usb: xhci: Fix vendor command error if the request type is USB_REQ_SET_ADDRESS or USB_REQ_SET_CONFIGURATION Anand Moon
2016-03-18 11:29 ` Marek Vasut

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.