-
-
Notifications
You must be signed in to change notification settings - Fork 11.5k
realtek: register ethernet device after NAPI context init #19787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I was wondering what caused this… nice! |
andrewjlamarche
approved these changes
Aug 16, 2025
ecsv
approved these changes
Aug 17, 2025
Booting Realtek switches via TFTP will have a chance of ~5% to fail with the following dump on SMP devices. Sample taken from RTL931x. [ 1.318320] rtl931x_chip_init: init ENCAP done [ 1.323360] rtl931x_chip_init: init MIB done [ 1.328337] rtl931x_chip_init: init ACL done [ 1.333219] rtl931x_chip_init: init ALE done [ 1.344307] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 00000000, ra == 806c5c4c [ 1.356418] Oops[openwrt#1]: [ 1.359067] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.40 #0 [ 1.366582] Hardware name: Linksys LGS352C [ 1.371226] $ 0 : 00000000 00000001 00000000 80b6cc44 [ 1.377179] $ 4 : 836b0540 00000000 00000000 83011d38 [ 1.383119] $ 8 : 00000000 ffffefff 00000001 80b08c08 [ 1.389071] $12 : ffffffea 83011d34 0000007 00000558 [ 1.395060] $16 : 836b0540 00000000 00000100 83011ebf [ 1.401003] $20 : 83011ec0 83011ec8 ffff8b3c 80b00000 [ 1.406984] $24 : 00000000 80b08c38 [ 1.412922] $28 : 83038000 83011e70 82fb37a0 806c5c4c [ 1.418888] Hi : 0000014b [ 1.422201] Lo : c74d8000 [ 1.425490] epc : 00000000 0x0 [ 1.429191] ra : 806c5c4c __napi_poll+0x4c/0x208 [ 1.434728] Status: 11000403 KERNEL EXL IE [ 1.439497] Cause : 50800008 (ExcCode 02) [ 1.444040] BadVA : 00000000 [ 1.447330] PrId : 0001a120 (MIPS interAptiv (multi)) [ 1.453157] Modules linked in: [ 1.456641] Process swapper/0 (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=00000000) [ 1.465742] Stack : 82faf248 80a8d558 817ed500 ffff8b3a 836b0540 8066a348 82fb2bc0 836b0540 [ 1.475209] 82fb3600 00000100 0000012c 806c6274 00000000 00000017 00000002 80196134 [ 1.484701] 80b00000 83011ed0 83011eb8 83011e00 83011ec0 83011ec0 83011ec8 83011ec8 [ 1.494233] 00000001 81920000 81920000 80aefe4c 836b0000 00000000 00000000 00000001 [ 1.503686] 00000100 00000000 83011f20 80aefde0 00000000 8019ac14 80b01550 00000000 [ 1.513144] ... [ 1.515957] Call Trace: [ 1.515996] [ 1.520458] [<8066a348>] rtl93xx_net_irq+0x1a4/0x1ac [ 1.526116] [<806c6274>] net_rx_action+0x18c/0x360 [ 1.531576] [<80196134>] __handle_irq_event_percpu+0x58/0x16c [ 1.538111] [<8019ac14>] handle_level_irq+0x1e0/0x1f4 [ 1.543870] [<80133588>] handle_softirqs+0x14c/0x2ec [ 1.549488] [<801339e4>] irq_exit+0x84/0xb4 [ 1.554183] [<805527dc>] plat_irq_dispatch+0x90/0xdc [ 1.559764] [<801019f0>] except_vec_vi_end+0xc4/0xd0 [ 1.565337] A network interrupt may be received before the device is setup properly. In this case NAPI structures are missing and __napi_poll() will find a NULL pointer in n->poll. Avoid this by registering the device after initialization is complete. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: openwrt#19787 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Lienol
pushed a commit
to Lienol/openwrt
that referenced
this pull request
Aug 17, 2025
Booting Realtek switches via TFTP will have a chance of ~5% to fail with the following dump on SMP devices. Sample taken from RTL931x. [ 1.318320] rtl931x_chip_init: init ENCAP done [ 1.323360] rtl931x_chip_init: init MIB done [ 1.328337] rtl931x_chip_init: init ACL done [ 1.333219] rtl931x_chip_init: init ALE done [ 1.344307] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 00000000, ra == 806c5c4c [ 1.356418] Oops[#1]: [ 1.359067] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.40 #0 [ 1.366582] Hardware name: Linksys LGS352C [ 1.371226] $ 0 : 00000000 00000001 00000000 80b6cc44 [ 1.377179] $ 4 : 836b0540 00000000 00000000 83011d38 [ 1.383119] $ 8 : 00000000 ffffefff 00000001 80b08c08 [ 1.389071] $12 : ffffffea 83011d34 00000072 00000558 [ 1.395060] $16 : 836b0540 00000000 00000100 83011ebf [ 1.401003] $20 : 83011ec0 83011ec8 ffff8b3c 80b00000 [ 1.406984] $24 : 00000000 80b08c38 [ 1.412922] $28 : 83038000 83011e70 82fb37a0 806c5c4c [ 1.418888] Hi : 0000014b [ 1.422201] Lo : c74d8000 [ 1.425490] epc : 00000000 0x0 [ 1.429191] ra : 806c5c4c __napi_poll+0x4c/0x208 [ 1.434728] Status: 11000403 KERNEL EXL IE [ 1.439497] Cause : 50800008 (ExcCode 02) [ 1.444040] BadVA : 00000000 [ 1.447330] PrId : 0001a120 (MIPS interAptiv (multi)) [ 1.453157] Modules linked in: [ 1.456641] Process swapper/0 (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=00000000) [ 1.465742] Stack : 82faf248 80a8d558 817ed500 ffff8b3a 836b0540 8066a348 82fb2bc0 836b0540 [ 1.475209] 82fb3600 00000100 0000012c 806c6274 00000000 00000017 00000002 80196134 [ 1.484701] 80b00000 83011ed0 83011eb8 83011e00 83011ec0 83011ec0 83011ec8 83011ec8 [ 1.494233] 00000001 81920000 81920000 80aefe4c 836b0000 00000000 00000000 00000001 [ 1.503686] 00000100 00000000 83011f20 80aefde0 00000000 8019ac14 80b01550 00000000 [ 1.513144] ... [ 1.515957] Call Trace: [ 1.515996] [ 1.520458] [<8066a348>] rtl93xx_net_irq+0x1a4/0x1ac [ 1.526116] [<806c6274>] net_rx_action+0x18c/0x360 [ 1.531576] [<80196134>] __handle_irq_event_percpu+0x58/0x16c [ 1.538111] [<8019ac14>] handle_level_irq+0x1e0/0x1f4 [ 1.543870] [<80133588>] handle_softirqs+0x14c/0x2ec [ 1.549488] [<801339e4>] irq_exit+0x84/0xb4 [ 1.554183] [<805527dc>] plat_irq_dispatch+0x90/0xdc [ 1.559764] [<801019f0>] except_vec_vi_end+0xc4/0xd0 [ 1.565337] A network interrupt may be received before the device is setup properly. In this case NAPI structures are missing and __napi_poll() will find a NULL pointer in n->poll. Avoid this by registering the device after initialization is complete. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: openwrt/openwrt#19787 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
igor-dyatlov
pushed a commit
to igor-dyatlov/openwrt
that referenced
this pull request
Aug 26, 2025
Booting Realtek switches via TFTP will have a chance of ~5% to fail with the following dump on SMP devices. Sample taken from RTL931x. [ 1.318320] rtl931x_chip_init: init ENCAP done [ 1.323360] rtl931x_chip_init: init MIB done [ 1.328337] rtl931x_chip_init: init ACL done [ 1.333219] rtl931x_chip_init: init ALE done [ 1.344307] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 00000000, ra == 806c5c4c [ 1.356418] Oops[#1]: [ 1.359067] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.40 #0 [ 1.366582] Hardware name: Linksys LGS352C [ 1.371226] $ 0 : 00000000 00000001 00000000 80b6cc44 [ 1.377179] $ 4 : 836b0540 00000000 00000000 83011d38 [ 1.383119] $ 8 : 00000000 ffffefff 00000001 80b08c08 [ 1.389071] $12 : ffffffea 83011d34 0000007 00000558 [ 1.395060] $16 : 836b0540 00000000 00000100 83011ebf [ 1.401003] $20 : 83011ec0 83011ec8 ffff8b3c 80b00000 [ 1.406984] $24 : 00000000 80b08c38 [ 1.412922] $28 : 83038000 83011e70 82fb37a0 806c5c4c [ 1.418888] Hi : 0000014b [ 1.422201] Lo : c74d8000 [ 1.425490] epc : 00000000 0x0 [ 1.429191] ra : 806c5c4c __napi_poll+0x4c/0x208 [ 1.434728] Status: 11000403 KERNEL EXL IE [ 1.439497] Cause : 50800008 (ExcCode 02) [ 1.444040] BadVA : 00000000 [ 1.447330] PrId : 0001a120 (MIPS interAptiv (multi)) [ 1.453157] Modules linked in: [ 1.456641] Process swapper/0 (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=00000000) [ 1.465742] Stack : 82faf248 80a8d558 817ed500 ffff8b3a 836b0540 8066a348 82fb2bc0 836b0540 [ 1.475209] 82fb3600 00000100 0000012c 806c6274 00000000 00000017 00000002 80196134 [ 1.484701] 80b00000 83011ed0 83011eb8 83011e00 83011ec0 83011ec0 83011ec8 83011ec8 [ 1.494233] 00000001 81920000 81920000 80aefe4c 836b0000 00000000 00000000 00000001 [ 1.503686] 00000100 00000000 83011f20 80aefde0 00000000 8019ac14 80b01550 00000000 [ 1.513144] ... [ 1.515957] Call Trace: [ 1.515996] [ 1.520458] [<8066a348>] rtl93xx_net_irq+0x1a4/0x1ac [ 1.526116] [<806c6274>] net_rx_action+0x18c/0x360 [ 1.531576] [<80196134>] __handle_irq_event_percpu+0x58/0x16c [ 1.538111] [<8019ac14>] handle_level_irq+0x1e0/0x1f4 [ 1.543870] [<80133588>] handle_softirqs+0x14c/0x2ec [ 1.549488] [<801339e4>] irq_exit+0x84/0xb4 [ 1.554183] [<805527dc>] plat_irq_dispatch+0x90/0xdc [ 1.559764] [<801019f0>] except_vec_vi_end+0xc4/0xd0 [ 1.565337] A network interrupt may be received before the device is setup properly. In this case NAPI structures are missing and __napi_poll() will find a NULL pointer in n->poll. Avoid this by registering the device after initialization is complete. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: openwrt#19787 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Vladdrako
pushed a commit
to Vladdrako/openwrt
that referenced
this pull request
Aug 27, 2025
Booting Realtek switches via TFTP will have a chance of ~5% to fail with the following dump on SMP devices. Sample taken from RTL931x. [ 1.318320] rtl931x_chip_init: init ENCAP done [ 1.323360] rtl931x_chip_init: init MIB done [ 1.328337] rtl931x_chip_init: init ACL done [ 1.333219] rtl931x_chip_init: init ALE done [ 1.344307] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 00000000, ra == 806c5c4c [ 1.356418] Oops[#1]: [ 1.359067] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.40 #0 [ 1.366582] Hardware name: Linksys LGS352C [ 1.371226] $ 0 : 00000000 00000001 00000000 80b6cc44 [ 1.377179] $ 4 : 836b0540 00000000 00000000 83011d38 [ 1.383119] $ 8 : 00000000 ffffefff 00000001 80b08c08 [ 1.389071] $12 : ffffffea 83011d34 0000007 00000558 [ 1.395060] $16 : 836b0540 00000000 00000100 83011ebf [ 1.401003] $20 : 83011ec0 83011ec8 ffff8b3c 80b00000 [ 1.406984] $24 : 00000000 80b08c38 [ 1.412922] $28 : 83038000 83011e70 82fb37a0 806c5c4c [ 1.418888] Hi : 0000014b [ 1.422201] Lo : c74d8000 [ 1.425490] epc : 00000000 0x0 [ 1.429191] ra : 806c5c4c __napi_poll+0x4c/0x208 [ 1.434728] Status: 11000403 KERNEL EXL IE [ 1.439497] Cause : 50800008 (ExcCode 02) [ 1.444040] BadVA : 00000000 [ 1.447330] PrId : 0001a120 (MIPS interAptiv (multi)) [ 1.453157] Modules linked in: [ 1.456641] Process swapper/0 (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=00000000) [ 1.465742] Stack : 82faf248 80a8d558 817ed500 ffff8b3a 836b0540 8066a348 82fb2bc0 836b0540 [ 1.475209] 82fb3600 00000100 0000012c 806c6274 00000000 00000017 00000002 80196134 [ 1.484701] 80b00000 83011ed0 83011eb8 83011e00 83011ec0 83011ec0 83011ec8 83011ec8 [ 1.494233] 00000001 81920000 81920000 80aefe4c 836b0000 00000000 00000000 00000001 [ 1.503686] 00000100 00000000 83011f20 80aefde0 00000000 8019ac14 80b01550 00000000 [ 1.513144] ... [ 1.515957] Call Trace: [ 1.515996] [ 1.520458] [<8066a348>] rtl93xx_net_irq+0x1a4/0x1ac [ 1.526116] [<806c6274>] net_rx_action+0x18c/0x360 [ 1.531576] [<80196134>] __handle_irq_event_percpu+0x58/0x16c [ 1.538111] [<8019ac14>] handle_level_irq+0x1e0/0x1f4 [ 1.543870] [<80133588>] handle_softirqs+0x14c/0x2ec [ 1.549488] [<801339e4>] irq_exit+0x84/0xb4 [ 1.554183] [<805527dc>] plat_irq_dispatch+0x90/0xdc [ 1.559764] [<801019f0>] except_vec_vi_end+0xc4/0xd0 [ 1.565337] A network interrupt may be received before the device is setup properly. In this case NAPI structures are missing and __napi_poll() will find a NULL pointer in n->poll. Avoid this by registering the device after initialization is complete. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: openwrt#19787 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Booting Realtek switches via TFTP will have a chance of ~5% to fail with the following dump on SMP devices. Sample taken from RTL931x.
An network interrupt may be received before the device is setup properly. In this case NAPI structures are missing and __napi_poll() will find a NULL pointer in n->poll. Avoid this by registering the device after initialization is complete.