git: fff3323694f7 - stable/14 - amdiommu: correctly initialize iommu.unit
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 10 Dec 2024 02:40:42 UTC
The branch stable/14 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=fff3323694f79e020ea139a020ed047bfeb578e3
commit fff3323694f79e020ea139a020ed047bfeb578e3
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-12-06 08:06:42 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-12-10 02:40:24 +0000
amdiommu: correctly initialize iommu.unit
(cherry picked from commit 53adc0b898a4d263cad0bdfb687d9f008e5768f3)
---
sys/x86/iommu/amd_drv.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sys/x86/iommu/amd_drv.c b/sys/x86/iommu/amd_drv.c
index 2ab0213925eb..72aae58334f2 100644
--- a/sys/x86/iommu/amd_drv.c
+++ b/sys/x86/iommu/amd_drv.c
@@ -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);