Bug 217399

Summary: Kernel OOPS on boot with Kernel 6.3(.1) and RTL8153 Gigabit Ethernet Adapter
Product: Drivers Reporter: Bernd Buschinski (b.buschinski)
Component: USBAssignee: Default virtual assignee for Drivers/USB (drivers_usb)
Status: RESOLVED CODE_FIX    
Severity: normal CC: b.buschinski, kubakici, regressions
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: 6.3 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: Kernel OOPS on boot
lsusb -v, for the the device

Description Bernd Buschinski 2023-05-04 11:11:24 UTC
Created attachment 304215 [details]
Kernel OOPS on boot

Hello,

on my laptop with kernel 6.3.0 and 6.3.1 fails to correctly boot if the usb-c device "RTL8153 Gigabit Ethernet Adapter" is connected.

If I unplug it, boot and the plug it in, everything works fine.

This used to work fine with 6.2.10.

HW:
- Dell Inc. Latitude 7410/0M5G57, BIOS 1.22.0 03/20/2023
- Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter


Call Trace (manually typed from the image, typos maybe be included)
- bpf_dev_bound_netdeuv _unregister
- unregister_netdevice_many_notify
- unregister_netdevice_gueue
- unregister_netdev
- usbnet_disconnect
- usb_unbind_interface
- device_release_driver_internal
- bus_remove_device
- device_del
- ? kobject_put
- usb_disable_device
- usb_set_configuration
- rt18152_cfgselector_probe
- usb_probe_device
- really_probe
- ? driver_probe_device
- ...


For the full output, please see the attached image.
Comment 1 Bernd Buschinski 2023-05-04 11:49:33 UTC
lsusb:
Bus 004 Device 003: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter


and yes, I made a typo in the call trace, it is `rtl8152_cfgselector_probe`
Comment 2 Bernd Buschinski 2023-05-04 11:51:44 UTC
Created attachment 304216 [details]
lsusb -v, for the the device
Comment 3 Bernd Buschinski 2023-05-04 11:58:28 UTC
I did not bisect it, but I think 

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.3.1&id=ec51fbd1b8a2bca2948dede99c14ec63dc57ff6b

is at least related, maybe.... feel free to correct me.
Comment 4 The Linux kernel's regression tracker (Thorsten Leemhuis) 2023-05-05 09:49:22 UTC
Forwarded the report to the developers:

https://lore.kernel.org/regressions/ec4be122-e213-ca5b-f5d6-e8f9c3fd3bee@leemhuis.info/T/#u
Comment 5 Jakub Kicinski 2023-05-05 19:38:55 UTC
Hi Bernard, are you able to compile your own kernel to see if this simple edit would fix the problem for you?

diff --git a/kernel/bpf/offload.c b/kernel/bpf/offload.c
index d9c9f45e3529..8a26cd8814c1 100644
--- a/kernel/bpf/offload.c
+++ b/kernel/bpf/offload.c
@@ -859,4 +859,4 @@ static int __init bpf_offload_init(void)
 	return rhashtable_init(&offdevs, &offdevs_params);
 }
 
-late_initcall(bpf_offload_init);
+core_initcall(bpf_offload_init);
Comment 6 Jakub Kicinski 2023-05-05 19:39:30 UTC
s/Bernard/Bernd/ apologies
Comment 7 Bernd Buschinski 2023-05-06 09:39:28 UTC
Hi, I applied your patch to 6.3.0 and it works fine. I rebooted 3 times and it always worked.

Just to be sure, I reverted the Patch and it failed again.

So thanks for your work, it fixes my issue :)
Comment 8 Bernd Buschinski 2023-05-13 13:51:57 UTC
Hello, since I saw that kernel 6.3.2 also had some bpf changes, I tried it.

Vanilla 6.3.2: failed to boot
Patch + 6.3.2: works fine

Is there anything else that I can help you with? Something to test? Do you need any additional information?
Comment 9 Bernd Buschinski 2023-06-11 07:11:43 UTC
Hello, I tested with 6.3.7 (which contains the fix https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.3.7&id=7e1ca7f01d872293ab1594c726922ff459830903) and can confirm that it works fine, thanks! :)