Bluetooth: btusb: Fix not being able to reconnect after suspend

This partially reverts 81b3e33bb054 ("Bluetooth: btusb: Don't fail
external suspend requests") as it introduced a call to hci_suspend_dev
that assumes the system-suspend which doesn't work well when just the
device is being suspended because wakeup flag is only set for remote
devices that can wakeup the system.

Reported-by: Rafael J. Wysocki <rafael@kernel.org>
Reported-by: Heiner Kallweit <hkallweit1@gmail.com>
Reported-by: Kenneth Crudup <kenny@panix.com>
Fixes: 610712298b11 ("Bluetooth: btusb: Don't fail external suspend requests")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tested-by: Rafael J. Wysocki <rafael@kernel.org>

Changed files
-14
drivers
bluetooth
-14
drivers/bluetooth/btusb.c
··· 4038 static int btusb_suspend(struct usb_interface *intf, pm_message_t message) 4039 { 4040 struct btusb_data *data = usb_get_intfdata(intf); 4041 - int err; 4042 4043 BT_DBG("intf %p", intf); 4044 ··· 4050 if (data->suspend_count++) 4051 return 0; 4052 4053 - /* Notify Host stack to suspend; this has to be done before stopping 4054 - * the traffic since the hci_suspend_dev itself may generate some 4055 - * traffic. 4056 - */ 4057 - err = hci_suspend_dev(data->hdev); 4058 - if (err) { 4059 - data->suspend_count--; 4060 - return err; 4061 - } 4062 - 4063 spin_lock_irq(&data->txlock); 4064 if (!(PMSG_IS_AUTO(message) && data->tx_in_flight)) { 4065 set_bit(BTUSB_SUSPENDING, &data->flags); ··· 4057 } else { 4058 spin_unlock_irq(&data->txlock); 4059 data->suspend_count--; 4060 - hci_resume_dev(data->hdev); 4061 return -EBUSY; 4062 } 4063 ··· 4176 clear_bit(BTUSB_SUSPENDING, &data->flags); 4177 spin_unlock_irq(&data->txlock); 4178 schedule_work(&data->work); 4179 - 4180 - hci_resume_dev(data->hdev); 4181 4182 return 0; 4183
··· 4038 static int btusb_suspend(struct usb_interface *intf, pm_message_t message) 4039 { 4040 struct btusb_data *data = usb_get_intfdata(intf); 4041 4042 BT_DBG("intf %p", intf); 4043 ··· 4051 if (data->suspend_count++) 4052 return 0; 4053 4054 spin_lock_irq(&data->txlock); 4055 if (!(PMSG_IS_AUTO(message) && data->tx_in_flight)) { 4056 set_bit(BTUSB_SUSPENDING, &data->flags); ··· 4068 } else { 4069 spin_unlock_irq(&data->txlock); 4070 data->suspend_count--; 4071 return -EBUSY; 4072 } 4073 ··· 4188 clear_bit(BTUSB_SUSPENDING, &data->flags); 4189 spin_unlock_irq(&data->txlock); 4190 schedule_work(&data->work); 4191 4192 return 0; 4193