* [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
* [PATCH v3 2/2] Bluetooth: btintel_pcie: Fold MAC_INIT into btintel_pcie_get_mac_access()
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 ` 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
1 sibling, 0 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
MAC_INIT and MAC_ACCESS_REQ are the function control register bits
required to acquire MAC access for target reads. Currently, MAC_INIT is
set separately by btintel_pcie_mac_init(), which is called right before
btintel_pcie_read_device_mem() in btintel_parse_mbox_tlv(),
btintel_pcie_read_hwexp() and btintel_pcie_dump_fwtrigger_event().
btintel_pcie_dump_traces() also reads device memory under MAC access,
but it never called btintel_pcie_mac_init(), so MAC_INIT was missing on
the coredump path.
Fold the MAC_INIT handling into btintel_pcie_get_mac_access() so that
every user of MAC access programs MAC_INIT. Set MAC_INIT and
MAC_ACCESS_REQ with a single register write when either bit is not
already set. Drop btintel_pcie_mac_init() along with its three call
sites. This also fixes btintel_pcie_dump_traces().
Fixes: 07e6bddb54b4 ("Bluetooth: btintel_pcie: Add support for device coredump")
Assisted-by: Copilot:Gemini 4 Argon
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Kiran K <kiran.k@intel.com>
---
drivers/bluetooth/btintel_pcie.c | 28 ++++++----------------------
1 file changed, 6 insertions(+), 22 deletions(-)
changes in v2:
- split the patch into two
changes in v3:
- https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261103143759.555315-1-kiran.k%40intel.com
by update commit message and adding fix tag
- For pre-existing issue, patches will be submitted seperatly.
diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
index 9b75807065c0..55454900322b 100644
--- a/drivers/bluetooth/btintel_pcie.c
+++ b/drivers/bluetooth/btintel_pcie.c
@@ -870,28 +870,18 @@ static int btintel_pcie_reset_bt(struct btintel_pcie_data *data)
return reg == 0 ? 0 : -ENODEV;
}
-static void btintel_pcie_mac_init(struct btintel_pcie_data *data)
-{
- u32 reg;
-
- reg = btintel_pcie_rd_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_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)
{
- u32 reg;
+ u32 reg, val;
int retry = 15;
+ const u32 req = BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_INIT |
+ BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_ACCESS_REQ;
reg = btintel_pcie_rd_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_REG);
- if (!(reg & BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_ACCESS_REQ)) {
- reg |= BTINTEL_PCIE_CSR_FUNC_CTRL_MAC_ACCESS_REQ;
- btintel_pcie_wr_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_REG, reg);
- }
+ val = reg | req;
+ if (val != reg)
+ btintel_pcie_wr_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_REG, val);
do {
reg = btintel_pcie_rd_reg32(data, BTINTEL_PCIE_CSR_FUNC_CTRL_REG);
@@ -2045,8 +2035,6 @@ static int btintel_parse_mbox_tlv(struct btintel_pcie_data *data)
if (!buffer)
return -ENOMEM;
- btintel_pcie_mac_init(data);
-
err = btintel_pcie_read_device_mem(data, buffer, tbl_addr,
buffer_len);
if (err)
@@ -2737,8 +2725,6 @@ static void btintel_pcie_read_hwexp(struct btintel_pcie_data *data)
if (!buf)
goto exit_on_error;
- btintel_pcie_mac_init(data);
-
err = btintel_pcie_read_device_mem(data, buf, addr, len);
if (err)
goto exit_on_error;
@@ -2826,8 +2812,6 @@ static int btintel_pcie_dump_fwtrigger_event(struct btintel_pcie_data *data)
if (!buf)
return -ENOMEM;
- btintel_pcie_mac_init(data);
-
err = btintel_pcie_read_device_mem(data, buf, data->debug_evt_addr,
len);
if (err)
--
2.54.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [v3,1/2] Bluetooth: btintel_pcie: Set only MAC_INIT in btintel_pcie_mac_init()
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 ` bluez.test.bot
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-11-20 13:30 UTC (permalink / raw)
To: linux-bluetooth, kiran.k
[-- Attachment #1: Type: text/plain, Size: 2907 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/1217120/
---Test result---
Test Summary:
CheckPatch FAIL 1.31 seconds
VerifyFixes PASS 0.11 seconds
VerifySignedoff PASS 0.11 seconds
GitLint FAIL 0.59 seconds
SubjectPrefix PASS 0.20 seconds
BuildKernel PASS 28.62 seconds
CheckAllWarning PASS 32.32 seconds
CheckSparse PASS 34.57 seconds
BuildKernel32 PASS 28.85 seconds
CheckKernelLLVM PASS 28.62 seconds
TestRunnerSetup PASS 669.51 seconds
IncrementalBuild PASS 27.49 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[v3,1/2] Bluetooth: btintel_pcie: Set only MAC_INIT in btintel_pcie_mac_init()
WARNING: Non-standard signature: Assisted-by:
#109:
Assisted-by: Copilot:Gemini 4 Argon
ERROR: Unrecognized email address: 'Copilot:Gemini 4 Argon'
#109:
Assisted-by: Copilot:Gemini 4 Argon
total: 1 errors, 1 warnings, 18 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/15004865.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.
[v3,2/2] Bluetooth: btintel_pcie: Fold MAC_INIT into btintel_pcie_get_mac_access()
WARNING: Non-standard signature: Assisted-by:
#117:
Assisted-by: Copilot:Gemini 4 Argon
ERROR: Unrecognized email address: 'Copilot:Gemini 4 Argon'
#117:
Assisted-by: Copilot:Gemini 4 Argon
total: 1 errors, 1 warnings, 58 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/15004866.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:
[v3,2/2] Bluetooth: btintel_pcie: Fold MAC_INIT into btintel_pcie_get_mac_access()
1: T1 Title exceeds max length (82>80): "[v3,2/2] Bluetooth: btintel_pcie: Fold MAC_INIT into btintel_pcie_get_mac_access()"
https://github.com/bluez/bluetooth-next/pull/1167
---
Regards,
Linux Bluetooth
^ permalink raw reply [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