Don't take ownership by writing the OS-owned semaphore when the BIOS-owned flag
isn't set. I'd tend to say that's a rather odd interpretation of the specified protocol if a BIOS goes mad if the sem is written to while it doesn't actually own the controller (it should just be a no-op in that case and directly set the sem state). But it seems this is what others do as well (FreeBSD, Linux) so we follow. Thanks to vegardw in #2083 for researching into this and proposing this fix. Minor other cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35780 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
98d5d91cbf
commit
2cf04ca728
@ -181,22 +181,24 @@ EHCI::EHCI(pci_info *info, Stack *stack)
|
||||
uint32 legacySupport = sPCIModule->read_pci_config(fPCIInfo->bus,
|
||||
fPCIInfo->device, fPCIInfo->function, extendedCapPointer, 4);
|
||||
if ((legacySupport & EHCI_LEGSUP_CAPID_MASK) == EHCI_LEGSUP_CAPID) {
|
||||
if (legacySupport & EHCI_LEGSUP_BIOSOWNED)
|
||||
TRACE_ALWAYS("the host controller is bios owned\n");
|
||||
if ((legacySupport & EHCI_LEGSUP_BIOSOWNED) != 0) {
|
||||
TRACE_ALWAYS("the host controller is bios owned, claiming"
|
||||
" ownership\n");
|
||||
|
||||
TRACE_ALWAYS("claiming ownership of the host controller\n");
|
||||
sPCIModule->write_pci_config(fPCIInfo->bus, fPCIInfo->device,
|
||||
fPCIInfo->function, extendedCapPointer + 3, 1, 1);
|
||||
sPCIModule->write_pci_config(fPCIInfo->bus, fPCIInfo->device,
|
||||
fPCIInfo->function, extendedCapPointer + 3, 1, 1);
|
||||
|
||||
for (int32 i = 0; i < 20; i++) {
|
||||
legacySupport = sPCIModule->read_pci_config(fPCIInfo->bus,
|
||||
fPCIInfo->device, fPCIInfo->function, extendedCapPointer, 4);
|
||||
for (int32 i = 0; i < 20; i++) {
|
||||
legacySupport = sPCIModule->read_pci_config(fPCIInfo->bus,
|
||||
fPCIInfo->device, fPCIInfo->function,
|
||||
extendedCapPointer, 4);
|
||||
|
||||
if ((legacySupport & EHCI_LEGSUP_BIOSOWNED) == 0)
|
||||
break;
|
||||
|
||||
if (legacySupport & EHCI_LEGSUP_BIOSOWNED) {
|
||||
TRACE_ALWAYS("controller is still bios owned, waiting\n");
|
||||
snooze(50000);
|
||||
} else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (legacySupport & EHCI_LEGSUP_BIOSOWNED) {
|
||||
@ -520,7 +522,7 @@ status_t
|
||||
EHCI::AddTo(Stack *stack)
|
||||
{
|
||||
#ifdef TRACE_USB
|
||||
set_dprintf_enabled(true);
|
||||
set_dprintf_enabled(true);
|
||||
#ifndef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
load_driver_symbols("ehci");
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user