Add the check whether it's own device to address the notifier call chain, let
it go if it's not own event. To fix below call trace:

[  128.397710] Initializing XFRM netlink socket
[  128.439147] Unable to handle kernel NULL pointer dereference at virtual 
address 0000000000000000
[  128.448369] Mem abort info:
[  128.451394]   ESR = 0x96000006
[  128.454496]   EC = 0x25: DABT (current EL), IL = 32 bits
[  128.459827]   SET = 0, FnV = 0
[  128.462915]   EA = 0, S1PTW = 0
[  128.466051]   FSC = 0x06: level 2 translation fault
[  128.470920] Data abort info:
[  128.473792]   ISV = 0, ISS = 0x00000006
[  128.477622]   CM = 0, WnR = 0
[  128.480630] user pgtable: 64k pages, 42-bit VAs, pgdp=00000008913c0000
[  128.487157] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000, 
pud=0000000000000000, pmd=0000000000000000
[  128.497755] Internal error: Oops: 96000006 [#1] PREEMPT SMP
[  128.566934] CPU: 0 PID: 707 Comm: dockerd Tainted: G           O      
5.15.44-yocto-standard #1
[  128.575610] Hardware name: Texas Instruments K3 J721E SoC (DT)
[  128.581425] pstate: a0000005 (NzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  128.588366] pc : virt_cpsw_inetaddr_event+0x38/0xe4 [ti_j721e_cpsw_virt_mac]
[  128.595402] lr : blocking_notifier_call_chain+0x78/0xb0
[  128.600616] sp : fffffe01212ef930
[  128.603916] x29: fffffe01212ef930 x28: fffffc080d3e6040 x27: fffffc0805e57600
[  128.611035] x26: fffffe0009adb918 x25: fffffc0805e57610 x24: fffffe0009adb918
[  128.618152] x23: fffffc080f5efb80 x22: 0000000000000001 x21: 00000000fffffffd
[  128.625271] x20: 0000000000000000 x19: 0000000000000000 x18: 0000000000000000
[  128.632388] x17: 0000000000000000 x16: 0000000000000000 x15: 000003ffacd799d8
[  128.639506] x14: fffffe000a180d60 x13: 0000000000000000 x12: 0000000000000000
[  128.646624] x11: 0000000000000000 x10: 0000000000001d00 x9 : fffffe000807eee8
[  128.653742] x8 : fffffe01212ef470 x7 : 0000000000000000 x6 : fffffe0009ad9a88
[  128.660860] x5 : 0000000000000000 x4 : fffffe00090e9fb0 x3 : fffffc08023a3000
[  128.667978] x2 : fffffc080f5efb80 x1 : 0000000000000001 x0 : fffffe0001af0010
[  128.675097] Call trace:
[  128.677531]  virt_cpsw_inetaddr_event+0x38/0xe4 [ti_j721e_cpsw_virt_mac]
[  128.684214]  blocking_notifier_call_chain+0x78/0xb0
[  128.689076]  __inet_insert_ifa+0x234/0x320
[  128.693160]  inet_rtm_newaddr+0x394/0x4b4
[  128.697155]  rtnetlink_rcv_msg+0x12c/0x32c
[  128.701241]  netlink_rcv_skb+0x68/0x134
[  128.705062]  rtnetlink_rcv+0x24/0x30
[  128.708625]  netlink_unicast+0x234/0x2f4
[  128.712532]  netlink_sendmsg+0x1c0/0x40c
[  128.716439]  __sys_sendto+0x118/0x180
[  128.720088]  __arm64_sys_sendto+0x34/0x44
[  128.724082]  invoke_syscall+0x5c/0x130
[  128.727820]  el0_svc_common.constprop.0+0x4c/0xf4
[  128.732508]  do_el0_svc+0x4c/0xac
[  128.735810]  el0_svc+0x20/0x60
[  128.738853]  el0t_64_sync_handler+0x10c/0x140
[  128.743194]  el0t_64_sync+0x1a0/0x1a4
[  128.746846] Code: f9400c43 f9400063 f944a465 f9406464 (f94000b3)
[  128.752921] ---[ end trace 77d3f7c301cbaa61 ]---

Signed-off-by: Xulin Sun <[email protected]>
---
 drivers/net/ethernet/ti/j721e-cpsw-virt-mac.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/ti/j721e-cpsw-virt-mac.c 
b/drivers/net/ethernet/ti/j721e-cpsw-virt-mac.c
index 74add047dc96..f1ff388f8269 100644
--- a/drivers/net/ethernet/ti/j721e-cpsw-virt-mac.c
+++ b/drivers/net/ethernet/ti/j721e-cpsw-virt-mac.c
@@ -1427,6 +1427,9 @@ static int virt_cpsw_inetaddr_event(struct notifier_block 
*unused,
        struct virt_cpsw_common *common;
        int ret = 0;
 
+       if (ndev->netdev_ops != &virt_cpsw_nuss_netdev_ops)
+               goto out;
+
        if (!virt_cpsw_dev_check(ndev))
                goto out;
 
-- 
2.36.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#11403): 
https://lists.yoctoproject.org/g/linux-yocto/message/11403
Mute This Topic: https://lists.yoctoproject.org/mt/91897349/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to