Skip to contentSkip to conversation

Bluetooth: btintel_pcie: Fix driver not posting maximum rx buffers

PATCH Superseded Kiran K 4 participants 10 messages May 25, 2025 – May 28, 2025 Bluetooth drivers

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Kiran K

author
#0 lore raw

PATCH 1/3 Bluetooth: btintel_pcie: Fix driver not posting maximum rx buffers

The driver was posting only 6 rx buffers, despite the maximum rx buffers being defined as 16. Update the driver to post the full 16 Rx buffers to utilize the maximum capacity and improve performance.

Fixes c2b636b3f788 ("Bluetooth: btintel_pcie: Add support for PCIe transport")
---
 drivers/bluetooth/btintel_pcie.c | 3 ++-
 drivers/bluetooth/btintel_pcie.h | 3 ---
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/bluetooth/btintel_pcie.c +2 -1
index 50fe17f1e1d1..2c7731803c9f 100644
@@ -396,8 +396,9 @@ static int btintel_pcie_submit_rx(struct btintel_pcie_data *data)
 static int btintel_pcie_start_rx(struct btintel_pcie_data *data)
 {
 	int i, ret;
+	struct rxq *rxq = &data->rxq;
 
-	for (i = 0; i < BTINTEL_PCIE_RX_MAX_QUEUE; i++) {
+	for (i = 0; i < rxq->count; i++) {
 		ret = btintel_pcie_submit_rx(data);
 		if (ret)
 			return ret;
drivers/bluetooth/btintel_pcie.h +0 -3
index 21b964b15c1c..5ddd6d7d8d45 100644
@@ -177,9 +177,6 @@ enum {
 /* Doorbell vector for TFD */
 #define BTINTEL_PCIE_TX_DB_VEC	0
 
-/* Number of pending RX requests for downlink */
-#define BTINTEL_PCIE_RX_MAX_QUEUE	6
-
 /* Doorbell vector for FRBD */
 #define BTINTEL_PCIE_RX_DB_VEC	513
 
Signature · 1 line
2.43.0
author
#1 lore raw

PATCH 2/3 Bluetooth: btintel_pcie: Increase the tx and rx descriptor count

From: Chandrashekar Devegowda <[email protected]>

This change addresses latency issues observed in HID use cases where events arrive in bursts. By increasing the Rx descriptor count to 64, the firmware can handle bursty data more effectively, reducing latency and preventing buffer overflows.

---
 drivers/bluetooth/btintel_pcie.c | 24 ++++++++++++------------
 drivers/bluetooth/btintel_pcie.h |  7 +++++--
 2 files changed, 17 insertions(+), 14 deletions(-)
drivers/bluetooth/btintel_pcie.c +12 -12
index 2c7731803c9f..03f13de4a723 100644
@@ -1783,8 +1783,8 @@ static int btintel_pcie_alloc(struct btintel_pcie_data *data)
 	 *  + size of index * Number of queues(2) * type of index array(4)
 	 *  + size of context information
 	 */
-	total = (sizeof(struct tfd) + sizeof(struct urbd0) + sizeof(struct frbd)
-		+ sizeof(struct urbd1)) * BTINTEL_DESCS_COUNT;
+	total = (sizeof(struct tfd) + sizeof(struct urbd0)) * BTINTEL_PCIE_TX_DESCS_COUNT;
+	total += (sizeof(struct frbd) + sizeof(struct urbd1)) * BTINTEL_PCIE_RX_DESCS_COUNT;
 
 	/* Add the sum of size of index array and size of ci struct */
 	total += (sizeof(u16) * BTINTEL_PCIE_NUM_QUEUES * 4) + sizeof(struct ctx_info);
@@ -1809,36 +1809,36 @@ static int btintel_pcie_alloc(struct btintel_pcie_data *data)
 	data->dma_v_addr = v_addr;
 
 	/* Setup descriptor count */
-	data->txq.count = BTINTEL_DESCS_COUNT;
-	data->rxq.count = BTINTEL_DESCS_COUNT;
+	data->txq.count = BTINTEL_PCIE_TX_DESCS_COUNT;
+	data->rxq.count = BTINTEL_PCIE_RX_DESCS_COUNT;
 
 	/* Setup tfds */
 	data->txq.tfds_p_addr = p_addr;
 	data->txq.tfds = v_addr;
 
-	p_addr += (sizeof(struct tfd) * BTINTEL_DESCS_COUNT);
-	v_addr += (sizeof(struct tfd) * BTINTEL_DESCS_COUNT);
+	p_addr += (sizeof(struct tfd) * BTINTEL_PCIE_TX_DESCS_COUNT);
+	v_addr += (sizeof(struct tfd) * BTINTEL_PCIE_TX_DESCS_COUNT);
 
 	/* Setup urbd0 */
 	data->txq.urbd0s_p_addr = p_addr;
 	data->txq.urbd0s = v_addr;
 
-	p_addr += (sizeof(struct urbd0) * BTINTEL_DESCS_COUNT);
-	v_addr += (sizeof(struct urbd0) * BTINTEL_DESCS_COUNT);
+	p_addr += (sizeof(struct urbd0) * BTINTEL_PCIE_TX_DESCS_COUNT);
+	v_addr += (sizeof(struct urbd0) * BTINTEL_PCIE_TX_DESCS_COUNT);
 
 	/* Setup FRBD*/
 	data->rxq.frbds_p_addr = p_addr;
 	data->rxq.frbds = v_addr;
 
-	p_addr += (sizeof(struct frbd) * BTINTEL_DESCS_COUNT);
-	v_addr += (sizeof(struct frbd) * BTINTEL_DESCS_COUNT);
+	p_addr += (sizeof(struct frbd) * BTINTEL_PCIE_RX_DESCS_COUNT);
+	v_addr += (sizeof(struct frbd) * BTINTEL_PCIE_RX_DESCS_COUNT);
 
 	/* Setup urbd1 */
 	data->rxq.urbd1s_p_addr = p_addr;
 	data->rxq.urbd1s = v_addr;
 
-	p_addr += (sizeof(struct urbd1) * BTINTEL_DESCS_COUNT);
-	v_addr += (sizeof(struct urbd1) * BTINTEL_DESCS_COUNT);
+	p_addr += (sizeof(struct urbd1) * BTINTEL_PCIE_RX_DESCS_COUNT);
+	v_addr += (sizeof(struct urbd1) * BTINTEL_PCIE_RX_DESCS_COUNT);
 
 	/* Setup data buffers for txq */
 	err = btintel_pcie_setup_txq_bufs(data, &data->txq);
drivers/bluetooth/btintel_pcie.h +5 -2
index 5ddd6d7d8d45..7dad4523236c 100644
@@ -154,8 +154,11 @@ enum msix_mbox_int_causes {
 /* Default interrupt timeout in msec */
 #define BTINTEL_DEFAULT_INTR_TIMEOUT_MS	3000
 
-/* The number of descriptors in TX/RX queues */
-#define BTINTEL_DESCS_COUNT	16
+/* The number of descriptors in TX queues */
+#define BTINTEL_PCIE_TX_DESCS_COUNT	32
+
+/* The number of descriptors in RX queues */
+#define BTINTEL_PCIE_RX_DESCS_COUNT	64
 
 /* Number of Queue for TX and RX
  * It indicates the index of the IA(Index Array)
Signature · 1 line
2.43.0
author
#2 lore raw

PATCH 3/3 Bluetooth: btintel_pcie: Reduce driver buffer posting to prevent race condition

In reply to Kiran K

From: Chandrashekar Devegowda <[email protected]>

Modify the driver to post 3 fewer buffers than the maximum rx buffers
(64) allowed for the firmware. This change mitigates a hardware issue causing a race condition in the firmware, improving stability and data handling.

---
 drivers/bluetooth/btintel_pcie.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/bluetooth/btintel_pcie.c +4 -1
index 03f13de4a723..14f000e08e1e 100644
@@ -398,7 +398,10 @@ static int btintel_pcie_start_rx(struct btintel_pcie_data *data)
 	int i, ret;
 	struct rxq *rxq = &data->rxq;
 
-	for (i = 0; i < rxq->count; i++) {
+	/* Post (BTINTEL_PCIE_RX_DESCS_COUNT - 3) buffers to overcome the
+	 * hardware issues leading to race condition at the firmware.
+	 */
+	for (i = 0; i < rxq->count - 3; i++) {
 		ret = btintel_pcie_submit_rx(data);
 		if (ret)
 			return ret;
Signature · 1 line
2.43.0
#3 lore raw

Re: [PATCH v1 3/3] Bluetooth: btintel_pcie: Reduce driver buffer posting to prevent race condition

Dear Chandrashekar, dear Kiran,

Thank you for the patch.

Am 25.05.25 um 07:39 schrieb Kiran K:

Quoted 6 lines

From: Chandrashekar Devegowda <[email protected]>

Modify the driver to post 3 fewer buffers than the maximum rx buffers
(64) allowed for the firmware. This change mitigates a hardware issue causing a race condition in the firmware, improving stability and data handling.

Interesting. Please elaborate, which firmware versions are affected, and if a fix is going to be expected, and how to reproduce the issue, so it can be tested without and with your patch.

Is the errata published? Why three buffers less and not two or four?

Out of curiosity: Does the Microsoft Windows driver do the same?

Quoted 11 lines
---
  drivers/bluetooth/btintel_pcie.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/bluetooth/btintel_pcie.c +0 -0
index 03f13de4a723..14f000e08e1e 100644

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_start_rx(struct btintel_pcie_data *data) · line 402

Quoted 6 lines
drivers/bluetooth/btintel_pcie.c +2 -1
@@ -398,7 +398,10 @@ static int btintel_pcie_start_rx(struct btintel_pcie_data *data)
  	int i, ret;
  	struct rxq *rxq = &data->rxq;
 
-	for (i = 0; i < rxq->count; i++) {
+	/* Post (BTINTEL_PCIE_RX_DESCS_COUNT - 3) buffers to overcome the
+	 * hardware issues leading to race condition at the firmware.

If you had an errata, it’d be great to document it here to.

I’d remove *the*.

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_start_rx(struct btintel_pcie_data *data) · line 407

Quoted 5 lines
drivers/bluetooth/btintel_pcie.c +2 -0
+	 */
+	for (i = 0; i < rxq->count - 3; i++) {
  		ret = btintel_pcie_submit_rx(data);
  		if (ret)
  			return ret;

Kind regards,

Paul

author
#4 lore raw

RE: [PATCH v1 3/3] Bluetooth: btintel_pcie: Reduce driver buffer posting to prevent race condition

Hi Paul,

Thanks for your comments.

Quoted 17 lines

Subject: Re: [PATCH v1 3/3] Bluetooth: btintel_pcie: Reduce driver buffer posting to prevent race condition

Dear Chandrashekar, dear Kiran,

Thank you for the patch.

Am 25.05.25 um 07:39 schrieb Kiran K:

Quoted 6 lines

From: Chandrashekar Devegowda <[email protected]>

Modify the driver to post 3 fewer buffers than the maximum rx buffers
(64) allowed for the firmware. This change mitigates a hardware issue causing a race condition in the firmware, improving stability and data handling.

Quoted 4 lines

Interesting. Please elaborate, which firmware versions are affected, and if a fix is going to be expected, and how to reproduce the issue, so it can be tested without and with your patch.

The firmware is for the upcoming product and is not available in public yet. As I said in 1/3, the issue is seen on android kernel and it's very hard to reproduce the issue on vanilla kernel.

Quoted 2 lines

Is the errata published?

Our internal documents are updated. I have also entered a comment in code.

Quoted 1 line

Why three buffers less and not two or four?

The recommendation from firmware / HW is to use at least 3 buffers as guard buffers. Anything less than three causes RFH (receive flow handler - RX path) blockage.

Quoted 1 line

Out of curiosity: Does the Microsoft Windows driver do the same?

Yes.

Quoted 18 lines

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_start_rx(struct

Quoted 14 lines

Signed-off-by: Chandrashekar Devegowda
<[email protected]>

---
  drivers/bluetooth/btintel_pcie.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/bluetooth/btintel_pcie.c +0 -0
index 03f13de4a723..14f000e08e1e 100644
@@ -398,7 +398,10 @@ static int btintel_pcie_start_rx(struct

btintel_pcie_data *data)

Quoted 3 lines
drivers/bluetooth/btintel_pcie.c +0 -0
  	int i, ret;
  	struct rxq *rxq = &data->rxq;
 
Quoted 7 lines

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_start_rx(struct btintel_pcie_data *data) · line 402

Quoted 3 lines
drivers/bluetooth/btintel_pcie.c +2 -1
-	for (i = 0; i < rxq->count; i++) {
+	/* Post (BTINTEL_PCIE_RX_DESCS_COUNT - 3) buffers to overcome the
+	 * hardware issues leading to race condition at the firmware.

If you had an errata, it’d be great to document it here to.

I’d remove *the*.

Ack

Quoted 11 lines

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_start_rx(struct btintel_pcie_data *data) · line 407

Quoted 6 lines
drivers/bluetooth/btintel_pcie.c +2 -0
+	 */
+	for (i = 0; i < rxq->count - 3; i++) {
  		ret = btintel_pcie_submit_rx(data);
  		if (ret)
  			return ret;

Kind regards,

Paul

Regards,
Kiran

#5 lore raw

Re: [PATCH v1 3/3] Bluetooth: btintel_pcie: Reduce driver buffer posting to prevent race condition

Hi Kiran,

Quoted 23 lines · Kiran

Hi Paul,

Thanks for your comments.

Quoted 16 lines

Subject: Re: [PATCH v1 3/3] Bluetooth: btintel_pcie: Reduce driver buffer posting to prevent race condition

Dear Chandrashekar, dear Kiran,

Thank you for the patch.

Am 25.05.25 um 07:39 schrieb Kiran K:

Quoted 6 lines

From: Chandrashekar Devegowda <[email protected]>

Modify the driver to post 3 fewer buffers than the maximum rx buffers
(64) allowed for the firmware. This change mitigates a hardware issue causing a race condition in the firmware, improving stability and data handling.

Quoted 5 lines
Quoted 4 lines

Interesting. Please elaborate, which firmware versions are affected, and if a fix is going to be expected, and how to reproduce the issue, so it can be tested without and with your patch.

The firmware is for the upcoming product and is not available in public yet. As I said in 1/3, the issue is seen on android kernel and it's very hard to reproduce the issue on vanilla kernel.

If it affects Android specific versions only then it should be posted for upstream, anyway this sounds like it is more of a workaround then a proper fix for the problem.

Quoted 6 lines
Quoted 2 lines

Is the errata published?

Our internal documents are updated. I have also entered a comment in code.

Quoted 1 line

Why three buffers less and not two or four?

The recommendation from firmware / HW is to use at least 3 buffers as guard buffers. Anything less than three causes RFH (receive flow handler - RX path) blockage.

Are these buffers discovered at runtime or they are hardcoded, for the former then the firmware shall be adjusted to give a proper number and in case of the later then the driver shall be updated, either way having to do -3 sounds like a bad idea in the long term.

Quoted 37 lines
Quoted 1 line

Out of curiosity: Does the Microsoft Windows driver do the same?

Yes.

Quoted 18 lines

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_start_rx(struct

Quoted 14 lines

Signed-off-by: Chandrashekar Devegowda
<[email protected]>

---
  drivers/bluetooth/btintel_pcie.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/bluetooth/btintel_pcie.c +0 -0
index 03f13de4a723..14f000e08e1e 100644
@@ -398,7 +398,10 @@ static int btintel_pcie_start_rx(struct

btintel_pcie_data *data)

Quoted 3 lines
drivers/bluetooth/btintel_pcie.c +0 -0
     int i, ret;
     struct rxq *rxq = &data->rxq;
 
Quoted 7 lines

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_start_rx(struct btintel_pcie_data *data) · line 402

Quoted 3 lines
drivers/bluetooth/btintel_pcie.c +2 -1
-    for (i = 0; i < rxq->count; i++) {
+    /* Post (BTINTEL_PCIE_RX_DESCS_COUNT - 3) buffers to overcome the
+     * hardware issues leading to race condition at the firmware.

If you had an errata, it’d be great to document it here to.

I’d remove *the*.

Ack

Quoted 8 lines
Quoted 6 lines
drivers/bluetooth/btintel_pcie.c +2 -0
+     */
+    for (i = 0; i < rxq->count - 3; i++) {
             ret = btintel_pcie_submit_rx(data);
             if (ret)
                     return ret;
Quoted 7 lines
Quoted 3 lines

Kind regards,

Paul

Regards,
Kiran

--
Luiz Augusto von Dentz

author
#6 lore raw

RE: [PATCH v1 3/3] Bluetooth: btintel_pcie: Reduce driver buffer posting to prevent race condition

Hi Luiz,

Quoted 35 lines

Subject: Re: [PATCH v1 3/3] Bluetooth: btintel_pcie: Reduce driver buffer posting to prevent race condition

Hi Kiran,

Quoted 16 lines · Kiran

Hi Paul,

Thanks for your comments.

Quoted 10 lines

Subject: Re: [PATCH v1 3/3] Bluetooth: btintel_pcie: Reduce driver buffer posting to prevent race condition

Dear Chandrashekar, dear Kiran,

Thank you for the patch.

Am 25.05.25 um 07:39 schrieb Kiran K:

Quoted 1 line

From: Chandrashekar Devegowda

<[email protected]>

Quoted 12 lines
Quoted 12 lines
Quoted 6 lines

Modify the driver to post 3 fewer buffers than the maximum rx buffers
(64) allowed for the firmware. This change mitigates a hardware issue causing a race condition in the firmware, improving stability and data handling.

Interesting. Please elaborate, which firmware versions are affected, and if a fix is going to be expected, and how to reproduce the issue, so it can be tested without and with your patch.

Quoted 7 lines
Quoted 1 line

The firmware is for the upcoming product and is not available in public yet.

As I said in 1/3, the issue is seen on android kernel and it's very hard to reproduce the issue on vanilla kernel.

If it affects Android specific versions only then it should be posted for upstream, anyway this sounds like it is more of a workaround then a proper fix for the problem.

The issue is seen on Linux also but the reproduction rate - (1/25) is less compared to android (1/5). As the firmware content is same for both, I feel this work around is applicable for Linux as well.

Quoted 7 lines
Quoted 4 lines
Quoted 3 lines

Is the errata published?

Our internal documents are updated. I have also entered a comment in

code.

Quoted 2 lines
Quoted 2 lines

Why three buffers less and not two or four?

Quoted 9 lines
Quoted 1 line

The recommendation from firmware / HW is to use at least 3 buffers as guard

buffers. Anything less than three causes RFH (receive flow handler - RX path) blockage.

Are these buffers discovered at runtime or they are hardcoded, for the former then the firmware shall be adjusted to give a proper number and in case of the later then the driver shall be updated, either way having to do -3 sounds like a bad idea in the long term.

The maximum number of buffers for RX (N) and the buffers granted for firmware(N-3) are hardcoded. As the issue is related to the hardware, it would take sometime to get it fixed.

Quoted 42 lines
Quoted 42 lines
Quoted 2 lines

Out of curiosity: Does the Microsoft Windows driver do the same?

Yes.

Quoted 18 lines

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_start_rx(struct

Quoted 14 lines

Signed-off-by: Chandrashekar Devegowda
<[email protected]>

---
  drivers/bluetooth/btintel_pcie.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/bluetooth/btintel_pcie.c +0 -0
index 03f13de4a723..14f000e08e1e 100644
@@ -398,7 +398,10 @@ static int btintel_pcie_start_rx(struct

btintel_pcie_data *data)

Quoted 3 lines
drivers/bluetooth/btintel_pcie.c +0 -0
     int i, ret;
     struct rxq *rxq = &data->rxq;
 
Quoted 7 lines

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_start_rx(struct btintel_pcie_data *data) · line 402

Quoted 3 lines
drivers/bluetooth/btintel_pcie.c +2 -1
-    for (i = 0; i < rxq->count; i++) {
+    /* Post (BTINTEL_PCIE_RX_DESCS_COUNT - 3) buffers to overcome the
+     * hardware issues leading to race condition at the firmware.

If you had an errata, it’d be great to document it here to.

I’d remove *the*.

Ack

Quoted 11 lines

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_start_rx(struct btintel_pcie_data *data) · line 407

Quoted 6 lines
drivers/bluetooth/btintel_pcie.c +2 -0
+     */
+    for (i = 0; i < rxq->count - 3; i++) {
             ret = btintel_pcie_submit_rx(data);
             if (ret)
                     return ret;

Kind regards,

Paul

Quoted 7 lines
Quoted 3 lines

Regards,
Kiran

--
Luiz Augusto von Dentz

Thanks,
Kiran

#7 lore raw
In reply to Kiran K

Dear Kiran,

Thank you for the patch.

Am 25.05.25 um 07:39 schrieb Kiran K:

Quoted 2 lines

The driver was posting only 6 rx buffers, despite the maximum rx buffers being defined as 16.

The second part is worded strangely, as the macro, you remove, is defined to be 6. Was it just a typo?

Quoted 2 lines

Update the driver to post the full 16 Rx buffers to utilize the maximum capacity and improve performance.

Please also note, that you remove the macro, because the value seems to be detectable.

Please also mention, how your change can be verified, for example read out in the logs or from /sys, and how the performance can be measured, and what you measured before and after. (Claimns regarding performance should always come with measurements.)

Quoted 28 lines
Fixes c2b636b3f788 ("Bluetooth: btintel_pcie: Add support for PCIe transport")
---
  drivers/bluetooth/btintel_pcie.c | 3 ++-
  drivers/bluetooth/btintel_pcie.h | 3 ---
  2 files changed, 2 insertions(+), 4 deletions(-)
drivers/bluetooth/btintel_pcie.c +2 -1
index 50fe17f1e1d1..2c7731803c9f 100644
@@ -396,8 +396,9 @@ static int btintel_pcie_submit_rx(struct btintel_pcie_data *data)
  static int btintel_pcie_start_rx(struct btintel_pcie_data *data)
  {
  	int i, ret;
+	struct rxq *rxq = &data->rxq;
 
-	for (i = 0; i < BTINTEL_PCIE_RX_MAX_QUEUE; i++) {
+	for (i = 0; i < rxq->count; i++) {
  		ret = btintel_pcie_submit_rx(data);
  		if (ret)
  			return ret;
drivers/bluetooth/btintel_pcie.h +0 -0
index 21b964b15c1c..5ddd6d7d8d45 100644

drivers/bluetooth/btintel_pcie.h enum { · line 181

Quoted 8 lines
drivers/bluetooth/btintel_pcie.h +0 -3
@@ -177,9 +177,6 @@ enum {
  /* Doorbell vector for TFD */
  #define BTINTEL_PCIE_TX_DB_VEC	0
 
-/* Number of pending RX requests for downlink */
-#define BTINTEL_PCIE_RX_MAX_QUEUE	6
-
  /* Doorbell vector for FRBD */
  #define BTINTEL_PCIE_RX_DB_VEC	513

Kind regards,

Paul

author
#8 lore raw

Hi Paul,

Thanks for the comments.

Quoted 6 lines

Subject: Re: [PATCH v1 1/3] Bluetooth: btintel_pcie: Fix driver not posting maximum rx buffers

Dear Kiran,

Quoted 9 lines

Thank you for the patch.

Am 25.05.25 um 07:39 schrieb Kiran K:

Quoted 2 lines

The driver was posting only 6 rx buffers, despite the maximum rx buffers being defined as 16.

The second part is worded strangely, as the macro, you remove, is defined to be 6. Was it just a typo?

The macro value was defined incorrectly to 6, instead of 16.

Quoted 6 lines
Quoted 2 lines

Update the driver to post the full 16 Rx buffers to utilize the maximum capacity and improve performance.

Please also note, that you remove the macro, because the value seems to be detectable.

Instead of using macro, rxq->count is used which is initialized to 16 in the buffer allocation function btintel_pcie_alloc().

Quoted 1 line

Please also mention, how your change can be verified, for example read out in

The issue was reported internally over Android. On connecting bluetooth mouse, there was an exception reported from firmware in less than 5 seconds as there are not enough buffer for the firmware to send the hid reports. Along with this change, we would also need 2/3 and 3/3 patches to fully fix the exception issue.

Quoted 1 line

the logs or from /sys, and how the performance can be measured, and what

When the firmware exception occurs, driver prints the exception in the kernel message.

Quoted 2 lines

you measured before and after. (Claimns regarding performance should always come with measurements.)

This issue is more to do with stability rather than performance. I will update the commit message in the v2 version of the patch.

Quoted 46 lines

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_submit_rx(struct

Quoted 17 lines

Signed-off-by: Chandrashekar Devegowda
<[email protected]>

Fixes c2b636b3f788 ("Bluetooth: btintel_pcie: Add support for PCIe

transport")

---
  drivers/bluetooth/btintel_pcie.c | 3 ++-
  drivers/bluetooth/btintel_pcie.h | 3 ---
  2 files changed, 2 insertions(+), 4 deletions(-)
drivers/bluetooth/btintel_pcie.c +0 -0
index 50fe17f1e1d1..2c7731803c9f 100644
@@ -396,8 +396,9 @@ static int btintel_pcie_submit_rx(struct

btintel_pcie_data *data)

Quoted 16 lines
drivers/bluetooth/btintel_pcie.c +2 -1
  static int btintel_pcie_start_rx(struct btintel_pcie_data *data)
  {
  	int i, ret;
+	struct rxq *rxq = &data->rxq;
 
-	for (i = 0; i < BTINTEL_PCIE_RX_MAX_QUEUE; i++) {
+	for (i = 0; i < rxq->count; i++) {
  		ret = btintel_pcie_submit_rx(data);
  		if (ret)
  			return ret;
drivers/bluetooth/btintel_pcie.h +0 -0
index 21b964b15c1c..5ddd6d7d8d45 100644

drivers/bluetooth/btintel_pcie.h enum { · line 181

Quoted 8 lines
drivers/bluetooth/btintel_pcie.h +0 -3
@@ -177,9 +177,6 @@ enum {
  /* Doorbell vector for TFD */
  #define BTINTEL_PCIE_TX_DB_VEC	0
 
-/* Number of pending RX requests for downlink */
-#define BTINTEL_PCIE_RX_MAX_QUEUE	6
-
  /* Doorbell vector for FRBD */
  #define BTINTEL_PCIE_RX_DB_VEC	513

Kind regards,

Quoted 1 line

Paul

Thanks,
Kiran

#9 lore raw
In reply to Kiran K

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=966178

---Test result---

Test Summary:

CheckPatch                    PENDING   0.33 seconds
GitLint                       PENDING   0.21 seconds
SubjectPrefix                 PASS      0.34 seconds
BuildKernel                   PASS      24.56 seconds
CheckAllWarning               PASS      26.73 seconds
CheckSparse                   PASS      30.13 seconds
BuildKernel32                 PASS      23.98 seconds
TestRunnerSetup               PASS      452.70 seconds
TestRunner_l2cap-tester       PASS      25.09 seconds
TestRunner_iso-tester         PASS      37.26 seconds
TestRunner_bnep-tester        PASS      5.86 seconds
TestRunner_mgmt-tester        PASS      131.88 seconds
TestRunner_rfcomm-tester      PASS      9.27 seconds
TestRunner_sco-tester         PASS      14.55 seconds
TestRunner_ioctl-tester       PASS      9.89 seconds
TestRunner_mesh-tester        PASS      7.30 seconds
TestRunner_smp-tester         PASS      8.71 seconds
TestRunner_userchan-tester    PASS      6.09 seconds
IncrementalBuild              PENDING   0.94 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:

---
Regards,
Linux Bluetooth