Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97b7b36d authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Bluetooth: Added spinlocks for serial_clock_vote"

parents ab252fbc f76f49ff
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -231,11 +231,11 @@ static void qca_wq_awake_device(struct work_struct *work)

	BT_DBG("hu %p wq awake device", hu);

	spin_lock(&qca->hci_ibs_lock);

	/* Vote for serial clock */
	serial_clock_vote(HCI_IBS_TX_VOTE_CLOCK_ON, hu);

	spin_lock(&qca->hci_ibs_lock);

	/* Send wake indication to device */
	if (send_hci_ibs_cmd(HCI_IBS_WAKE_IND, hu) < 0)
		BT_ERR("Failed to send WAKE to device");
@@ -260,9 +260,10 @@ static void qca_wq_awake_rx(struct work_struct *work)

	BT_DBG("hu %p wq awake rx", hu);

	spin_lock(&qca->hci_ibs_lock);

	serial_clock_vote(HCI_IBS_RX_VOTE_CLOCK_ON, hu);

	spin_lock(&qca->hci_ibs_lock);
	qca->rx_ibs_state = HCI_IBS_RX_AWAKE;

	/* Always acknowledge device wake up,
@@ -287,7 +288,11 @@ static void qca_wq_serial_rx_clock_vote_off(struct work_struct *work)

	BT_DBG("hu %p rx clock vote off", hu);

	spin_lock(&qca->hci_ibs_lock);

	serial_clock_vote(HCI_IBS_RX_VOTE_CLOCK_OFF, hu);

	spin_unlock(&qca->hci_ibs_lock);
}

static void qca_wq_serial_tx_clock_vote_off(struct work_struct *work)
@@ -298,6 +303,8 @@ static void qca_wq_serial_tx_clock_vote_off(struct work_struct *work)

	BT_DBG("hu %p tx clock vote off", hu);

	spin_lock(&qca->hci_ibs_lock);

	/* Run HCI tx handling unlocked */
	hci_uart_tx_wakeup(hu);

@@ -305,6 +312,8 @@ static void qca_wq_serial_tx_clock_vote_off(struct work_struct *work)
	 * It is up to the tty driver to pend the clocks off until tx done.
	 */
	serial_clock_vote(HCI_IBS_TX_VOTE_CLOCK_OFF, hu);

	spin_unlock(&qca->hci_ibs_lock);
}

static void hci_ibs_tx_idle_timeout(unsigned long arg)
@@ -517,8 +526,12 @@ static int qca_close(struct hci_uart *hu)

	BT_DBG("hu %p qca close", hu);

	spin_lock(&qca->hci_ibs_lock);

	serial_clock_vote(HCI_IBS_VOTE_STATS_UPDATE, hu);

	spin_unlock(&qca->hci_ibs_lock);

	skb_queue_purge(&qca->tx_wait_q);
	skb_queue_purge(&qca->txq);
	del_timer(&qca->tx_idle_timer);