linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: George Cherian <george.cherian@marvell.com>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"shannon.zhao@linux.alibaba.com" <shannon.zhao@linux.alibaba.com>,
	Jayachandran Chandrasekharan Nair <jnair@marvell.com>,
	George Cherian <gcherian@marvell.com>,
	Vadim Lomovtsev <Vadim.Lomovtsev@marvell.com>,
	Manish Jaggi <mjaggi@caviumnetworks.com>
Subject: Re: [PATCH] PCI: Enhance the ACS quirk for Cavium devices
Date: Mon, 30 Sep 2019 15:34:10 -0500	[thread overview]
Message-ID: <20190930203409.GA195851@google.com> (raw)
In-Reply-To: <20190919024319.GA8792@dc5-eodlnx05.marvell.com>

[+cc Vadim, Manish]

On Thu, Sep 19, 2019 at 02:43:34AM +0000, George Cherian wrote:
> Enhance the ACS quirk for Cavium Processors. Add the root port
> vendor ID's in an array and use the same in match function.
> For newer devices add the vendor ID's in the array so that the
> match function is simpler.
> 
> Signed-off-by: George Cherian <george.cherian@marvell.com>
> ---
>  drivers/pci/quirks.c | 28 +++++++++++++++++++---------
>  1 file changed, 19 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 44c4ae1abd00..64deeaddd51c 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -4241,17 +4241,27 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)
>  #endif
>  }
>  
> +static const u16 pci_quirk_cavium_acs_ids[] = {
> +	/* CN88xx family of devices */
> +	0xa180, 0xa170,
> +	/* CN99xx family of devices */
> +	0xaf84,
> +	/* CN11xxx family of devices */
> +	0xb884,
> +};
> +
>  static bool pci_quirk_cavium_acs_match(struct pci_dev *dev)
>  {
> -	/*
> -	 * Effectively selects all downstream ports for whole ThunderX 1
> -	 * family by 0xf800 mask (which represents 8 SoCs), while the lower
> -	 * bits of device ID are used to indicate which subdevice is used
> -	 * within the SoC.
> -	 */
> -	return (pci_is_pcie(dev) &&
> -		(pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT) &&
> -		((dev->device & 0xf800) == 0xa000));
> +	int i;
> +
> +	if (!pci_is_pcie(dev) || pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT)
> +		return false;
> +
> +	for (i = 0; i < ARRAY_SIZE(pci_quirk_cavium_acs_ids); i++)
> +		if (pci_quirk_cavium_acs_ids[i] == dev->device)

I'm a little skeptical of this because the previous test:

  (dev->device & 0xf800) == 0xa000

could match *many* devices, but of those, the new code only matches two
(0xa180, 0xa170).

And the comment says the new code matches the CN99xx and CN11xxx
*families*, but it only matches a single device ID for each, which
makes me think there may be more devices to come.

Maybe this is all what you want, but please confirm.

The commit log should be explicit that this adds CN99xx and CN11xxx,
which previously were not matched.

This looks like stable material?

> +			return true;
> +
> +	return false;
>  }
>  
>  static int pci_quirk_cavium_acs(struct pci_dev *dev, u16 acs_flags)
> -- 
> 2.17.1
> 

  reply	other threads:[~2019-09-30 20:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-19  2:43 [PATCH] PCI: Enhance the ACS quirk for Cavium devices George Cherian
2019-09-30 20:34 ` Bjorn Helgaas [this message]
2019-09-30 23:20   ` Jayachandran Chandrasekharan Nair
2019-10-04 19:48     ` Bjorn Helgaas
2019-10-08  8:25       ` Robert Richter
2019-10-08 21:32         ` Bjorn Helgaas
2019-10-09  2:51           ` [EXT] " George Cherian
2019-10-09 12:42             ` Bjorn Helgaas
2019-10-22 21:15               ` Bjorn Helgaas
2019-10-28 21:33                 ` Bjorn Helgaas
2019-11-06 17:16                   ` Bjorn Helgaas

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=20190930203409.GA195851@google.com \
    --to=helgaas@kernel.org \
    --cc=Vadim.Lomovtsev@marvell.com \
    --cc=gcherian@marvell.com \
    --cc=george.cherian@marvell.com \
    --cc=jnair@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mjaggi@caviumnetworks.com \
    --cc=shannon.zhao@linux.alibaba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).