Hi Joerg,

> -----Original Message-----
> From: Joerg Roedel <jroe...@suse.de>
> Sent: Tuesday, September 25, 2018 7:02 PM
> To: Nath, Arindam <arindam.n...@amd.com>
> Cc: iommu@lists.linux-foundation.org; Suthikulpanit, Suravee
> <suravee.suthikulpa...@amd.com>
> Subject: Re: [PATCH] iommu/amd: return devid as alias for ACPI HID devices
> 
> Hi Arindam,
> 
> On Tue, Sep 18, 2018 at 03:40:58PM +0530, Arindam Nath wrote:
> > @@ -246,7 +246,13 @@ static u16 get_alias(struct device *dev)
> >
> >     /* The callers make sure that get_device_id() does not fail here */
> >     devid = get_device_id(dev);
> > +
> > +   /* For ACPI HID devices, we simply return the devid as such */
> > +   if (!dev_is_pci(dev))
> > +           return devid;
> > +
> 
> Does this fix some bug? If there is no alias defined for the device-id,
> it should just return the correct devid even without that change.

It does fix an issue where eMMC controller is an ACPI HID device and it fails 
to work with IOMMU enabled.

Since for the ACPI HID, there is no actual pci_dev backing it, there is a NULL 
pointer de-referencing inside pci_for_each_dma_alias() while trying to access 
pdev->bus->number.

Thanks,
Arindam

> 
> Regards,
> 
>       Joerg
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to