Bluetooth: btintel_pcie: Set only MAC_INIT in btintel_pcie_mac_init()
PATCH v3 1/2 Bluetooth: btintel_pcie: Set only MAC_INIT in btintel_pcie_mac_init()
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.
---
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(-)
drivers/bluetooth/btintel_pcie.c +4 -7
@@ -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)
Signature · 1 line
2.54.0
PATCH v3 2/2 Bluetooth: btintel_pcie: Fold MAC_INIT into btintel_pcie_get_mac_access()
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().
--- 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.
drivers/bluetooth/btintel_pcie.c +6 -22
@@ -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)
Signature · 1 line
2.54.0
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:
ERROR: Unrecognized email address: 'Copilot:Gemini 4 Argon' #109:
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:
ERROR: Unrecognized email address: 'Copilot:Gemini 4 Argon' #117:
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
This series was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:
Hello:
This series was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:
Quoted 11 lines · On Fri, 20 Nov 2026 15:12:48 +0530 you wrote:
btintel_pcie_mac_init()is called prior to reading device memory via target access. To acquire MAC access, only theMAC_INITandMAC_ACCESS_REQbits in the function control register need to be programmed.Currently,
btintel_pcie_mac_init()also modifiesFUNC_ENA,FUNC_INIT,BUS_MASTER_DISCON, andSW_RESET, which are not relevant to MAC access (though doing so had no observed side effects). Leave those bits untouched and only setMAC_INITif it is not already set.[...]
Here is the summary with links:
- [v3,1/2] Bluetooth: btintel_pcie: Set only MAC_INIT in btintel_pcie_mac_init()
https://git.kernel.org/bluetooth/bluetooth-next/c/b535edbf5178 - [v3,2/2] Bluetooth: btintel_pcie: Fold MAC_INIT into btintel_pcie_get_mac_access() https://git.kernel.org/bluetooth/bluetooth-next/c/4fe38719e673
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html