7c03b6dcc6
The original P49 patch had incorrect line numbers that caused patch --fuzz=3 to insert cpu_id field and methods at wrong locations, corrupting irq_helpers.rs. Regenerate from clean P0-P48 baseline.
46 lines
2.1 KiB
Diff
46 lines
2.1 KiB
Diff
diff --git a/drivers/pcid/src/driver_interface/irq_helpers.rs b/drivers/pcid/src/driver_interface/irq_helpers.rs
|
|
index f62cc055..8bfbc604 100644
|
|
--- a/drivers/pcid/src/driver_interface/irq_helpers.rs
|
|
+++ b/drivers/pcid/src/driver_interface/irq_helpers.rs
|
|
@@ -266,0 +267 @@ pub struct InterruptVector {
|
|
+ cpu_id: usize,
|
|
@@ -284,0 +286,18 @@ impl InterruptVector {
|
|
+ pub fn cpu_id(&self) -> usize {
|
|
+ self.cpu_id
|
|
+ }
|
|
+
|
|
+ /// Log the IRQ affinity for this vector.
|
|
+ pub fn log_affinity(&self, driver: &str) {
|
|
+ let kind_str = match self.kind {
|
|
+ InterruptVectorKind::Legacy => "legacy",
|
|
+ InterruptVectorKind::Msi => "MSI",
|
|
+ InterruptVectorKind::MsiX { .. } => "MSI-X",
|
|
+ };
|
|
+ log::info!(
|
|
+ "{driver}: IRQ affinity = {kind_str} on CPU {} vector {}",
|
|
+ self.cpu_id,
|
|
+ self.vector
|
|
+ );
|
|
+ }
|
|
+
|
|
@@ -331,0 +351 @@ pub fn pci_allocate_interrupt_vector(
|
|
+ log::info!("{driver}: allocated MSI-X interrupt on CPU {bsp_cpu_id}");
|
|
@@ -339,0 +360 @@ pub fn pci_allocate_interrupt_vector(
|
|
+ cpu_id: bsp_cpu_id,
|
|
@@ -348,0 +370,3 @@ pub fn pci_allocate_interrupt_vector(
|
|
+ let bsp_cpu_id = read_bsp_apic_id()
|
|
+ .unwrap_or_else(|err| panic!("{driver}: failed to read BSP APIC ID: {err}"));
|
|
+ log::info!("{driver}: allocated MSI interrupt on CPU {bsp_cpu_id}");
|
|
@@ -351,0 +376 @@ pub fn pci_allocate_interrupt_vector(
|
|
+ cpu_id: bsp_cpu_id,
|
|
@@ -359,0 +385,2 @@ pub fn pci_allocate_interrupt_vector(
|
|
+ let bsp_cpu_id = read_bsp_apic_id().unwrap_or(0);
|
|
+ log::info!("{driver}: allocated legacy INTx interrupt on CPU {bsp_cpu_id}");
|
|
@@ -362,0 +390 @@ pub fn pci_allocate_interrupt_vector(
|
|
+ cpu_id: bsp_cpu_id,
|
|
@@ -378,0 +407,2 @@ pub fn pci_allocate_interrupt_vector(
|
|
+ let bsp_cpu_id = read_bsp_apic_id().unwrap_or(0);
|
|
+ log::info!("{driver}: allocated legacy INTx interrupt on CPU {bsp_cpu_id}");
|
|
@@ -381,0 +412 @@ pub fn pci_allocate_interrupt_vector(
|
|
+ cpu_id: bsp_cpu_id,
|