Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v1 1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt"
@ 2026-11-23  6:55 Kiran K
  2026-11-23  6:55 ` [PATCH v1 2/3] Bluetooth: btintel_pcie: Serialize doorbell writes and target reads Kiran K
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Kiran K @ 2026-11-23  6:55 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: chethan.tumkur.narayan, chandrashekar.devegowda, ravindra,
	Kiran K

This reverts commit d572ea4b621ce60279da5179a0c338660c8b7331.

That commit worked around invalid mbox TLV reads by making the mbox
worker wait for the GP0 alive interrupt before the target access. The
controller must not see an access to HBUS_TARG_WRPTR at the same time as
an access to the PRPH_DEV_ADDR/PRPH_DEV_RD register pair. Waiting for GP0
is not exhaustive: it only narrows the window for the mbox worker, and
there are other cases where these accesses overlap, such as the other
users of target access (hwexp, fwtrigger, coredump) and the TX doorbell.

The next patch serializes these accesses with a lock, which covers all
of them. Drop the handshake as it is no longer needed.

Also drop the handshake completion that commit 4f6ead67b93b
("Bluetooth: btintel_pcie: verify and serialize D-state transitions")
added to the set_dxstate() D0 fallback path, since the flags and wait
queue it relied on no longer exist.

Assisted-by: Copilot:claude-sonnet-5.5
Signed-off-by: Kiran K <kiran.k@intel.com>
---
 drivers/bluetooth/btintel_pcie.c | 51 ++------------------------------
 drivers/bluetooth/btintel_pcie.h |  7 -----
 2 files changed, 3 insertions(+), 55 deletions(-)

diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
index 55454900322b..d95127327c71 100644
--- a/drivers/bluetooth/btintel_pcie.c
+++ b/drivers/bluetooth/btintel_pcie.c
@@ -1986,25 +1986,6 @@ static int btintel_parse_mbox_tlv(struct btintel_pcie_data *data)
 	struct mbox_tlv *tlv;
 	struct btintel_data *cnvi_data = hci_get_priv(data->hdev);
 	u8 hw_variant = INTEL_HW_VARIANT(cnvi_data->cnvi_bt);
-	long t;
-
-	/* Wait for GP0 alive interrupt to post RX buffers */
-	t = wait_event_timeout(data->mbox_parse_wait_q,
-			       test_bit(BTINTEL_PCIE_MBOX_PARSE_READY, &data->flags),
-			       msecs_to_jiffies(BTINTEL_PCIE_MBOX_INTR_TIMEOUT_MS));
-	if (!t) {
-		bt_dev_warn(data->hdev,
-			    "Timeout (%u ms) waiting for alive interrupt before mbox TLV parse; skipping",
-			    BTINTEL_PCIE_MBOX_INTR_TIMEOUT_MS);
-		return 0;
-	}
-	clear_bit(BTINTEL_PCIE_MBOX_PARSE_READY, &data->flags);
-
-	if (data->log_mask & BTINTEL_PCIE_LOG_MBOX)
-		bt_dev_info(data->hdev,
-			    "mbox TLV parse started at %lld ns (%lld us after mbox interrupt)",
-			    ktime_to_ns(ktime_get()),
-			    ktime_to_us(ktime_sub(ktime_get(), data->mbox_intr_ts)));
 
 	memset(&data->dump_info, 0, sizeof(data->dump_info));
 
@@ -2288,23 +2269,12 @@ static void btintel_pcie_msix_gp1_handler(struct btintel_pcie_data *data)
 	if (target_access &&
 	    !test_and_set_bit(BTINTEL_PCIE_MAIL_BOX_INTR,
 				   &data->flags)) {
-		/* Arm the mbox<->alive handshake */
-		clear_bit(BTINTEL_PCIE_MBOX_PARSE_READY, &data->flags);
-		set_bit(BTINTEL_PCIE_MBOX_PARSE_PENDING, &data->flags);
-		data->mbox_intr_ts = ktime_get();
-
-		if (data->log_mask & BTINTEL_PCIE_LOG_MBOX)
-			bt_dev_info(data->hdev,
-				    "mbox interrupt received at %lld ns; queuing mbox_work",
-				    ktime_to_ns(data->mbox_intr_ts));
-
 		WRITE_ONCE(data->debug_table_addr, addr);
 		WRITE_ONCE(data->debug_table_size, size);
 		if (!queue_work(data->dump_workqueue,
-				&data->mbox_work)) {
-			clear_bit(BTINTEL_PCIE_MAIL_BOX_INTR, &data->flags);
-			clear_bit(BTINTEL_PCIE_MBOX_PARSE_PENDING, &data->flags);
-		}
+				&data->mbox_work))
+			clear_bit(BTINTEL_PCIE_MAIL_BOX_INTR,
+				  &data->flags);
 	}
 
 	/* Mailbox is read, ack to FW */
@@ -2421,12 +2391,6 @@ static void btintel_pcie_msix_gp0_handler(struct btintel_pcie_data *data)
 	if (submit_rx) {
 		btintel_pcie_reset_ia(data);
 		btintel_pcie_start_rx(data);
-
-		/* Complete the mbox<->alive handshake */
-		if (test_and_clear_bit(BTINTEL_PCIE_MBOX_PARSE_PENDING, &data->flags)) {
-			set_bit(BTINTEL_PCIE_MBOX_PARSE_READY, &data->flags);
-			wake_up(&data->mbox_parse_wait_q);
-		}
 	}
 
 	if (signal_waitq) {
@@ -4911,8 +4875,6 @@ static int btintel_pcie_probe(struct pci_dev *pdev,
 	init_waitqueue_head(&data->rfkill_wait_q);
 	data->rfkill_wait_done = false;
 
-	init_waitqueue_head(&data->mbox_parse_wait_q);
-
 	data->workqueue = alloc_ordered_workqueue(KBUILD_MODNAME, WQ_HIGHPRI);
 	if (!data->workqueue)
 		return -ENOMEM;
@@ -5261,13 +5223,6 @@ static int btintel_pcie_set_dxstate(struct btintel_pcie_data *data, u32 dxstate)
 				if (err)
 					return err;
 
-				/* Complete the mbox<->alive handshake */
-				if (test_and_clear_bit(BTINTEL_PCIE_MBOX_PARSE_PENDING,
-						       &data->flags)) {
-					set_bit(BTINTEL_PCIE_MBOX_PARSE_READY, &data->flags);
-					wake_up(&data->mbox_parse_wait_q);
-				}
-
 				return 0;
 			}
 		} else {
diff --git a/drivers/bluetooth/btintel_pcie.h b/drivers/bluetooth/btintel_pcie.h
index 28acc20eefdf..6b7cf3819f25 100644
--- a/drivers/bluetooth/btintel_pcie.h
+++ b/drivers/bluetooth/btintel_pcie.h
@@ -174,8 +174,6 @@ enum {
 	BTINTEL_PCIE_HW_RFKILL_STATE_CHECK,
 	BTINTEL_PCIE_SETUP_DONE,
 	BTINTEL_PCIE_MAIL_BOX_INTR,
-	BTINTEL_PCIE_MBOX_PARSE_PENDING,
-	BTINTEL_PCIE_MBOX_PARSE_READY,
 	BTINTEL_PCIE_FATAL_ERR_POST_SETUP_PENDING,
 };
 
@@ -237,7 +235,6 @@ enum btintel_pcie_mbox_msg {
 
 /* Default interrupt timeout in msec */
 #define BTINTEL_DEFAULT_INTR_TIMEOUT_MS	3000
-#define BTINTEL_PCIE_MBOX_INTR_TIMEOUT_MS	500
 
 #define BTINTEL_PCIE_DX_TRANSITION_MAX_RETRIES	3
 
@@ -842,10 +839,6 @@ struct btintel_pcie_data {
 	struct btintel_pcie_mbox	mbox;
 	atomic64_t	last_dump_jiffies64;
 
-	/* Wait queue for mbox_worker to wait for GP0 alive interrupt */
-	wait_queue_head_t	mbox_parse_wait_q;
-	/* Timestamp captured in GP1 handler when mbox interrupt is received */
-	ktime_t	mbox_intr_ts;
 	bool		pcie_alloc_init;
 };
 
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v1 2/3] Bluetooth: btintel_pcie: Serialize doorbell writes and target reads
  2026-11-23  6:55 [PATCH v1 1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt" Kiran K
@ 2026-11-23  6:55 ` Kiran K
  2026-11-23  6:55 ` [PATCH v1 3/3] Bluetooth: btintel_pcie: Serialize MAC access requests Kiran K
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Kiran K @ 2026-11-23  6:55 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: chethan.tumkur.narayan, chandrashekar.devegowda, ravindra,
	Kiran K

The controller must not see an access to HBUS_TARG_WRPTR at the same
time as an access to the PRPH_DEV_ADDR/PRPH_DEV_RD register pair used
for target access. Posting an RX buffer or ringing the TX doorbell while
a target read is in flight can produce invalid mailbox values. The
address/data pair also has to stay together, since several works
(mbox, hwexp, fwtrigger, coredump) read device memory concurrently.

Add dev_mem_lock and take it inside btintel_pcie_rd_dev_mem() and the new
btintel_pcie_wr_dev_mem() and btintel_pcie_wr_wrptr() helpers. The YoYo
config set writes use the same lock.

The critical sections are only a few MMIO accesses and never sleep, so a
spinlock is sufficient.

Fixes: d572ea4b621c ("Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt")
Fixes: 68e0925f16c0 ("Bluetooth: btintel_pcie: Add yoyo support for config set TLV")
Assisted-by: Copilot:claude-sonnet-5.5
Signed-off-by: Kiran K <kiran.k@intel.com>
---
 drivers/bluetooth/btintel_pcie.c | 15 +++++++--------
 drivers/bluetooth/btintel_pcie.h | 33 +++++++++++++++++++++++++++++++-
 2 files changed, 39 insertions(+), 9 deletions(-)

diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
index d95127327c71..75f1724336ae 100644
--- a/drivers/bluetooth/btintel_pcie.c
+++ b/drivers/bluetooth/btintel_pcie.c
@@ -540,7 +540,7 @@ static void btintel_pcie_set_tx_db(struct btintel_pcie_data *data, u16 index)
 	val = index;
 	val |= (BTINTEL_PCIE_TX_DB_VEC << 16);
 
-	btintel_pcie_wr_reg32(data, BTINTEL_PCIE_CSR_HBUS_TARG_WRPTR, val);
+	btintel_pcie_wr_wrptr(data, val);
 }
 
 /* Copy the data to next(@tfd_index) data buffer and update the TFD(transfer
@@ -754,7 +754,7 @@ static void btintel_pcie_set_rx_db(struct btintel_pcie_data *data, u16 index)
 	val = index;
 	val |= (BTINTEL_PCIE_RX_DB_VEC << 16);
 
-	btintel_pcie_wr_reg32(data, BTINTEL_PCIE_CSR_HBUS_TARG_WRPTR, val);
+	btintel_pcie_wr_wrptr(data, val);
 }
 
 /* Update the FRBD (free buffer descriptor) with the @frbd_index and the
@@ -1075,7 +1075,10 @@ btintel_pcie_apply_yoyo_config_sets(struct btintel_pcie_data *data,
 				}
 
 				BT_DBG("YoYo: CSR write [0x%08x] = 0x%08x", addr, value);
+				/* addr may be PRPH_DEV_* or HBUS_TARG_WRPTR */
+				spin_lock(&data->dev_mem_lock);
 				btintel_pcie_wr_reg32(data, addr, value);
+				spin_unlock(&data->dev_mem_lock);
 				break;
 			/* Indirect Address Access (Peripheral MAC and Device Memory) */
 			case BTINTEL_PCIE_CFGSET_PERIPH_MAC:
@@ -1089,12 +1092,7 @@ btintel_pcie_apply_yoyo_config_sets(struct btintel_pcie_data *data,
 					continue;
 				}
 
-				btintel_pcie_wr_reg32(data,
-						      BTINTEL_PCIE_PRPH_DEV_ADDR_REG,
-						      addr);
-				btintel_pcie_wr_reg32(data,
-						      BTINTEL_PCIE_PRPH_DEV_WR_REG,
-						      value);
+				btintel_pcie_wr_dev_mem(data, addr, value);
 				BT_DBG("YoYo: indirect write type %u addr 0x%08x value 0x%08x",
 				       config_set->config_set_type, addr, value);
 				break;
@@ -4864,6 +4862,7 @@ static int btintel_pcie_probe(struct pci_dev *pdev,
 	spin_lock_init(&data->irq_lock);
 	spin_lock_init(&data->hci_rx_lock);
 	spin_lock_init(&data->ipc_lock);
+	spin_lock_init(&data->dev_mem_lock);
 	mutex_init(&data->rfkill_doorbell_lock);
 
 	init_waitqueue_head(&data->gp0_wait_q);
diff --git a/drivers/bluetooth/btintel_pcie.h b/drivers/bluetooth/btintel_pcie.h
index 6b7cf3819f25..124e837da94b 100644
--- a/drivers/bluetooth/btintel_pcie.h
+++ b/drivers/bluetooth/btintel_pcie.h
@@ -769,6 +769,10 @@ struct btintel_pcie_data {
 	spinlock_t	hci_rx_lock;
 	/* lock to serialize IPC control register updates */
 	spinlock_t	ipc_lock;
+	/* lock to serialize HBUS_TARG_WRPTR writes against the PRPH_DEV_ADDR/
+	 * PRPH_DEV_RD target access register pair. Never sleep while held.
+	 */
+	spinlock_t	dev_mem_lock;
 
 	void __iomem	*base_addr;
 
@@ -880,9 +884,36 @@ static inline void btintel_pcie_clr_reg_bits(struct btintel_pcie_data *data,
 	iowrite32(r, data->base_addr + offset);
 }
 
+/* Caller must hold MAC access. The address/data register pair is accessed
+ * under dev_mem_lock so that it neither overlaps a HBUS_TARG_WRPTR write nor
+ * interleaves with another reader.
+ */
 static inline u32 btintel_pcie_rd_dev_mem(struct btintel_pcie_data *data,
 					  u32 addr)
 {
+	u32 val;
+
+	spin_lock(&data->dev_mem_lock);
+	btintel_pcie_wr_reg32(data, BTINTEL_PCIE_PRPH_DEV_ADDR_REG, addr);
+	val = btintel_pcie_rd_reg32(data, BTINTEL_PCIE_PRPH_DEV_RD_REG);
+	spin_unlock(&data->dev_mem_lock);
+
+	return val;
+}
+
+static inline void btintel_pcie_wr_dev_mem(struct btintel_pcie_data *data,
+					  u32 addr, u32 val)
+{
+	spin_lock(&data->dev_mem_lock);
 	btintel_pcie_wr_reg32(data, BTINTEL_PCIE_PRPH_DEV_ADDR_REG, addr);
-	return btintel_pcie_rd_reg32(data, BTINTEL_PCIE_PRPH_DEV_RD_REG);
+	btintel_pcie_wr_reg32(data, BTINTEL_PCIE_PRPH_DEV_WR_REG, val);
+	spin_unlock(&data->dev_mem_lock);
+}
+
+static inline void btintel_pcie_wr_wrptr(struct btintel_pcie_data *data,
+					 u32 val)
+{
+	spin_lock(&data->dev_mem_lock);
+	btintel_pcie_wr_reg32(data, BTINTEL_PCIE_CSR_HBUS_TARG_WRPTR, val);
+	spin_unlock(&data->dev_mem_lock);
 }
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v1 3/3] Bluetooth: btintel_pcie: Serialize MAC access requests
  2026-11-23  6:55 [PATCH v1 1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt" Kiran K
  2026-11-23  6:55 ` [PATCH v1 2/3] Bluetooth: btintel_pcie: Serialize doorbell writes and target reads Kiran K
