[USBOHCI]
authorCameron Gutman <aicommander@gmail.com>
Wed, 25 Jan 2012 06:35:00 +0000 (06:35 +0000)
committerCameron Gutman <aicommander@gmail.com>
Wed, 25 Jan 2012 06:35:00 +0000 (06:35 +0000)
- Don't turn off interrupts before setting the OHCI_OWNERSHIP_CHANGE_REQUEST bit because it prevents the SMM driver from receiving the interrupt that tells it to give up ownership of the host controller
- This fix should be merged to Haiku also which has the same bug

svn path=/branches/usb-bringup-trunk/; revision=55170

drivers/usb/usbohci/hardware.cpp

index f3a15bc..e7d8268 100644 (file)
@@ -883,11 +883,6 @@ CUSBHardwareDevice::StopController(void)
     ULONG Control, Reset, Status;
     ULONG Index, FrameInterval;
 
-    //
-    // first turn off all interrupts
-    //
-    WRITE_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + OHCI_INTERRUPT_DISABLE_OFFSET), OHCI_ALL_INTERRUPTS);
-
     //
     // check context
     //
@@ -931,18 +926,17 @@ CUSBHardwareDevice::StopController(void)
         if (Control & OHCI_INTERRUPT_ROUTING)
         {
             DPRINT1("SMM not responding\n");
-            //
-            // some controllers also depend on this
-            //
-            WRITE_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + OHCI_CONTROL_OFFSET), OHCI_HC_FUNCTIONAL_STATE_RESET);
-
-            //
-            // wait a bit
-            //
-            KeStallExecutionProcessor(100);
+        }
+        else
+        {
+            DPRINT1("SMM has given up ownership\n");
         }
     }
 
+    //
+    // turn off interrupts
+    //
+    WRITE_REGISTER_ULONG((PULONG)((PUCHAR)m_Base + OHCI_INTERRUPT_DISABLE_OFFSET), OHCI_ALL_INTERRUPTS);
 
     //
     // have a break