linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-rc] RDMA/efa: Add shutdown notifier
@ 2024-04-25  7:51 Michael Margolin
  2024-04-25  9:59 ` Tao Liu
  2024-04-25 11:12 ` Zhu Yanjun
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Margolin @ 2024-04-25  7:51 UTC (permalink / raw)
  To: jgg, leon, linux-rdma
  Cc: sleybo, matua, gal.pressman, ltao, Firas Jahjah, Yonatan Nachum

Add driver function to stop the device and release any active IRQs as
preparation for shutdown. This should fix issues cased by unexpected AQ
interrupts when booting kernel using kexec and possible data integrity
issues when the system is being shutdown during traffic.

Reviewed-by: Firas Jahjah <firasj@amazon.com>
Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
Signed-off-by: Michael Margolin <mrgolin@amazon.com>
---
 drivers/infiniband/hw/efa/efa_main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/infiniband/hw/efa/efa_main.c b/drivers/infiniband/hw/efa/efa_main.c
index 5fa3603c80d8..d1a48f988f6c 100644
--- a/drivers/infiniband/hw/efa/efa_main.c
+++ b/drivers/infiniband/hw/efa/efa_main.c
@@ -671,11 +671,22 @@ static void efa_remove(struct pci_dev *pdev)
 	efa_remove_device(pdev);
 }
 
+static void efa_shutdown(struct pci_dev *pdev)
+{
+	struct efa_dev *dev = pci_get_drvdata(pdev);
+
+	efa_destroy_eqs(dev);
+	efa_com_dev_reset(&dev->edev, EFA_REGS_RESET_SHUTDOWN);
+	efa_free_irq(dev, &dev->admin_irq);
+	efa_disable_msix(dev);
+}
+
 static struct pci_driver efa_pci_driver = {
 	.name           = DRV_MODULE_NAME,
 	.id_table       = efa_pci_tbl,
 	.probe          = efa_probe,
 	.remove         = efa_remove,
+	.shutdown       = efa_shutdown,
 };
 
 module_pci_driver(efa_pci_driver);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH for-rc] RDMA/efa: Add shutdown notifier
  2024-04-25  7:51 [PATCH for-rc] RDMA/efa: Add shutdown notifier Michael Margolin
@ 2024-04-25  9:59 ` Tao Liu
  2024-04-25 11:12 ` Zhu Yanjun
  1 sibling, 0 replies; 6+ messages in thread
From: Tao Liu @ 2024-04-25  9:59 UTC (permalink / raw)
  To: Michael Margolin
  Cc: jgg, leon, linux-rdma, sleybo, matua, gal.pressman, Firas Jahjah,
	Yonatan Nachum

Hi Michael,

Thanks a lot for the patch.

Thanks,
Tao Liu

On Thu, Apr 25, 2024 at 3:52 PM Michael Margolin <mrgolin@amazon.com> wrote:
>
> Add driver function to stop the device and release any active IRQs as
> preparation for shutdown. This should fix issues cased by unexpected AQ
> interrupts when booting kernel using kexec and possible data integrity
> issues when the system is being shutdown during traffic.
>
> Reviewed-by: Firas Jahjah <firasj@amazon.com>
> Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
> Signed-off-by: Michael Margolin <mrgolin@amazon.com>
> ---
>  drivers/infiniband/hw/efa/efa_main.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/drivers/infiniband/hw/efa/efa_main.c b/drivers/infiniband/hw/efa/efa_main.c
> index 5fa3603c80d8..d1a48f988f6c 100644
> --- a/drivers/infiniband/hw/efa/efa_main.c
> +++ b/drivers/infiniband/hw/efa/efa_main.c
> @@ -671,11 +671,22 @@ static void efa_remove(struct pci_dev *pdev)
>         efa_remove_device(pdev);
>  }
>
> +static void efa_shutdown(struct pci_dev *pdev)
> +{
> +       struct efa_dev *dev = pci_get_drvdata(pdev);
> +
> +       efa_destroy_eqs(dev);
> +       efa_com_dev_reset(&dev->edev, EFA_REGS_RESET_SHUTDOWN);
> +       efa_free_irq(dev, &dev->admin_irq);
> +       efa_disable_msix(dev);
> +}
> +
>  static struct pci_driver efa_pci_driver = {
>         .name           = DRV_MODULE_NAME,
>         .id_table       = efa_pci_tbl,
>         .probe          = efa_probe,
>         .remove         = efa_remove,
> +       .shutdown       = efa_shutdown,
>  };
>
>  module_pci_driver(efa_pci_driver);
> --
> 2.40.1
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH for-rc] RDMA/efa: Add shutdown notifier
  2024-04-25  7:51 [PATCH for-rc] RDMA/efa: Add shutdown notifier Michael Margolin
  2024-04-25  9:59 ` Tao Liu
@ 2024-04-25 11:12 ` Zhu Yanjun
  2024-04-25 17:15   ` Margolin, Michael
  2024-04-25 17:18   ` [PATCH for-rc v2] " Michael Margolin
  1 sibling, 2 replies; 6+ messages in thread
