2024-06-06 20:46:57

by Timo Schröder

[permalink] [raw]
Subject: Bluetooth Kernel Bug: After connecting either HFP/HSP or A2DP is not available (Regression in 6.9.3, 6.8.12)

Hallo,
on my two notebooks, one with Ubuntu (Mainline Kernel 6.9.3, bluez
5.7.2) and the other one with Manjaro (6.9.3, bluez 5.7.6) I'm having
problems with my Sony WH-1000XM3 and Shure BT1. Either A2DP or HFP/HSP
is not available after the connection has been established after a
reboot or a reconnection. It's reproducible that with the WH-1000XM3
the A2DP profiles are missing and with the Shure BT1 HFP/HSP profiles
are missing. It also takes longer than usual to connect and I have a
log message in the journal:

Jun 06 16:28:10 liebig bluetoothd[854]:
profiles/audio/avdtp.c:cancel_request() Discover: Connection timed out
(110)

When I disable and re-enable bluetooth (while the Headsets are still
on) and trigger a reconnect from the notebooks, A2DP and HFP/HSP
Profiles are available again.

I also tested it with 6.8.12 and it's the same problem. 6.8.11 and
6.9.2 don't have the problem.
So I did a bisection. After reverting commit
af1d425b6dc67cd67809f835dd7afb6be4d43e03 "Bluetooth: HCI: Remove
HCI_AMP support" for 6.9.3 it's working again without problems.

Let me know if you need anything from me.

Best regards,
Timo


Attachments:
inxi_lifebookE754_ubuntu (9.86 kB)
inxi_thinkpadP14v_manjaro (17.06 kB)
Download all attachments

2024-06-06 21:24:50

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Bluetooth Kernel Bug: After connecting either HFP/HSP or A2DP is not available (Regression in 6.9.3, 6.8.12)

Hi Timo,

On Thu, Jun 6, 2024 at 4:46 PM Timo Schröder <[email protected]> wrote:
>
> Hallo,
> on my two notebooks, one with Ubuntu (Mainline Kernel 6.9.3, bluez
> 5.7.2) and the other one with Manjaro (6.9.3, bluez 5.7.6) I'm having
> problems with my Sony WH-1000XM3 and Shure BT1. Either A2DP or HFP/HSP
> is not available after the connection has been established after a
> reboot or a reconnection. It's reproducible that with the WH-1000XM3
> the A2DP profiles are missing and with the Shure BT1 HFP/HSP profiles
> are missing. It also takes longer than usual to connect and I have a
> log message in the journal:
>
> Jun 06 16:28:10 liebig bluetoothd[854]:
> profiles/audio/avdtp.c:cancel_request() Discover: Connection timed out
> (110)
>
> When I disable and re-enable bluetooth (while the Headsets are still
> on) and trigger a reconnect from the notebooks, A2DP and HFP/HSP
> Profiles are available again.
>
> I also tested it with 6.8.12 and it's the same problem. 6.8.11 and
> 6.9.2 don't have the problem.
> So I did a bisection. After reverting commit
> af1d425b6dc67cd67809f835dd7afb6be4d43e03 "Bluetooth: HCI: Remove
> HCI_AMP support" for 6.9.3 it's working again without problems.
>
> Let me know if you need anything from me.

Wait what, that patch has nothing to do with any of these profiles not
really sure how that would cause a regression really, are you sure you
don't have actual connection timeout happening at the link layer and
that by some chance didn't happen when running with HCI_AMP reverted?

I'd be surprised that HCI_AMP has any effect in most controllers
anyway, only virtual controllers was using that afaik.


--
Luiz Augusto von Dentz

2024-06-07 03:56:11

by Paul Menzel

[permalink] [raw]
Subject: Re: Bluetooth Kernel Bug: After connecting either HFP/HSP or A2DP is not available (Regression in 6.9.3, 6.8.12)

#regzbot ^introduced: af1d425b6dc6


Dear Timo,


Am 06.06.24 um 22:46 schrieb Timo Schröder:

