mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-17 16:28:06 +03:00
Kernel: Reorder VirtIODevice PCI initialization steps
We can't reset the device before we've read the PCI configuration space, because we read the reset register location from the configuration space.
This commit is contained in:
parent
7cf34b5549
commit
cbc845c8a8
Notes:
sideshowbarker
2024-07-18 18:04:38 +09:00
Author: https://github.com/ccapitalK Commit: https://github.com/SerenityOS/serenity/commit/cbc845c8a8a Pull-request: https://github.com/SerenityOS/serenity/pull/7122
@ -48,9 +48,6 @@ VirtIODevice::VirtIODevice(PCI::Address address, String class_name)
|
||||
PCI::enable_interrupt_line(pci_address());
|
||||
enable_irq();
|
||||
|
||||
reset_device();
|
||||
set_status_bit(DEVICE_STATUS_ACKNOWLEDGE);
|
||||
|
||||
auto capabilities = PCI::get_physical_id(address).capabilities();
|
||||
for (auto& capability : capabilities) {
|
||||
if (capability.id() == PCI_CAPABILITY_VENDOR_SPECIFIC) {
|
||||
@ -90,6 +87,9 @@ VirtIODevice::VirtIODevice(PCI::Address address, String class_name)
|
||||
m_isr_cfg = get_config(ConfigurationType::ISR, 0);
|
||||
}
|
||||
|
||||
reset_device();
|
||||
set_status_bit(DEVICE_STATUS_ACKNOWLEDGE);
|
||||
|
||||
set_status_bit(DEVICE_STATUS_DRIVER);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user