FROMGIT: Bluetooth: Cancel le_scan_restart work when stopping discovery

Not cancelling it has caused a bug where passive background scanning is
disabled out of the blue, preventing BLE keyboards/mice to reconnect.
Here is how it happens:
After hci_req_stop_discovery, there is still le_scan_restart_work
scheduled. Invocation of le_scan_restart_work causes a harmful
le_scan_disable_work to be scheduled. This le_scan_disable_work will
eventually disable passive scanning when the timer fires.

Sample btmon trace:

< HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7
        Type: Passive (0x00)
        Interval: 367.500 msec (0x024c)
        Window: 37.500 msec (0x003c)
        Own address type: Public (0x00)
        Filter policy: Accept all advertisement (0x00)
> HCI Event: Command Complete (0x0e) plen 4
      LE Set Scan Parameters (0x08|0x000b) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
        Scanning: Enabled (0x01)
        Filter duplicates: Disabled (0x00)
> HCI Event: Command Complete (0x0e) plen 4
      LE Set Scan Enable (0x08|0x000c) ncmd 2
        Status: Success (0x00)
...
< HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2
        Scanning: Disabled (0x00)
        Filter duplicates: Disabled (0x00)
> HCI Event: Command Complete (0x0e) plen 4
      LE Set Scan Enable (0x08|0x000c) ncmd 2
        Status: Success (0x00)
// Background scanning is not working here onwards.

Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Sonny Sasaka <sonnysasaka@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
(cherry picked from commit c06632a4ec3a7b823f0e9c04cd4836135bba44bf
 https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master)

BUG=b:180952808
TEST=Do the steps in b:180952808#comment8

Change-Id: Ibe0f27ddd8c3b6c4a57f7fa0ef648654324565c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2762783
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Michael Sun <michaelfsun@google.com>
Reviewed-by: Alain Michaud <alainm@chromium.org>
Commit-Queue: Sonny Sasaka <sonnysasaka@chromium.org>
Tested-by: Sonny Sasaka <sonnysasaka@chromium.org>
(cherry picked from commit f905061136dce0e086650738bf89c6db2f5733a7)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2770781
Reviewed-by: Yu Liu <yudiliu@google.com>
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index 601b747..6adb8d5 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -2700,6 +2700,7 @@
 
 		if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) {
 			cancel_delayed_work(&hdev->le_scan_disable);
+			cancel_delayed_work(&hdev->le_scan_restart);
 			hci_req_add_le_scan_disable(req);
 		}