Re: [PATCH V3 1/2] Drivers/PCI: Export pcie_has_flr() interface

From: Christoph Hellwig
Date: Tue Dec 12 2017 - 10:07:35 EST


On Fri, Dec 08, 2017 at 02:24:24PM -0600, Bjorn Helgaas wrote:
> I'd rather change pcie_flr() so you could *always* call it, and it
> would return 0, -ENOTTY, or whatever, based on whether FLR is
> supported. Is that feasible?
>
> I don't like the "Can I do this? Ok, do this" style of interfaces.
> It's racy (not really applicable in this case) and seems clunky.

I was tempted to change all that for the whole reset sequence but didn't
dare to do that because someone probably put some thought into the
current scheme.

I'd love to get rid of the "can I do this" interfaces entirely, and also
change to EOPNOTSUPP for the not supported case.