On Thu, Jun 17, 2021 at 02:28:36AM +0300, Max Gurtovoy wrote:
On 6/16/2021 3:34 AM, Jason Gunthorpe wrote:Oh, even better, so it isn't really an issue
On Tue, Jun 15, 2021 at 06:22:45PM -0600, Alex Williamson wrote:Actually the dynamic table is the first table the driver search. So new_id
On Tue, 15 Jun 2021 20:32:57 -0300Oh Hum. Actually I think this shows the anti-match behavior is
Jason Gunthorpe <jgg@xxxxxxxxxx> wrote:
On Tue, Jun 15, 2021 at 05:22:42PM -0600, Alex Williamson wrote:I'd expect pci-pf-stub to have one of each, an any-id with
anti-match isn't the intention. The deployment will have match tablesNo, pci_match_device() returns NULL if a match is found that is markedb) alone is a functional, runtime difference.I would state b) differently:
b) Ignore the driver-override-only match entries in the ID table.
driver-override-only and a driver_override is not specified. That's
the same as no match at all. We don't then go on to search past that
match in the table, we fail to bind the driver. That's effectively an
anti-match when there's no driver_override on the device.
where all entires are either flags=0 or are driver-override-only.
override-only flag and the one device ID currently in the table with
no flag.
actually a bug.. :(
For something like pci_pf_stub_whitelist, if we add a
driver_override-only using the PCI any id then it effectively disables
new_id completely because the match search will alway find the
driver_override match first and stop searching. There is no chance to
see things new_id adds.
works exactly the same AFAIU.
But you're right for static mixed table (I assumed that this will neverMe too, we could organize the driver-overrides to be last
happen I guess).
- found_id = pci_match_id(drv->id_table, dev);Yeah, keep searching makes logical sense to me
- if (found_id) {
+ ids = drv->id_table;
+ while ((found_id = pci_match_id(ids, dev))) {
diff --git a/drivers/pci/pci-pf-stub.c b/drivers/pci/pci-pf-stub.cAnd we don't really want this change any more right? No reason to put
index 45855a5e9fca..49544ba9a7af 100644
+++ b/drivers/pci/pci-pf-stub.c
@@ -19,6 +19,7 @@
*/
static const struct pci_device_id pci_pf_stub_whitelist[] = {
{ PCI_VDEVICE(AMAZON, 0x0053) },
+ { PCI_DEVICE_FLAGS(PCI_ANY_ID, PCI_ANY_ID,
PCI_ID_F_STUB_DRIVER_OVERRIDE) }, /* match all by default (override) */
/* required last entry */
{ 0 }
pci_stub in the module.alias file?
Thanks,
Jason