950-0918-irqchip-irq-brcmstb-l2-Add-config-for-2711-controlle.patch 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. From fa4d4ed28c92cf4470e518f1a7362dc7941632d7 Mon Sep 17 00:00:00 2001
  2. From: Dom Cobley <[email protected]>
  3. Date: Wed, 28 Jun 2023 16:24:29 +0100
  4. Subject: [PATCH] irqchip/irq-brcmstb-l2: Add config for 2711 controller
  5. We currently see these regularly:
  6. [ 25.157560] irq 31, desc: 00000000c15e6d2c, depth: 0, count: 0, unhandled: 0
  7. [ 25.164658] ->handle_irq(): 00000000b1775675, brcmstb_l2_intc_irq_handle+0x0/0x1a8
  8. [ 25.172352] ->irq_data.chip(): 00000000fea59f1c, gic_chip_mode1+0x0/0x108
  9. [ 25.179166] ->action(): 000000003eda6d6f
  10. [ 25.183096] ->action->handler(): 000000002c09e646, bad_chained_irq+0x0/0x58
  11. [ 25.190084] IRQ_LEVEL set
  12. [ 25.193142] IRQ_NOPROBE set
  13. [ 25.196198] IRQ_NOREQUEST set
  14. [ 25.199255] IRQ_NOTHREAD set
  15. with:
  16. $ cat /proc/interrupts | grep 31:
  17. 31: 1 0 0 0 GICv2 129 Level (null)
  18. The interrupt is described in DT with IRQ_TYPE_LEVEL_HIGH
  19. But the current compatible string uses the controller in edge triggered mode
  20. (as that config matches our register layout).
  21. Add a new compatible structure for level driven interrupt with our register layout.
  22. We had already been using this compatible string in device tree, so no change needed
  23. there.
  24. Signed-off-by: Dom Cobley <[email protected]>
  25. ---
  26. drivers/irqchip/irq-brcmstb-l2.c | 17 +++++++++++++++++
  27. 1 file changed, 17 insertions(+)
  28. --- a/drivers/irqchip/irq-brcmstb-l2.c
  29. +++ b/drivers/irqchip/irq-brcmstb-l2.c
  30. @@ -52,6 +52,16 @@ static const struct brcmstb_intc_init_pa
  31. .cpu_mask_clear = 0x0C
  32. };
  33. +/* Register offsets in the 2711 L2 level interrupt controller */
  34. +static const struct brcmstb_intc_init_params l2_2711_lvl_intc_init = {
  35. + .handler = handle_level_irq,
  36. + .cpu_status = 0x00,
  37. + .cpu_clear = 0x08,
  38. + .cpu_mask_status = 0x0c,
  39. + .cpu_mask_set = 0x10,
  40. + .cpu_mask_clear = 0x14
  41. +};
  42. +
  43. /* L2 intc private data structure */
  44. struct brcmstb_l2_intc_data {
  45. struct irq_domain *domain;
  46. @@ -289,11 +299,18 @@ static int __init brcmstb_l2_lvl_intc_of
  47. return brcmstb_l2_intc_of_init(np, parent, &l2_lvl_intc_init);
  48. }
  49. +static int __init brcmstb_l2_2711_lvl_intc_of_init(struct device_node *np,
  50. + struct device_node *parent)
  51. +{
  52. + return brcmstb_l2_intc_of_init(np, parent, &l2_2711_lvl_intc_init);
  53. +}
  54. +
  55. IRQCHIP_PLATFORM_DRIVER_BEGIN(brcmstb_l2)
  56. IRQCHIP_MATCH("brcm,l2-intc", brcmstb_l2_edge_intc_of_init)
  57. IRQCHIP_MATCH("brcm,hif-spi-l2-intc", brcmstb_l2_edge_intc_of_init)
  58. IRQCHIP_MATCH("brcm,upg-aux-aon-l2-intc", brcmstb_l2_edge_intc_of_init)
  59. IRQCHIP_MATCH("brcm,bcm7271-l2-intc", brcmstb_l2_lvl_intc_of_init)
  60. +IRQCHIP_MATCH("brcm,bcm2711-l2-intc", brcmstb_l2_2711_lvl_intc_of_init)
  61. IRQCHIP_PLATFORM_DRIVER_END(brcmstb_l2)
  62. MODULE_DESCRIPTION("Broadcom STB generic L2 interrupt controller");
  63. MODULE_LICENSE("GPL v2");