From: Bjorn Helgaas <helgaas@kernel.org>
To: sathyanarayanan.kuppuswamy@linux.intel.com
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
ashok.raj@intel.com, keith.busch@intel.com
Subject: Re: [PATCH v7 1/7] PCI/ATS: Fix pci_prg_resp_pasid_required() dependency issues
Date: Thu, 5 Sep 2019 14:18:54 -0500 [thread overview]
Message-ID: <20190905191854.GE103977@google.com> (raw)
In-Reply-To: <ef40dbdc4eae32490caec47bed5b57eeb438dd80.1567029860.git.sathyanarayanan.kuppuswamy@linux.intel.com>
On Wed, Aug 28, 2019 at 03:14:01PM -0700, sathyanarayanan.kuppuswamy@linux.intel.com wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> Since pci_prg_resp_pasid_required() function has dependency on both
> PASID and PRI, define it only if both CONFIG_PCI_PRI and
> CONFIG_PCI_PASID config options are enabled.
>
> Fixes: e5567f5f6762 ("PCI/ATS: Add pci_prg_resp_pasid_required()
> interface.")
[Don't split tags, including "Fixes:" across lines]
This definitely doesn't fix e5567f5f6762. That commit added
pci_prg_resp_pasid_required(), but with no dependency on
CONFIG_PCI_PRI or CONFIG_PCI_PASID.
This patch is only required when a subsequent patch is applied. It
should be squashed into the commit that requires it so it's obvious
why it's needed.
I've been poking at this series, and I'll post a v8 soon with this and
other fixes.
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> ---
> drivers/pci/ats.c | 10 ++++++----
> include/linux/pci-ats.h | 12 +++++++++---
> 2 files changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c
> index e18499243f84..cdd936d10f68 100644
> --- a/drivers/pci/ats.c
> +++ b/drivers/pci/ats.c
> @@ -395,6 +395,8 @@ int pci_pasid_features(struct pci_dev *pdev)
> }
> EXPORT_SYMBOL_GPL(pci_pasid_features);
>
> +#ifdef CONFIG_PCI_PRI
> +
> /**
> * pci_prg_resp_pasid_required - Return PRG Response PASID Required bit
> * status.
> @@ -402,10 +404,8 @@ EXPORT_SYMBOL_GPL(pci_pasid_features);
> *
> * Returns 1 if PASID is required in PRG Response Message, 0 otherwise.
> *
> - * Even though the PRG response PASID status is read from PRI Status
> - * Register, since this API will mainly be used by PASID users, this
> - * function is defined within #ifdef CONFIG_PCI_PASID instead of
> - * CONFIG_PCI_PRI.
> + * Since this API has dependency on both PRI and PASID, protect it
> + * with both CONFIG_PCI_PRI and CONFIG_PCI_PASID.
> */
> int pci_prg_resp_pasid_required(struct pci_dev *pdev)
> {
> @@ -425,6 +425,8 @@ int pci_prg_resp_pasid_required(struct pci_dev *pdev)
> }
> EXPORT_SYMBOL_GPL(pci_prg_resp_pasid_required);
>
> +#endif
> +
> #define PASID_NUMBER_SHIFT 8
> #define PASID_NUMBER_MASK (0x1f << PASID_NUMBER_SHIFT)
> /**
> diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h
> index 1ebb88e7c184..1a0bdaee2f32 100644
> --- a/include/linux/pci-ats.h
> +++ b/include/linux/pci-ats.h
> @@ -40,7 +40,6 @@ void pci_disable_pasid(struct pci_dev *pdev);
> void pci_restore_pasid_state(struct pci_dev *pdev);
> int pci_pasid_features(struct pci_dev *pdev);
> int pci_max_pasids(struct pci_dev *pdev);
> -int pci_prg_resp_pasid_required(struct pci_dev *pdev);
>
> #else /* CONFIG_PCI_PASID */
>
> @@ -67,11 +66,18 @@ static inline int pci_max_pasids(struct pci_dev *pdev)
> return -EINVAL;
> }
>
> +#endif /* CONFIG_PCI_PASID */
> +
> +#if defined(CONFIG_PCI_PRI) && defined(CONFIG_PCI_PASID)
> +
> +int pci_prg_resp_pasid_required(struct pci_dev *pdev);
> +
> +#else /* CONFIG_PCI_PASID && CONFIG_PCI_PRI */
> +
> static inline int pci_prg_resp_pasid_required(struct pci_dev *pdev)
> {
> return 0;
> }
> -#endif /* CONFIG_PCI_PASID */
> -
> +#endif
>
> #endif /* LINUX_PCI_ATS_H*/
> --
> 2.21.0
>
next prev parent reply other threads:[~2019-09-05 19:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-28 22:14 [PATCH v7 0/7] Fix PF/VF dependency issue sathyanarayanan.kuppuswamy
2019-08-28 22:14 ` [PATCH v7 1/7] PCI/ATS: Fix pci_prg_resp_pasid_required() dependency issues sathyanarayanan.kuppuswamy
2019-09-05 19:18 ` Bjorn Helgaas [this message]
2019-10-03 17:20 ` Kuppuswamy Sathyanarayanan
2019-10-03 19:04 ` Bjorn Helgaas
2019-10-03 20:37 ` Kuppuswamy Sathyanarayanan
2019-10-03 21:01 ` Bjorn Helgaas
2019-10-03 21:11 ` Kuppuswamy Sathyanarayanan
2019-10-04 12:49 ` Bjorn Helgaas
2019-08-28 22:14 ` [PATCH v7 2/7] PCI/ATS: Cache PRI capability check result sathyanarayanan.kuppuswamy
2019-08-28 22:14 ` [PATCH v7 3/7] PCI/ATS: Cache PASID " sathyanarayanan.kuppuswamy
2019-08-28 22:14 ` [PATCH v7 4/7] PCI/ATS: Add PRI support for PCIe VF devices sathyanarayanan.kuppuswamy
2019-08-28 22:14 ` [PATCH v7 5/7] PCI/ATS: Add PASID " sathyanarayanan.kuppuswamy
2019-08-28 22:14 ` [PATCH v7 6/7] PCI/ATS: Disable PF/VF ATS service independently sathyanarayanan.kuppuswamy
2019-08-28 22:14 ` [PATCH v7 7/7] PCI: Skip Enhanced Allocation (EA) initialization for VF device sathyanarayanan.kuppuswamy
2019-10-03 17:21 ` Kuppuswamy Sathyanarayanan
2019-10-03 18:57 ` Bjorn Helgaas
2019-10-03 19:20 ` Raj, Ashok
2019-09-05 19:22 ` [PATCH v7 0/7] Fix PF/VF dependency issue 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=20190905191854.GE103977@google.com \
--to=helgaas@kernel.org \
--cc=ashok.raj@intel.com \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=sathyanarayanan.kuppuswamy@linux.intel.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).