@ 2026-11-23  6:55 ` Kiran K
  2026-11-23 20:44   ` kernel test robot
  2026-11-23 11:56 ` [v1,1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt" bluez.test.bot
  2026-11-23 19:40 ` [PATCH v1 1/3] " patchwork-bot+bluetooth
  3 siblings, 1 reply; 6+ messages in thread
From: Kiran K @ 2026-11-23  6:55 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: chethan.tumkur.narayan, chandrashekar.devegowda, ravindra,
	Kiran K

MAC_ACCESS_REQ is requested and released with an unlocked
read-modify-write of FUNC_CTRL. The YoYo config set path and the dump
workqueue (device memory read and trace dump) can run it concurrently.
One path can then release MAC_ACCESS_REQ while another is still
accessing the target, or their FUNC_CTRL updates can overwrite each
other.

Hold a new mac_access_lock across the whole request, access and release
sequence in these users. Also release MAC_ACCESS_REQ when the request
fails, so a timed-out request is not left set.

Fixes: 68e0925f16c0 ("Bluetooth: btintel_pcie: Add yoyo support for config set TLV")
Assisted-by: Copilot:claude-sonnet-5.5
Signed-off-by: Kiran K <kiran.k@intel.com>
---
 drivers/bluetooth/btintel_pcie.c | 15 ++++++++++++++-
 drivers/bluetooth/btintel_pcie.h |  4 ++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
