Based on current code, if CONFIG_DEBUG_SHIRQ is enabled, there is below
calltrace when executing reboot operation.
[  225.626580] Unable to handle kernel paging request at virtual address 
006b6b6b6b6b6c3f
......
[  225.797449] Call trace:
[  225.799890]  fman_get_normal_pending+0x14/0x34
[  225.804333]  __free_irq+0x234/0x334
[  225.807821]  free_irq+0x3c/0x8c
[  225.810959]  devm_free_irq+0x64/0xa0
[  225.814534]  FreeFmDev.part.0+0x50/0xc4
[  225.818369]  fm_shutdown+0x30/0x4c
[  225.821769]  platform_shutdown+0x2c/0x3c
[  225.825691]  device_shutdown+0x130/0x210
......
[  225.860374]  el0t_64_sync+0x18c/0x190
The root cause is that the fm_irq() is invoked as a callback function,
and there is register operation in fman_get_normal_pending() after register
resource has been unmapped. In this way, above calltrace is triggered and
system hangs up. Therefore, move the irq free operation forward to make sure
that it is before releasing register resource.

Signed-off-by: Meng Li <meng...@windriver.com>
---
 .../freescale/sdk_fman/src/wrapper/lnxwrp_fm.c        | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c 
b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c
index 1856130e66a3..71674b10655d 100644
--- a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c
+++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c
@@ -1213,6 +1213,12 @@ static void FreeFmDev(t_LnxWrpFmDev  *p_LnxWrpFmDev)
 
     FreeFmPcdDev(p_LnxWrpFmDev);
 
+    if (p_LnxWrpFmDev->err_irq != 0) {
+           devm_free_irq(p_LnxWrpFmDev->dev, p_LnxWrpFmDev->err_irq, 
p_LnxWrpFmDev);
+    }
+
+    devm_free_irq(p_LnxWrpFmDev->dev, p_LnxWrpFmDev->irq, p_LnxWrpFmDev);
+
 #ifdef CONFIG_FSL_SDK_FMAN_RTC_API
     if (p_LnxWrpFmDev->h_RtcDev)
        FM_RTC_Free(p_LnxWrpFmDev->h_RtcDev);
@@ -1238,11 +1244,6 @@ static void FreeFmDev(t_LnxWrpFmDev  *p_LnxWrpFmDev)
     SYS_UnregisterIoMap(p_LnxWrpFmDev->fmBaseAddr);
     devm_iounmap(p_LnxWrpFmDev->dev, UINT_TO_PTR(p_LnxWrpFmDev->fmBaseAddr));
     devm_release_mem_region(p_LnxWrpFmDev->dev, p_LnxWrpFmDev->fmPhysBaseAddr, 
p_LnxWrpFmDev->fmMemSize);
-    if (p_LnxWrpFmDev->err_irq != 0) {
-        devm_free_irq(p_LnxWrpFmDev->dev, p_LnxWrpFmDev->err_irq, 
p_LnxWrpFmDev);
-    }
-
-    devm_free_irq(p_LnxWrpFmDev->dev, p_LnxWrpFmDev->irq, p_LnxWrpFmDev);
 }
 
 /* FMan character device file operations */
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13949): 
https://lists.yoctoproject.org/g/linux-yocto/message/13949
Mute This Topic: https://lists.yoctoproject.org/mt/106237503/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to