610-pcie-mediatek-fix-clearing-interrupt-status.patch 794 B

1234567891011121314151617181920212223
  1. From: Felix Fietkau <[email protected]>
  2. Date: Fri, 4 Sep 2020 18:33:27 +0200
  3. Subject: [PATCH] pcie-mediatek: fix clearing interrupt status
  4. Clearing the status needs to happen after running the handler, otherwise
  5. we will get an extra spurious interrupt after the cause has been cleared
  6. Signed-off-by: Felix Fietkau <[email protected]>
  7. ---
  8. --- a/drivers/pci/controller/pcie-mediatek.c
  9. +++ b/drivers/pci/controller/pcie-mediatek.c
  10. @@ -607,9 +607,9 @@ static void mtk_pcie_intr_handler(struct
  11. if (status & INTX_MASK) {
  12. for_each_set_bit_from(bit, &status, PCI_NUM_INTX + INTX_SHIFT) {
  13. /* Clear the INTx */
  14. - writel(1 << bit, port->base + PCIE_INT_STATUS);
  15. generic_handle_domain_irq(port->irq_domain,
  16. bit - INTX_SHIFT);
  17. + writel(1 << bit, port->base + PCIE_INT_STATUS);
  18. }
  19. }