Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1433093

Re: [RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks

From Duc Dang <dhdang@apm.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks
Date 2016-06-28 18:20 +0200
Message-ID <rP3TX-Uy-3@gated-at.bofh.it> (permalink)
References <rOW65-3XK-9@gated-at.bofh.it> <rOW65-3XK-7@gated-at.bofh.it> <rP0W6-7u6-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jun 28, 2016 at 6:04 AM, Christopher Covington
<cov@codeaurora.org> wrote:
> Hi Tomasz,
>
> On 06/28/2016 03:54 AM, Tomasz Nowicki wrote:
>
>> diff --git a/drivers/pci/host/mcfg-quirks.c b/drivers/pci/host/mcfg-quirks.c
>> new file mode 100644
>> index 0000000..fb2b184
>> --- /dev/null
>> +++ b/drivers/pci/host/mcfg-quirks.c
>> @@ -0,0 +1,88 @@
>
>> +static bool pci_mcfg_fixup_match(struct pci_cfg_fixup *f,
>> +                              struct acpi_table_header *mcfg_header)
>> +{
>> +     int olen = min_t(u8, strlen(f->oem_id), ACPI_OEM_ID_SIZE);
>> +     int tlen = min_t(u8, strlen(f->oem_table_id), ACPI_OEM_TABLE_ID_SIZE);
>> +
>> +     return (!strncmp(f->oem_id, mcfg_header->oem_id, olen) &&
>> +             !strncmp(f->oem_table_id, mcfg_header->oem_table_id, tlen) &&
>> +             f->oem_revision == mcfg_header->oem_revision);
>> +}
>
> Ard's comments on v3 included:
>
> "... exact OEM table/rev id matches ..."
> "... substring match ... out of the question ..."
>
> I originally advocated the substring match approach because
> space-padding the input strings was unfamiliar. But given that some
> vendors have a "PLAT    " then "PLAT2   " naming scheme, where the
> former needs quirks and the latter (hopefully) doesn't, I agree with Ard
> and think space-padded inputs is the better way to go. Sorry for the
> lack of foresight.

I think having OEM Table ID as "PLAT   " and then "PLAT2  " (the the
next version of the SoC)
is common. So yes, matching full string is better as we can use "PLAT2  "
in MCFG table and not worry about the "PLAT" sub-string match causes the quirk
to be applied unintentionally.

>
> (I'm happy to rip it out, test, and communicate the delta however you'd
> prefer--just let me know.)
>
> Regards,
> Cov
>
> --
> Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> a Linux Foundation Collaborative Project
Regards,
Duc Dang.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks Tomasz Nowicki <tn@semihalf.com> - 2016-06-28 10:00 +0200
  Re: [RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks Christopher Covington <cov@codeaurora.org> - 2016-06-28 15:10 +0200
    Re: [RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks Duc Dang <dhdang@apm.com> - 2016-06-28 18:20 +0200
      Re: [RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks Tomasz Nowicki <tn@semihalf.com> - 2016-06-29 12:50 +0200
        Re: [RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks Christopher Covington <cov@codeaurora.org> - 2016-06-29 15:40 +0200
          Re: [RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks Tomasz Nowicki <tn@semihalf.com> - 2016-06-29 16:00 +0200
            Re: [RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-06-29 16:00 +0200
            Re: [RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks Jeffrey Hugo <jhugo@codeaurora.org> - 2016-06-29 17:40 +0200
          Re: [RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-06-29 16:00 +0200

csiph-web