Skip to contentSkip to conversation

Bluetooth: btusb: Fix the patch for MT7920 the affected to MT7921

PATCH Applied Peter Tsao 5 participants 5 messages Apr 15, 2024 – May 8, 2024

Subsystems (3)
lore
Share & tools
lore

Peter Tsao

author
#0 lore raw

PATCH 1/1 Bluetooth: btusb: Fix the patch for MT7920 the affected to MT7921

Because both MT7920 and MT7921 use the same chip ID.
We use the 8th bit of fw_flavor to distingush MT7920. The original patch made a mistake to check whole fw_flavor, that makes the condition both true (dev_id == 0x7961 && fw_flavor), and makes MT7921 flow wrong.

In this patch, we correct the flow to get the 8th bit value for MT7920. And the patch is verified pass with both MT7920 and MT7921.

---
 drivers/bluetooth/btusb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/bluetooth/btusb.c +1 -0
index 4c0cc13adb47..8bede0a33566 100644
@@ -3123,6 +3123,7 @@ static int btusb_mtk_setup(struct hci_dev *hdev)
 			bt_dev_err(hdev, "Failed to get fw flavor (%d)", err);
 			return err;
 		}
+		fw_flavor = (fw_flavor & 0x00000080) >> 7;
 	}
 
 	mediatek = hci_get_priv(hdev);
Signature · 1 line
2.18.0
#1 lore raw

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/project/bluetooth/list/?series=844667

---Test result---

Test Summary:

CheckPatch                    PASS      0.60 seconds
GitLint                       PASS      0.28 seconds
SubjectPrefix                 PASS      0.10 seconds
BuildKernel                   PASS      30.59 seconds
CheckAllWarning               PASS      34.12 seconds
CheckSparse                   PASS      39.61 seconds
CheckSmatch                   FAIL      37.61 seconds
BuildKernel32                 PASS      30.35 seconds
TestRunnerSetup               PASS      541.29 seconds
TestRunner_l2cap-tester       PASS      20.82 seconds
TestRunner_iso-tester         PASS      33.08 seconds
TestRunner_bnep-tester        PASS      4.85 seconds
TestRunner_mgmt-tester        PASS      111.09 seconds
TestRunner_rfcomm-tester      PASS      7.57 seconds
TestRunner_sco-tester         PASS      15.20 seconds
TestRunner_ioctl-tester       PASS      7.91 seconds
TestRunner_mesh-tester        PASS      6.02 seconds
TestRunner_smp-tester         PASS      6.93 seconds
TestRunner_userchan-tester    PASS      5.04 seconds
IncrementalBuild              PASS      28.40 seconds

Details
##############################
Test: CheckSmatch - FAIL
Desc: Run smatch tool with source
Output:

Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: net/bluetooth/hci_core.o] Error 139 make[4]: *** Deleting file 'net/bluetooth/hci_core.o'
make[3]: *** [scripts/Makefile.build:485: net/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:485: net] Error 2
make[2]: *** Waiting for unfinished jobs....
Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: drivers/bluetooth/bcm203x.o] Error 139 make[4]: *** Deleting file 'drivers/bluetooth/bcm203x.o'
make[4]: *** Waiting for unfinished jobs....
Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: drivers/bluetooth/bpa10x.o] Error 139 make[4]: *** Deleting file 'drivers/bluetooth/bpa10x.o'
make[3]: *** [scripts/Makefile.build:485: drivers/bluetooth] Error 2 make[2]: *** [scripts/Makefile.build:485: drivers] Error 2
make[1]: *** [/github/workspace/src/src/Makefile:1919: .] Error 2
make: *** [Makefile:240: __sub-make] Error 2

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Peter Tsao
This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 10 lines · On Mon, 15 Apr 2024 22:19:22 +0800 you wrote:

Because both MT7920 and MT7921 use the same chip ID.
We use the 8th bit of fw_flavor to distingush MT7920. The original patch made a mistake to check whole fw_flavor, that makes the condition both true (dev_id == 0x7961 && fw_flavor), and makes MT7921 flow wrong.

In this patch, we correct the flow to get the 8th bit value for MT7920. And the patch is verified pass with both MT7920 and MT7921.

[...]

Here is the summary with links:
- Bluetooth: btusb: Fix the patch for MT7920 the affected to MT7921

    https://git.kernel.org/bluetooth/bluetooth-next/c/263296438807

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#3 lore raw
Quoted 11 lines · On 16.04.24 17:10, [email protected] wrote:

This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 6 lines · On Mon, 15 Apr 2024 22:19:22 +0800 you wrote:

Because both MT7920 and MT7921 use the same chip ID.
We use the 8th bit of fw_flavor to distingush MT7920. The original patch made a mistake to check whole fw_flavor, that makes the condition both true (dev_id == 0x7961 && fw_flavor), and makes MT7921 flow wrong.

Quoted 8 lines
Quoted 4 lines

In this patch, we correct the flow to get the 8th bit value for MT7920. And the patch is verified pass with both MT7920 and MT7921.

[...]

Here is the summary with links:
- Bluetooth: btusb: Fix the patch for MT7920 the affected to MT7921

    https://git.kernel.org/bluetooth/bluetooth-next/c/263296438807

Hi! 6.9 is only days close and this is fixing a 6.9 regression, so allow me to quickly ask: do you still plan to submit this for mainline merge soon? Or did you already and I just missed it? Ciao, Thorsten

#4 lore raw

Hi,

Quoted 18 lines · Linux regression tracking (Thorsten Leemhuis)
Quoted 16 lines · On 16.04.24 17:10, [email protected] wrote:

This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 10 lines · On Mon, 15 Apr 2024 22:19:22 +0800 you wrote:

Because both MT7920 and MT7921 use the same chip ID.
We use the 8th bit of fw_flavor to distingush MT7920. The original patch made a mistake to check whole fw_flavor, that makes the condition both true (dev_id == 0x7961 && fw_flavor), and makes MT7921 flow wrong.

In this patch, we correct the flow to get the 8th bit value for MT7920. And the patch is verified pass with both MT7920 and MT7921.

[...]

Quoted 7 lines
Quoted 3 lines

Here is the summary with links:
- Bluetooth: btusb: Fix the patch for MT7920 the affected to MT7921

    https://git.kernel.org/bluetooth/bluetooth-next/c/263296438807

Hi! 6.9 is only days close and this is fixing a 6.9 regression, so allow me to quickly ask: do you still plan to submit this for mainline merge soon? Or did you already and I just missed it? Ciao, Thorsten

It wasn't marked with Fixes or stable though which is what I usually use as an indicator to backport.

Signature · 1 line
Luiz Augusto von Dentz