Re: [RFC PATCH 1/3] pci, acpi: Match PCI config space accessors against platfrom specific ECAM quirks.

From: David Daney
Date: Fri Jun 03 2016 - 12:57:52 EST

On 06/03/2016 08:32 AM, Gabriele Paoloni wrote:
+struct pci_ecam_ops *pci_mcfg_get_ops(struct acpi_pci_root *root)
+ int bus_num = root->secondary.start;
+ int domain = root->segment;
+ struct pci_cfg_fixup *f;
+ if (!mcfg_table)
+ return &pci_generic_ecam_ops;
+ /*
+ * Match against platform specific quirks and return
+ * CAM ops.
+ *
+ * First match against PCI topology <domain:bus> then use OEM ID
+ * OEM revision from MCFG table standard header.
+ */
+ for (f = __start_acpi_mcfg_fixups; f < __end_acpi_mcfg_fixups;
f++) {
+ if ((f->domain == domain || f->domain ==
+ (f->bus_num == bus_num || f->bus_num ==
+ (!strncmp(f->oem_id, mcfg_table->header.oem_id,
+ (f->oem_revision == mcfg_table->header.oem_revision))

Is this more likely to be updated between quirky and fixed platforms
than oem_table_id? What do folks think about using oem_table_id instead
of, or in addition to, oem_revision?

From my understanding we need to stick to this mechanism as (otherwise)
there are platforms out in the field that would need a FW update.

So I don't think that using oem_table_id "instead" is possible; about
"in addition" I think it is doable, but I do not see the advantage much.
I mean that if a platform gets fixed the oem revision should change too,

I think you are correct. My take away on discussions about using this style of quirk matching was that we would require the oem_revision to change as different quirks (or lack of quirks) were required.

David Daney