> on my two notebooks, one with Ubuntu (Mainline Kernel 6.9.3, bluez
> 5.7.2) and the other one with Manjaro (6.9.3, bluez 5.7.6) I'm having
> problems with my Sony WH-1000XM3 and Shure BT1. Either A2DP or HFP/HSP
> is not available after the connection has been established after a
> reboot or a reconnection. It's reproducible that with the WH-1000XM3
> the A2DP profiles are missing and with the Shure BT1 HFP/HSP profiles
> are missing. It also takes longer than usual to connect and I have a
> log message in the journal:
>
> Jun 06 16:28:10 liebig bluetoothd[854]: profiles/audio/avdtp.c:cancel_request() Discover: Connection timed out (110)
>
> When I disable and re-enable bluetooth (while the Headsets are still
> on) and trigger a reconnect from the notebooks, A2DP and HFP/HSP
> Profiles are available again.
>
> I also tested it with 6.8.12 and it's the same problem. 6.8.11 and
> 6.9.2 don't have the problem.
> So I did a bisection. After reverting commit
> af1d425b6dc67cd67809f835dd7afb6be4d43e03 "Bluetooth: HCI: Remove
> HCI_AMP support" for 6.9.3 it's working again without problems.

Thank you for bisecting the issue.

> Let me know if you need anything from me.

If you could test the master branch or bluetooth-next, and, if
reproducible, also with the upstream commit
84a4bb6548a29326564f0e659fb8064503ecc1c7 reverted, that’d be great.


Kind regards,

Paul

2024-06-07 06:10:43

by Thorsten Leemhuis

[permalink] [raw]
Subject: Re: Bluetooth Kernel Bug: After connecting either HFP/HSP or A2DP is not available (Regression in 6.9.3, 6.8.12)

On 06.06.24 23:23, Luiz Augusto von Dentz wrote:
> On Thu, Jun 6, 2024 at 4:46 PM Timo Schröder <[email protected]> wrote:
>> on my two notebooks, one with Ubuntu (Mainline Kernel 6.9.3, bluez
>> 5.7.2) and the other one with Manjaro (6.9.3, bluez 5.7.6) I'm having
>> problems with my Sony WH-1000XM3 and Shure BT1. Either A2DP or HFP/HSP
>> is not available after the connection has been established after a
>> reboot or a reconnection. It's reproducible that with the WH-1000XM3
>> the A2DP profiles are missing and with the Shure BT1 HFP/HSP profiles
>> are missing. It also takes longer than usual to connect and I have a
>> log message in the journal:
>>
>> Jun 06 16:28:10 liebig bluetoothd[854]:
>> profiles/audio/avdtp.c:cancel_request() Discover: Connection timed out
>> (110)
>>
>> When I disable and re-enable bluetooth (while the Headsets are still
>> on) and trigger a reconnect from the notebooks, A2DP and HFP/HSP
>> Profiles are available again.
>>
>> I also tested it with 6.8.12 and it's the same problem. 6.8.11 and
>> 6.9.2 don't have the problem.
>> So I did a bisection. After reverting commit
>> af1d425b6dc67cd67809f835dd7afb6be4d43e03 "Bluetooth: HCI: Remove
>> HCI_AMP support" for 6.9.3 it's working again without problems.
>>
>> Let me know if you need anything from me.
>
> Wait what, that patch has nothing to do with any of these profiles not
> really sure how that would cause a regression really, are you sure you
> don't have actual connection timeout happening at the link layer and
> that by some chance didn't happen when running with HCI_AMP reverted?
>
> I'd be surprised that HCI_AMP has any effect in most controllers
> anyway, only virtual controllers was using that afaik.

Stupid question from a bystander without knowledge in the field (so feel
free to ignore this): is that patch maybe causing trouble because it has
some hidden dependency on a earlier change that was not backported to
6.9.y?

