openwrt/target/linux/ath79
Sven Eckelmann ac4a21141a ath79: ag71xx: Disable napi related interrupts during probe
ag71xx_probe is registering ag71xx_interrupt as handler for the gmac0/gmac1
interrupts. The handler is trying to use napi_schedule to handle the
processing of packets. But the netif_napi_add for this device is
called a lot later in ag71xx_probe.

It can therefore happen that a still running gmac0/gmac1 is triggering the
interrupt handler with a bit from AG71XX_INT_POLL set in
AG71XX_REG_INT_STATUS. The handler will then call napi_schedule and the
napi code will crash the system because the ag->napi is not yet
initialized:

  libphy: Fixed MDIO Bus: probed
  CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 00000000, ra == 81373408
  Oops[#1]:
  CPU: 0 PID: 1 Comm: swapper Not tainted 5.4.152 #0
  $ 0   : 00000000 00000001 00000000 8280bf28
  $ 4   : 82a98cb0 00000000 81620000 00200140
  $ 8   : 00000000 00000000 74657272 7570743a
  $12   : 0000005b 8280bdb9 ffffffff ffffffff
  $16   : 00000001 82a98cb0 00000000 8280bf27
  $20   : 8280bf28 81620000 ffff8b00 8280bf30
  $24   : 00000000 8125af9c
  $28   : 82828000 8280bed8 81610000 81373408
  Hi    : 00005fff
  Lo    : 2e48f657
  epc   : 00000000 0x0
  ra    : 81373408 __napi_poll+0x3c/0x11c
  Status: 1100dc03 KERNEL EXL IE
  Cause : 00800008 (ExcCode 02)
  BadVA : 00000000
  PrId  : 00019750 (MIPS 74Kc)
  Modules linked in:
  Process swapper (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=00000000)
  Stack : ffff8afb ffff8afa 81620000 00200140 00000000 82a98cb0 00000008 0000012c
          81625620 81373684 ffffffff ffffffff ffffffef 00000008 816153d8 81620000
          815b0d60 815bbd54 00000000 81753700 8280bf28 8280bf28 8280bf30 8280bf30
          81753748 00000008 00000003 00000004 0000000c 00000100 3fffffff 8175373c
          816059f0 814ddb48 00000001 8160ab30 81615488 810618bc 00000006 00000000
          ...
  Call Trace:

  [<81373684>] net_rx_action+0xfc/0x26c
  [<814ddb48>] __do_softirq+0x118/0x2ec
  [<810618bc>] handle_percpu_irq+0x50/0x80
  [<8125ab8c>] plat_irq_dispatch+0x94/0xc8
  [<81004e98>] handle_int+0x138/0x144

  Code: (Bad address in epc)

  ---[ end trace a60d797432b656b2 ]---

The gmcc0/gmac1 must be brought in a state in which it doesn't signal a
AG71XX_INT_POLL related status bits as interrupt before registering the
interrupt handler. ag71xx_hw_start will take care of re-initializing the
AG71XX_REG_INT_ENABLE.

Fixes: f529a37420 ("surprise :p")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2021-10-23 18:50:31 +02:00
..
base-files/etc/hotplug.d/ieee80211 ath79: add WiFi migration for AR913x 2020-09-28 16:23:03 +02:00
dts ath79: add support for TP-Link CPE710-v1 2021-09-25 19:28:54 +02:00
files ath79: ag71xx: Disable napi related interrupts during probe 2021-10-23 18:50:31 +02:00
generic ath79: add support for TP-Link CPE710-v1 2021-09-25 19:28:54 +02:00
image ath79: lzma-loader: fix & re-enable per-board CONFIG_BOARD_DEV 2021-10-22 21:25:18 +02:00
mikrotik ath79: mikrotik: use 64 KiB SPI NOR erase sectors 2021-10-22 08:15:40 -10:00
nand treewide: remove "+" sign for increment with macaddr_add 2021-06-05 23:54:37 +02:00
patches-5.4 kernel: bump 5.4 to 5.4.154 2021-10-21 00:17:36 +02:00
patches-5.10 kernel: bump 5.10 to 5.10.74 2021-10-21 00:17:36 +02:00
tiny ath79: consolidate testing kernel 2021-04-10 19:28:04 +02:00
config-5.4 ath79: add missing MTD_NAND_RB91X symbol 2021-07-09 17:11:12 +02:00
config-5.10 ath79: add missing GPIO_LATCH symbol 2021-06-22 00:39:48 +02:00
Makefile ath79: consolidate testing kernel 2021-04-10 19:28:04 +02:00
modules.mk ath79: add new OF only target for QCA MIPS silicon 2018-05-07 08:06:51 +02:00