Skip to contentSkip to conversation

Bluetooth: hci_intel: Give priority to LPM packets

PATCH Loic Poulain 2 participants 2 messages Sep 9, 2015 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Change the way to insert LPM packets into the txq.
Use skb_queue_head instead of skb_queue_tail to always prioritise LPM packets over potential tx queue content.

---
 drivers/bluetooth/hci_intel.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/bluetooth/hci_intel.c +6 -3
index 3314823..21f339f 100644
@@ -190,7 +190,8 @@ static int intel_lpm_suspend(struct hci_uart *hu)
 
 	set_bit(STATE_LPM_TRANSACTION, &intel->flags);
 
-	skb_queue_tail(&intel->txq, skb);
+	/* LPM flow is a priority, enqueue packet at list head */
+	skb_queue_head(&intel->txq, skb);
 	hci_uart_tx_wakeup(hu);
 
 	intel_wait_lpm_transaction(hu);
@@ -233,7 +234,8 @@ static int intel_lpm_resume(struct hci_uart *hu)
 
 	set_bit(STATE_LPM_TRANSACTION, &intel->flags);
 
-	skb_queue_tail(&intel->txq, skb);
+	/* LPM flow is a priority, enqueue packet at list head */
+	skb_queue_head(&intel->txq, skb);
 	hci_uart_tx_wakeup(hu);
 
 	intel_wait_lpm_transaction(hu);
@@ -272,7 +274,8 @@ static int intel_lpm_host_wake(struct hci_uart *hu)
 	       sizeof(lpm_resume_ack));
 	bt_cb(skb)->pkt_type = HCI_LPM_PKT;
 
-	skb_queue_tail(&intel->txq, skb);
+	/* LPM flow is a priority, enqueue packet at list head */
+	skb_queue_head(&intel->txq, skb);
 	hci_uart_tx_wakeup(hu);
 
 	bt_dev_dbg(hu->hdev, "Resumed by controller");
Signature · 1 line
1.9.1
maintainer
#1 lore raw

Hi Loic,

Quoted 8 lines

Change the way to insert LPM packets into the txq.
Use skb_queue_head instead of skb_queue_tail to always prioritise LPM packets over potential tx queue content.

---
drivers/bluetooth/hci_intel.c | 9 ++++++---

1 file changed, 6 insertions(+), 3 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel