2020-11-08 18:44:59

by Martin Kaiser

[permalink] [raw]
Subject: [PATCH] PCI: brcmstb: Remove irq handler and data in one go

Replace the two separate calls for removing the irq handler and data with a
single irq_set_chained_handler_and_data() call.

Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/pci/controller/pcie-brcmstb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index bea86899bd5d..7c666f4deb47 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -606,8 +606,7 @@ static void brcm_msi_remove(struct brcm_pcie *pcie)

if (!msi)
return;
- irq_set_chained_handler(msi->irq, NULL);
- irq_set_handler_data(msi->irq, NULL);
+ irq_set_chained_handler_and_data(msi->irq, NULL, NULL);
brcm_free_domains(msi);
}

--
2.20.1


2020-11-09 02:04:51

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH] PCI: brcmstb: Remove irq handler and data in one go



On 11/8/2020 10:42 AM, Martin Kaiser wrote:
> Replace the two separate calls for removing the irq handler and data with a
> single irq_set_chained_handler_and_data() call.
>
> Signed-off-by: Martin Kaiser <[email protected]>

Acked-by: Florian Fainelli <[email protected]>
--
Florian

2020-11-11 21:56:44

by Martin Kaiser

[permalink] [raw]
Subject: [PATCH v2] PCI: brcmstb: Fix race in removing chained IRQ handler

Call irq_set_chained_handler_and_data() to clear the chained handler
and the handler's data under irq_desc->lock.

See also 2cf5a03cb29d ("PCI/keystone: Fix race in installing chained
IRQ handler").

Signed-off-by: Martin Kaiser <[email protected]>
Acked-by: Florian Fainelli <[email protected]>
---
v2:
- rewrite the commit message to clarify that this is a bugfix

drivers/pci/controller/pcie-brcmstb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index bea86899bd5d..7c666f4deb47 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -606,8 +606,7 @@ static void brcm_msi_remove(struct brcm_pcie *pcie)

if (!msi)
return;
- irq_set_chained_handler(msi->irq, NULL);
- irq_set_handler_data(msi->irq, NULL);
+ irq_set_chained_handler_and_data(msi->irq, NULL, NULL);
brcm_free_domains(msi);
}

--
2.20.1

2020-11-12 09:12:05

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: Re: [PATCH v2] PCI: brcmstb: Fix race in removing chained IRQ handler

On Wed, 2020-11-11 at 22:53 +0100, Martin Kaiser wrote:
> Call irq_set_chained_handler_and_data() to clear the chained handler
> and the handler's data under irq_desc->lock.
>
> See also 2cf5a03cb29d ("PCI/keystone: Fix race in installing chained
> IRQ handler").
>
> Signed-off-by: Martin Kaiser <[email protected]>
> Acked-by: Florian Fainelli <[email protected]>
> ---

Acked-by: Nicolas Saenz Julienne <[email protected]>

Thanks!

> v2:
> - rewrite the commit message to clarify that this is a bugfix
>
> drivers/pci/controller/pcie-brcmstb.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
> index bea86899bd5d..7c666f4deb47 100644
> --- a/drivers/pci/controller/pcie-brcmstb.c
> +++ b/drivers/pci/controller/pcie-brcmstb.c
> @@ -606,8 +606,7 @@ static void brcm_msi_remove(struct brcm_pcie *pcie)
>
> if (!msi)
> return;
> - irq_set_chained_handler(msi->irq, NULL);
> - irq_set_handler_data(msi->irq, NULL);
> + irq_set_chained_handler_and_data(msi->irq, NULL, NULL);
> brcm_free_domains(msi);
> }
>


Attachments:
signature.asc (499.00 B)
This is a digitally signed message part

2020-11-12 22:07:57

by Martin Kaiser

[permalink] [raw]
Subject: [PATCH v3] PCI: brcmstb: remove chained IRQ handler and data in one go

Call irq_set_chained_handler_and_data() to clear the chained handler
and the handler's data under irq_desc->lock.

See also 2cf5a03cb29d ("PCI/keystone: Fix race in installing chained
IRQ handler").

Signed-off-by: Martin Kaiser <[email protected]>
Acked-by: Florian Fainelli <[email protected]>
Acked-by: Nicolas Saenz Julienne <[email protected]>
---
v3:
- rewrite the commit message again. this is no race condition if we
remove the interrupt handler. sorry for the noise.
v2:
- rewrite the commit message to clarify that this is a bugfix

drivers/pci/controller/pcie-brcmstb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index bea86899bd5d..7c666f4deb47 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -606,8 +606,7 @@ static void brcm_msi_remove(struct brcm_pcie *pcie)

if (!msi)
return;
- irq_set_chained_handler(msi->irq, NULL);
- irq_set_handler_data(msi->irq, NULL);
+ irq_set_chained_handler_and_data(msi->irq, NULL, NULL);
brcm_free_domains(msi);
}

--
2.20.1

2021-01-15 21:43:37

by Martin Kaiser

[permalink] [raw]
Subject: [PATCH v4] PCI: brcmstb: Remove chained IRQ handler and data in one go

Call irq_set_chained_handler_and_data() to clear the chained handler
and the handler's data under irq_desc->lock.

See also 2cf5a03cb29d ("PCI/keystone: Fix race in installing chained
IRQ handler").

Signed-off-by: Martin Kaiser <[email protected]>
Acked-by: Florian Fainelli <[email protected]>
Acked-by: Nicolas Saenz Julienne <[email protected]>
---
Hi Lorenzo,
I sent this simple patch back in November, it seems that it got lost
somehow. Is there any chance that you can apply it?
Thanks, Martin

v4:
- resend after two months
- clean up the commit message while at it
v3:
- rewrite the commit message again. this is no race condition if we
remove the interrupt handler. sorry for the noise.
v2:
- rewrite the commit message to clarify that this is a bugfix

drivers/pci/controller/pcie-brcmstb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index d41257f43a8f..95f6dd93ceae 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -603,8 +603,7 @@ static void brcm_msi_remove(struct brcm_pcie *pcie)

if (!msi)
return;
- irq_set_chained_handler(msi->irq, NULL);
- irq_set_handler_data(msi->irq, NULL);
+ irq_set_chained_handler_and_data(msi->irq, NULL, NULL);
brcm_free_domains(msi);
}

--
2.20.1

2021-01-19 12:47:58

by Lorenzo Pieralisi

[permalink] [raw]
Subject: Re: [PATCH v4] PCI: brcmstb: Remove chained IRQ handler and data in one go

On Fri, 15 Jan 2021 22:15:32 +0100, Martin Kaiser wrote:
> Call irq_set_chained_handler_and_data() to clear the chained handler
> and the handler's data under irq_desc->lock.
>
> See also 2cf5a03cb29d ("PCI/keystone: Fix race in installing chained
> IRQ handler").

Applied to pci/misc, thanks!

[1/1] PCI: brcmstb: Remove chained IRQ handler and data in one go
https://git.kernel.org/lpieralisi/pci/c/5ce6697a44

Thanks,
Lorenzo