linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Jean-Philippe Brucker <jean-philippe@linaro.org>
Cc: will@kernel.org, robh+dt@kernel.org, joro@8bytes.org,
	baolu.lu@linux.intel.com, sudeep.holla@arm.com,
	linux-doc@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org,
	lorenzo.pieralisi@arm.com, corbet@lwn.net, mark.rutland@arm.com,
	liviu.dudau@arm.com, guohanjun@huawei.com, rjw@rjwysocki.net,
	lenb@kernel.org, robin.murphy@arm.com, dwmw2@infradead.org,
	amurray@thegoodpenguin.co.uk, frowand.list@gmail.com
Subject: Re: [PATCH v2 02/11] PCI: Add ats_supported host bridge flag
Date: Thu, 12 Mar 2020 16:21:24 -0500	[thread overview]
Message-ID: <20200312212124.GA178131@google.com> (raw)
In-Reply-To: <20200311124506.208376-3-jean-philippe@linaro.org>

On Wed, Mar 11, 2020 at 01:44:57PM +0100, Jean-Philippe Brucker wrote:
> Each vendor has their own way of describing whether a host bridge
> supports ATS.  The Intel and AMD ACPI tables selectively enable or
> disable ATS per device or sub-tree, while Arm has a single bit for each
> host bridge.  For those that need it, add an ats_supported bit to the
> host bridge structure.

Can you mention the specific ACPI tables here in the commit log?

Maybe elaborate on the "for those that need it" bit?  I'm not sure if
you need it for the cases where DT or ACPI tells us directly for the
host bridge, or if you need it for the more selective cases?

I guess in one sense you *always* need it since you check the cached
bit later.

I don't understand the implications of this, especially the selective
situation.  Given your comment from the first posting, I thought this
was a property of the host bridge, so I don't know what it means to
say some devices support ATS but others don't.

> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> ---
> v1->v2: try to improve the comment
> ---
>  drivers/pci/probe.c | 8 ++++++++
>  include/linux/pci.h | 1 +
>  2 files changed, 9 insertions(+)
> 
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 512cb4312ddd..b5e36f06b40a 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -598,6 +598,14 @@ static void pci_init_host_bridge(struct pci_host_bridge *bridge)
>  	bridge->native_shpc_hotplug = 1;
>  	bridge->native_pme = 1;
>  	bridge->native_ltr = 1;
> +
> +	/*
> +	 * Some systems (ACPI IORT, device-tree) declare ATS support at the host
> +	 * bridge, and clear this bit when ATS isn't supported. Others (ACPI
> +	 * DMAR and IVRS) declare ATS support with a smaller granularity, and
> +	 * need this bit set.
> +	 */
> +	bridge->ats_supported = 1;
>  }
>  
>  struct pci_host_bridge *pci_alloc_host_bridge(size_t priv)
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 3840a541a9de..9fe2e84d74d7 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -511,6 +511,7 @@ struct pci_host_bridge {
>  	unsigned int	native_pme:1;		/* OS may use PCIe PME */
>  	unsigned int	native_ltr:1;		/* OS may use PCIe LTR */
>  	unsigned int	preserve_config:1;	/* Preserve FW resource setup */
> +	unsigned int	ats_supported:1;
>  
>  	/* Resource alignment requirements */
>  	resource_size_t (*align_resource)(struct pci_dev *dev,
> -- 
> 2.25.1
> 

  reply	other threads:[~2020-03-12 21:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 12:44 [PATCH v2 00/11] PCI/ATS: Device-tree support and other improvements Jean-Philippe Brucker
2020-03-11 12:44 ` [PATCH v2 01/11] dt-bindings: PCI: generic: Add ats-supported property Jean-Philippe Brucker
2020-03-11 12:44 ` [PATCH v2 02/11] PCI: Add ats_supported host bridge flag Jean-Philippe Brucker
2020-03-12 21:21   ` Bjorn Helgaas [this message]
2020-03-11 12:44 ` [PATCH v2 03/11] PCI: OF: Check whether the host bridge supports ATS Jean-Philippe Brucker
2020-03-12 20:45   ` Bjorn Helgaas
2020-03-11 12:44 ` [PATCH v2 04/11] ACPI/IORT: Check ATS capability in root complex node Jean-Philippe Brucker
2020-03-12 20:58   ` Bjorn Helgaas
2020-03-11 12:45 ` [PATCH v2 05/11] PCI/ATS: Gather checks into pci_ats_supported() Jean-Philippe Brucker
2020-03-12 21:01   ` Bjorn Helgaas
2020-03-11 12:45 ` [PATCH v2 06/11] iommu/amd: Use pci_ats_supported() Jean-Philippe Brucker
2020-03-11 12:45 ` [PATCH v2 07/11] iommu/arm-smmu-v3: " Jean-Philippe Brucker
2020-03-18 21:49   ` Will Deacon
2020-03-11 12:45 ` [PATCH v2 08/11] iommu/vt-d: " Jean-Philippe Brucker
2020-03-12  1:44   ` Lu Baolu
2020-03-12  7:54     ` Jean-Philippe Brucker
2020-03-12  8:18       ` Lu Baolu
2020-03-11 12:45 ` [PATCH v2 09/11] ACPI/IORT: Drop ATS fwspec flag Jean-Philippe Brucker
2020-03-11 12:45 ` [PATCH v2 10/11] arm64: dts: fast models: Enable PCIe ATS for Base RevC FVP Jean-Philippe Brucker
2020-03-11 12:45 ` [PATCH v2 11/11] Documentation: Generalize the "pci=noats" boot parameter Jean-Philippe Brucker

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=20200312212124.GA178131@google.com \
    --to=helgaas@kernel.org \
    --cc=amurray@thegoodpenguin.co.uk \
    --cc=baolu.lu@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=frowand.list@gmail.com \
    --cc=guohanjun@huawei.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jean-philippe@linaro.org \
    --cc=joro@8bytes.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=sudeep.holla@arm.com \
    --cc=will@kernel.org \
    /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).