linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Rajat Jain <rajatja@google.com>
Cc: linux-pci@vger.kernel.org, "Boris V." <borisvk@bstnet.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Bjorn Helgaas <helgaas@kernel.org>,
	rajatxjain@gmail.com
Subject: Re: [PATCH] PCI: Always call pci_enable_acs() regardless of pdev->acs_cap
Date: Fri, 30 Oct 2020 13:25:30 -0600	[thread overview]
Message-ID: <20201030132530.59bd8b9a@w520.home> (raw)
In-Reply-To: <20201028231545.4116866-1-rajatja@google.com>

On Wed, 28 Oct 2020 16:15:45 -0700
Rajat Jain <rajatja@google.com> wrote:

> Some devices may have have anomalies with the ACS cpability structure,
> and they may be using quirks to support ACS functionality via other
> registers. For such devices, it is important we always call
> pci_enable_acs() to give the quirks a chance to enable ACS in other ways.
> 
> For Eg:
> There seems a class of Intel devices quirked with *_intel_pch_acs_*
> functions, that do not expose the standard ACS capability structure. But
> these quirks help support ACS on these devices using other registers:
> pci_quirk_enable_intel_pch_acs() -> doesn't use acs_cap to enable ACS
> 
> This has already been taken care of in the quirks, in the other direction
> i.e. when checking if the ACS is enabled or not. So no need to do
> anything there.
> 
> Reported-by: Boris V <borisvk@bstnet.org>
> Fixes: 52fbf5bdeeef ("PCI: Cache ACS capability offset in device")
> Signed-off-by: Rajat Jain <rajatja@google.com>
> ---
>  drivers/pci/pci.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 6d4d5a2f923d..ab398226c55e 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -3516,8 +3516,13 @@ void pci_acs_init(struct pci_dev *dev)
>  {
>  	dev->acs_cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS);
>  
> -	if (dev->acs_cap)
> -		pci_enable_acs(dev);
> +	/*
> +	 * Attempt to enable ACS regardless of capability because some rootports
> +	 * (e.g. the ones quirked with *_intel_pch_acs_*) may not expose
> +	 * standard rootport capability structure, but still may support ACS via
> +	 * those quirks.
> +	 */
> +	pci_enable_acs(dev);
>  }
>  
>  /**

Much needed regression fix for v5.9:

Reviewed-by: Alex Williamson <alex.williamson@redhat.com>


  parent reply	other threads:[~2020-10-30 19:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28 23:15 [PATCH] PCI: Always call pci_enable_acs() regardless of pdev->acs_cap Rajat Jain
2020-10-28 23:19 ` Rajat Jain
2020-10-30 19:25 ` Alex Williamson [this message]
2020-10-30 21:42 ` 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=20201030132530.59bd8b9a@w520.home \
    --to=alex.williamson@redhat.com \
    --cc=borisvk@bstnet.org \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rajatja@google.com \
    --cc=rajatxjain@gmail.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).