2017-08-10 11:26:47

by Faiz Abbas

[permalink] [raw]
Subject: [PATCH] pci: dwc: Clear MSI interrupt status after it is handled

If the interrupt status is cleared before it is handled, it is possible
that another interrupt will trigger while servicing the previous one.
This is causing timeouts in some wireless lan cards which use pcie.
Therefore, clear MSI interrupt status after it gets serviced instead
of before calling generic_handler.

Signed-off-by: Faiz Abbas <[email protected]>
---
drivers/pci/dwc/pcie-designware-host.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/dwc/pcie-designware-host.c b/drivers/pci/dwc/pcie-designware-host.c
index 28ed32b..78b2584 100644
--- a/drivers/pci/dwc/pcie-designware-host.c
+++ b/drivers/pci/dwc/pcie-designware-host.c
@@ -71,9 +71,9 @@ irqreturn_t dw_handle_msi_irq(struct pcie_port *pp)
while ((pos = find_next_bit((unsigned long *) &val, 32,
pos)) != 32) {
irq = irq_find_mapping(pp->irq_domain, i * 32 + pos);
+ generic_handle_irq(irq);
dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + i * 12,
4, 1 << pos);
- generic_handle_irq(irq);
pos++;
}
}
--
2.7.4


2017-08-18 11:43:40

by Joao Pinto

[permalink] [raw]
Subject: Re: [PATCH] pci: dwc: Clear MSI interrupt status after it is handled

Hello,

Às 12:24 PM de 8/10/2017, Faiz Abbas escreveu:
> If the interrupt status is cleared before it is handled, it is possible
> that another interrupt will trigger while servicing the previous one.
> This is causing timeouts in some wireless lan cards which use pcie.
> Therefore, clear MSI interrupt status after it gets serviced instead
> of before calling generic_handler.
>
> Signed-off-by: Faiz Abbas <[email protected]>
> ---
> drivers/pci/dwc/pcie-designware-host.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/dwc/pcie-designware-host.c b/drivers/pci/dwc/pcie-designware-host.c
> index 28ed32b..78b2584 100644
> --- a/drivers/pci/dwc/pcie-designware-host.c
> +++ b/drivers/pci/dwc/pcie-designware-host.c
> @@ -71,9 +71,9 @@ irqreturn_t dw_handle_msi_irq(struct pcie_port *pp)
> while ((pos = find_next_bit((unsigned long *) &val, 32,
> pos)) != 32) {
> irq = irq_find_mapping(pp->irq_domain, i * 32 + pos);
> + generic_handle_irq(irq);
> dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + i * 12,
> 4, 1 << pos);
> - generic_handle_irq(irq);
> pos++;
> }
> }
>

It makes sense.

Acked-By: Joao Pinto <[email protected]>

2017-08-22 20:51:37

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH] pci: dwc: Clear MSI interrupt status after it is handled

On Thu, Aug 10, 2017 at 04:54:55PM +0530, Faiz Abbas wrote:
> If the interrupt status is cleared before it is handled, it is possible
> that another interrupt will trigger while servicing the previous one.
> This is causing timeouts in some wireless lan cards which use pcie.
> Therefore, clear MSI interrupt status after it gets serviced instead
> of before calling generic_handler.
>
> Signed-off-by: Faiz Abbas <[email protected]>

Applied with Joao's ack to pci/host-designware for v4.14, thanks!

> ---
> drivers/pci/dwc/pcie-designware-host.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/dwc/pcie-designware-host.c b/drivers/pci/dwc/pcie-designware-host.c
> index 28ed32b..78b2584 100644
> --- a/drivers/pci/dwc/pcie-designware-host.c
> +++ b/drivers/pci/dwc/pcie-designware-host.c
> @@ -71,9 +71,9 @@ irqreturn_t dw_handle_msi_irq(struct pcie_port *pp)
> while ((pos = find_next_bit((unsigned long *) &val, 32,
> pos)) != 32) {
> irq = irq_find_mapping(pp->irq_domain, i * 32 + pos);
> + generic_handle_irq(irq);
> dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + i * 12,
> 4, 1 << pos);
> - generic_handle_irq(irq);
> pos++;
> }
> }
> --
> 2.7.4
>