mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-03 19:24:02 +08:00
iommu/amd: Remove first/last_device handling
The code is buggy and the values read from PCI are not reliable anyway, so it is the best to just remove this code. Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
parent
d125941698
commit
226e889b20
@ -824,20 +824,10 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
|
|||||||
switch (e->type) {
|
switch (e->type) {
|
||||||
case IVHD_DEV_ALL:
|
case IVHD_DEV_ALL:
|
||||||
|
|
||||||
DUMP_printk(" DEV_ALL\t\t\t first devid: %02x:%02x.%x"
|
DUMP_printk(" DEV_ALL\t\t\tflags: %02x\n", e->flags);
|
||||||
" last device %02x:%02x.%x flags: %02x\n",
|
|
||||||
PCI_BUS_NUM(iommu->first_device),
|
|
||||||
PCI_SLOT(iommu->first_device),
|
|
||||||
PCI_FUNC(iommu->first_device),
|
|
||||||
PCI_BUS_NUM(iommu->last_device),
|
|
||||||
PCI_SLOT(iommu->last_device),
|
|
||||||
PCI_FUNC(iommu->last_device),
|
|
||||||
e->flags);
|
|
||||||
|
|
||||||
for (dev_i = iommu->first_device;
|
for (dev_i = 0; dev_i <= amd_iommu_last_bdf; ++dev_i)
|
||||||
dev_i <= iommu->last_device; ++dev_i)
|
set_dev_entry_from_acpi(iommu, dev_i, e->flags, 0);
|
||||||
set_dev_entry_from_acpi(iommu, dev_i,
|
|
||||||
e->flags, 0);
|
|
||||||
break;
|
break;
|
||||||
case IVHD_DEV_SELECT:
|
case IVHD_DEV_SELECT:
|
||||||
|
|
||||||
@ -993,17 +983,6 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initializes the device->iommu mapping for the driver */
|
|
||||||
static int __init init_iommu_devices(struct amd_iommu *iommu)
|
|
||||||
{
|
|
||||||
u32 i;
|
|
||||||
|
|
||||||
for (i = iommu->first_device; i <= iommu->last_device; ++i)
|
|
||||||
set_iommu_for_device(iommu, i);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void __init free_iommu_one(struct amd_iommu *iommu)
|
static void __init free_iommu_one(struct amd_iommu *iommu)
|
||||||
{
|
{
|
||||||
free_command_buffer(iommu);
|
free_command_buffer(iommu);
|
||||||
@ -1122,8 +1101,6 @@ static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h)
|
|||||||
*/
|
*/
|
||||||
amd_iommu_rlookup_table[iommu->devid] = NULL;
|
amd_iommu_rlookup_table[iommu->devid] = NULL;
|
||||||
|
|
||||||
init_iommu_devices(iommu);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1250,11 +1227,6 @@ static int iommu_init_pci(struct amd_iommu *iommu)
|
|||||||
pci_read_config_dword(iommu->dev, cap_ptr + MMIO_MISC_OFFSET,
|
pci_read_config_dword(iommu->dev, cap_ptr + MMIO_MISC_OFFSET,
|
||||||
&misc);
|
&misc);
|
||||||
|
|
||||||
iommu->first_device = PCI_DEVID(MMIO_GET_BUS(range),
|
|
||||||
MMIO_GET_FD(range));
|
|
||||||
iommu->last_device = PCI_DEVID(MMIO_GET_BUS(range),
|
|
||||||
MMIO_GET_LD(range));
|
|
||||||
|
|
||||||
if (!(iommu->cap & (1 << IOMMU_CAP_IOTLB)))
|
if (!(iommu->cap & (1 << IOMMU_CAP_IOTLB)))
|
||||||
amd_iommu_iotlb_sup = false;
|
amd_iommu_iotlb_sup = false;
|
||||||
|
|
||||||
|
@ -516,11 +516,6 @@ struct amd_iommu {
|
|||||||
/* pci domain of this IOMMU */
|
/* pci domain of this IOMMU */
|
||||||
u16 pci_seg;
|
u16 pci_seg;
|
||||||
|
|
||||||
/* first device this IOMMU handles. read from PCI */
|
|
||||||
u16 first_device;
|
|
||||||
/* last device this IOMMU handles. read from PCI */
|
|
||||||
u16 last_device;
|
|
||||||
|
|
||||||
/* start of exclusion range of that IOMMU */
|
/* start of exclusion range of that IOMMU */
|
||||||
u64 exclusion_start;
|
u64 exclusion_start;
|
||||||
/* length of exclusion range of that IOMMU */
|
/* length of exclusion range of that IOMMU */
|
||||||
|
Loading…
Reference in New Issue
Block a user