Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1304789
| From | Wan Zongshun <vw@iommu.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 5/6] iommu/amd: Add support for non-pci devices |
| Date | 2016-01-08 19:10 +0100 |
| Message-ID | <qOII3-1k3-19@gated-at.bofh.it> (permalink) |
| References | <qOhy9-7Vb-7@gated-at.bofh.it> <qOhy9-7Vb-17@gated-at.bofh.it> <qOhy9-7Vb-15@gated-at.bofh.it> <qOvKO-Iq-7@gated-at.bofh.it> <qOEbo-6yE-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
>>
>>
>> static bool check_device(struct device *dev)
>> {
>> u16 devid;
>> ......
>>
>> /* No PCI device */
>> if (!dev_is_pci(dev) && (get_acpihid_device_id(dev, NULL) < 0))
>> return false;
>>
>> devid = get_device_id(dev);
>
> That is true for this case, but the other call-sites of get_device_id()
> still have to care about a potential negative return value, right?
>
Actually I am supposing the '.add_device' will be the first called in
iommu initializing stage, so I think as long as having no error of check
device here, any call-sites of get_device_id() will be fine, because
adding device successfully should be the pre-condition of any iommu
function can be performed, please correct me.
static int amd_iommu_add_device(struct device *dev)
{
struct iommu_dev_data *dev_data;
struct iommu_domain *domain;
struct amd_iommu *iommu;
u16 devid;
int ret;
if (!check_device(dev) || get_dev_data(dev))
return 0;
devid = get_device_id(dev);
iommu = amd_iommu_rlookup_table[devid];
Vincent.
>
> Joerg
>
>
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH 5/6] iommu/amd: Add support for non-pci devices Joerg Roedel <joro@8bytes.org> - 2016-01-07 13:10 +0100
Re: [PATCH 5/6] iommu/amd: Add support for non-pci devices Wan ZongShun <mcuos.com@gmail.com> - 2016-01-08 04:20 +0100
Re: [PATCH 5/6] iommu/amd: Add support for non-pci devices Joerg Roedel <joro@8bytes.org> - 2016-01-08 13:20 +0100
Re: [PATCH 5/6] iommu/amd: Add support for non-pci devices Joerg Roedel <joro@8bytes.org> - 2016-01-08 18:10 +0100
Re: [PATCH 5/6] iommu/amd: Add support for non-pci devices Wan Zongshun <vw@iommu.org> - 2016-01-09 11:10 +0100
Re: [PATCH 5/6] iommu/amd: Add support for non-pci devices Wan Zongshun <vw@iommu.org> - 2016-01-08 19:10 +0100
csiph-web