mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	Bluetooth: btusb: Revert Fix the autosuspend enable and disable
drivers/usb/core/hub.c: usb_new_device() contains the following:
        /* By default, forbid autosuspend for all devices.  It will be
         * allowed for hubs during binding.
         */
        usb_disable_autosuspend(udev);
So for anything which is not a hub, such as btusb devices, autosuspend is
disabled by default and we must call usb_enable_autosuspend(udev) to
enable it.
This means that the "Fix the autosuspend enable and disable" commit,
which drops the usb_enable_autosuspend() call when the enable_autosuspend
module option is true, is completely wrong, revert it.
This reverts commit 7bd9fb058d.
Cc: Hui Wang <hui.wang@canonical.com>
Fixes: 7bd9fb058d ("Bluetooth: btusb: Fix the autosuspend enable and disable")
Acked-by: Hui Wang <hui.wang@canonical.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
			
			
This commit is contained in:
		
							parent
							
								
									17e7124aad
								
							
						
					
					
						commit
						895915226a
					
				
					 1 changed files with 2 additions and 5 deletions
				
			
		|  | @ -4849,8 +4849,8 @@ static int btusb_probe(struct usb_interface *intf, | ||||||
| 			data->diag = NULL; | 			data->diag = NULL; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if (!enable_autosuspend) | 	if (enable_autosuspend) | ||||||
| 		usb_disable_autosuspend(data->udev); | 		usb_enable_autosuspend(data->udev); | ||||||
| 
 | 
 | ||||||
| 	err = hci_register_dev(hdev); | 	err = hci_register_dev(hdev); | ||||||
| 	if (err < 0) | 	if (err < 0) | ||||||
|  | @ -4910,9 +4910,6 @@ static void btusb_disconnect(struct usb_interface *intf) | ||||||
| 		gpiod_put(data->reset_gpio); | 		gpiod_put(data->reset_gpio); | ||||||
| 
 | 
 | ||||||
| 	hci_free_dev(hdev); | 	hci_free_dev(hdev); | ||||||
| 
 |  | ||||||
| 	if (!enable_autosuspend) |  | ||||||
| 		usb_enable_autosuspend(data->udev); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #ifdef CONFIG_PM | #ifdef CONFIG_PM | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Hans de Goede
						Hans de Goede