This makes hci_suspend_notifier use the hci_*_sync which can be executed synchronously which is allowed in the suspend_notifier and simplifies a lot of the handling since the status of each command can be checked inline so no other work need to be scheduled thus can be performed without using of a state machine.
Showing the changes to include (2 of 10 files). Show all
Unified · Split
| @@ -523,7 +523,6 @@ struct hci_dev { · 522 unmodified lines | |||
| 523 | bool advertising_paused; | 523 | bool advertising_paused; |
| 524 | 524 | ||
| 525 | struct notifier_block suspend_notifier; | 525 | struct notifier_block suspend_notifier; |
| 526 | struct work_struct suspend_prepare; | ||
| 527 | enum suspended_state suspend_state_next; | 526 | enum suspended_state suspend_state_next; |
| 528 | enum suspended_state suspend_state; | 527 | enum suspended_state suspend_state; |
| 529 | bool scanning_paused; | 528 | bool scanning_paused; |
| @@ -532,9 +531,6 @@ struct hci_dev { · 2 unmodified lines | |||
| 532 | bdaddr_t wake_addr; | 531 | bdaddr_t wake_addr; |
| 533 | u8 wake_addr_type; | 532 | u8 wake_addr_type; |
| 534 | 533 | ||
| 535 | wait_queue_head_t suspend_wait_q; | ||
| 536 | DECLARE_BITMAP(suspend_tasks, __SUSPEND_NUM_TASKS); | ||
| 537 | |||
| 538 | struct hci_conn_hash conn_hash; | 534 | struct hci_conn_hash conn_hash; |
| 539 | 535 | ||
| 540 | struct list_head mgmt_pending; | 536 | struct list_head mgmt_pending; |
| @@ -92,3 +92,6 @@ int hci_set_powered_sync(struct hci_dev *hdev, u8 val); · 91 unmodified lines | |||
| 92 | 92 | ||
| 93 | int hci_start_discovery_sync(struct hci_dev *hdev); | 93 | int hci_start_discovery_sync(struct hci_dev *hdev); |
| 94 | int hci_stop_discovery_sync(struct hci_dev *hdev); | 94 | int hci_stop_discovery_sync(struct hci_dev *hdev); |
| 95 | |||
| 96 | int hci_suspend_sync(struct hci_dev *hdev); | ||
| 97 | int hci_resume_sync(struct hci_dev *hdev); | ||