Timo, to rule that out (and it's good to know in general, too) it would
be good to known if current mainline (e.g. 6.10-rc) is affected as well.

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
--
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
If I did something stupid, please tell me, as explained on that page.

2024-06-07 21:43:36

by Timo Schröder

[permalink] [raw]
Subject: Re: Bluetooth Kernel Bug: After connecting either HFP/HSP or A2DP is not available (Regression in 6.9.3, 6.8.12)

Am Fr., 7. Juni 2024 um 08:10 Uhr schrieb Linux regression tracking
(Thorsten Leemhuis) <[email protected]>:
>
> On 06.06.24 23:23, Luiz Augusto von Dentz wrote:
> > On Thu, Jun 6, 2024 at 4:46 PM Timo Schröder <[email protected]> wrote:
> >> on my two notebooks, one with Ubuntu (Mainline Kernel 6.9.3, bluez
> >> 5.7.2) and the other one with Manjaro (6.9.3, bluez 5.7.6) I'm having
> >> problems with my Sony WH-1000XM3 and Shure BT1. Either A2DP or HFP/HSP
> >> is not available after the connection has been established after a
> >> reboot or a reconnection. It's reproducible that with the WH-1000XM3
> >> the A2DP profiles are missing and with the Shure BT1 HFP/HSP profiles
> >> are missing. It also takes longer than usual to connect and I have a
> >> log message in the journal:
> >>
> >> Jun 06 16:28:10 liebig bluetoothd[854]:
> >> profiles/audio/avdtp.c:cancel_request() Discover: Connection timed out
> >> (110)
> >>
> >> When I disable and re-enable bluetooth (while the Headsets are still
> >> on) and trigger a reconnect from the notebooks, A2DP and HFP/HSP
> >> Profiles are available again.
> >>
> >> I also tested it with 6.8.12 and it's the same problem. 6.8.11 and
> >> 6.9.2 don't have the problem.
> >> So I did a bisection. After reverting commit
> >> af1d425b6dc67cd67809f835dd7afb6be4d43e03 "Bluetooth: HCI: Remove
> >> HCI_AMP support" for 6.9.3 it's working again without problems.
> >>
> >> Let me know if you need anything from me.
> >
> > Wait what, that patch has nothing to do with any of these profiles not
> > really sure how that would cause a regression really, are you sure you
> > don't have actual connection timeout happening at the link layer and
> > that by some chance didn't happen when running with HCI_AMP reverted?
> >
> > I'd be surprised that HCI_AMP has any effect in most controllers
> > anyway, only virtual controllers was using that afaik.
>
> Stupid question from a bystander without knowledge in the field (so feel
> free to ignore this): is that patch maybe causing trouble because it has
> some hidden dependency on a earlier change that was not backported to
> 6.9.y?
>
> Timo, to rule that out (and it's good to know in general, too) it would
> be good to known if current mainline (e.g. 6.10-rc) is affected as well.
>
> Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
> --
> Everything you wanna know about Linux kernel regression tracking:
> https://linux-regtracking.leemhuis.info/about/#tldr
> If I did something stupid, please tell me, as explained on that page.

Hallo Thorsten, I tried with 6.10-rc2 and it's the same problem on my systems.

2024-06-07 22:02:33

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Bluetooth Kernel Bug: After connecting either HFP/HSP or A2DP is not available (Regression in 6.9.3, 6.8.12)

Hi Timo,

On Fri, Jun 7, 2024 at 5:43 PM Timo Schröder <[email protected]> wrote:
>
> Am Fr., 7. Juni 2024 um 08:10 Uhr schrieb Linux regression tracking
> (Thorsten Leemhuis) <[email protected]>:
> >
> > On 06.06.24 23:23, Luiz Augusto von Dentz wrote:
> > > On Thu, Jun 6, 2024 at 4:46 PM Timo Schröder <[email protected]> wrote:
> > >> on my two notebooks, one with Ubuntu (Mainline Kernel 6.9.3, bluez
> > >> 5.7.2) and the other one with Manjaro (6.9.3, bluez 5.7.6) I'm having
> > >> problems with my Sony WH-1000XM3 and Shure BT1. Either A2DP or HFP/HSP
> > >> is not available after the connection has been established after a
> > >> reboot or a reconnection. It's reproducible that with the WH-1000XM3
> > >> the A2DP profiles are missing and with the Shure BT1 HFP/HSP profiles
> > >> are missing. It also takes longer than usual to connect and I have a
> > >> log message in the journal:
> > >>
> > >> Jun 06 16:28:10 liebig bluetoothd[854]:
> > >> profiles/audio/avdtp.c:cancel_request() Discover: Connection timed out
> > >> (110)
> > >>
> > >> When I disable and re-enable bluetooth (while the Headsets are still
> > >> on) and trigger a reconnect from the notebooks, A2DP and HFP/HSP
> > >> Profiles are available again.
> > >>
> > >> I also tested it with 6.8.12 and it's the same problem. 6.8.11 and
> > >> 6.9.2 don't have the problem.
> > >> So I did a bisection. After reverting commit
> > >> af1d425b6dc67cd67809f835dd7afb6be4d43e03 "Bluetooth: HCI: Remove
> > >> HCI_AMP support" for 6.9.3 it's working again without problems.
> > >>
> > >> Let me know if you need anything from me.
> > >
> > > Wait what, that patch has nothing to do with any of these profiles not
> > > really sure how that would cause a regression really, are you sure you
> > > don't have actual connection timeout happening at the link layer and
> > > that by some chance didn't happen when running with HCI_AMP reverted?
> > >
> > > I'd be surprised that HCI_AMP has any effect in most controllers
> > > anyway, only virtual controllers was using that afaik.
> >
> > Stupid question from a bystander without knowledge in the field (so feel
> > free to ignore this): is that patch maybe causing trouble because it has
> > some hidden dependency on a earlier change that was not backported to
> > 6.9.y?
> >
> > Timo, to rule that out (and it's good to know in general, too) it would
> > be good to known if current mainline (e.g. 6.10-rc) is affected as well.
> >
> > Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
> > --
> > Everything you wanna know about Linux kernel regression tracking:
> > https://linux-regtracking.leemhuis.info/about/#tldr
> > If I did something stupid, please tell me, as explained on that page.
>
> Hallo Thorsten, I tried with 6.10-rc2 and it's the same problem on my systems.

Could you please create a issue at
https://github.com/bluez/bluez/issues and then attach btmon traces and
bluetoothd? This is a really weird regression, also is your system
using pulseaudio or pipewire?

--
Luiz Augusto von Dentz

2024-06-08 12:24:07

by Timo Schröder

[permalink] [raw]
Subject: Re: Bluetooth Kernel Bug: After connecting either HFP/HSP or A2DP is not available (Regression in 6.9.3, 6.8.12)

Hi Paul,
I built kernels with bluetooth-next and it's the same problem on both
systems. After reverting 84a4bb6548a29326564f0e659fb806
4503ecc1c7 the
problem is gone.

Best regards, Timo

Am Fr., 7. Juni 2024 um 05:55 Uhr schrieb Paul Menzel <[email protected]>:
>
> #regzbot ^introduced: af1d425b6dc6
>
>
> Dear Timo,
>
>
> Am 06.06.24 um 22:46 schrieb Timo Schröder:
>
> > on my two notebooks, one with Ubuntu (Mainline Kernel 6.9.3, bluez
> > 5.7.2) and the other one with Manjaro (6.9.3, bluez 5.7.6) I'm having
> > problems with my Sony WH-1000XM3 and Shure BT1. Either A2DP or HFP/HSP
> > is not available after the connection has been established after a
> > reboot or a reconnection. It's reproducible that with the WH-1000XM3
> > the A2DP profiles are missing and with the Shure BT1 HFP/HSP profiles
> > are missing. It also takes longer than usual to connect and I have a
> > log message in the journal:
> >
> > Jun 06 16:28:10 liebig bluetoothd[854]: profiles/audio/avdtp.c:cancel_request() Discover: Connection timed out (110)
> >
> > When I disable and re-enable bluetooth (while the Headsets are still
> > on) and trigger a reconnect from the notebooks, A2DP and HFP/HSP
> > Profiles are available again.
> >
> > I also tested it with 6.8.12 and it's the same problem. 6.8.11 and
> > 6.9.2 don't have the problem.
> > So I did a bisection. After reverting commit
> > af1d425b6dc67cd67809f835dd7afb6be4d43e03 "Bluetooth: HCI: Remove
> > HCI_AMP support" for 6.9.3 it's working again without problems.
>
> Thank you for bisecting the issue.
>
> > Let me know if you need anything from me.
>
> If you could test the master branch or bluetooth-next, and, if
> reproducible, also with the upstream commit
> 84a4bb6548a29326564f0e659fb8064503ecc1c7 reverted, that’d be great.
>
>
> Kind regards,
>
> Paul

2024-06-08 12:25:10

by Timo Schröder

[permalink] [raw]
Subject: Re: Bluetooth Kernel Bug: After connecting either HFP/HSP or A2DP is not available (Regression in 6.9.3, 6.8.12)

Hi Luiz,
as requested I opened an issue. Please see:
https://github.com/bluez/bluez/issues/865

Best regards,
Timo

Am Sa., 8. Juni 2024 um 00:01 Uhr schrieb Luiz Augusto von Dentz
<[email protected]>:
>
> Hi Timo,
>
> On Fri, Jun 7, 2024 at 5:43 PM Timo Schröder <[email protected]> wrote:
> >
> > Am Fr., 7. Juni 2024 um 08:10 Uhr schrieb Linux regression tracking
> > (Thorsten Leemhuis) <[email protected]>:
> > >
> > > On 06.06.24 23:23, Luiz Augusto von Dentz wrote:
> > > > On Thu, Jun 6, 2024 at 4:46 PM Timo Schröder <[email protected]> wrote:
> > > >> on my two notebooks, one with Ubuntu (Mainline Kernel 6.9.3, bluez
> > > >> 5.7.2) and the other one with Manjaro (6.9.3, bluez 5.7.6) I'm having
> > > >> problems with my Sony WH-1000XM3 and Shure BT1. Either A2DP or HFP/HSP
> > > >> is not available after the connection has been established after a
> > > >> reboot or a reconnection. It's reproducible that with the WH-1000XM3
> > > >> the A2DP profiles are missing and with the Shure BT1 HFP/HSP profiles
> > > >> are missing. It also takes longer than usual to connect and I have a
> > > >> log message in the journal:
> > > >>
> > > >> Jun 06 16:28:10 liebig bluetoothd[854]:
> > > >> profiles/audio/avdtp.c:cancel_request() Discover: Connection timed out
> > > >> (110)
> > > >>
> > > >> When I disable and re-enable bluetooth (while the Headsets are still
> > > >> on) and trigger a reconnect from the notebooks, A2DP and HFP/HSP
> > > >> Profiles are available again.
> > > >>
> > > >> I also tested it with 6.8.12 and it's the same problem. 6.8.11 and
> > > >> 6.9.2 don't have the problem.
> > > >> So I did a bisection. After reverting commit
> > > >> af1d425b6dc67cd67809f835dd7afb6be4d43e03 "Bluetooth: HCI: Remove
> > > >> HCI_AMP support" for 6.9.3 it's working again without problems.
> > > >>
> > > >> Let me know if you need anything from me.
> > > >
> > > > Wait what, that patch has nothing to do with any of these profiles not
> > > > really sure how that would cause a regression really, are you sure you
> > > > don't have actual connection timeout happening at the link layer and
> > > > that by some chance didn't happen when running with HCI_AMP reverted?
> > > >
> > > > I'd be surprised that HCI_AMP has any effect in most controllers
> > > > anyway, only virtual controllers was using that afaik.
> > >
> > > Stupid question from a bystander without knowledge in the field (so feel
> > > free to ignore this): is that patch maybe causing trouble because it has
> > > some hidden dependency on a earlier change that was not backported to
> > > 6.9.y?
> > >
> > > Timo, to rule that out (and it's good to know in general, too) it would
> > > be good to known if current mainline (e.g. 6.10-rc) is affected as well.
> > >
> > > Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
> > > --
> > > Everything you wanna know about Linux kernel regression tracking:
> > > https://linux-regtracking.leemhuis.info/about/#tldr
> > > If I did something stupid, please tell me, as explained on that page.
> >
> > Hallo Thorsten, I tried with 6.10-rc2 and it's the same problem on my systems.
>
> Could you please create a issue at
> https://github.com/bluez/bluez/issues and then attach btmon traces and
> bluetoothd? This is a really weird regression, also is your system
> using pulseaudio or pipewire?
>
> --
> Luiz Augusto von Dentz

2024-06-08 22:02:26

by Pauli Virtanen

[permalink] [raw]
Subject: [PATCH] Bluetooth: fix connection setup in l2cap_connect

The amp_id argument of l2cap_connect() was removed in
commit 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")

It was always called with amp_id == 0, i.e. AMP_ID_BREDR == 0x00 (ie.
non-AMP controller). In the above commit, the code path for amp_id != 0
was preserved, although it should have used the amp_id == 0 one.

Restore the previous behavior of the non-AMP code path, to fix problems
with L2CAP connections.

Fixes: 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
Signed-off-by: Pauli Virtanen <[email protected]>
---

Notes:
Tried proofreading the commit, and this part seemed suspicious.
Can you try if this fixes the problem?

net/bluetooth/l2cap_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index c49e0d4b3c0d..fc633feb12a1 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4016,8 +4016,8 @@ static void l2cap_connect(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd,
status = L2CAP_CS_NO_INFO;
}
} else {
- l2cap_state_change(chan, BT_CONNECT2);
- result = L2CAP_CR_PEND;
+ l2cap_state_change(chan, BT_CONFIG);
+ result = L2CAP_CR_SUCCESS;
status = L2CAP_CS_AUTHEN_PEND;
}
} else {
--
2.45.2


2024-06-08 22:31:18

by bluez.test.bot

[permalink] [raw]
Subject: RE: Bluetooth: fix connection setup in l2cap_connect

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=860197

---Test result---

Test Summary:
CheckPatch PASS 0.67 seconds
GitLint PASS 0.32 seconds
SubjectPrefix PASS 0.12 seconds
BuildKernel PASS 29.74 seconds
CheckAllWarning PASS 32.41 seconds
CheckSparse PASS 37.63 seconds
CheckSmatch FAIL 34.89 seconds
BuildKernel32 PASS 28.75 seconds
TestRunnerSetup PASS 521.46 seconds
TestRunner_l2cap-tester PASS 18.29 seconds
TestRunner_iso-tester FAIL 33.17 seconds
TestRunner_bnep-tester PASS 4.72 seconds
TestRunner_mgmt-tester PASS 111.25 seconds
TestRunner_rfcomm-tester PASS 7.33 seconds
TestRunner_sco-tester PASS 14.90 seconds
TestRunner_ioctl-tester PASS 7.75 seconds
TestRunner_mesh-tester PASS 5.83 seconds
TestRunner_smp-tester PASS 6.81 seconds
TestRunner_userchan-tester PASS 4.92 seconds
IncrementalBuild PASS 27.66 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....
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
##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:
Total: 122, Passed: 117 (95.9%), Failed: 1, Not Run: 4

Failed Test Cases
ISO Connect2 Suspend - Success Failed 4.232 seconds


---
Regards,
Linux Bluetooth

2024-06-09 12:50:08

by Timo Schröder

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: fix connection setup in l2cap_connect

Hi Pauli,

unfortunately it doesn't fix the issue. I'm still experiencing the
same behaviour. I attached btmon traces and bluetoothd log.

Best regards,
Timo

Am So., 9. Juni 2024 um 00:02 Uhr schrieb Pauli Virtanen <[email protected]>:
>
> The amp_id argument of l2cap_connect() was removed in
> commit 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
>
> It was always called with amp_id == 0, i.e. AMP_ID_BREDR == 0x00 (ie.
> non-AMP controller). In the above commit, the code path for amp_id != 0
> was preserved, although it should have used the amp_id == 0 one.
>
> Restore the previous behavior of the non-AMP code path, to fix problems
> with L2CAP connections.
>
> Fixes: 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
> Signed-off-by: Pauli Virtanen <[email protected]>
> ---
>
> Notes:
> Tried proofreading the commit, and this part seemed suspicious.
> Can you try if this fixes the problem?
>
> net/bluetooth/l2cap_core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index c49e0d4b3c0d..fc633feb12a1 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -4016,8 +4016,8 @@ static void l2cap_connect(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd,
> status = L2CAP_CS_NO_INFO;
> }
> } else {
> - l2cap_state_change(chan, BT_CONNECT2);
> - result = L2CAP_CR_PEND;
> + l2cap_state_change(chan, BT_CONFIG);
> + result = L2CAP_CR_SUCCESS;
> status = L2CAP_CS_AUTHEN_PEND;
> }
> } else {
> --
> 2.45.2
>


Attachments:
btmon_WH-1000XM3_patch1 (222.87 kB)
bluetoothd_WH-1000XM3_patch1 (110.53 kB)
Download all attachments

2024-06-09 15:01:45

by Pauli Virtanen

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: fix connection setup in l2cap_connect

Hi,

su, 2024-06-09 kello 14:49 +0200, Timo Schröder kirjoitti:
> Hi Pauli,
>
> unfortunately it doesn't fix the issue. I'm still experiencing the
> same behaviour. I attached btmon traces and bluetoothd log.

Right, sorry, I see now the patch is wrong and did it for the wrong if
branch... I'll send a v2.

Pauli

>
> Best regards,
> Timo
>
> Am So., 9. Juni 2024 um 00:02 Uhr schrieb Pauli Virtanen <[email protected]>:
> >
> > The amp_id argument of l2cap_connect() was removed in
> > commit 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
> >
> > It was always called with amp_id == 0, i.e. AMP_ID_BREDR == 0x00 (ie.
> > non-AMP controller). In the above commit, the code path for amp_id != 0
> > was preserved, although it should have used the amp_id == 0 one.
> >
> > Restore the previous behavior of the non-AMP code path, to fix problems
> > with L2CAP connections.
> >
> > Fixes: 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
> > Signed-off-by: Pauli Virtanen <[email protected]>
> > ---
> >
> > Notes:
> > Tried proofreading the commit, and this part seemed suspicious.
> > Can you try if this fixes the problem?
> >
> > net/bluetooth/l2cap_core.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> > index c49e0d4b3c0d..fc633feb12a1 100644
> > --- a/net/bluetooth/l2cap_core.c
> > +++ b/net/bluetooth/l2cap_core.c
> > @@ -4016,8 +4016,8 @@ static void l2cap_connect(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd,
> > status = L2CAP_CS_NO_INFO;
> > }
> > } else {
> > - l2cap_state_change(chan, BT_CONNECT2);
> > - result = L2CAP_CR_PEND;
> > + l2cap_state_change(chan, BT_CONFIG);
> > + result = L2CAP_CR_SUCCESS;
> > status = L2CAP_CS_AUTHEN_PEND;
> > }
> > } else {
> > --
> > 2.45.2
> >


2024-06-09 15:06:41

by Pauli Virtanen

[permalink] [raw]
Subject: [PATCH v2] Bluetooth: fix connection setup in l2cap_connect

The amp_id argument of l2cap_connect() was removed in
commit 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")

It was always called with amp_id == 0, i.e. AMP_ID_BREDR == 0x00 (ie.
non-AMP controller). In the above commit, the code path for amp_id != 0
was preserved, although it should have used the amp_id == 0 one.

Restore the previous behavior of the non-AMP code path, to fix problems
with L2CAP connections.

Fixes: 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
Signed-off-by: Pauli Virtanen <[email protected]>
---

Notes:
v2: do the change in the actually right if branch

Tried proofreading the commit, and this part seemed suspicious.
Can you try if this fixes the problem?

net/bluetooth/l2cap_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index c49e0d4b3c0d..aed025734d04 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4011,8 +4011,8 @@ static void l2cap_connect(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd,
status = L2CAP_CS_AUTHOR_PEND;
chan->ops->defer(chan);
} else {
- l2cap_state_change(chan, BT_CONNECT2);
- result = L2CAP_CR_PEND;
+ l2cap_state_change(chan, BT_CONFIG);
+ result = L2CAP_CR_SUCCESS;
status = L2CAP_CS_NO_INFO;
}
} else {
--
2.45.2


2024-06-09 15:32:15

by bluez.test.bot

[permalink] [raw]
Subject: RE: [v2] Bluetooth: fix connection setup in l2cap_connect

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=860256

---Test result---

Test Summary:
CheckPatch PASS 0.79 seconds
GitLint FAIL 0.54 seconds
SubjectPrefix PASS 0.13 seconds
BuildKernel PASS 30.75 seconds
CheckAllWarning PASS 33.22 seconds
CheckSparse PASS 39.03 seconds
CheckSmatch FAIL 35.74 seconds
BuildKernel32 PASS 28.69 seconds
TestRunnerSetup PASS 520.59 seconds
TestRunner_l2cap-tester PASS 20.24 seconds
TestRunner_iso-tester PASS 32.85 seconds
TestRunner_bnep-tester PASS 4.74 seconds
TestRunner_mgmt-tester PASS 112.00 seconds
TestRunner_rfcomm-tester PASS 7.42 seconds
TestRunner_sco-tester PASS 14.92 seconds
TestRunner_ioctl-tester PASS 7.73 seconds
TestRunner_mesh-tester PASS 5.82 seconds
TestRunner_smp-tester PASS 6.79 seconds
TestRunner_userchan-tester PASS 4.90 seconds
IncrementalBuild PASS 27.56 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[v2] Bluetooth: fix connection setup in l2cap_connect

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
18: B2 Line has trailing whitespace: " "
##############################
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....
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

2024-06-09 16:30:15

by Timo Schröder

[permalink] [raw]
Subject: Re: [PATCH v2] Bluetooth: fix connection setup in l2cap_connect

Hi Pauli,

well done! This patch fixes the issue. Thank you.

Best regards,
Timo


Am So., 9. Juni 2024 um 17:06 Uhr schrieb Pauli Virtanen <[email protected]>:
>
> The amp_id argument of l2cap_connect() was removed in
> commit 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
>
> It was always called with amp_id == 0, i.e. AMP_ID_BREDR == 0x00 (ie.
> non-AMP controller). In the above commit, the code path for amp_id != 0
> was preserved, although it should have used the amp_id == 0 one.
>
> Restore the previous behavior of the non-AMP code path, to fix problems
> with L2CAP connections.
>
> Fixes: 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
> Signed-off-by: Pauli Virtanen <[email protected]>
> ---
>
> Notes:
> v2: do the change in the actually right if branch
>
> Tried proofreading the commit, and this part seemed suspicious.
> Can you try if this fixes the problem?
>
> net/bluetooth/l2cap_core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index c49e0d4b3c0d..aed025734d04 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -4011,8 +4011,8 @@ static void l2cap_connect(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd,
> status = L2CAP_CS_AUTHOR_PEND;
> chan->ops->defer(chan);
> } else {
> - l2cap_state_change(chan, BT_CONNECT2);
> - result = L2CAP_CR_PEND;
> + l2cap_state_change(chan, BT_CONFIG);
> + result = L2CAP_CR_SUCCESS;
> status = L2CAP_CS_NO_INFO;
> }
> } else {
> --
> 2.45.2
>

2024-06-09 17:41:36

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH v2] Bluetooth: fix connection setup in l2cap_connect

