Hmmm, today is not a good day - I sent wrong patch with mistake, sorry... :-(

I hope attached patch is finally OK...

BR,
Ales

Sorry, I missed the patch... :-)
There it is.

28.8.2013 08:59, Melki Christian (consultant) wrote:
I'm thinking of the EHCI hand-over. In the case of EHCI handover
beeing successful within the timeout, you never clear the USBLEGCTLSTS
register (SMI's). You do that in the other cases however. Why? I can
not think of any case of a successful handover with SMI's still
enabled. To what purpose? A buggy BIOS would maybe act upon such
stuff? Maybe thats a case for lost devices etc?
Ok, I made a short look into Linux USB source code and I saw there is
USBLEGCTLSTS register reset in any case.
(What is maybe more interesting, Linux driver DOES NOT handover on some
(broken) devices, only reset SMI...)

So I prepared simple "SMI" patch (attached).

BR,
Ales


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

--- ./grub/grub-core/bus/usb/ehci.c	2013-05-12 23:15:17.857567000 +0200
+++ ./grub_patched/grub-core/bus/usb/ehci.c	2013-08-31 23:03:54.587218402 +0200
@@ -716,7 +716,7 @@ grub_ehci_pci_iter (grub_pci_device_t de
       usblegsup = grub_pci_read (pciaddr_eecp);
       if (usblegsup & GRUB_EHCI_BIOS_OWNED)
 	{
-	  grub_boot_time ("Taking ownership of EHCI port");
+	  grub_boot_time ("Taking ownership of EHCI controller");
 	  grub_dprintf ("ehci",
 			"EHCI grub_ehci_pci_iter: EHCI owned by: BIOS\n");
 	  /* Ownership change - set OS_OWNED bit */
@@ -737,13 +737,8 @@ grub_ehci_pci_iter (grub_pci_device_t de
 	      grub_pci_write (pciaddr_eecp, GRUB_EHCI_OS_OWNED);
 	      /* Ensure PCI register is written */
 	      grub_pci_read (pciaddr_eecp);
-	      /* Disable SMI.  */
-	      pciaddr_eecp = grub_pci_make_address (dev, eecp_offset + 4);
-	      grub_pci_write (pciaddr_eecp, 0);
-	      /* Ensure PCI register is written */
-	      grub_pci_read (pciaddr_eecp);
 	    }
-	  grub_boot_time ("Ownership of EHCI port taken");
+	  grub_boot_time ("Ownership of EHCI controller taken");
 	}
       else if (usblegsup & GRUB_EHCI_OS_OWNED)
 	/* XXX: What to do in this case - nothing ? Can it happen ? */
@@ -758,12 +753,14 @@ grub_ehci_pci_iter (grub_pci_device_t de
 	  grub_pci_write (pciaddr_eecp, GRUB_EHCI_OS_OWNED);
 	  /* Ensure PCI register is written */
 	  grub_pci_read (pciaddr_eecp);
-	  /* Disable SMI, just to be sure.  */
-	  pciaddr_eecp = grub_pci_make_address (dev, eecp_offset + 4);
-	  grub_pci_write (pciaddr_eecp, 0);
-	  /* Ensure PCI register is written */
-	  grub_pci_read (pciaddr_eecp);
 	}
+
+    /* Disable SMI, just to be sure.  */
+    pciaddr_eecp = grub_pci_make_address (dev, eecp_offset + 4);
+    grub_pci_write (pciaddr_eecp, 0);
+    /* Ensure PCI register is written */
+    grub_pci_read (pciaddr_eecp);
+
     }
 
   grub_dprintf ("ehci", "inithw: EHCI grub_ehci_pci_iter: ownership OK\n");
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to