[PATCH] Patch for clearing PRC bit in PORTSC register at the time of XHCI driver insertion

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

 



Hi Greg,

Our host controller sets PRC and CSC bits at the time of initialization
even though no USB device is attached. At the time of initialization,
hub_probe() gets called and in-turn it calls hub_activate().
hub_activate() clears the CSC bit, but PRC bit does not get cleared (in
linux 3.6.1). hub_events() has functionality to clear the PRC bit, but
initially there is no events from HUB, so hub_events() may not clear the
PRC bit. Due to this behavior, when we try to insert a USB device,
interrupt does not generate (because, earlier, PRC bit was set and not
cleared) and USB device does not get enumerated.

Below Patch allows to clear PRC bit in hub_activate() function. So,
above issue gets resolved.

This patch is currently against a linux 3.6.1 kernel, for the x86
architecture.

Let me know in case of any concern.

Thanks,
Bhavik Kothari

-------------------------------------------------------------------------
diffstat for the Patch is:
	linux-3.6.1/drivers/usb/core/hub.c |    6 ++++++
 	1 file changed, 6 insertions(+)


Signed-off-by: Bhavik Kothari <bhavik.kothari@xxxxxxxxxxxxxxxx>

---------------------------------------------------------------------------
--- a/linux-3.6.1/drivers/usb/core/hub.c	2012-10-07 21:11:28.000000000 +0530
+++ b/linux-3.6.1/drivers/usb/core/hub.c	2012-10-31 11:37:26.760917272 +0530
@@ -1078,6 +1078,12 @@ static void hub_activate(struct usb_hub
 			clear_port_feature(hub->hdev, port1,
 					USB_PORT_FEAT_C_BH_PORT_RESET);
 		}
+		if (portchange & USB_PORT_STAT_C_RESET) {
+			need_debounce_delay = true;
+			clear_port_feature(hub->hdev, port1,
+					USB_PORT_FEAT_C_RESET);
+		}
+
 		/* We can forget about a "removed" device when there's a
 		 * physical disconnect or the connect status changes.
 		 */
--
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