Subject: [PATCH] pci: designware: fix missing msi irqs

From: [email-masked] (Marek Vasut)
Date: Thu, 12 Dec 2013 23:01:01 +0100

On Thursday, December 12, 2013 at 07:29:03 PM, Harro Haan wrote:
> The interrupts were cleared after the irq handler was called.
> This means that new interrupts that occur after the handler handled
> the previous irq but before the interrupt is cleared will be missed.
> 
> Signed-off-by: Harro Haan <[email-masked]>
> Cc: Mohit Kumar <[email-masked]>
> Cc: Jingoo Han <[email-masked]>
> Cc: Bjorn Helgaas <[email-masked]>
> Cc: Marek Vasut <[email-masked]>
> Cc: Richard Zhu <[email-masked]>
> Cc: Shawn Guo <[email-masked]>
> Cc: Pratyush Anand <[email-masked]>
> Cc: Tim Harvey <[email-masked]>
> Cc: Juergen Beisert <[email-masked]>
> Cc: Arnd Bergmann <[email-masked]>
> Cc: Siva Reddy Kallam <[email-masked]>
> Cc: Srikanth T Shivanand <[email-masked]>
> Cc: Sean Cross <[email-masked]>
> Cc: linux-pci at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> ---
>  drivers/pci/host/pcie-designware.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/host/pcie-designware.c
> b/drivers/pci/host/pcie-designware.c index 1ce0453..762f596 100644
> --- a/drivers/pci/host/pcie-designware.c
> +++ b/drivers/pci/host/pcie-designware.c
> @@ -167,11 +167,13 @@ void dw_handle_msi_irq(struct pcie_port *pp)
>  			while ((pos = find_next_bit(&val, 32, pos)) != 32) {
>  				irq = irq_find_mapping(pp->irq_domain,
>  						i * 32 + pos);
> +				dw_pcie_wr_own_conf(pp,
> +						PCIE_MSI_INTR0_STATUS + i * 12,
> +						4, 1 << pos);
>  				generic_handle_irq(irq);
>  				pos++;
>  			}
>  		}
> -		dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + i * 12, 4, val);
>  	}
>  }

On imx6-sabrelite:

Tested-by: Marek Vasut <[email-masked]>

Best regards,
Marek Vasut