-
Notifications
You must be signed in to change notification settings - Fork 148
pahole/kernel: Workaround dwarf bug for function encoding #311
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
Conversation
Master branch: f055f35 Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/netdevbpf/list/?series=379377
conflict:
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=379377 irrelevant now. Closing PR. |
…format For incoming SCO connection with transparent coding format, alt setting of CVSD is getting applied instead of Transparent. Before fix: < HCI Command: Accept Synchron.. (0x01|0x0029) plen 21 #2196 [hci0] 321.342548 Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd) Transmit bandwidth: 8000 Receive bandwidth: 8000 Max latency: 13 Setting: 0x0003 Input Coding: Linear Input Data Format: 1's complement Input Sample Size: 8-bit # of bits padding at MSB: 0 Air Coding Format: Transparent Data Retransmission effort: Optimize for link quality (0x02) Packet type: 0x003f HV1 may be used HV2 may be used HV3 may be used EV3 may be used EV4 may be used EV5 may be used > HCI Event: Command Status (0x0f) plen 4 #2197 [hci0] 321.343585 Accept Synchronous Connection Request (0x01|0x0029) ncmd 1 Status: Success (0x00) > HCI Event: Synchronous Connect Comp.. (0x2c) plen 17 #2198 [hci0] 321.351666 Status: Success (0x00) Handle: 257 Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd) Link type: eSCO (0x02) Transmission interval: 0x0c Retransmission window: 0x04 RX packet length: 60 TX packet length: 60 Air mode: Transparent (0x03) ........ > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2336 [hci0] 321.383655 < SCO Data TX: Handle 257 flags 0x00 dlen 60 #2337 [hci0] 321.389558 > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2338 [hci0] 321.393615 > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2339 [hci0] 321.393618 > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2340 [hci0] 321.393618 < SCO Data TX: Handle 257 flags 0x00 dlen 60 #2341 [hci0] 321.397070 > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2342 [hci0] 321.403622 > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2343 [hci0] 321.403625 > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2344 [hci0] 321.403625 > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2345 [hci0] 321.403625 < SCO Data TX: Handle 257 flags 0x00 dlen 60 #2346 [hci0] 321.404569 < SCO Data TX: Handle 257 flags 0x00 dlen 60 #2347 [hci0] 321.412091 > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2348 [hci0] 321.413626 > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2349 [hci0] 321.413630 > SCO Data RX: Handle 257 flags 0x00 dlen 48 #2350 [hci0] 321.413630 < SCO Data TX: Handle 257 flags 0x00 dlen 60 #2351 [hci0] 321.419674 After fix: < HCI Command: Accept Synchronou.. (0x01|0x0029) plen 21 #309 [hci0] 49.439693 Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd) Transmit bandwidth: 8000 Receive bandwidth: 8000 Max latency: 13 Setting: 0x0003 Input Coding: Linear Input Data Format: 1's complement Input Sample Size: 8-bit # of bits padding at MSB: 0 Air Coding Format: Transparent Data Retransmission effort: Optimize for link quality (0x02) Packet type: 0x003f HV1 may be used HV2 may be used HV3 may be used EV3 may be used EV4 may be used EV5 may be used > HCI Event: Command Status (0x0f) plen 4 #310 [hci0] 49.440308 Accept Synchronous Connection Request (0x01|0x0029) ncmd 1 Status: Success (0x00) > HCI Event: Synchronous Connect Complete (0x2c) plen 17 #311 [hci0] 49.449308 Status: Success (0x00) Handle: 257 Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd) Link type: eSCO (0x02) Transmission interval: 0x0c Retransmission window: 0x04 RX packet length: 60 TX packet length: 60 Air mode: Transparent (0x03) < SCO Data TX: Handle 257 flags 0x00 dlen 60 #312 [hci0] 49.450421 < SCO Data TX: Handle 257 flags 0x00 dlen 60 #313 [hci0] 49.457927 > HCI Event: Max Slots Change (0x1b) plen 3 #314 [hci0] 49.460345 Handle: 256 Max slots: 5 < SCO Data TX: Handle 257 flags 0x00 dlen 60 #315 [hci0] 49.465453 > SCO Data RX: Handle 257 flags 0x00 dlen 60 #316 [hci0] 49.470502 > SCO Data RX: Handle 257 flags 0x00 dlen 60 #317 [hci0] 49.470519 < SCO Data TX: Handle 257 flags 0x00 dlen 60 #318 [hci0] 49.472996 > SCO Data RX: Handle 257 flags 0x00 dlen 60 #319 [hci0] 49.480412 < SCO Data TX: Handle 257 flags 0x00 dlen 60 #320 [hci0] 49.480492 < SCO Data TX: Handle 257 flags 0x00 dlen 60 #321 [hci0] 49.487989 > SCO Data RX: Handle 257 flags 0x00 dlen 60 #322 [hci0] 49.490303 < SCO Data TX: Handle 257 flags 0x00 dlen 60 #323 [hci0] 49.495496 > SCO Data RX: Handle 257 flags 0x00 dlen 60 #324 [hci0] 49.500304 > SCO Data RX: Handle 257 flags 0x00 dlen 60 #325 [hci0] 49.500311 Signed-off-by: Kiran K <[email protected]> Signed-off-by: Lokendra Singh <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
…_locked The SEV platform device can be shutdown with a null psp_master, e.g., using DEBUG_TEST_DRIVER_REMOVE. Found using KASAN: [ 137.148210] ccp 0000:23:00.1: enabling device (0000 -> 0002) [ 137.162647] ccp 0000:23:00.1: no command queues available [ 137.170598] ccp 0000:23:00.1: sev enabled [ 137.174645] ccp 0000:23:00.1: psp enabled [ 137.178890] general protection fault, probably for non-canonical address 0xdffffc000000001e: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN NOPTI [ 137.182693] KASAN: null-ptr-deref in range [0x00000000000000f0-0x00000000000000f7] [ 137.182693] CPU: 93 PID: 1 Comm: swapper/0 Not tainted 6.8.0-rc1+ #311 [ 137.182693] RIP: 0010:__sev_platform_shutdown_locked+0x51/0x180 [ 137.182693] Code: 08 80 3c 08 00 0f 85 0e 01 00 00 48 8b 1d 67 b6 01 08 48 b8 00 00 00 00 00 fc ff df 48 8d bb f0 00 00 00 48 89 f9 48 c1 e9 03 <80> 3c 01 00 0f 85 fe 00 00 00 48 8b 9b f0 00 00 00 48 85 db 74 2c [ 137.182693] RSP: 0018:ffffc900000cf9b0 EFLAGS: 00010216 [ 137.182693] RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 000000000000001e [ 137.182693] RDX: 0000000000000000 RSI: 0000000000000008 RDI: 00000000000000f0 [ 137.182693] RBP: ffffc900000cf9c8 R08: 0000000000000000 R09: fffffbfff58f5a66 [ 137.182693] R10: ffffc900000cf9c8 R11: ffffffffac7ad32f R12: ffff8881e5052c28 [ 137.182693] R13: ffff8881e5052c28 R14: ffff8881758e43e8 R15: ffffffffac64abf8 [ 137.182693] FS: 0000000000000000(0000) GS:ffff889de7000000(0000) knlGS:0000000000000000 [ 137.182693] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 137.182693] CR2: 0000000000000000 CR3: 0000001cf7c7e000 CR4: 0000000000350ef0 [ 137.182693] Call Trace: [ 137.182693] <TASK> [ 137.182693] ? show_regs+0x6c/0x80 [ 137.182693] ? __die_body+0x24/0x70 [ 137.182693] ? die_addr+0x4b/0x80 [ 137.182693] ? exc_general_protection+0x126/0x230 [ 137.182693] ? asm_exc_general_protection+0x2b/0x30 [ 137.182693] ? __sev_platform_shutdown_locked+0x51/0x180 [ 137.182693] sev_firmware_shutdown.isra.0+0x1e/0x80 [ 137.182693] sev_dev_destroy+0x49/0x100 [ 137.182693] psp_dev_destroy+0x47/0xb0 [ 137.182693] sp_destroy+0xbb/0x240 [ 137.182693] sp_pci_remove+0x45/0x60 [ 137.182693] pci_device_remove+0xaa/0x1d0 [ 137.182693] device_remove+0xc7/0x170 [ 137.182693] really_probe+0x374/0xbe0 [ 137.182693] ? srso_return_thunk+0x5/0x5f [ 137.182693] __driver_probe_device+0x199/0x460 [ 137.182693] driver_probe_device+0x4e/0xd0 [ 137.182693] __driver_attach+0x191/0x3d0 [ 137.182693] ? __pfx___driver_attach+0x10/0x10 [ 137.182693] bus_for_each_dev+0x100/0x190 [ 137.182693] ? __pfx_bus_for_each_dev+0x10/0x10 [ 137.182693] ? __kasan_check_read+0x15/0x20 [ 137.182693] ? srso_return_thunk+0x5/0x5f [ 137.182693] ? _raw_spin_unlock+0x27/0x50 [ 137.182693] driver_attach+0x41/0x60 [ 137.182693] bus_add_driver+0x2a8/0x580 [ 137.182693] driver_register+0x141/0x480 [ 137.182693] __pci_register_driver+0x1d6/0x2a0 [ 137.182693] ? srso_return_thunk+0x5/0x5f [ 137.182693] ? esrt_sysfs_init+0x1cd/0x5d0 [ 137.182693] ? __pfx_sp_mod_init+0x10/0x10 [ 137.182693] sp_pci_init+0x22/0x30 [ 137.182693] sp_mod_init+0x14/0x30 [ 137.182693] ? __pfx_sp_mod_init+0x10/0x10 [ 137.182693] do_one_initcall+0xd1/0x470 [ 137.182693] ? __pfx_do_one_initcall+0x10/0x10 [ 137.182693] ? parameq+0x80/0xf0 [ 137.182693] ? srso_return_thunk+0x5/0x5f [ 137.182693] ? __kmalloc+0x3b0/0x4e0 [ 137.182693] ? kernel_init_freeable+0x92d/0x1050 [ 137.182693] ? kasan_populate_vmalloc_pte+0x171/0x190 [ 137.182693] ? srso_return_thunk+0x5/0x5f [ 137.182693] kernel_init_freeable+0xa64/0x1050 [ 137.182693] ? __pfx_kernel_init+0x10/0x10 [ 137.182693] kernel_init+0x24/0x160 [ 137.182693] ? __switch_to_asm+0x3e/0x70 [ 137.182693] ret_from_fork+0x40/0x80 [ 137.182693] ? __pfx_kernel_init+0x10/0x10 [ 137.182693] ret_from_fork_asm+0x1b/0x30 [ 137.182693] </TASK> [ 137.182693] Modules linked in: [ 137.538483] ---[ end trace 0000000000000000 ]--- Fixes: 1b05ece ("crypto: ccp - During shutdown, check SEV data pointer before using") Cc: [email protected] Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Kim Phillips <[email protected]> Reviewed-by: Liam Merwick <[email protected]> Acked-by: John Allen <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
Dave Hansen reports the following crash on a 32-bit system with CONFIG_HIGHMEM=y and CONFIG_X86_PAE=y: > 0xf75fe000 is the mem_map[] entry for the first page >4GB. It > obviously wasn't allocated, thus the oops. BUG: unable to handle page fault for address: f75fe000 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page *pdpt = 0000000002da2001 *pde = 000000000300c067 *pte = 0000000000000000 Oops: Oops: 0002 [#1] SMP NOPTI CPU: 0 UID: 0 PID: 0 Comm: swapper Not tainted 6.15.0-rc1-00288-ge618ee89561b-dirty #311 PREEMPT(undef) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 EIP: __free_pages_core+0x3c/0x74 ... Call Trace: memblock_free_pages+0x11/0x2c memblock_free_all+0x2ce/0x3a0 mm_core_init+0xf5/0x320 start_kernel+0x296/0x79c i386_start_kernel+0xad/0xb0 startup_32_smp+0x151/0x154 The mem_map[] is allocated up to the end of ZONE_HIGHMEM which is defined by max_pfn. The bug was introduced by this recent commit: 6faea34 ("arch, mm: streamline HIGHMEM freeing") Previously, freeing of high memory was also clamped to the end of ZONE_HIGHMEM but after this change, memblock_free_all() tries to free memory above the of ZONE_HIGHMEM as well and that causes access to mem_map[] entries beyond the end of the memory map. To fix this, discard the memory after max_pfn from memblock on 32-bit systems so that core MM would be aware only of actually usable memory. Fixes: 6faea34 ("arch, mm: streamline HIGHMEM freeing") Reported-by: Dave Hansen <[email protected]> Tested-by: Arnd Bergmann <[email protected]> Signed-off-by: Mike Rapoport (Microsoft) <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: Andy Shevchenko <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Davide Ciminaghi <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: Sean Christopherson <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] # discussion and submission
The kernel will have below dump when system resume if the USB net device was already disconnected during system suspend. [ 46.392207] ------------[ cut here ]------------ [ 46.392216] called from state HALTED [ 46.392255] WARNING: CPU: 0 PID: 56 at drivers/net/phy/phy.c:1630 phy_stop+0x12c/0x194 [ 46.392272] Modules linked in: [ 46.392281] CPU: 0 UID: 0 PID: 56 Comm: kworker/0:3 Not tainted 6.15.0-rc7-next-20250523-06664-ga6888feb9f45-dirty kernel-patches#311 PREEMPT [ 46.392287] Hardware name: NXP i.MX93 11X11 EVK board (DT) [ 46.392291] Workqueue: usb_hub_wq hub_event [ 46.392301] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 46.392306] pc : phy_stop+0x12c/0x194 [ 46.392311] lr : phy_stop+0x12c/0x194 [ 46.392315] sp : ffff8000828fb720 [ 46.392317] x29: ffff8000828fb720 x28: ffff000005558b50 x27: ffff00000555b400 [ 46.392324] x26: ffff000004e4f000 x25: ffff00000557f800 x24: 0000000000000000 [ 46.392331] x23: 0000000000000000 x22: ffff8000817eea10 x21: ffff000004fc5000 [ 46.392338] x20: ffff000004fc5a00 x19: ffff0000056eb000 x18: fffffffffffeb3c0 [ 46.392345] x17: ffff7ffffdc3c000 x16: ffff800080000000 x15: 0000000000000000 [ 46.392352] x14: 0000000000000000 x13: 206574617473206d x12: ffff800082057068 [ 46.392359] x11: 0000000000000058 x10: 0000000000000018 x9 : ffff800082057068 [ 46.392366] x8 : 0000000000000264 x7 : ffff8000820af068 x6 : ffff8000820af068 [ 46.392373] x5 : ffff00007fb80308 x4 : 0000000000000000 x3 : ffff7ffffdc3c000 [ 46.392379] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000004ed4600 [ 46.392386] Call trace: [ 46.392390] phy_stop+0x12c/0x194 (P) [ 46.392396] phylink_stop+0x28/0x114 [ 46.392404] ax88772_stop+0x18/0x28 [ 46.392411] usbnet_stop+0x80/0x230 [ 46.392418] __dev_close_many+0xb4/0x1e0 [ 46.392427] dev_close_many+0x88/0x140 [ 46.392434] unregister_netdevice_many_notify+0x1b8/0xa10 [ 46.392440] unregister_netdevice_queue+0xe0/0xe8 [ 46.392445] unregister_netdev+0x24/0x50 [ 46.392450] usbnet_disconnect+0x50/0x124 [ 46.392457] usb_unbind_interface+0x78/0x2b4 [ 46.392463] device_remove+0x70/0x80 [ 46.392470] device_release_driver_internal+0x1cc/0x224 [ 46.392475] device_release_driver+0x18/0x30 [ 46.392480] bus_remove_device+0xc8/0x108 [ 46.392488] device_del+0x14c/0x420 [ 46.392495] usb_disable_device+0xe4/0x1c0 [ 46.392502] usb_disconnect+0xd8/0x2ac [ 46.392508] hub_event+0x91c/0x1580 [ 46.392514] process_one_work+0x148/0x290 [ 46.392523] worker_thread+0x2c8/0x3e4 [ 46.392530] kthread+0x12c/0x204 [ 46.392536] ret_from_fork+0x10/0x20 [ 46.392545] ---[ end trace 0000000000000000 ]--- It's because usb_resume_interface() will be skipped if the USB core found the USB device was already disconnected. In this case, asix_resume() will not be called anymore. So asix_suspend/resume() can't be balanced. When ax88772_stop() is called, the phy device was already stopped. To avoid calling phylink_stop() a second time, check whether usb net device is already in suspend state. Fixes: e0bffe3 ("net: asix: ax88772: migrate to phylink") Cc: [email protected] Signed-off-by: Xu Yang <[email protected]> Signed-off-by: NipaLocal <nipa@local>
The kernel will have below dump when system resume if the USB net device was already disconnected during system suspend. [ 46.392207] ------------[ cut here ]------------ [ 46.392216] called from state HALTED [ 46.392255] WARNING: CPU: 0 PID: 56 at drivers/net/phy/phy.c:1630 phy_stop+0x12c/0x194 [ 46.392272] Modules linked in: [ 46.392281] CPU: 0 UID: 0 PID: 56 Comm: kworker/0:3 Not tainted 6.15.0-rc7-next-20250523-06664-ga6888feb9f45-dirty kernel-patches#311 PREEMPT [ 46.392287] Hardware name: NXP i.MX93 11X11 EVK board (DT) [ 46.392291] Workqueue: usb_hub_wq hub_event [ 46.392301] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 46.392306] pc : phy_stop+0x12c/0x194 [ 46.392311] lr : phy_stop+0x12c/0x194 [ 46.392315] sp : ffff8000828fb720 [ 46.392317] x29: ffff8000828fb720 x28: ffff000005558b50 x27: ffff00000555b400 [ 46.392324] x26: ffff000004e4f000 x25: ffff00000557f800 x24: 0000000000000000 [ 46.392331] x23: 0000000000000000 x22: ffff8000817eea10 x21: ffff000004fc5000 [ 46.392338] x20: ffff000004fc5a00 x19: ffff0000056eb000 x18: fffffffffffeb3c0 [ 46.392345] x17: ffff7ffffdc3c000 x16: ffff800080000000 x15: 0000000000000000 [ 46.392352] x14: 0000000000000000 x13: 206574617473206d x12: ffff800082057068 [ 46.392359] x11: 0000000000000058 x10: 0000000000000018 x9 : ffff800082057068 [ 46.392366] x8 : 0000000000000264 x7 : ffff8000820af068 x6 : ffff8000820af068 [ 46.392373] x5 : ffff00007fb80308 x4 : 0000000000000000 x3 : ffff7ffffdc3c000 [ 46.392379] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000004ed4600 [ 46.392386] Call trace: [ 46.392390] phy_stop+0x12c/0x194 (P) [ 46.392396] phylink_stop+0x28/0x114 [ 46.392404] ax88772_stop+0x18/0x28 [ 46.392411] usbnet_stop+0x80/0x230 [ 46.392418] __dev_close_many+0xb4/0x1e0 [ 46.392427] dev_close_many+0x88/0x140 [ 46.392434] unregister_netdevice_many_notify+0x1b8/0xa10 [ 46.392440] unregister_netdevice_queue+0xe0/0xe8 [ 46.392445] unregister_netdev+0x24/0x50 [ 46.392450] usbnet_disconnect+0x50/0x124 [ 46.392457] usb_unbind_interface+0x78/0x2b4 [ 46.392463] device_remove+0x70/0x80 [ 46.392470] device_release_driver_internal+0x1cc/0x224 [ 46.392475] device_release_driver+0x18/0x30 [ 46.392480] bus_remove_device+0xc8/0x108 [ 46.392488] device_del+0x14c/0x420 [ 46.392495] usb_disable_device+0xe4/0x1c0 [ 46.392502] usb_disconnect+0xd8/0x2ac [ 46.392508] hub_event+0x91c/0x1580 [ 46.392514] process_one_work+0x148/0x290 [ 46.392523] worker_thread+0x2c8/0x3e4 [ 46.392530] kthread+0x12c/0x204 [ 46.392536] ret_from_fork+0x10/0x20 [ 46.392545] ---[ end trace 0000000000000000 ]--- It's because usb_resume_interface() will be skipped if the USB core found the USB device was already disconnected. In this case, asix_resume() will not be called anymore. So asix_suspend/resume() can't be balanced. When ax88772_stop() is called, the phy device was already stopped. To avoid calling phylink_stop() a second time, check whether usb net device is already in suspend state. Fixes: e0bffe3 ("net: asix: ax88772: migrate to phylink") Cc: [email protected] Signed-off-by: Xu Yang <[email protected]> Signed-off-by: NipaLocal <nipa@local>
The kernel will have below dump when system resume if the USB net device was already disconnected during system suspend. [ 46.392207] ------------[ cut here ]------------ [ 46.392216] called from state HALTED [ 46.392255] WARNING: CPU: 0 PID: 56 at drivers/net/phy/phy.c:1630 phy_stop+0x12c/0x194 [ 46.392272] Modules linked in: [ 46.392281] CPU: 0 UID: 0 PID: 56 Comm: kworker/0:3 Not tainted 6.15.0-rc7-next-20250523-06664-ga6888feb9f45-dirty kernel-patches#311 PREEMPT [ 46.392287] Hardware name: NXP i.MX93 11X11 EVK board (DT) [ 46.392291] Workqueue: usb_hub_wq hub_event [ 46.392301] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 46.392306] pc : phy_stop+0x12c/0x194 [ 46.392311] lr : phy_stop+0x12c/0x194 [ 46.392315] sp : ffff8000828fb720 [ 46.392317] x29: ffff8000828fb720 x28: ffff000005558b50 x27: ffff00000555b400 [ 46.392324] x26: ffff000004e4f000 x25: ffff00000557f800 x24: 0000000000000000 [ 46.392331] x23: 0000000000000000 x22: ffff8000817eea10 x21: ffff000004fc5000 [ 46.392338] x20: ffff000004fc5a00 x19: ffff0000056eb000 x18: fffffffffffeb3c0 [ 46.392345] x17: ffff7ffffdc3c000 x16: ffff800080000000 x15: 0000000000000000 [ 46.392352] x14: 0000000000000000 x13: 206574617473206d x12: ffff800082057068 [ 46.392359] x11: 0000000000000058 x10: 0000000000000018 x9 : ffff800082057068 [ 46.392366] x8 : 0000000000000264 x7 : ffff8000820af068 x6 : ffff8000820af068 [ 46.392373] x5 : ffff00007fb80308 x4 : 0000000000000000 x3 : ffff7ffffdc3c000 [ 46.392379] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000004ed4600 [ 46.392386] Call trace: [ 46.392390] phy_stop+0x12c/0x194 (P) [ 46.392396] phylink_stop+0x28/0x114 [ 46.392404] ax88772_stop+0x18/0x28 [ 46.392411] usbnet_stop+0x80/0x230 [ 46.392418] __dev_close_many+0xb4/0x1e0 [ 46.392427] dev_close_many+0x88/0x140 [ 46.392434] unregister_netdevice_many_notify+0x1b8/0xa10 [ 46.392440] unregister_netdevice_queue+0xe0/0xe8 [ 46.392445] unregister_netdev+0x24/0x50 [ 46.392450] usbnet_disconnect+0x50/0x124 [ 46.392457] usb_unbind_interface+0x78/0x2b4 [ 46.392463] device_remove+0x70/0x80 [ 46.392470] device_release_driver_internal+0x1cc/0x224 [ 46.392475] device_release_driver+0x18/0x30 [ 46.392480] bus_remove_device+0xc8/0x108 [ 46.392488] device_del+0x14c/0x420 [ 46.392495] usb_disable_device+0xe4/0x1c0 [ 46.392502] usb_disconnect+0xd8/0x2ac [ 46.392508] hub_event+0x91c/0x1580 [ 46.392514] process_one_work+0x148/0x290 [ 46.392523] worker_thread+0x2c8/0x3e4 [ 46.392530] kthread+0x12c/0x204 [ 46.392536] ret_from_fork+0x10/0x20 [ 46.392545] ---[ end trace 0000000000000000 ]--- It's because usb_resume_interface() will be skipped if the USB core found the USB device was already disconnected. In this case, asix_resume() will not be called anymore. So asix_suspend/resume() can't be balanced. When ax88772_stop() is called, the phy device was already stopped. To avoid calling phylink_stop() a second time, check whether usb net device is already in suspend state. Fixes: e0bffe3 ("net: asix: ax88772: migrate to phylink") Cc: [email protected] Signed-off-by: Xu Yang <[email protected]> Signed-off-by: NipaLocal <nipa@local>
The kernel will have below dump when system resume if the USB net device was already disconnected during system suspend. [ 46.392207] ------------[ cut here ]------------ [ 46.392216] called from state HALTED [ 46.392255] WARNING: CPU: 0 PID: 56 at drivers/net/phy/phy.c:1630 phy_stop+0x12c/0x194 [ 46.392272] Modules linked in: [ 46.392281] CPU: 0 UID: 0 PID: 56 Comm: kworker/0:3 Not tainted 6.15.0-rc7-next-20250523-06664-ga6888feb9f45-dirty kernel-patches#311 PREEMPT [ 46.392287] Hardware name: NXP i.MX93 11X11 EVK board (DT) [ 46.392291] Workqueue: usb_hub_wq hub_event [ 46.392301] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 46.392306] pc : phy_stop+0x12c/0x194 [ 46.392311] lr : phy_stop+0x12c/0x194 [ 46.392315] sp : ffff8000828fb720 [ 46.392317] x29: ffff8000828fb720 x28: ffff000005558b50 x27: ffff00000555b400 [ 46.392324] x26: ffff000004e4f000 x25: ffff00000557f800 x24: 0000000000000000 [ 46.392331] x23: 0000000000000000 x22: ffff8000817eea10 x21: ffff000004fc5000 [ 46.392338] x20: ffff000004fc5a00 x19: ffff0000056eb000 x18: fffffffffffeb3c0 [ 46.392345] x17: ffff7ffffdc3c000 x16: ffff800080000000 x15: 0000000000000000 [ 46.392352] x14: 0000000000000000 x13: 206574617473206d x12: ffff800082057068 [ 46.392359] x11: 0000000000000058 x10: 0000000000000018 x9 : ffff800082057068 [ 46.392366] x8 : 0000000000000264 x7 : ffff8000820af068 x6 : ffff8000820af068 [ 46.392373] x5 : ffff00007fb80308 x4 : 0000000000000000 x3 : ffff7ffffdc3c000 [ 46.392379] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000004ed4600 [ 46.392386] Call trace: [ 46.392390] phy_stop+0x12c/0x194 (P) [ 46.392396] phylink_stop+0x28/0x114 [ 46.392404] ax88772_stop+0x18/0x28 [ 46.392411] usbnet_stop+0x80/0x230 [ 46.392418] __dev_close_many+0xb4/0x1e0 [ 46.392427] dev_close_many+0x88/0x140 [ 46.392434] unregister_netdevice_many_notify+0x1b8/0xa10 [ 46.392440] unregister_netdevice_queue+0xe0/0xe8 [ 46.392445] unregister_netdev+0x24/0x50 [ 46.392450] usbnet_disconnect+0x50/0x124 [ 46.392457] usb_unbind_interface+0x78/0x2b4 [ 46.392463] device_remove+0x70/0x80 [ 46.392470] device_release_driver_internal+0x1cc/0x224 [ 46.392475] device_release_driver+0x18/0x30 [ 46.392480] bus_remove_device+0xc8/0x108 [ 46.392488] device_del+0x14c/0x420 [ 46.392495] usb_disable_device+0xe4/0x1c0 [ 46.392502] usb_disconnect+0xd8/0x2ac [ 46.392508] hub_event+0x91c/0x1580 [ 46.392514] process_one_work+0x148/0x290 [ 46.392523] worker_thread+0x2c8/0x3e4 [ 46.392530] kthread+0x12c/0x204 [ 46.392536] ret_from_fork+0x10/0x20 [ 46.392545] ---[ end trace 0000000000000000 ]--- It's because usb_resume_interface() will be skipped if the USB core found the USB device was already disconnected. In this case, asix_resume() will not be called anymore. So asix_suspend/resume() can't be balanced. When ax88772_stop() is called, the phy device was already stopped. To avoid calling phylink_stop() a second time, check whether usb net device is already in suspend state. Fixes: e0bffe3 ("net: asix: ax88772: migrate to phylink") Cc: [email protected] Signed-off-by: Xu Yang <[email protected]> Signed-off-by: NipaLocal <nipa@local>
Pull request for series with
subject: pahole/kernel: Workaround dwarf bug for function encoding
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=379377