Skip to content

Commit

Permalink
Fix a bug where MSI interrupts on x86 were always routed to APIC ID 0…
Browse files Browse the repository at this point in the history
… rather

than the APIC ID of the boot CPU prior to SI_SUB_SMP.  This resulted in
some storage controllers not being able to enumerate attached devices when
using MSI/MSI-X interrupts.  This only affects <= 7.x, so it is a direct
commit to 7.3 rather than an MFC.

Approved by:	re (kib)
  • Loading branch information
bsdjhb committed Feb 17, 2010
1 parent 9d0a344 commit 40c5467
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sys/amd64/amd64/msi.c
Expand Up @@ -321,6 +321,7 @@ msi_alloc(device_t dev, int count, int maxcount, int *irqs)
for (i = 0; i < count; i++) {
msi = (struct msi_intsrc *)intr_lookup_source(irqs[i]);
msi->msi_dev = dev;
msi->msi_cpu = PCPU_GET(apic_id);
msi->msi_vector = vector + i;
if (bootverbose)
printf("msi: routing MSI IRQ %d to vector %u\n",
Expand Down Expand Up @@ -477,6 +478,7 @@ msix_alloc(device_t dev, int *irq)
/* Setup source. */
msi->msi_dev = dev;
msi->msi_vector = vector;
msi->msi_cpu = PCPU_GET(apic_id);
msi->msi_msix = 1;

KASSERT(msi->msi_intsrc.is_handlers == 0, ("dead MSI-X has handlers"));
Expand Down
2 changes: 2 additions & 0 deletions sys/i386/i386/msi.c
Expand Up @@ -321,6 +321,7 @@ msi_alloc(device_t dev, int count, int maxcount, int *irqs)
for (i = 0; i < count; i++) {
msi = (struct msi_intsrc *)intr_lookup_source(irqs[i]);
msi->msi_dev = dev;
msi->msi_cpu = PCPU_GET(apic_id);
msi->msi_vector = vector + i;
if (bootverbose)
printf("msi: routing MSI IRQ %d to vector %u\n",
Expand Down Expand Up @@ -477,6 +478,7 @@ msix_alloc(device_t dev, int *irq)
/* Setup source. */
msi->msi_dev = dev;
msi->msi_vector = vector;
msi->msi_cpu = PCPU_GET(apic_id);
msi->msi_msix = 1;

KASSERT(msi->msi_intsrc.is_handlers == 0, ("dead MSI-X has handlers"));
Expand Down

0 comments on commit 40c5467

Please sign in to comment.