From: Zhu Yanjun @ 2024-04-25 11:12 UTC (permalink / raw)
  To: Michael Margolin, jgg, leon, linux-rdma
  Cc: sleybo, matua, gal.pressman, ltao, Firas Jahjah, Yonatan Nachum

On 25.04.24 09:51, Michael Margolin wrote:
> Add driver function to stop the device and release any active IRQs as
> preparation for shutdown. This should fix issues cased by unexpected AQ

s/cased/caused ?

Zhu Yanjun

> interrupts when booting kernel using kexec and possible data integrity
> issues when the system is being shutdown during traffic.
> 
> Reviewed-by: Firas Jahjah <firasj@amazon.com>
> Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
> Signed-off-by: Michael Margolin <mrgolin@amazon.com>
> ---
>   drivers/infiniband/hw/efa/efa_main.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/infiniband/hw/efa/efa_main.c b/drivers/infiniband/hw/efa/efa_main.c
> index 5fa3603c80d8..d1a48f988f6c 100644
> --- a/drivers/infiniband/hw/efa/efa_main.c
> +++ b/drivers/infiniband/hw/efa/efa_main.c
> @@ -671,11 +671,22 @@ static void efa_remove(struct pci_dev *pdev)
>   	efa_remove_device(pdev);
>   }
>   
> +static void efa_shutdown(struct pci_dev *pdev)
> +{
> +	struct efa_dev *dev = pci_get_drvdata(pdev);
> +
> +	efa_destroy_eqs(dev);
> +	efa_com_dev_reset(&dev->edev, EFA_REGS_RESET_SHUTDOWN);
> +	efa_free_irq(dev, &dev->admin_irq);
> +	efa_disable_msix(dev);
> +}
> +
>   static struct pci_driver efa_pci_driver = {
>   	.name           = DRV_MODULE_NAME,
>   	.id_table       = efa_pci_tbl,
>   	.probe          = efa_probe,
>   	.remove         = efa_remove,
> +	.shutdown       = efa_shutdown,
>   };
>   
>   module_pci_driver(efa_pci_driver);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH for-rc] RDMA/efa: Add shutdown notifier
  2024-04-25 11:12 ` Zhu Yanjun
@ 2024-04-25 17:15   ` Margolin, Michael
  2024-04-25 17:18   ` [PATCH for-rc v2] " Michael Margolin
  1 sibling, 0 replies; 6+ messages in thread
From: Margolin, Michael @ 2024-04-25 17:15 UTC (permalink / raw)
  To: Zhu Yanjun, jgg, leon, linux-rdma
  Cc: sleybo, matua, gal.pressman, ltao, Firas Jahjah, Yonatan Nachum


On 4/25/2024 2:12 PM, Zhu Yanjun wrote:
> CAUTION: This email originated from outside of the organization. Do 
> not click links or open attachments unless you can confirm the sender 
> and know the content is safe.
>
>
>
> On 25.04.24 09:51, Michael Margolin wrote:
>> Add driver function to stop the device and release any active IRQs as
>> preparation for shutdown. This should fix issues cased by unexpected AQ
>
> s/cased/caused ?
>
> Zhu Yanjun

Right, thanks.


Michael



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH for-rc v2] RDMA/efa: Add shutdown notifier
  2024-04-25 11:12 ` Zhu Yanjun
  2024-04-25 17:15   ` Margolin, Michael
@ 2024-04-25 17:18   ` Michael Margolin
  2024-04-29 12:06     ` Jason Gunthorpe
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Margolin @ 2024-04-25 17:18 UTC (permalink / raw)
  To: jgg, leon, linux-rdma
  Cc: sleybo, matua, gal.pressman, ltao, Firas Jahjah, Yonatan Nachum

Add driver function to stop the device and release any active IRQs as
preparation for shutdown. This should fix issues caused by unexpected AQ
interrupts when booting kernel using kexec and possible data integrity
issues when the system is being shutdown during traffic.

Reviewed-by: Firas Jahjah <firasj@amazon.com>
Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
Signed-off-by: Michael Margolin <mrgolin@amazon.com>
---
 drivers/infiniband/hw/efa/efa_main.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/infiniband/hw/efa/efa_main.c b/drivers/infiniband/hw/efa/efa_main.c
index 5fa3603c80d8..d1a48f988f6c 100644
--- a/drivers/infiniband/hw/efa/efa_main.c
+++ b/drivers/infiniband/hw/efa/efa_main.c
@@ -671,11 +671,22 @@ static void efa_remove(struct pci_dev *pdev)
 	efa_remove_device(pdev);
 }
 
+static void efa_shutdown(struct pci_dev *pdev)
+{
+	struct efa_dev *dev = pci_get_drvdata(pdev);
+
+	efa_destroy_eqs(dev);
+	efa_com_dev_reset(&dev->edev, EFA_REGS_RESET_SHUTDOWN);
+	efa_free_irq(dev, &dev->admin_irq);
+	efa_disable_msix(dev);
+}
+
 static struct pci_driver efa_pci_driver = {
 	.name           = DRV_MODULE_NAME,
 	.id_table       = efa_pci_tbl,
 	.probe          = efa_probe,
 	.remove         = efa_remove,
+	.shutdown       = efa_shutdown,
 };
 
 module_pci_driver(efa_pci_driver);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH for-rc v2] RDMA/efa: Add shutdown notifier
  2024-04-25 17:18   ` [PATCH for-rc v2] " Michael Margolin
