[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <16164cd2-0dce-8bfe-92da-f874184a3127@gmail.com>
Date: Tue, 6 Sep 2022 17:27:08 +0100
From: Edward Cree <ecree.xilinx@...il.com>
To: pieter.jansen-van-vuuren@....com, netdev@...r.kernel.org,
linux-net-drivers@....com
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
edumazet@...gle.com, Martin Habets <habetsm.xilinx@...il.com>
Subject: Re: [PATCH net-next] sfc: introduce shutdown entry point in efx pci
driver
On 06/09/2022 11:56, pieter.jansen-van-vuuren@....com wrote:
> From: Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@....com>
>
> Make the device inactive when the system shutdown callback has been
> invoked. This is achieved by freezing the driver and disabling the
> PCI bus mastering.
>
> Co-developed-by: Martin Habets <habetsm.xilinx@...il.com>
> Signed-off-by: Martin Habets <habetsm.xilinx@...il.com>
> Signed-off-by: Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@....com>
Acked-by: Edward Cree <ecree.xilinx@...il.com>
> ---
> drivers/net/ethernet/sfc/efx.c | 12 ++++++++++++
> drivers/net/ethernet/sfc/siena/efx.c | 12 ++++++++++++
> 2 files changed, 24 insertions(+)
>
> diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
> index 153d68e29b8b..b85c95e1ae7c 100644
> --- a/drivers/net/ethernet/sfc/efx.c
> +++ b/drivers/net/ethernet/sfc/efx.c
> @@ -1175,6 +1175,17 @@ static int efx_pm_freeze(struct device *dev)
> return 0;
> }
>
> +static void efx_pci_shutdown(struct pci_dev *pci_dev)
> +{
> + struct efx_nic *efx = pci_get_drvdata(pci_dev);
> +
> + if (!efx)
> + return;
> +
> + efx_pm_freeze(&pci_dev->dev);
> + pci_disable_device(pci_dev);
> +}
> +
> static int efx_pm_thaw(struct device *dev)
> {
> int rc;
> @@ -1279,6 +1290,7 @@ static struct pci_driver efx_pci_driver = {
> .probe = efx_pci_probe,
> .remove = efx_pci_remove,
> .driver.pm = &efx_pm_ops,
> + .shutdown = efx_pci_shutdown,
> .err_handler = &efx_err_handlers,
> #ifdef CONFIG_SFC_SRIOV
> .sriov_configure = efx_pci_sriov_configure,
> diff --git a/drivers/net/ethernet/sfc/siena/efx.c b/drivers/net/ethernet/sfc/siena/efx.c
> index 63d999e63960..cf09521b0c64 100644
> --- a/drivers/net/ethernet/sfc/siena/efx.c
> +++ b/drivers/net/ethernet/sfc/siena/efx.c
> @@ -1148,6 +1148,17 @@ static int efx_pm_freeze(struct device *dev)
> return 0;
> }
>
> +static void efx_pci_shutdown(struct pci_dev *pci_dev)
> +{
> + struct efx_nic *efx = pci_get_drvdata(pci_dev);
> +
> + if (!efx)
> + return;
> +
> + efx_pm_freeze(&pci_dev->dev);
> + pci_disable_device(pci_dev);
> +}
> +
> static int efx_pm_thaw(struct device *dev)
> {
> int rc;
> @@ -1252,6 +1263,7 @@ static struct pci_driver efx_pci_driver = {
> .probe = efx_pci_probe,
> .remove = efx_pci_remove,
> .driver.pm = &efx_pm_ops,
> + .shutdown = efx_pci_shutdown,
> .err_handler = &efx_siena_err_handlers,
> #ifdef CONFIG_SFC_SIENA_SRIOV
> .sriov_configure = efx_pci_sriov_configure,
>
Powered by blists - more mailing lists