Hi Jean, On 27.02.2017 20:54, Jean-Philippe Brucker wrote:
+/* + * Returns -ENOSYS if ATS is not supported either by the device or by the SMMU + */ +static int arm_smmu_enable_ats(struct arm_smmu_master_data *master) +{ + int ret; + size_t stu; + struct pci_dev *pdev; + struct arm_smmu_device *smmu = master->smmu; + + if (!(smmu->features & ARM_SMMU_FEAT_ATS) || !dev_is_pci(master->dev)) + return -ENOSYS; + + pdev = to_pci_dev(master->dev); + +#ifdef CONFIG_PCI_ATS + if (!pdev->ats_cap) + return -ENOSYS; +#else + return -ENOSYS; +#endif
Nit: This deserves to be another helper in ats.c like: int pci_ats_supported(struct pci_dev *dev) { if (!pdev->ats_cap) return 0; return 1; } Thanks, Tomasz