Patchwork [U-Boot] musb: process control messages after roothub accepted it

login
register
mail settings
Submitter Mike Frysinger
Date April 21, 2011, 4:42 p.m.
Message ID <1303404130-7237-1-git-send-email-vapier@gentoo.org>
Download mbox | patch
Permalink /patch/92426/
State Accepted
Commit b17ce92a424ab5ea93a1ed973e5d2ce047a7d321
Delegated to: Remy Bohmer
Headers show

Comments

Mike Frysinger - April 21, 2011, 4:42 p.m.
From: Cliff Cai <cliff.cai@analog.com>

When dealing with non-multipoint devices, if the software root hub code
accepted the message, then we still need to process it normally.  So only
return quickly when the root hub skipped the message or is otherwise in
an error state.

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/usb/musb/musb_hcd.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
Remy Bohmer - May 12, 2011, 8:03 p.m.
Hi,

2011/4/21 Mike Frysinger <vapier@gentoo.org>:
> From: Cliff Cai <cliff.cai@analog.com>
>
> When dealing with non-multipoint devices, if the software root hub code
> accepted the message, then we still need to process it normally.  So only
> return quickly when the root hub skipped the message or is otherwise in
> an error state.
>
> Signed-off-by: Cliff Cai <cliff.cai@analog.com>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>

Applied to u-boot-usb
Thanks.

Remy

Patch

diff --git a/drivers/usb/musb/musb_hcd.c b/drivers/usb/musb/musb_hcd.c
index 8b0c61d..974bb31 100644
--- a/drivers/usb/musb/musb_hcd.c
+++ b/drivers/usb/musb/musb_hcd.c
@@ -853,8 +853,11 @@  int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 
 #ifdef MUSB_NO_MULTIPOINT
 	/* Control message is for the HUB? */
-	if (devnum == rh_devnum)
-		return musb_submit_rh_msg(dev, pipe, buffer, len, setup);
+	if (devnum == rh_devnum) {
+		int stat = musb_submit_rh_msg(dev, pipe, buffer, len, setup);
+		if (stat)
+			return stat;
+	}
 #endif
 
 	/* select control endpoint */