mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 09:10:28 +00:00
pci: return 0 for pci_remap_intr_method MSI-X non-error case
When remapping a MSI-X vector, we would always return ENOENT, even if successful. This didn't really matter, as the sole caller of BUS_REMAP_INTR also didn't check for errors. Return 0 if there's no error, so that we can start handling (or at least warning about) actual failures. Reviewed by: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41449
This commit is contained in:
parent
a51f81c2e5
commit
43e545e8e0
|
@ -2447,6 +2447,8 @@ pci_remap_intr_method(device_t bus, device_t dev, u_int irq)
|
|||
* through all the slots that use this IRQ and update them.
|
||||
*/
|
||||
if (cfg->msix.msix_alloc > 0) {
|
||||
bool found = false;
|
||||
|
||||
for (i = 0; i < cfg->msix.msix_alloc; i++) {
|
||||
mv = &cfg->msix.msix_vectors[i];
|
||||
if (mv->mv_irq == irq) {
|
||||
|
@ -2466,9 +2468,10 @@ pci_remap_intr_method(device_t bus, device_t dev, u_int irq)
|
|||
pci_enable_msix(dev, j, addr, data);
|
||||
pci_unmask_msix(dev, j);
|
||||
}
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
return (ENOENT);
|
||||
return (found ? 0 : ENOENT);
|
||||
}
|
||||
|
||||
return (ENOENT);
|
||||
|
|
Loading…
Reference in a new issue