2022-05-13 20:24:45

by CGEL

[permalink] [raw]
Subject: [PATCH] qedr: Remove unnecessary synchronize_irq() before free_irq()

From: Minghao Chi <[email protected]>

Calling synchronize_irq() right before free_irq() is quite useless. On one
hand the IRQ can easily fire again before free_irq() is entered, on the
other hand free_irq() itself calls synchronize_irq() internally (in a race
condition free way), before any state associated with the IRQ is freed.

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: Minghao Chi <[email protected]>
---
drivers/infiniband/hw/qedr/main.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/infiniband/hw/qedr/main.c b/drivers/infiniband/hw/qedr/main.c
index 65ce6d0f1885..5152f10d2e6d 100644
--- a/drivers/infiniband/hw/qedr/main.c
+++ b/drivers/infiniband/hw/qedr/main.c
@@ -500,7 +500,6 @@ static void qedr_sync_free_irqs(struct qedr_dev *dev)
if (dev->int_info.msix_cnt) {
idx = i * dev->num_hwfns + dev->affin_hwfn_idx;
vector = dev->int_info.msix[idx].vector;
- synchronize_irq(vector);
free_irq(vector, &dev->cnq_array[i]);
}
}
--
2.25.1




2022-05-15 11:45:16

by Michal Kalderon

[permalink] [raw]
Subject: RE: [EXT] [PATCH] qedr: Remove unnecessary synchronize_irq() before free_irq()

> -----Original Message-----
> From: [email protected] <[email protected]>
> Sent: Friday, May 13, 2022 11:17 AM
> To: Michal Kalderon <[email protected]>
> Cc: Ariel Elior <[email protected]>; [email protected]; [email protected]; linux-
> [email protected]; [email protected]; Minghao Chi
> <[email protected]>; Zeal Robot <[email protected]>
> Subject: [EXT] [PATCH] qedr: Remove unnecessary synchronize_irq() before
> free_irq()
>
> External Email
>
> ----------------------------------------------------------------------
> From: Minghao Chi <[email protected]>
>
> Calling synchronize_irq() right before free_irq() is quite useless. On one
> hand the IRQ can easily fire again before free_irq() is entered, on the
> other hand free_irq() itself calls synchronize_irq() internally (in a race
> condition free way), before any state associated with the IRQ is freed.
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: Minghao Chi <[email protected]>
> ---
> drivers/infiniband/hw/qedr/main.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/qedr/main.c
> b/drivers/infiniband/hw/qedr/main.c
> index 65ce6d0f1885..5152f10d2e6d 100644
> --- a/drivers/infiniband/hw/qedr/main.c
> +++ b/drivers/infiniband/hw/qedr/main.c
> @@ -500,7 +500,6 @@ static void qedr_sync_free_irqs(struct qedr_dev
> *dev)
> if (dev->int_info.msix_cnt) {
> idx = i * dev->num_hwfns + dev->affin_hwfn_idx;
> vector = dev->int_info.msix[idx].vector;
> - synchronize_irq(vector);
> free_irq(vector, &dev->cnq_array[i]);
> }
> }
> --
> 2.25.1
>

Thanks,?

Acked-by: Michal Kalderon?<[email protected]>



2022-05-18 03:42:09

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: [PATCH] qedr: Remove unnecessary synchronize_irq() before free_irq()

On Fri, May 13, 2022 at 08:16:47AM +0000, [email protected] wrote:
> From: Minghao Chi <[email protected]>
>
> Calling synchronize_irq() right before free_irq() is quite useless. On one
> hand the IRQ can easily fire again before free_irq() is entered, on the
> other hand free_irq() itself calls synchronize_irq() internally (in a race
> condition free way), before any state associated with the IRQ is freed.
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: Minghao Chi <[email protected]>
> Acked-by: Michal KalderonĀ <[email protected]>
> ---
> drivers/infiniband/hw/qedr/main.c | 1 -
> 1 file changed, 1 deletion(-)

Applied to for-next, thanks

Jason