Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v3 1/2] Bluetooth: btintel_pcie: Set only MAC_INIT in btintel_pcie_mac_init()
@ 2026-11-20  9:42 Kiran K
  2026-11-20  9:42 ` [PATCH v3 2/2] Bluetooth: btintel_pcie: Fold MAC_INIT into btintel_pcie_get_mac_access() Kiran K
  2026-11-20 13:30 ` [v3,1/2] Bluetooth: btintel_pcie: Set only MAC_INIT in btintel_pcie_mac_init() bluez.test.bot
  0 siblings, 2 replies; 3+ messages in thread
From: Kiran K @ 2026-11-20  9:42 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: chethan.tumkur.narayan, chandrashekar.devegowda, Kiran K,
	Paul Menzel

btintel_pcie_mac_init() is called prior to reading device memory via
target access. To acquire MAC access, only the MAC_INIT and
MAC_ACCESS_REQ bits in the function control register need to be
programmed.

Currently, btintel_pcie_mac_init() also modifies FUNC_ENA, FUNC_INIT,
BUS_MASTER_DISCON, and SW_RESET, which are not relevant to MAC access
(though doing so had no observed side effects). Leave those bits
untouched and only set MAC_INIT if it is not already set.

Fixes: b9465e6670a2 ("Bluetooth: btintel_pcie: Read hardware exception data")
Assisted-by: Copilot:Gemini 4 Argon
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Kiran K <kiran.k@intel.com>
---
changes in v2:
- Split the patch into two

changes in v3:
- No change

 drivers/bluetooth/btintel_pcie.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
index 12a2cca09d7d..9b75807065c0 100644
--- a/drivers/bluetooth/btintel_pcie.c
+++ b/drivers/bluetooth/btintel_pcie.c
@@ -874,14 +874,11 @@ static void btintel_pcie_mac_init(struct btintel_pcie_data *data)
 {
 	u32 reg;
 
-	/* Set MAC_INIT bit to start primary bootloader */
 	reg = btintel_pcie_rd_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_REG);
-	reg &= ~(BTINTEL_PCIE_CSR_FUNC_CTRL_FUNC_INIT |
-			BTINTEL_PCIE_CSR_FUNC_CTRL_BUS_MASTER_DISCON |
-			BTINTEL_PCIE_CSR_FUNC_CTRL_SW_RESET);
-	reg |= (BTINTEL_PCIE_CSR_FUNC_CTRL_FUNC_ENA |
-			BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_INIT);
-	btintel_pcie_wr_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_REG, reg);
+	if (!(reg & BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_INIT)) {
+		reg |= BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_INIT;
+		btintel_pcie_wr_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_REG, reg);
+	}
 }
 
 static int btintel_pcie_get_mac_access(struct btintel_pcie_data *data)
-- 
2.54.0


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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20  9:42 [PATCH v3 1/2] Bluetooth: btintel_pcie: Set only MAC_INIT in btintel_pcie_mac_init() Kiran K
2026-11-20  9:42 ` [PATCH v3 2/2] Bluetooth: btintel_pcie: Fold MAC_INIT into btintel_pcie_get_mac_access() Kiran K
2026-11-20 13:30 ` [v3,1/2] Bluetooth: btintel_pcie: Set only MAC_INIT in btintel_pcie_mac_init() bluez.test.bot

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