Skip to contentSkip to conversation

EHCI: don't stop after finding the first controller

PATCH Christer Weinigel 2 participants 3 messages May 31, 2012

lore
Share & tools
lore
#0 lore raw

Hi,

Modern Intel chipsets have multiple EHCI controllers but the EHCI code will only detect the first one. I noticed this because on a test laptop all external USB ports are connected to the second EHCI controller so none of them would show up in grub.

The reason is that the PCI code will stop if the PCI iterator function returns a nonzero value. Change the return value to zero on success so that the PCI iterator continues with the next controller.

grub-core/bus/usb/ehci.c +1 -1
index d8ecf26..240c0d5 100644
@@ -839,7 +839,7 @@ grub_ehci_pci_iter (grub_pci_device_t dev,
   grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: CONFIG_FLAG: %08x\n",
                grub_ehci_oper_read32 (e, GRUB_EHCI_CONFIG_FLAG));
 
-  return 1;
+  return 0;
 
 fail:
   if (e)
#1 lore raw

Please update to latest bzr. Something similar was applied quite some time ago.

Quoted 30 lines · Christer Weinigel

Hi,

Modern Intel chipsets have multiple EHCI controllers but the EHCI code will only detect the first one. I noticed this because on a test laptop all external USB ports are connected to the second EHCI controller so none of them would show up in grub.

The reason is that the PCI code will stop if the PCI iterator function returns a nonzero value. Change the return value to zero on success so that the PCI iterator continues with the next controller.

grub-core/bus/usb/ehci.c +1 -1
index d8ecf26..240c0d5 100644
@@ -839,7 +839,7 @@ grub_ehci_pci_iter (grub_pci_device_t dev,
   grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: CONFIG_FLAG: %08x\n",
                grub_ehci_oper_read32 (e, GRUB_EHCI_CONFIG_FLAG));
 
-  return 1;
+  return 0;
 
 fail:
   if (e)

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
#2 lore raw
In reply to Christer Weinigel

grub-core/bus/usb/ehci.c grub_ehci_pci_iter (grub_pci_device_t dev, · line 845

Quoted 13 lines · Christer Weinigel
grub-core/bus/usb/ehci.c +1 -1
index d8ecf26..240c0d5 100644
@@ -839,7 +839,7 @@ grub_ehci_pci_iter (grub_pci_device_t dev,
   grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: CONFIG_FLAG: %08x\n",
                grub_ehci_oper_read32 (e, GRUB_EHCI_CONFIG_FLAG));
 
-  return 1;
+  return 0;
 
 fail:
   if (e)

Darn. That one had been fixed in bazaar already.

Sorry about the noise.

/Christer