Merge tag 'for-net-2024-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth

Pull bluetooth fixes from Luiz Augusto Von Dentz:

- ISO: Fix multiple init when debugfs is disabled

- Call iso_exit() on module unload

- Remove debugfs directory on module init failure

- btusb: Fix not being able to reconnect after suspend

- btusb: Fix regression with fake CSR controllers 0a12:0001

- bnep: fix wild-memory-access in proto_unregister

Note: normally the bluetooth fixes go through the networking tree, but
this missed the weekly merge, and two of the commits fix regressions
that have caused a fair amount of noise and have now hit stable too:

https://lore.kernel.org/all/4e1977ca-6166-4891-965e-34a6f319035f@leemhuis.info/

So I'm pulling it directly just to expedite things and not miss yet
another -rc release. This is not meant to become a new pattern.

* tag 'for-net-2024-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth:
Bluetooth: btusb: Fix regression with fake CSR controllers 0a12:0001
Bluetooth: bnep: fix wild-memory-access in proto_unregister
Bluetooth: btusb: Fix not being able to reconnect after suspend
Bluetooth: Remove debugfs directory on module init failure
Bluetooth: Call iso_exit() on module unload
Bluetooth: ISO: Fix multiple init when debugfs is disabled

Changed files
+14 -25
drivers
bluetooth
net
bluetooth
+9 -18
drivers/bluetooth/btusb.c
··· 1345 1345 if (!urb) 1346 1346 return -ENOMEM; 1347 1347 1348 - /* Use maximum HCI Event size so the USB stack handles 1349 - * ZPL/short-transfer automatically. 1350 - */ 1351 - size = HCI_MAX_EVENT_SIZE; 1348 + if (le16_to_cpu(data->udev->descriptor.idVendor) == 0x0a12 && 1349 + le16_to_cpu(data->udev->descriptor.idProduct) == 0x0001) 1350 + /* Fake CSR devices don't seem to support sort-transter */ 1351 + size = le16_to_cpu(data->intr_ep->wMaxPacketSize); 1352 + else 1353 + /* Use maximum HCI Event size so the USB stack handles 1354 + * ZPL/short-transfer automatically. 1355 + */ 1356 + size = HCI_MAX_EVENT_SIZE; 1352 1357 1353 1358 buf = kmalloc(size, mem_flags); 1354 1359 if (!buf) { ··· 4043 4038 static int btusb_suspend(struct usb_interface *intf, pm_message_t message) 4044 4039 { 4045 4040 struct btusb_data *data = usb_get_intfdata(intf); 4046 - int err; 4047 4041 4048 4042 BT_DBG("intf %p", intf); 4049 4043 ··· 4055 4051 if (data->suspend_count++) 4056 4052 return 0; 4057 4053 4058 - /* Notify Host stack to suspend; this has to be done before stopping 4059 - * the traffic since the hci_suspend_dev itself may generate some 4060 - * traffic. 4061 - */ 4062 - err = hci_suspend_dev(data->hdev); 4063 - if (err) { 4064 - data->suspend_count--; 4065 - return err; 4066 - } 4067 - 4068 4054 spin_lock_irq(&data->txlock); 4069 4055 if (!(PMSG_IS_AUTO(message) && data->tx_in_flight)) { 4070 4056 set_bit(BTUSB_SUSPENDING, &data->flags); ··· 4062 4068 } else { 4063 4069 spin_unlock_irq(&data->txlock); 4064 4070 data->suspend_count--; 4065 - hci_resume_dev(data->hdev); 4066 4071 return -EBUSY; 4067 4072 } 4068 4073 ··· 4181 4188 clear_bit(BTUSB_SUSPENDING, &data->flags); 4182 4189 spin_unlock_irq(&data->txlock); 4183 4190 schedule_work(&data->work); 4184 - 4185 - hci_resume_dev(data->hdev); 4186 4191 4187 4192 return 0; 4188 4193
+3
net/bluetooth/af_bluetooth.c
··· 825 825 bt_sysfs_cleanup(); 826 826 cleanup_led: 827 827 bt_leds_cleanup(); 828 + debugfs_remove_recursive(bt_debugfs); 828 829 return err; 829 830 } 830 831 831 832 static void __exit bt_exit(void) 832 833 { 834 + iso_exit(); 835 + 833 836 mgmt_exit(); 834 837 835 838 sco_exit();
+1 -2
net/bluetooth/bnep/core.c
··· 745 745 if (flt[0]) 746 746 BT_INFO("BNEP filters: %s", flt); 747 747 748 - bnep_sock_init(); 749 - return 0; 748 + return bnep_sock_init(); 750 749 } 751 750 752 751 static void __exit bnep_exit(void)
+1 -5
net/bluetooth/iso.c
··· 2301 2301 2302 2302 hci_register_cb(&iso_cb); 2303 2303 2304 - if (IS_ERR_OR_NULL(bt_debugfs)) 2305 - return 0; 2306 - 2307 - if (!iso_debugfs) { 2304 + if (!IS_ERR_OR_NULL(bt_debugfs)) 2308 2305 iso_debugfs = debugfs_create_file("iso", 0444, bt_debugfs, 2309 2306 NULL, &iso_debugfs_fops); 2310 - } 2311 2307 2312 2308 iso_inited = true; 2313 2309