Hi Pauli,

On Sun, Jun 9, 2024 at 11:06 AM Pauli Virtanen <[email protected]> wrote:
>
> The amp_id argument of l2cap_connect() was removed in
> commit 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
>
> It was always called with amp_id == 0, i.e. AMP_ID_BREDR == 0x00 (ie.
> non-AMP controller). In the above commit, the code path for amp_id != 0
> was preserved, although it should have used the amp_id == 0 one.
>
> Restore the previous behavior of the non-AMP code path, to fix problems
> with L2CAP connections.

While at it we could create a test case to cover this code path with
l2cap-tester.

> Fixes: 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
> Signed-off-by: Pauli Virtanen <[email protected]>
> ---
>
> Notes:
> v2: do the change in the actually right if branch
>
> Tried proofreading the commit, and this part seemed suspicious.
> Can you try if this fixes the problem?
>
> net/bluetooth/l2cap_core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index c49e0d4b3c0d..aed025734d04 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -4011,8 +4011,8 @@ static void l2cap_connect(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd,
> status = L2CAP_CS_AUTHOR_PEND;
> chan->ops->defer(chan);
> } else {
> - l2cap_state_change(chan, BT_CONNECT2);
> - result = L2CAP_CR_PEND;
> + l2cap_state_change(chan, BT_CONFIG);
> + result = L2CAP_CR_SUCCESS;
> status = L2CAP_CS_NO_INFO;
> }
> } else {
> --
> 2.45.2
>
>


--
Luiz Augusto von Dentz

2024-06-10 14:38:57

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH v2] Bluetooth: fix connection setup in l2cap_connect

Hello:

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

On Sun, 9 Jun 2024 18:06:20 +0300 you wrote:
> The amp_id argument of l2cap_connect() was removed in
> commit 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
>
> It was always called with amp_id == 0, i.e. AMP_ID_BREDR == 0x00 (ie.
> non-AMP controller). In the above commit, the code path for amp_id != 0
> was preserved, although it should have used the amp_id == 0 one.
>
> [...]

Here is the summary with links:
- [v2] Bluetooth: fix connection setup in l2cap_connect
https://git.kernel.org/bluetooth/bluetooth-next/c/5fe0be8868aa

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