@ 2024-04-29 12:06     ` Jason Gunthorpe
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2024-04-29 12:06 UTC (permalink / raw)
  To: Michael Margolin
  Cc: leon, linux-rdma, sleybo, matua, gal.pressman, ltao,
	Firas Jahjah, Yonatan Nachum

On Thu, Apr 25, 2024 at 05:18:14PM +0000, Michael Margolin wrote:
> Add driver function to stop the device and release any active IRQs as
> preparation for shutdown. This should fix issues caused by unexpected AQ
> interrupts when booting kernel using kexec and possible data integrity
> issues when the system is being shutdown during traffic.
> 
> Reviewed-by: Firas Jahjah <firasj@amazon.com>
> Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
> Signed-off-by: Michael Margolin <mrgolin@amazon.com>
> ---
>  drivers/infiniband/hw/efa/efa_main.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)

Applied to for-next

Jason

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-29 12:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25  7:51 [PATCH for-rc] RDMA/efa: Add shutdown notifier Michael Margolin
2024-04-25  9:59 ` Tao Liu
2024-04-25 11:12 ` Zhu Yanjun
2024-04-25 17:15   ` Margolin, Michael
2024-04-25 17:18   ` [PATCH for-rc v2] " Michael Margolin
2024-04-29 12:06     ` Jason Gunthorpe

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).