|
| 1 | +net: mana: Cleanup "mana" debugfs dir after cleanup of all children |
| 2 | + |
| 3 | +jira NONE_AUTOMATION |
| 4 | +Rebuild_History Non-Buildable kernel-5.14.0-570.16.1.el9_6 |
| 5 | +commit-author Shradha Gupta < [email protected]> |
| 6 | +commit eaeea5028fa82412392d9325c44624ef8fcd1869 |
| 7 | +Empty-Commit: Cherry-Pick Conflicts during history rebuild. |
| 8 | +Will be included in final tarball splat. Ref for failed cherry-pick at: |
| 9 | +ciq/ciq_backports/kernel-5.14.0-570.16.1.el9_6/eaeea502.failed |
| 10 | + |
| 11 | +In mana_driver_exit(), mana_debugfs_root gets cleanup before any of it's |
| 12 | +children (which happens later in the pci_unregister_driver()). |
| 13 | +Due to this, when mana driver is configured as a module and rmmod is |
| 14 | +invoked, following stack gets printed along with failure in rmmod command. |
| 15 | + |
| 16 | +[ 2399.317651] BUG: kernel NULL pointer dereference, address: 0000000000000098 |
| 17 | +[ 2399.318657] #PF: supervisor write access in kernel mode |
| 18 | +[ 2399.319057] #PF: error_code(0x0002) - not-present page |
| 19 | +[ 2399.319528] PGD 10eb68067 P4D 0 |
| 20 | +[ 2399.319914] Oops: Oops: 0002 [#1] SMP NOPTI |
| 21 | +[ 2399.320308] CPU: 72 UID: 0 PID: 5815 Comm: rmmod Not tainted 6.13.0-rc5+ #89 |
| 22 | +[ 2399.320986] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS Hyper-V UEFI Release v4.1 09/28/2024 |
| 23 | +[ 2399.321892] RIP: 0010:down_write+0x1a/0x50 |
| 24 | +[ 2399.322303] Code: 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 55 48 89 e5 41 54 49 89 fc e8 9d cd ff ff 31 c0 ba 01 00 00 00 <f0> 49 0f b1 14 24 75 17 65 48 8b 05 f6 84 dd 5f 49 89 44 24 08 4c |
| 25 | +[ 2399.323669] RSP: 0018:ff53859d6c663a70 EFLAGS: 00010246 |
| 26 | +[ 2399.324061] RAX: 0000000000000000 RBX: ff1d4eb505060180 RCX: ffffff8100000000 |
| 27 | +[ 2399.324620] RDX: 0000000000000001 RSI: 0000000000000064 RDI: 0000000000000098 |
| 28 | +[ 2399.325167] RBP: ff53859d6c663a78 R08: 00000000000009c4 R09: ff1d4eb4fac90000 |
| 29 | +[ 2399.325681] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000098 |
| 30 | +[ 2399.326185] R13: ff1d4e42e1a4a0c8 R14: ff1d4eb538ce0000 R15: 0000000000000098 |
| 31 | +[ 2399.326755] FS: 00007fe729570000(0000) GS:ff1d4eb2b7200000(0000) knlGS:0000000000000000 |
| 32 | +[ 2399.327269] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 |
| 33 | +[ 2399.327690] CR2: 0000000000000098 CR3: 00000001c0584005 CR4: 0000000000373ef0 |
| 34 | +[ 2399.328166] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 |
| 35 | +[ 2399.328623] DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400 |
| 36 | +[ 2399.329055] Call Trace: |
| 37 | +[ 2399.329243] <TASK> |
| 38 | +[ 2399.329379] ? show_regs+0x69/0x80 |
| 39 | +[ 2399.329602] ? __die+0x25/0x70 |
| 40 | +[ 2399.329856] ? page_fault_oops+0x271/0x550 |
| 41 | +[ 2399.330088] ? psi_group_change+0x217/0x470 |
| 42 | +[ 2399.330341] ? do_user_addr_fault+0x455/0x7b0 |
| 43 | +[ 2399.330667] ? finish_task_switch.isra.0+0x91/0x2f0 |
| 44 | +[ 2399.331004] ? exc_page_fault+0x73/0x160 |
| 45 | +[ 2399.331275] ? asm_exc_page_fault+0x27/0x30 |
| 46 | +[ 2399.343324] ? down_write+0x1a/0x50 |
| 47 | +[ 2399.343631] simple_recursive_removal+0x4d/0x2c0 |
| 48 | +[ 2399.343977] ? __pfx_remove_one+0x10/0x10 |
| 49 | +[ 2399.344251] debugfs_remove+0x45/0x70 |
| 50 | +[ 2399.344511] mana_destroy_rxq+0x44/0x400 [mana] |
| 51 | +[ 2399.344845] mana_destroy_vport+0x54/0x1c0 [mana] |
| 52 | +[ 2399.345229] mana_detach+0x2f1/0x4e0 [mana] |
| 53 | +[ 2399.345466] ? ida_free+0x150/0x160 |
| 54 | +[ 2399.345718] ? __cond_resched+0x1a/0x50 |
| 55 | +[ 2399.345987] mana_remove+0xf4/0x1a0 [mana] |
| 56 | +[ 2399.346243] mana_gd_remove+0x25/0x80 [mana] |
| 57 | +[ 2399.346605] pci_device_remove+0x41/0xb0 |
| 58 | +[ 2399.346878] device_remove+0x46/0x70 |
| 59 | +[ 2399.347150] device_release_driver_internal+0x1e3/0x250 |
| 60 | +[ 2399.347831] ? klist_remove+0x81/0xe0 |
| 61 | +[ 2399.348377] driver_detach+0x4b/0xa0 |
| 62 | +[ 2399.348906] bus_remove_driver+0x83/0x100 |
| 63 | +[ 2399.349435] driver_unregister+0x31/0x60 |
| 64 | +[ 2399.349919] pci_unregister_driver+0x40/0x90 |
| 65 | +[ 2399.350492] mana_driver_exit+0x1c/0xb50 [mana] |
| 66 | +[ 2399.351102] __do_sys_delete_module.constprop.0+0x184/0x320 |
| 67 | +[ 2399.351664] ? __fput+0x1a9/0x2d0 |
| 68 | +[ 2399.352200] __x64_sys_delete_module+0x12/0x20 |
| 69 | +[ 2399.352760] x64_sys_call+0x1e66/0x2140 |
| 70 | +[ 2399.353316] do_syscall_64+0x79/0x150 |
| 71 | +[ 2399.353813] ? syscall_exit_to_user_mode+0x49/0x230 |
| 72 | +[ 2399.354346] ? do_syscall_64+0x85/0x150 |
| 73 | +[ 2399.354816] ? irqentry_exit+0x1d/0x30 |
| 74 | +[ 2399.355287] ? exc_page_fault+0x7f/0x160 |
| 75 | +[ 2399.355756] entry_SYSCALL_64_after_hwframe+0x76/0x7e |
| 76 | +[ 2399.356302] RIP: 0033:0x7fe728d26aeb |
| 77 | +[ 2399.356776] Code: 73 01 c3 48 8b 0d 45 33 0f 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 15 33 0f 00 f7 d8 64 89 01 48 |
| 78 | +[ 2399.358372] RSP: 002b:00007ffff954d6f8 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0 |
| 79 | +[ 2399.359066] RAX: ffffffffffffffda RBX: 00005609156cc760 RCX: 00007fe728d26aeb |
| 80 | +[ 2399.359779] RDX: 000000000000000a RSI: 0000000000000800 RDI: 00005609156cc7c8 |
| 81 | +[ 2399.360535] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 |
| 82 | +[ 2399.361261] R10: 00007fe728dbeac0 R11: 0000000000000206 R12: 00007ffff954d950 |
| 83 | +[ 2399.361952] R13: 00005609156cc2a0 R14: 00007ffff954ee5f R15: 00005609156cc760 |
| 84 | +[ 2399.362688] </TASK> |
| 85 | + |
| 86 | +Fixes: 6607c17c6c5e ("net: mana: Enable debugfs files for MANA device") |
| 87 | + |
| 88 | + Signed-off-by: Shradha Gupta < [email protected]> |
| 89 | + Reviewed-by: Michal Swiatkowski < [email protected]> |
| 90 | +Link: https://patch.msgid.link/ [email protected] |
| 91 | + Signed-off-by: Jakub Kicinski < [email protected]> |
| 92 | +(cherry picked from commit eaeea5028fa82412392d9325c44624ef8fcd1869) |
| 93 | + Signed-off-by: Jonathan Maple < [email protected]> |
| 94 | + |
| 95 | +# Conflicts: |
| 96 | +# drivers/net/ethernet/microsoft/mana/gdma_main.c |
| 97 | +diff --cc drivers/net/ethernet/microsoft/mana/gdma_main.c |
| 98 | +index c64e146c2832,be95336ce089..000000000000 |
| 99 | +--- a/drivers/net/ethernet/microsoft/mana/gdma_main.c |
| 100 | ++++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c |
| 101 | +@@@ -1623,7 -1641,28 +1623,32 @@@ static struct pci_driver mana_driver = |
| 102 | + .shutdown = mana_gd_shutdown, |
| 103 | + }; |
| 104 | + |
| 105 | +++<<<<<<< HEAD |
| 106 | + +module_pci_driver(mana_driver); |
| 107 | +++======= |
| 108 | ++ static int __init mana_driver_init(void) |
| 109 | ++ { |
| 110 | ++ int err; |
| 111 | ++ |
| 112 | ++ mana_debugfs_root = debugfs_create_dir("mana", NULL); |
| 113 | ++ |
| 114 | ++ err = pci_register_driver(&mana_driver); |
| 115 | ++ if (err) |
| 116 | ++ debugfs_remove(mana_debugfs_root); |
| 117 | ++ |
| 118 | ++ return err; |
| 119 | ++ } |
| 120 | ++ |
| 121 | ++ static void __exit mana_driver_exit(void) |
| 122 | ++ { |
| 123 | ++ pci_unregister_driver(&mana_driver); |
| 124 | ++ |
| 125 | ++ debugfs_remove(mana_debugfs_root); |
| 126 | ++ } |
| 127 | ++ |
| 128 | ++ module_init(mana_driver_init); |
| 129 | ++ module_exit(mana_driver_exit); |
| 130 | +++>>>>>>> eaeea5028fa8 (net: mana: Cleanup "mana" debugfs dir after cleanup of all children) |
| 131 | + |
| 132 | + MODULE_DEVICE_TABLE(pci, mana_id_table); |
| 133 | + |
| 134 | +* Unmerged path drivers/net/ethernet/microsoft/mana/gdma_main.c |
0 commit comments