index 75f1724336ae..3b2c8bbb36e9 100644
--- a/drivers/bluetooth/btintel_pcie.c
+++ b/drivers/bluetooth/btintel_pcie.c
@@ -1035,6 +1035,7 @@ btintel_pcie_apply_yoyo_config_sets(struct btintel_pcie_data *data,
 
 		if (config_set->config_set_type == BTINTEL_PCIE_CFGSET_PERIPH_MAC ||
 		    config_set->config_set_type == BTINTEL_PCIE_CFGSET_DEVICE_MEM) {
+			mutex_lock(&data->mac_access_lock);
 			ret = btintel_pcie_get_mac_access(data);
 			if (ret) {
 				BT_WARN("YoYo: MAC access failed for config set (%d), skipping",
@@ -1044,6 +1045,7 @@ btintel_pcie_apply_yoyo_config_sets(struct btintel_pcie_data *data,
 				 * request bit is not leaked.
 				 */
 				btintel_pcie_release_mac_access(data);
+				mutex_unlock(&data->mac_access_lock);
 				continue;
 			}
 		}
@@ -1104,8 +1106,10 @@ btintel_pcie_apply_yoyo_config_sets(struct btintel_pcie_data *data,
 		}
 
 		if (config_set->config_set_type == BTINTEL_PCIE_CFGSET_PERIPH_MAC ||
-		    config_set->config_set_type == BTINTEL_PCIE_CFGSET_DEVICE_MEM)
+		    config_set->config_set_type == BTINTEL_PCIE_CFGSET_DEVICE_MEM) {
 			btintel_pcie_release_mac_access(data);
+			mutex_unlock(&data->mac_access_lock);
+		}
 	}
 }
 
