All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Covington <cov@codeaurora.org>
To: Tomasz Nowicki <tn@semihalf.com>,
	helgaas@kernel.org, arnd@arndb.de, will.deacon@arm.com,
	catalin.marinas@arm.com, rafael@kernel.org,
	hanjun.guo@linaro.org, Lorenzo.Pieralisi@arm.com,
	okaya@codeaurora.org, jchandra@broadcom.com
Cc: robert.richter@caviumnetworks.com, mw@semihalf.com,
	Liviu.Dudau@arm.com, ddaney@caviumnetworks.com,
	wangyijing@huawei.com, msalter@redhat.com,
	linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	linaro-acpi@lists.linaro.org, jcm@redhat.com,
	andrea.gallo@linaro.org, dhdang@apm.com, jeremy.linton@arm.com,
	liudongdong3@huawei.com, gabriele.paoloni@huawei.com,
	jhugo@codeaurora.org, Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks
Date: Tue, 28 Jun 2016 09:04:42 -0400	[thread overview]
Message-ID: <577275EA.7010002@codeaurora.org> (raw)
In-Reply-To: <1467100442-28078-4-git-send-email-tn@semihalf.com>

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'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

WARNING: multiple messages have this Message-ID (diff)
From: cov@codeaurora.org (Christopher Covington)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks
Date: Tue, 28 Jun 2016 09:04:42 -0400	[thread overview]
Message-ID: <577275EA.7010002@codeaurora.org> (raw)
In-Reply-To: <1467100442-28078-4-git-send-email-tn@semihalf.com>

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'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

  reply	other threads:[~2016-06-28 13:04 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-28  7:53 [RFC PATCH v4 0/5] ECAM quirks handling for ARM64 platforms Tomasz Nowicki
2016-06-28  7:53 ` Tomasz Nowicki
2016-06-28  7:53 ` [RFC PATCH v4 1/5] PCI: Embed pci_ecam_ops in pci_config_window structure Tomasz Nowicki
2016-06-28  7:53   ` Tomasz Nowicki
2016-06-28  7:53   ` Tomasz Nowicki
2016-06-28  7:53 ` [RFC PATCH v4 2/5] PCI/ACPI: Move ACPI ECAM mapping to generic MCFG driver Tomasz Nowicki
2016-06-28  7:53   ` Tomasz Nowicki
2016-06-28  7:53   ` Tomasz Nowicki
2016-06-28  7:54 ` [RFC PATCH v4 3/5] PCI: Check platform specific ECAM quirks Tomasz Nowicki
2016-06-28  7:54   ` Tomasz Nowicki
2016-06-28 13:04   ` Christopher Covington [this message]
2016-06-28 13:04     ` Christopher Covington
2016-06-28 16:12     ` Duc Dang
2016-06-28 16:12       ` Duc Dang
2016-06-28 16:12       ` Duc Dang
2016-06-29 10:48       ` Tomasz Nowicki
2016-06-29 10:48         ` Tomasz Nowicki
2016-06-29 10:48         ` Tomasz Nowicki
2016-06-29 13:34         ` Christopher Covington
2016-06-29 13:34           ` Christopher Covington
2016-06-29 13:34           ` Christopher Covington
2016-06-29 13:52           ` Tomasz Nowicki
2016-06-29 13:52             ` Tomasz Nowicki
2016-06-29 13:52             ` Tomasz Nowicki
2016-06-29 13:57             ` Ard Biesheuvel
2016-06-29 13:57               ` Ard Biesheuvel
2016-06-29 13:57               ` Ard Biesheuvel
2016-06-29 15:38             ` Jeffrey Hugo
2016-06-29 15:38               ` Jeffrey Hugo
2016-06-29 15:38               ` Jeffrey Hugo
2016-06-29 13:56           ` Ard Biesheuvel
2016-06-29 13:56             ` Ard Biesheuvel
2016-06-29 13:56             ` Ard Biesheuvel
2016-07-22 11:38             ` Robert Richter
2016-07-22 11:38               ` Robert Richter
2016-07-22 11:38               ` Robert Richter
2016-07-22 12:00               ` Ard Biesheuvel
2016-07-22 12:00                 ` Ard Biesheuvel
2016-07-22 12:00                 ` Ard Biesheuvel
2016-07-22 12:11                 ` Robert Richter
2016-07-22 12:11                   ` Robert Richter
2016-07-22 12:11                   ` Robert Richter
2016-07-25 21:56   ` Mark Salter
2016-07-25 21:56     ` Mark Salter
2016-06-28  7:54 ` [RFC PATCH v4 4/5] ARM64/PCI: Start using quirks handling for ACPI based PCI host controller Tomasz Nowicki
2016-06-28  7:54   ` Tomasz Nowicki
2016-06-28  7:54 ` [RFC PATCH v4 5/5] PCI: thunder: Add ThunderX PEM MCFG quirk to the list Tomasz Nowicki
2016-06-28  7:54   ` Tomasz Nowicki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=577275EA.7010002@codeaurora.org \
    --to=cov@codeaurora.org \
    --cc=Liviu.Dudau@arm.com \
    --cc=Lorenzo.Pieralisi@arm.com \
    --cc=andrea.gallo@linaro.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=ddaney@caviumnetworks.com \
    --cc=dhdang@apm.com \
    --cc=gabriele.paoloni@huawei.com \
    --cc=hanjun.guo@linaro.org \
    --cc=helgaas@kernel.org \
    --cc=jchandra@broadcom.com \
    --cc=jcm@redhat.com \
    --cc=jeremy.linton@arm.com \
    --cc=jhugo@codeaurora.org \
    --cc=linaro-acpi@lists.linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=liudongdong3@huawei.com \
    --cc=msalter@redhat.com \
    --cc=mw@semihalf.com \
    --cc=okaya@codeaurora.org \
    --cc=rafael@kernel.org \
    --cc=robert.richter@caviumnetworks.com \
    --cc=tn@semihalf.com \
    --cc=wangyijing@huawei.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.