diff --git a/Kernel/Bus/PCI/Access.cpp b/Kernel/Bus/PCI/Access.cpp index 964afd7e24e..ad1f8c9106d 100644 --- a/Kernel/Bus/PCI/Access.cpp +++ b/Kernel/Bus/PCI/Access.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -40,7 +39,6 @@ UNMAP_AFTER_INIT bool Access::initialize_for_memory_access(PhysicalAddress mcfg_ if (Access::is_initialized()) return false; - InterruptDisabler disabler; auto* access = new Access(Access::AccessType::Memory); if (!access->search_pci_domains_from_acpi_mcfg_table(mcfg_table)) return false; @@ -307,7 +305,8 @@ u32 Access::read32_field(Address address, u32 field) UNMAP_AFTER_INIT void Access::rescan_hardware_with_memory_addressing() { - MutexLocker locker(m_scan_lock); + MutexLocker locker(m_access_lock); + SpinlockLocker scan_locker(m_scan_lock); VERIFY(m_device_identifiers.is_empty()); VERIFY(!m_domains.is_empty()); VERIFY(m_access_type == AccessType::Memory); @@ -330,7 +329,8 @@ UNMAP_AFTER_INIT void Access::rescan_hardware_with_memory_addressing() UNMAP_AFTER_INIT void Access::rescan_hardware_with_io_addressing() { - MutexLocker locker(m_scan_lock); + MutexLocker locker(m_access_lock); + SpinlockLocker scan_locker(m_scan_lock); VERIFY(m_device_identifiers.is_empty()); VERIFY(m_access_type == AccessType::IO); dbgln_if(PCI_DEBUG, "PCI: IO enumerating hardware"); @@ -456,7 +456,7 @@ UNMAP_AFTER_INIT void Access::enumerate_bus(int type, u8 bus, bool recursive) void Access::fast_enumerate(Function& callback) const { - MutexLocker locker(m_scan_lock); + MutexLocker locker(m_access_lock); VERIFY(!m_device_identifiers.is_empty()); for (auto& device_identifier : m_device_identifiers) { callback(device_identifier); diff --git a/Kernel/Bus/PCI/Access.h b/Kernel/Bus/PCI/Access.h index f8fc3c19556..55762fec576 100644 --- a/Kernel/Bus/PCI/Access.h +++ b/Kernel/Bus/PCI/Access.h @@ -11,6 +11,7 @@ #include #include #include +#include namespace Kernel::PCI { @@ -82,7 +83,7 @@ private: // General Data-members mutable Mutex m_access_lock; - mutable Mutex m_scan_lock; + mutable Spinlock m_scan_lock; Bitmap m_enumerated_buses; AccessType m_access_type; Vector m_device_identifiers;