@@ -1752,15 +1756,19 @@ static void btintel_pcie_dump_traces(struct hci_dev *hdev)
 	struct btintel_pcie_data *data = hci_get_drvdata(hdev);
 	int ret;
 
+	mutex_lock(&data->mac_access_lock);
 	ret = btintel_pcie_get_mac_access(data);
 	if (ret) {
 		bt_dev_err(hdev, "Failed to get mac access: (%d)", ret);
+		btintel_pcie_release_mac_access(data);
+		mutex_unlock(&data->mac_access_lock);
 		return;
 	}
 
 	ret = btintel_pcie_read_debug_regions(data);
 
 	btintel_pcie_release_mac_access(data);
+	mutex_unlock(&data->mac_access_lock);
 
 	if (ret)
 		bt_dev_err(hdev, "Failed to dump traces: (%d)", ret);
@@ -1884,9 +1892,12 @@ static int btintel_pcie_read_device_mem(struct btintel_pcie_data *data,
 	u32 *val = buf;
 
 	/* Get device mac access */
+	mutex_lock(&data->mac_access_lock);
 	err = btintel_pcie_get_mac_access(data);
 	if (err) {
 		bt_dev_err(data->hdev, "Failed to get mac access %d", err);
+		btintel_pcie_release_mac_access(data);
+		mutex_unlock(&data->mac_access_lock);
 		return err;
 	}
 
@@ -1899,6 +1910,7 @@ static int btintel_pcie_read_device_mem(struct btintel_pcie_data *data,
 		*val = btintel_pcie_rd_dev_mem(data, dev_addr);
 
 	btintel_pcie_release_mac_access(data);
+	mutex_unlock(&data->mac_access_lock);
 
 	return 0;
 }
@@ -4863,6 +4875,7 @@ static int btintel_pcie_probe(struct pci_dev *pdev,
 	spin_lock_init(&data->hci_rx_lock);
 	spin_lock_init(&data->ipc_lock);
 	spin_lock_init(&data->dev_mem_lock);
+	mutex_init(&data->mac_access_lock);
 	mutex_init(&data->rfkill_doorbell_lock);
 
 	init_waitqueue_head(&data->gp0_wait_q);
diff --git a/drivers/bluetooth/btintel_pcie.h b/drivers/bluetooth/btintel_pcie.h
index 124e837da94b..97267a7e9762 100644
--- a/drivers/bluetooth/btintel_pcie.h
+++ b/drivers/bluetooth/btintel_pcie.h
@@ -773,6 +773,10 @@ struct btintel_pcie_data {
 	 * PRPH_DEV_RD target access register pair. Never sleep while held.
 	 */
 	spinlock_t	dev_mem_lock;
+	/* lock to serialize the MAC_ACCESS_REQ get/release sequence together
+	 * with the target accesses done under it. Held across sleeping calls.
+	 */
+	struct mutex	mac_access_lock;
 
 	void __iomem	*base_addr;
 
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [v1,1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt"
  2026-11-23  6:55 [PATCH v1 1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt" Kiran K
  2026-11-23  6:55 ` [PATCH v1 2/3] Bluetooth: btintel_pcie: Serialize doorbell writes and target reads Kiran K
  2026-11-23  6:55 ` [PATCH v1 3/3] Bluetooth: btintel_pcie: Serialize MAC access requests Kiran K
@ 2026-11-23 11:56 ` bluez.test.bot
  2026-11-23 19:40 ` [PATCH v1 1/3] " patchwork-bot+bluetooth
  3 siblings, 0 replies; 6+ messages in thread
From: bluez.test.bot @ 2026-11-23 11:56 UTC (permalink / raw)
  To: linux-bluetooth, kiran.k

[-- Attachment #1: Type: text/plain, Size: 3686 bytes --]

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/series/1219220/

---Test result---

Test Summary:
CheckPatch                    FAIL      1.55 seconds
VerifyFixes                   PASS      0.05 seconds
VerifySignedoff               PASS      0.05 seconds
GitLint                       FAIL      0.45 seconds
SubjectPrefix                 PASS      0.12 seconds
BuildKernel                   PASS      20.46 seconds
CheckAllWarning               PASS      23.11 seconds
CheckSparse                   PASS      24.40 seconds
BuildKernel32                 PASS      20.41 seconds
CheckKernelLLVM               PASS      22.32 seconds
TestRunnerSetup               PASS      476.71 seconds
IncrementalBuild              PASS      20.51 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[v1,1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt"
WARNING: Non-standard signature: Assisted-by:
#115: 
Assisted-by: Copilot:claude-sonnet-5.5

ERROR: Unrecognized email address: 'Copilot:claude-sonnet-5.5'
#115: 
Assisted-by: Copilot:claude-sonnet-5.5

total: 1 errors, 1 warnings, 109 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/home/runner/work/bluetooth-next/bluetooth-next/src/patch/15011639.patch has style problems, please review.

NOTE: Ignored message types: UNKNOWN_COMMIT_ID

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.


[v1,2/3] Bluetooth: btintel_pcie: Serialize doorbell writes and target reads
WARNING: Non-standard signature: Assisted-by:
#116: 
Assisted-by: Copilot:claude-sonnet-5.5

ERROR: Unrecognized email address: 'Copilot:claude-sonnet-5.5'
#116: 
Assisted-by: Copilot:claude-sonnet-5.5

total: 1 errors, 1 warnings, 93 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/home/runner/work/bluetooth-next/bluetooth-next/src/patch/15011640.patch has style problems, please review.

NOTE: Ignored message types: UNKNOWN_COMMIT_ID

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.


[v1,3/3] Bluetooth: btintel_pcie: Serialize MAC access requests
WARNING: Non-standard signature: Assisted-by:
#111: 
Assisted-by: Copilot:claude-sonnet-5.5

ERROR: Unrecognized email address: 'Copilot:claude-sonnet-5.5'
#111: 
Assisted-by: Copilot:claude-sonnet-5.5

total: 1 errors, 1 warnings, 80 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/home/runner/work/bluetooth-next/bluetooth-next/src/patch/15011641.patch has style problems, please review.

NOTE: Ignored message types: UNKNOWN_COMMIT_ID

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.


##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[v1,1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt"

1: T1 Title exceeds max length (89>80): "[v1,1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt""


https://github.com/bluez/bluetooth-next/pull/1201

---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt"
  2026-11-23  6:55 [PATCH v1 1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt" Kiran K
                   ` (2 preceding siblings ...)
  2026-11-23 11:56 ` [v1,1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt" bluez.test.bot
@ 2026-11-23 19:40 ` patchwork-bot+bluetooth
  3 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+bluetooth @ 2026-11-23 19:40 UTC (permalink / raw)
  To: Kiran K
  Cc: linux-bluetooth, chethan.tumkur.narayan, chandrashekar.devegowda,
	ravindra

Hello:

This series was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon, 23 Nov 2026 12:25:21 +0530 you wrote:
> This reverts commit d572ea4b621ce60279da5179a0c338660c8b7331.
> 
> That commit worked around invalid mbox TLV reads by making the mbox
> worker wait for the GP0 alive interrupt before the target access. The
> controller must not see an access to HBUS_TARG_WRPTR at the same time as
> an access to the PRPH_DEV_ADDR/PRPH_DEV_RD register pair. Waiting for GP0
> is not exhaustive: it only narrows the window for the mbox worker, and
> there are other cases where these accesses overlap, such as the other
> users of target access (hwexp, fwtrigger, coredump) and the TX doorbell.
> 
> [...]

Here is the summary with links:
  - [v1,1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt"
    https://git.kernel.org/bluetooth/bluetooth-next/c/35eb0a106542
  - [v1,2/3] Bluetooth: btintel_pcie: Serialize doorbell writes and target reads
    https://git.kernel.org/bluetooth/bluetooth-next/c/4c7812123eac
  - [v1,3/3] Bluetooth: btintel_pcie: Serialize MAC access requests
    https://git.kernel.org/bluetooth/bluetooth-next/c/5bf3a9b6b720

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 3/3] Bluetooth: btintel_pcie: Serialize MAC access requests
  2026-11-23  6:55 ` [PATCH v1 3/3] Bluetooth: btintel_pcie: Serialize MAC access requests Kiran K
@ 2026-11-23 20:44   ` kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2026-11-23 20:44 UTC (permalink / raw)
  To: Kiran K, linux-bluetooth
  Cc: llvm, oe-kbuild-all, chethan.tumkur.narayan,
	chandrashekar.devegowda, ravindra, Kiran K

Hi Kiran,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on next-20261123]
[cannot apply to linus/master v7.4-rc4]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Kiran-K/Bluetooth-btintel_pcie-Serialize-doorbell-writes-and-target-reads/20261123-122522
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
patch link:    https://lore.kernel.org/r/20261123065523.2769017-3-kiran.k%40intel.com
patch subject: [PATCH v1 3/3] Bluetooth: btintel_pcie: Serialize MAC access requests
config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20261124/20261124043547.lzdrjg8w-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 2012344e5da8e03ea4b8283ecd6fad6e13f09d64)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261124/20261124043547.lzdrjg8w-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261124043547.lzdrjg8w-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/bluetooth/btintel_pcie.c:1053:12: warning: mutex 'data->mac_access_lock' is not held on every path through here [-Wthread-safety-analysis]
    1053 |                 for (i = 0; i < config_set->num_pairs; i++) {
         |                          ^
   drivers/bluetooth/btintel_pcie.c:1038:4: note: mutex acquired here
    1038 |                         mutex_lock(&data->mac_access_lock);
         |                         ^
   include/linux/mutex.h:193:26: note: expanded from macro 'mutex_lock'
     193 | #define mutex_lock(lock) mutex_lock_nested(lock, 0)
         |                          ^
>> drivers/bluetooth/btintel_pcie.c:1111:4: warning: releasing mutex 'data->mac_access_lock' that was not held [-Wthread-safety-analysis]
    1111 |                         mutex_unlock(&data->mac_access_lock);
         |                         ^
   2 warnings generated.


vim +1053 drivers/bluetooth/btintel_pcie.c

50932a1567d614c Ajaykv  2026-11-11  1000  
68e0925f16c028a Ajaykv  2026-11-11  1001  static void
68e0925f16c028a Ajaykv  2026-11-11  1002  btintel_pcie_apply_yoyo_config_sets(struct btintel_pcie_data *data,
68e0925f16c028a Ajaykv  2026-11-11  1003  				    u32 time_point)
68e0925f16c028a Ajaykv  2026-11-11  1004  {
68e0925f16c028a Ajaykv  2026-11-11  1005  	struct btintel_pcie_yoyo_config_set *config_set;
68e0925f16c028a Ajaykv  2026-11-11  1006  	resource_size_t bar0_len;
68e0925f16c028a Ajaykv  2026-11-11  1007  	int ret;
68e0925f16c028a Ajaykv  2026-11-11  1008  	u32 i;
68e0925f16c028a Ajaykv  2026-11-11  1009  
68e0925f16c028a Ajaykv  2026-11-11  1010  	if (!data)
68e0925f16c028a Ajaykv  2026-11-11  1011  		return;
68e0925f16c028a Ajaykv  2026-11-11  1012  
68e0925f16c028a Ajaykv  2026-11-11  1013  	/* Get the length of PCI BAR0 */
68e0925f16c028a Ajaykv  2026-11-11  1014  	bar0_len = pci_resource_len(data->pdev, 0);
68e0925f16c028a Ajaykv  2026-11-11  1015  
68e0925f16c028a Ajaykv  2026-11-11  1016  	if (!data->yoyo.enabled)
68e0925f16c028a Ajaykv  2026-11-11  1017  		return;
68e0925f16c028a Ajaykv  2026-11-11  1018  
68e0925f16c028a Ajaykv  2026-11-11  1019  	list_for_each_entry(config_set, &data->yoyo.config_set_list, list) {
68e0925f16c028a Ajaykv  2026-11-11  1020  		u32 pair_addr, addr, value;
68e0925f16c028a Ajaykv  2026-11-11  1021  
68e0925f16c028a Ajaykv  2026-11-11  1022  		if (config_set->time_point != time_point)
68e0925f16c028a Ajaykv  2026-11-11  1023  			continue;
68e0925f16c028a Ajaykv  2026-11-11  1024  
68e0925f16c028a Ajaykv  2026-11-11  1025  		switch (config_set->config_set_type) {
68e0925f16c028a Ajaykv  2026-11-11  1026  		case BTINTEL_PCIE_CFGSET_CSR:
68e0925f16c028a Ajaykv  2026-11-11  1027  		case BTINTEL_PCIE_CFGSET_PERIPH_MAC:
68e0925f16c028a Ajaykv  2026-11-11  1028  		case BTINTEL_PCIE_CFGSET_DEVICE_MEM:
68e0925f16c028a Ajaykv  2026-11-11  1029  			break;
68e0925f16c028a Ajaykv  2026-11-11  1030  		default:
68e0925f16c028a Ajaykv  2026-11-11  1031  			BT_WARN("YoYo: unknown/unsupported config_set type %u, skipping",
68e0925f16c028a Ajaykv  2026-11-11  1032  				config_set->config_set_type);
68e0925f16c028a Ajaykv  2026-11-11  1033  			continue;
68e0925f16c028a Ajaykv  2026-11-11  1034  		}
68e0925f16c028a Ajaykv  2026-11-11  1035  
68e0925f16c028a Ajaykv  2026-11-11  1036  		if (config_set->config_set_type == BTINTEL_PCIE_CFGSET_PERIPH_MAC ||
68e0925f16c028a Ajaykv  2026-11-11  1037  		    config_set->config_set_type == BTINTEL_PCIE_CFGSET_DEVICE_MEM) {
1151389a60ccbe5 Kiran K 2026-11-23  1038  			mutex_lock(&data->mac_access_lock);
68e0925f16c028a Ajaykv  2026-11-11  1039  			ret = btintel_pcie_get_mac_access(data);
68e0925f16c028a Ajaykv  2026-11-11  1040  			if (ret) {
68e0925f16c028a Ajaykv  2026-11-11  1041  				BT_WARN("YoYo: MAC access failed for config set (%d), skipping",
68e0925f16c028a Ajaykv  2026-11-11  1042  					ret);
68e0925f16c028a Ajaykv  2026-11-11  1043  				/* get_mac_access() asserts MAC_ACCESS_REQ before it
68e0925f16c028a Ajaykv  2026-11-11  1044  				 * polls, and leaves it set on timeout; drop it so the
68e0925f16c028a Ajaykv  2026-11-11  1045  				 * request bit is not leaked.
68e0925f16c028a Ajaykv  2026-11-11  1046  				 */
68e0925f16c028a Ajaykv  2026-11-11  1047  				btintel_pcie_release_mac_access(data);
1151389a60ccbe5 Kiran K 2026-11-23  1048  				mutex_unlock(&data->mac_access_lock);
68e0925f16c028a Ajaykv  2026-11-11  1049  				continue;
68e0925f16c028a Ajaykv  2026-11-11  1050  			}
68e0925f16c028a Ajaykv  2026-11-11  1051  		}
68e0925f16c028a Ajaykv  2026-11-11  1052  
68e0925f16c028a Ajaykv  2026-11-11 @1053  		for (i = 0; i < config_set->num_pairs; i++) {
68e0925f16c028a Ajaykv  2026-11-11  1054  			pair_addr = get_unaligned_le32(&config_set->pairs[i].address);
68e0925f16c028a Ajaykv  2026-11-11  1055  
68e0925f16c028a Ajaykv  2026-11-11  1056  			/* Calculate the effective address by adding the address offset */
68e0925f16c028a Ajaykv  2026-11-11  1057  			if (check_add_overflow(pair_addr, config_set->addr_offset, &addr)) {
68e0925f16c028a Ajaykv  2026-11-11  1058  				BT_WARN("YoYo: config set address overflow (0x%08x + 0x%08x)",
68e0925f16c028a Ajaykv  2026-11-11  1059  					pair_addr, config_set->addr_offset);
68e0925f16c028a Ajaykv  2026-11-11  1060  				continue;
68e0925f16c028a Ajaykv  2026-11-11  1061  			}
68e0925f16c028a Ajaykv  2026-11-11  1062  
68e0925f16c028a Ajaykv  2026-11-11  1063  			value = get_unaligned_le32(&config_set->pairs[i].value);
68e0925f16c028a Ajaykv  2026-11-11  1064  
68e0925f16c028a Ajaykv  2026-11-11  1065  			switch (config_set->config_set_type) {
68e0925f16c028a Ajaykv  2026-11-11  1066  			/* Direct Address Access (CSR) */
68e0925f16c028a Ajaykv  2026-11-11  1067  			case BTINTEL_PCIE_CFGSET_CSR:
68e0925f16c028a Ajaykv  2026-11-11  1068  				/* Validate the effective address for CSR access (Direct Address)
68e0925f16c028a Ajaykv  2026-11-11  1069  				 * addr not aligned to 4 bytes or exceeds the BAR0 length
68e0925f16c028a Ajaykv  2026-11-11  1070  				 */
68e0925f16c028a Ajaykv  2026-11-11  1071  				if ((addr & (sizeof(u32) - 1)) ||
68e0925f16c028a Ajaykv  2026-11-11  1072  				    bar0_len < sizeof(u32) ||
68e0925f16c028a Ajaykv  2026-11-11  1073  				    addr > bar0_len - sizeof(u32)) {
68e0925f16c028a Ajaykv  2026-11-11  1074  					BT_WARN("YoYo: bad CSR address 0x%08x for BAR0 length %llu",
68e0925f16c028a Ajaykv  2026-11-11  1075  						addr, (unsigned long long)bar0_len);
68e0925f16c028a Ajaykv  2026-11-11  1076  					continue;
68e0925f16c028a Ajaykv  2026-11-11  1077  				}
68e0925f16c028a Ajaykv  2026-11-11  1078  
68e0925f16c028a Ajaykv  2026-11-11  1079  				BT_DBG("YoYo: CSR write [0x%08x] = 0x%08x", addr, value);
6df2b5e2ac4b8a1 Kiran K 2026-11-23  1080  				/* addr may be PRPH_DEV_* or HBUS_TARG_WRPTR */
6df2b5e2ac4b8a1 Kiran K 2026-11-23  1081  				spin_lock(&data->dev_mem_lock);
68e0925f16c028a Ajaykv  2026-11-11  1082  				btintel_pcie_wr_reg32(data, addr, value);
6df2b5e2ac4b8a1 Kiran K 2026-11-23  1083  				spin_unlock(&data->dev_mem_lock);
68e0925f16c028a Ajaykv  2026-11-11  1084  				break;
68e0925f16c028a Ajaykv  2026-11-11  1085  			/* Indirect Address Access (Peripheral MAC and Device Memory) */
68e0925f16c028a Ajaykv  2026-11-11  1086  			case BTINTEL_PCIE_CFGSET_PERIPH_MAC:
68e0925f16c028a Ajaykv  2026-11-11  1087  			case BTINTEL_PCIE_CFGSET_DEVICE_MEM:
68e0925f16c028a Ajaykv  2026-11-11  1088  				/* The config-set TLV comes from an untrusted external file;
68e0925f16c028a Ajaykv  2026-11-11  1089  				 * reject null or unaligned targets.
68e0925f16c028a Ajaykv  2026-11-11  1090  				 */
68e0925f16c028a Ajaykv  2026-11-11  1091  				if (!addr || (addr & (sizeof(u32) - 1))) {
68e0925f16c028a Ajaykv  2026-11-11  1092  					BT_WARN("YoYo: bad indirect address 0x%08x for type %u",
68e0925f16c028a Ajaykv  2026-11-11  1093  						addr, config_set->config_set_type);
68e0925f16c028a Ajaykv  2026-11-11  1094  					continue;
68e0925f16c028a Ajaykv  2026-11-11  1095  				}
68e0925f16c028a Ajaykv  2026-11-11  1096  
6df2b5e2ac4b8a1 Kiran K 2026-11-23  1097  				btintel_pcie_wr_dev_mem(data, addr, value);
68e0925f16c028a Ajaykv  2026-11-11  1098  				BT_DBG("YoYo: indirect write type %u addr 0x%08x value 0x%08x",
68e0925f16c028a Ajaykv  2026-11-11  1099  				       config_set->config_set_type, addr, value);
68e0925f16c028a Ajaykv  2026-11-11  1100  				break;
68e0925f16c028a Ajaykv  2026-11-11  1101  			default:
68e0925f16c028a Ajaykv  2026-11-11  1102  				BT_WARN("YoYo: unknown config_set type %u",
68e0925f16c028a Ajaykv  2026-11-11  1103  					config_set->config_set_type);
68e0925f16c028a Ajaykv  2026-11-11  1104  				break;
68e0925f16c028a Ajaykv  2026-11-11  1105  			}
68e0925f16c028a Ajaykv  2026-11-11  1106  		}
68e0925f16c028a Ajaykv  2026-11-11  1107  
68e0925f16c028a Ajaykv  2026-11-11  1108  		if (config_set->config_set_type == BTINTEL_PCIE_CFGSET_PERIPH_MAC ||
1151389a60ccbe5 Kiran K 2026-11-23  1109  		    config_set->config_set_type == BTINTEL_PCIE_CFGSET_DEVICE_MEM) {
68e0925f16c028a Ajaykv  2026-11-11  1110  			btintel_pcie_release_mac_access(data);
1151389a60ccbe5 Kiran K 2026-11-23 @1111  			mutex_unlock(&data->mac_access_lock);
1151389a60ccbe5 Kiran K 2026-11-23  1112  		}
68e0925f16c028a Ajaykv  2026-11-11  1113  	}
68e0925f16c028a Ajaykv  2026-11-11  1114  }
68e0925f16c028a Ajaykv  2026-11-11  1115  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-23 20:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23  6:55 [PATCH v1 1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt" Kiran K
2026-11-23  6:55 ` [PATCH v1 2/3] Bluetooth: btintel_pcie: Serialize doorbell writes and target reads Kiran K
2026-11-23  6:55 ` [PATCH v1 3/3] Bluetooth: btintel_pcie: Serialize MAC access requests Kiran K
2026-11-23 20:44   ` kernel test robot
2026-11-23 11:56 ` [v1,1/3] Revert "Bluetooth: btintel_pcie: sync mbox tlv parsing with GP0 alive interrupt" bluez.test.bot
2026-11-23 19:40 ` [PATCH v1 1/3] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox