[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190516132807.GB101793@google.com>
Date: Thu, 16 May 2019 08:28:07 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Vidya Sagar <vidyas@...dia.com>
Cc: lorenzo.pieralisi@....com, robh+dt@...nel.org,
mark.rutland@....com, thierry.reding@...il.com,
jonathanh@...dia.com, kishon@...com, catalin.marinas@....com,
will.deacon@....com, jingoohan1@...il.com,
gustavo.pimentel@...opsys.com, mperttunen@...dia.com,
linux-pci@...r.kernel.org, devicetree@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, kthota@...dia.com,
mmaddireddy@...dia.com, sagar.tv@...il.com
Subject: Re: [PATCH V6 02/15] PCI/PME: Export pcie_pme_disable_msi() &
pcie_pme_no_msi() APIs
On Mon, May 13, 2019 at 10:36:13AM +0530, Vidya Sagar wrote:
> Export pcie_pme_disable_msi() & pcie_pme_no_msi() APIs to enable drivers
> using these APIs be able to build as loadable modules.
>
> Signed-off-by: Vidya Sagar <vidyas@...dia.com>
Nak, as-is.
1) The argument for why this is needed is unconvincing. If device
advertises MSI support, we should be able to use it.
2) If it turns out we really need this, it should be some sort of
per-device setting rather than a global thing like this.
> ---
> Changes since [v5]:
> * Corrected inline implementation of pcie_pme_no_msi() API
>
> Changes since [v4]:
> * None
>
> Changes since [v3]:
> * None
>
> Changes since [v2]:
> * Exported pcie_pme_no_msi() API after making pcie_pme_msi_disabled a static
>
> Changes since [v1]:
> * This is a new patch in v2 series
>
> drivers/pci/pcie/pme.c | 14 +++++++++++++-
> drivers/pci/pcie/portdrv.h | 14 ++------------
> 2 files changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
> index 54d593d10396..d5e0ea4a62fc 100644
> --- a/drivers/pci/pcie/pme.c
> +++ b/drivers/pci/pcie/pme.c
> @@ -25,7 +25,19 @@
> * that using MSI for PCIe PME signaling doesn't play well with PCIe PME-based
> * wake-up from system sleep states.
> */
> -bool pcie_pme_msi_disabled;
> +static bool pcie_pme_msi_disabled;
> +
> +void pcie_pme_disable_msi(void)
> +{
> + pcie_pme_msi_disabled = true;
> +}
> +EXPORT_SYMBOL_GPL(pcie_pme_disable_msi);
> +
> +bool pcie_pme_no_msi(void)
> +{
> + return pcie_pme_msi_disabled;
> +}
> +EXPORT_SYMBOL_GPL(pcie_pme_no_msi);
>
> static int __init pcie_pme_setup(char *str)
> {
> diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h
> index 944827a8c7d3..1d441fe26c51 100644
> --- a/drivers/pci/pcie/portdrv.h
> +++ b/drivers/pci/pcie/portdrv.h
> @@ -129,18 +129,8 @@ void pcie_port_bus_unregister(void);
> struct pci_dev;
>
> #ifdef CONFIG_PCIE_PME
> -extern bool pcie_pme_msi_disabled;
> -
> -static inline void pcie_pme_disable_msi(void)
> -{
> - pcie_pme_msi_disabled = true;
> -}
> -
> -static inline bool pcie_pme_no_msi(void)
> -{
> - return pcie_pme_msi_disabled;
> -}
> -
> +void pcie_pme_disable_msi(void);
> +bool pcie_pme_no_msi(void);
> void pcie_pme_interrupt_enable(struct pci_dev *dev, bool enable);
> #else /* !CONFIG_PCIE_PME */
> static inline void pcie_pme_disable_msi(void) {}
> --
> 2.17.1
>
Powered by blists - more mailing lists