Re: [PATCH v2 5/5] PCI/ATS: Mandate checking pci_ats_supported() before pci_prepare_ats()
Vasant Hegde <[email protected]>
| Newsgroups | org.kernel.vger.linux-pci,dev.linux.lists.iommu,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On 8/14/2026 7:26 AM, Pranjal Shrivastava wrote: > Currently, pci_prepare_ats() internally calls pci_ats_supported() and > returns -EINVAL if the device does not support ATS. While this provides > a silent safety check, it conflates support detection with configuration. > > Update pci_prepare_ats() to wrap the internal pci_ats_supported check in > a WARN_ON(). This mandates all callers to call pci_prepare_ats() only if > the function supports ATS. > > Update the function documentation to mention that callers must verify > ATS support (via pci_ats_supported()) before calling pci_prepare_ats(). > > Suggested-by: Baolu Lu <[email protected]> > Reviewed-by: Nicolin Chen <[email protected]> > Signed-off-by: Pranjal Shrivastava <[email protected]> Reviewed-by: Vasant Hegde <[email protected]> -Vasant