Re: [PATCH v6 3/6] PCI/ATS: Mandate checking pci_ats_supported() before pci_prepare_ats()

From: Pranjal Shrivastava

Date: Sun May 31 2026 - 13:06:41 EST


On Fri, May 29, 2026 at 02:56:01PM -0700, Nicolin Chen wrote:
> On Fri, May 29, 2026 at 11:12:05AM +0000, 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 <baolu.lu@xxxxxxxxxxxxxxx>
> > Signed-off-by: Pranjal Shrivastava <praan@xxxxxxxxxx>
>
> Sashiko pointed out a bisect issue. So, you might want to reorder
> a bit. The patch itself looks good to me.
>

Ack. I'll re-order for bisectibility.

> Reviewed-by: Nicolin Chen <nicolinc@xxxxxxxxxx>

Thanks!
Praan