Files
RedBear-OS/local/patches/base/P18-3-msi-msix-enablement.patch
T
vasilito cee25393d8 fix: boot process improvements — dependency cycle, INIT_NOTIFY, probing loop, and log spam fixes
- Fix P15-8-init-cycle-detection.patch: replace visiting+error with seen+silent-skip
  to eliminate 11 false-positive 'dependency cycle detected' errors on shared deps
- Fix P0-daemon-fix-init-notify-unwrap.patch: remove eprintln! for missing
  INIT_NOTIFY (expected for oneshot_async services, ~7 daemons affected)
- Fix driver-manager hotplug loop: add PERMANENTLY_SKIPPED static set shared
  between hotplug handler and DriverConfig::probe() to stop infinite re-probing
  of Fatal/NotSupported/deferred-exhausted device+driver pairs (e.g. ided)
- Fix driver-manager log_timeline: suppress repeated EPIPE/ENOENT errors with
  AtomicI32 dedup and AtomicBool one-shot guards for boot timeline JSON
- Add driver-manager SIGTERM handler, ACPI bus registration, --status mode,
  driver reap loop, graceful shutdown, and reduced deferred retries (30→3)
2026-05-17 12:34:02 +03:00

45 lines
1.8 KiB
Diff

--- a/drivers/pcid/src/main.rs
+++ b/drivers/pcid/src/main.rs
@@ -162,20 +162,32 @@
| CommandRegister::IO_ENABLE
});
- // Disable MSI and MSI-X in case a previous driver instance enabled them.
- for capability in capabilities {
+ // Detect MSI capabilities for logging
+ let has_msix = capabilities.iter().any(|c| matches!(c, PciCapability::MsiX(_)));
+ let has_msi = capabilities.iter().any(|c| matches!(c, PciCapability::Msi(_)));
+
+ // Disable MSI and MSI-X to start from a clean state.
+ // Drivers that support MSI will re-enable it via the pcid scheme interface
+ // using irq_helpers::pci_allocate_interrupt_vector(), which handles
+ // MSI-X -> MSI -> legacy fallback automatically.
+ for capability in capabilities.iter_mut() {
match capability {
- PciCapability::Msi(capability) => {
- capability.set_enabled(false, pcie);
- }
- PciCapability::MsiX(capability) => {
- capability.set_enabled(false, pcie);
- }
+ PciCapability::Msi(cap) => cap.set_enabled(false, pcie),
+ PciCapability::MsiX(cap) => cap.set_enabled(false, pcie),
_ => {}
}
}
- // Set IRQ line to 9 if not set
+ // Log MSI capability for debugging. Legacy IRQ is still configured as
+ // a baseline — drivers without MSI support (e.g., ahcid) need it.
+ // Drivers with MSI support will switch away from legacy via the scheme interface.
+ if has_msix {
+ info!(" has MSI-X capability (legacy IRQ as fallback)");
+ } else if has_msi {
+ info!(" has MSI capability (legacy IRQ as fallback)");
+ }
+
+ // Legacy IRQ baseline for all devices
let mut irq = 0xFF;
let mut interrupt_pin = 0xFF;