Skip to contentSkip to conversation

ehci: Fail for multi-transaction interrupt transfers

PATCH Superseded Benoît Thébaudeau 2 participants 2 messages Aug 9, 2012

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 2/8 ehci: Fail for multi-transaction interrupt transfers

Interrupt transfers requiring several transactions are not supported by submit_int_msg() because bInterval is ignored. This patch returns a failure code and prints an error message in this case.

Cc Marek Vasut <[email protected]>
Cc Ilya Yanok <[email protected]>
Cc Stefan Herbrechtsmeier <[email protected]>

---
Changes for v2: N/A.
Changes for v3:
- New patch.

 .../drivers/usb/host/ehci-hcd.c                    |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/usb/host/ehci-hcd.c +10 -1
index 1977c28..a4c84a3 100644
@@ -836,8 +836,17 @@ int
 submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 	       int length, int interval)
 {
-
 	debug("dev=%p, pipe=%lu, buffer=%p, length=%d, interval=%d",
 	      dev, pipe, buffer, length, interval);
+
+	/*
+	 * Interrupt transfers requiring several transactions are not supported
+	 * because bInterval is ignored.
+	 */
+	if (length > usb_maxpacket(dev, pipe)) {
+		printf("%s: Interrupt transfers requiring several transactions "
+			"are not\nsupported.\n", __func__);
+		return -1;
+	}
 	return ehci_submit_async(dev, pipe, buffer, length, NULL);
 }
#1 lore raw

PATCH v3 2/8 ehci: Fail for multi-transaction interrupt transfers

Dear Beno?t Th?baudeau,

Quoted 26 lines

Interrupt transfers requiring several transactions are not supported by submit_int_msg() because bInterval is ignored. This patch returns a failure code and prints an error message in this case.

Cc Marek Vasut <[email protected]>
Cc Ilya Yanok <[email protected]>
Cc Stefan Herbrechtsmeier <[email protected]>

---
Changes for v2: N/A.
Changes for v3:
- New patch.

 .../drivers/usb/host/ehci-hcd.c                    |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

u-boot-usb-8d5fb14/drivers/usb/host/ehci-hcd.c index 1977c28..a4c84a3 100644

drivers/usb/host/ehci-hcd.c +0 -1
@@ -836,8 +836,17 @@ int
 submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
 	       int length, int interval)
 {
-

drivers/usb/host/ehci-hcd.c int · line 848

Quoted 10 lines
drivers/usb/host/ehci-hcd.c +8 -0
 	debug("dev=%p, pipe=%lu, buffer=%p, length=%d, interval=%d",
 	      dev, pipe, buffer, length, interval);
+
+	/*
+	 * Interrupt transfers requiring several transactions are not supported
+	 * because bInterval is ignored.
+	 */
+	if (length > usb_maxpacket(dev, pipe)) {
+		printf("%s: Interrupt transfers requiring several transactions "
+			"are not\nsupported.\n", __func__);

Removed the newline before supported and applied.

Thanks!

drivers/usb/host/ehci-hcd.c int · line 852

Quoted 4 lines
drivers/usb/host/ehci-hcd.c +2 -0
+		return -1;
+	}
 	return ehci_submit_async(dev, pipe, buffer, length, NULL);
 }

Best regards,
Marek Vasut