Re: [PATCH 4/4] PCI/sysfs: Allow userspace to query and set device reset mechanism

From: Leon Romanovsky
Date: Thu Mar 18 2021 - 13:23:36 EST


On Thu, Mar 18, 2021 at 10:39:35AM -0600, Alex Williamson wrote:
> On Thu, 18 Mar 2021 11:09:34 +0200
> Leon Romanovsky <leon@xxxxxxxxxx> wrote:

<...>

> > I'm lost here, does vfio-pci use sysfs interface or internal to the kernel API?
> >
> > If it is latter then we don't really need sysfs, if not, we still need
> > some sort of DB to create second policy, because "supported != working".
> > What am I missing?
>
> vfio-pci uses the internal kernel API, ie. the variants of
> pci_reset_function(), which is the same interface used by the existing
> sysfs reset mechanism. This proposed configuration of the reset method
> would affect any driver using that same core infrastructure and from my
> perspective that's really the goal. In the case where a supported
> reset mechanism fails for a device, continuing to quirk those out for
> the best default behavior makes sense, I'd be disappointed for a vendor
> to not pursue improving the default behavior where it clearly makes
> sense. However, there's also a policy decision, the kernel imposes a
> preferential ordering of reset mechanism. Is that ordering the best
> case for all users? I've presented above a case where a userspace may
> prefer a policy of preferring a bus reset to a PM reset. So I think
> the question is not only are there supported mechanisms that don't
> work, where this interface allows userspace to more readily identify
> and work around those sorts of issues, but it also enables user
> preference and easier evaluation whether all of the supported reset
> mechanisms work rather than just the first one we encounter in the
> ordering we've decided to impose today. Thanks,

Alex,

Which email client do you use?
Your responses are grouped as one huge block without any chance to respond
to you on specific point or answer to your question.

I see your flow and understand your position, but will repeat my
position. We need to make sure that vendors will have incentive to
supply quirks.

And regarding vendors, see Amey response below about his touchpad troubles.
The cheap electronics vendors don't care about their users.

Thanks

>
> Alex
>