amdiommu: correctly initialize iommu.unit

(cherry picked from commit 53adc0b898)
This commit is contained in:
Konstantin Belousov 2024-12-06 10:06:42 +02:00
parent b50851e8eb
commit fff3323694

View file

@ -176,7 +176,6 @@ ivrs_lookup_ivhd_0x40(ACPI_IVRS_HARDWARE2 *h2, void *arg)
return (false);
ildp->sc->unit_dom = h2->PciSegmentGroup;
ildp->sc->iommu.unit = ivrs_info_to_unit_id(h2->Info);
ildp->sc->efr = h2->EfrRegisterImage;
return (true);
}
@ -194,7 +193,6 @@ ivrs_lookup_ivhd_0x10(ACPI_IVRS_HARDWARE1 *h1, void *arg)
return (false);
ildp->sc->unit_dom = h1->PciSegmentGroup;
ildp->sc->iommu.unit = ivrs_info_to_unit_id(h1->Info);
return (true);
}
@ -456,6 +454,7 @@ amdiommu_attach(device_t dev)
bool res;
sc = device_get_softc(dev);
sc->iommu.unit = device_get_unit(dev);
sc->iommu.dev = dev;
error = pci_find_cap(dev, PCIY_SECDEV, &sc->seccap_reg);