linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
To: linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	iommu@lists.linux-foundation.org
Cc: mark.rutland@arm.com, lorenzo.pieralisi@arm.com,
	will.deacon@arm.com, joro@8bytes.org, thunder.leizhen@huawei.com,
	rjw@rjwysocki.net, okaya@codeaurora.org, robh+dt@kernel.org,
	hanjun.guo@linaro.org, sudeep.holla@arm.com, bhelgaas@google.com,
	tn@semihalf.com, sunil.kovvuri@gmail.com, robin.murphy@arm.com,
	lenb@kernel.org
Subject: [PATCH 1/7] PCI: Move ATS declarations outside of CONFIG_PCI
Date: Wed, 24 May 2017 19:01:37 +0100	[thread overview]
Message-ID: <20170524180143.19855-2-jean-philippe.brucker@arm.com> (raw)
In-Reply-To: <20170524180143.19855-1-jean-philippe.brucker@arm.com>

Currently ATS helpers like pci_enable_ats are only defined when CONFIG_PCI
is enabled. The ARM SMMU driver might get built with CONFIG_PCI disabled.
It would thus have to wrap any use of ATS helpers around #ifdef
CONFIG_PCI, which isn't ideal.

A nicer solution is to always define these helpers. Since CONFIG_PCI_ATS
is only enabled in association with CONFIG_PCI, move defines outside of
CONFIG_PCI to prevent build failure when PCI is disabled.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
---
 include/linux/pci.h | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index 33c2b0b77429..775d495ef8d7 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1415,19 +1415,6 @@ int  ht_create_irq(struct pci_dev *dev, int idx);
 void ht_destroy_irq(unsigned int irq);
 #endif /* CONFIG_HT_IRQ */
 
-#ifdef CONFIG_PCI_ATS
-/* Address Translation Service */
-void pci_ats_init(struct pci_dev *dev);
-int pci_enable_ats(struct pci_dev *dev, int ps);
-void pci_disable_ats(struct pci_dev *dev);
-int pci_ats_queue_depth(struct pci_dev *dev);
-#else
-static inline void pci_ats_init(struct pci_dev *d) { }
-static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; }
-static inline void pci_disable_ats(struct pci_dev *d) { }
-static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; }
-#endif
-
 #ifdef CONFIG_PCIE_PTM
 int pci_enable_ptm(struct pci_dev *dev, u8 *granularity);
 #else
@@ -1613,6 +1600,19 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; }
 #define dev_is_pf(d) (false)
 #endif /* CONFIG_PCI */
 
+#ifdef CONFIG_PCI_ATS
+/* Address Translation Service */
+void pci_ats_init(struct pci_dev *dev);
+int pci_enable_ats(struct pci_dev *dev, int ps);
+void pci_disable_ats(struct pci_dev *dev);
+int pci_ats_queue_depth(struct pci_dev *dev);
+#else
+static inline void pci_ats_init(struct pci_dev *d) { }
+static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; }
+static inline void pci_disable_ats(struct pci_dev *d) { }
+static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; }
+#endif
+
 /* Include architecture-dependent settings and functions */
 
 #include <asm/pci.h>
-- 
2.12.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2017-05-24 18:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-24 18:01 [PATCH 0/7] Add PCI ATS support to SMMUv3 Jean-Philippe Brucker
2017-05-24 18:01 ` Jean-Philippe Brucker [this message]
2017-05-24 18:01 ` [PATCH 2/7] dt-bindings: PCI: Describe ATS property for root complex nodes Jean-Philippe Brucker
2017-05-30 10:01   ` Joerg Roedel
2017-05-30 10:58     ` Jean-Philippe Brucker
2017-05-31 17:17       ` Rob Herring
2017-05-31 17:23   ` Rob Herring
2017-06-01 12:28     ` Jean-Philippe Brucker
2017-06-05 17:20       ` Rob Herring
2017-06-06 11:11         ` Jean-Philippe Brucker
2017-06-20 11:38           ` Jean-Philippe Brucker
2017-05-24 18:01 ` [PATCH 3/7] iommu/of: Check ATS capability in " Jean-Philippe Brucker
2017-05-24 18:01 ` [PATCH 4/7] ACPI/IORT: " Jean-Philippe Brucker
2017-05-24 18:01 ` [PATCH 5/7] iommu/arm-smmu-v3: Link domains and devices Jean-Philippe Brucker
2017-05-24 18:01 ` [PATCH 6/7] iommu/arm-smmu-v3: Add support for PCI ATS Jean-Philippe Brucker
2017-05-30 10:28   ` Joerg Roedel
2017-05-30 10:58     ` Jean-Philippe Brucker
2017-05-24 18:01 ` [PATCH 7/7] iommu/arm-smmu-v3: Disable tagged pointers Jean-Philippe Brucker
2017-05-31 15:27 ` [PATCH 0/7] Add PCI ATS support to SMMUv3 Nate Watterson
2017-06-01 12:23   ` 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=20170524180143.19855-2-jean-philippe.brucker@arm.com \
    --to=jean-philippe.brucker@arm.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hanjun.guo@linaro.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=okaya@codeaurora.org \
    --cc=rjw@rjwysocki.net \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=sudeep.holla@arm.com \
    --cc=sunil.kovvuri@gmail.com \
    --cc=thunder.leizhen@huawei.com \
    --cc=tn@semihalf.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 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).