[PATCH] staging: dwc2: fix thinko in dwc2_hc_set_even_odd_frame()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I screwed up the sense of this if() statement while porting our
vendor driver to create the dwc2 driver. This caused frame overrun
errors on periodic transfers when there were other transfers
active in the same (micro)frame.

With this fix, the dwc2 driver now works on the Raspberry Pi
platform even with the USB Ethernet controller enabled, where
before that would cause all USB devices to stop working.

Thanks to Ray Jui and Jerry Lin at Broadcom for tracking this down.

Reported-by: Ray Jui <rjui@xxxxxxxxxxxx>
Signed-off-by: Paul Zimmerman <paulz@xxxxxxxxxxxx>
---
 drivers/staging/dwc2/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/dwc2/core.c b/drivers/staging/dwc2/core.c
index ac8ed15..e3a0e77 100644
--- a/drivers/staging/dwc2/core.c
+++ b/drivers/staging/dwc2/core.c
@@ -1148,7 +1148,7 @@ static void dwc2_hc_set_even_odd_frame(struct dwc2_hsotg *hsotg,
 	if (chan->ep_type == USB_ENDPOINT_XFER_INT ||
 	    chan->ep_type == USB_ENDPOINT_XFER_ISOC) {
 		/* 1 if _next_ frame is odd, 0 if it's even */
-		if (dwc2_hcd_get_frame_number(hsotg) & 0x1)
+		if (!(dwc2_hcd_get_frame_number(hsotg) & 0x1))
 			*hcchar |= HCCHAR_ODDFRM;
 	}
 }
-- 
1.8.2.rc0.16.g20a599e

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux