]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Bluetooth: btintel_pcie: Reduce driver buffer posting to prevent race condition
authorChandrashekar Devegowda <chandrashekar.devegowda@intel.com>
Tue, 3 Jun 2025 10:04:40 +0000 (15:34 +0530)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 5 Jun 2025 18:54:14 +0000 (14:54 -0400)
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.

Signed-off-by: Chandrashekar Devegowda <chandrashekar.devegowda@intel.com>
Signed-off-by: Kiran K <kiran.k@intel.com>
Fixes: c2b636b3f788 ("Bluetooth: btintel_pcie: Add support for PCIe transport")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
drivers/bluetooth/btintel_pcie.c

index 03f13de4a723e26a1672e528708840748bea94ea..563165c5efae33b7840107c7e550f56ee3df01c9 100644 (file)
@@ -398,7 +398,11 @@ 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;