From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71BF0C282DA for ; Wed, 17 Apr 2019 19:48:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D66F205C9 for ; Wed, 17 Apr 2019 19:48:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="USlJdEBB"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="POWFFCG4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D66F205C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TGKrqfU5WNDZa/DvwqDLG3DtIrU+dtO60NqGH8UNQ6I=; b=USlJdEBBpCpSaD LdPEFKZuFUnQlR1T7obC64ChFSfHLjJYcOiebQYxO/cUU1F5UX04gBjt9yKtawjP7U0iEYqol06KR 7x+5CyyeoKdVL5nKLulJ33wcukGetBZRYpe6SPe1OTxK1gscCGJC7geQGad35mrmrB7cxIkV92znC B9ZmUePJUNQtphr5pNjGLI1hFaEBjH21P+r//VbNboTTgXOYv2mIHAFJGneg063Nc6X2ib2xyDpq6 xJ1z1aa2GSAsjBtPfnXyuLG68pMRmvuLShZeskU/sA7qdg66VArIvpSyyMn/RDgTVfUyvNs/RXhCT OIyHx20mn5JPpvPE94PA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGqXD-0001Gi-FJ; Wed, 17 Apr 2019 19:47:55 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGqX9-0001GM-IM for linux-arm-kernel@lists.infradead.org; Wed, 17 Apr 2019 19:47:53 +0000 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 61F83205C9; Wed, 17 Apr 2019 19:47:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555530469; bh=d8gKCuw8mxLdXW711uuIWJMqzQlgj1Z+FJteTwebKrc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=POWFFCG4Gh0+ASda6B5d1ZcY25xjayK0cI8+3hVO5LhNFFNQSkpO4DoKiFlYK0bHP xDy8CgNNAcflM1fbAHjtZKshkG4yyligOflFqkIEGFP5Dfj6zobbfOoy77NJf2cz31 ci1xGoEyh/DsL8ViNusv88PJmh138nZUMhLK181I= Date: Wed, 17 Apr 2019 14:47:47 -0500 From: Bjorn Helgaas To: Jean-Philippe Brucker Subject: Re: [PATCH v3 1/9] PCI: Move ATS declarations outside of CONFIG_PCI Message-ID: <20190417194747.GA18308@google.com> References: <20190417182448.12382-1-jean-philippe.brucker@arm.com> <20190417182448.12382-2-jean-philippe.brucker@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190417182448.12382-2-jean-philippe.brucker@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190417_124751_643489_EB9123B7 X-CRM114-Status: GOOD ( 17.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lorenzo.pieralisi@arm.com, eric.auger@redhat.com, zhongmiao@hisilicon.com, rjw@rjwysocki.net, joro@8bytes.org, will.deacon@arm.com, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, hanjun.guo@linaro.org, sudeep.holla@arm.com, okaya@kernel.org, robin.murphy@arm.com, linux-arm-kernel@lists.infradead.org, lenb@kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 17, 2019 at 07:24:40PM +0100, Jean-Philippe Brucker wrote: > At the moment, the ATS functions are only defined when CONFIG_PCI is > enabled. Since we're about to use them in the Arm SMMUv3 driver, which > could be built with CONFIG_PCI disabled, and they are already guarded by > CONFIG_PCI_ATS which depends on CONFIG_PCI, move the definitions outside > of CONFIG_PCI. > > Signed-off-by: Jean-Philippe Brucker I guess this is OK with me, although AFAICS they're only used in arm_smmu_enable_ats() and arm_smmu_disable_ats() and I personally wouldn't find it objectionable to wrap the bodies of those functions in "#ifdef CONFIG_PCI". That might even be a useful hint to the reader, as opposed to relying on all these stub functions (dev_is_pci(), pci_ats_disabled(), pci_enable_ats(), pci_disable_ats(), as well as the complete struct pci_dev declaration) that depend on config settings that aren't obvious in the caller. Acked-by: Bjorn Helgaas > --- > include/linux/pci.h | 30 +++++++++++++++--------------- > 1 file changed, 15 insertions(+), 15 deletions(-) > > diff --git a/include/linux/pci.h b/include/linux/pci.h > index 77448215ef5b..169c6a18d0b0 100644 > --- a/include/linux/pci.h > +++ b/include/linux/pci.h > @@ -1521,21 +1521,6 @@ static inline void pcie_ecrc_get_policy(char *str) { } > > bool pci_ats_disabled(void); > > -#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); > -int pci_ats_page_aligned(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; } > -static inline int pci_ats_page_aligned(struct pci_dev *dev) { return 0; } > -#endif > - > #ifdef CONFIG_PCIE_PTM > int pci_enable_ptm(struct pci_dev *dev, u8 *granularity); > #else > @@ -1730,6 +1715,21 @@ static inline const struct pci_device_id *pci_match_id(const struct pci_device_i > { return NULL; } > #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); > +int pci_ats_page_aligned(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; } > +static inline int pci_ats_page_aligned(struct pci_dev *dev) { return 0; } > +#endif > + > /* Include architecture-dependent settings and functions */ > > #include > -- > 2.21.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel