diff mbox series

[v2] Bluetooth: hci_sync: Fix hci_update_accept_list_sync

Message ID 20220224151147.119619-1-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Headers show
Series [v2] Bluetooth: hci_sync: Fix hci_update_accept_list_sync | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS
tedd_an/subjectprefix success PASS
tedd_an/buildkernel success Build Kernel PASS
tedd_an/buildkernel32 success Build Kernel32 PASS
tedd_an/incremental_build success Pass
tedd_an/testrunnersetup success Test Runner Setup PASS
tedd_an/testrunnerl2cap-tester success Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerbnep-tester success Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnermgmt-tester success Total: 493, Passed: 493 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerrfcomm-tester success Total: 10, Passed: 10 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersco-tester success Total: 12, Passed: 12 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersmp-tester success Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunneruserchan-tester success Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0

Commit Message

Luiz Augusto von Dentz Feb. 24, 2022, 3:11 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

hci_update_accept_list_sync is returning the filter based on the error
but that gets overwritten by hci_le_set_addr_resolution_enable_sync
return instead of using the actual result of the likes of
hci_le_add_accept_list_sync which was intended.

Fixes: ad383c2c65a5b ("Bluetooth: hci_sync: Enable advertising when LL privacy is enabled")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
v2: Use u8 filter_policy instead of int ret as variable to store the result.

 net/bluetooth/hci_sync.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com Feb. 24, 2022, 4:04 p.m. UTC | #1
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=617616

---Test result---

Test Summary:
CheckPatch                    PASS      1.63 seconds
GitLint                       PASS      0.98 seconds
SubjectPrefix                 PASS      0.89 seconds
BuildKernel                   PASS      33.05 seconds
BuildKernel32                 PASS      29.40 seconds
Incremental Build with patchesPASS      39.56 seconds
TestRunner: Setup             PASS      514.51 seconds
TestRunner: l2cap-tester      PASS      14.40 seconds
TestRunner: bnep-tester       PASS      6.53 seconds
TestRunner: mgmt-tester       PASS      116.47 seconds
TestRunner: rfcomm-tester     PASS      9.05 seconds
TestRunner: sco-tester        PASS      8.87 seconds
TestRunner: smp-tester        PASS      8.63 seconds
TestRunner: userchan-tester   PASS      7.40 seconds



---
Regards,
Linux Bluetooth
Marcel Holtmann Feb. 24, 2022, 8:08 p.m. UTC | #2
Hi Luiz,

> hci_update_accept_list_sync is returning the filter based on the error
> but that gets overwritten by hci_le_set_addr_resolution_enable_sync
> return instead of using the actual result of the likes of
> hci_le_add_accept_list_sync which was intended.
> 
> Fixes: ad383c2c65a5b ("Bluetooth: hci_sync: Enable advertising when LL privacy is enabled")
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
> v2: Use u8 filter_policy instead of int ret as variable to store the result.
> 
> net/bluetooth/hci_sync.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)

patch has been applied to bluetooth-stable tree.

Regards

Marcel
Joey Corleone May 10, 2022, 10:36 a.m. UTC | #3
On 24.02.22 21:08, Marcel Holtmann wrote:
> Hi Luiz,
> 
>> hci_update_accept_list_sync is returning the filter based on the error
>> but that gets overwritten by hci_le_set_addr_resolution_enable_sync
>> return instead of using the actual result of the likes of
>> hci_le_add_accept_list_sync which was intended.
>>
>> Fixes: ad383c2c65a5b ("Bluetooth: hci_sync: Enable advertising when LL privacy is enabled")
>> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>> ---
>> v2: Use u8 filter_policy instead of int ret as variable to store the result.
>>
>> net/bluetooth/hci_sync.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
> 
> patch has been applied to bluetooth-stable tree.
> 
> Regards
> 
> Marcel

Just to put you in the loop in case you have not noticed it yet: there 
seems to be some kind of regression introduced by this patch. See 
comment #5 of ticket 215768 where Damien Thébault bisected the kernel [1].

Joey

[1] https://bugzilla.kernel.org/show_bug.cgi?id=215768#c5
Linux regression tracking (Thorsten Leemhuis) May 10, 2022, 3:29 p.m. UTC | #4
On 10.05.22 12:36, Joey Corleone wrote:
> On 24.02.22 21:08, Marcel Holtmann wrote:

>>> hci_update_accept_list_sync is returning the filter based on the error
>>> but that gets overwritten by hci_le_set_addr_resolution_enable_sync
>>> return instead of using the actual result of the likes of
>>> hci_le_add_accept_list_sync which was intended.
>>>
>>> Fixes: ad383c2c65a5b ("Bluetooth: hci_sync: Enable advertising when
>>> LL privacy is enabled")
>>> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>>> ---
>>> v2: Use u8 filter_policy instead of int ret as variable to store the
>>> result.
>>>
>>> net/bluetooth/hci_sync.c | 5 ++++-
>>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> patch has been applied to bluetooth-stable tree.
>>
>> Regards
>>
>> Marcel
> 
> Just to put you in the loop in case you have not noticed it yet: there
> seems to be some kind of regression introduced by this patch. See
> comment #5 of ticket 215768 where Damien Thébault bisected the kernel [1].

Thx for CCing the regressions list.

[TLDR: I'm adding this regression report to the list of tracked
regressions; all text from me you find below is based on a few templates
paragraphs you might have encountered already already in similar form.]

To be sure below issue doesn't fall through the cracks unnoticed, I'm
adding it to regzbot, my Linux kernel regression tracking bot:

#regzbot ^introduced 80740ebb7e1ad
#regzbot title net: bluetooth: can't suspend while bluetooth is enabled.
#regzbot ignore-activity
#regzbot from: plum <plumerlis@gmail.com>
#regzbot link: https://bugzilla.kernel.org/show_bug.cgi?id=215768

This isn't a regression? This issue or a fix for it are already
discussed somewhere else? It was fixed already? You want to clarify when
the regression started to happen? Or point out I got the title or
something else totally wrong? Then just reply -- ideally with also
telling regzbot about it, as explained here:
https://linux-regtracking.leemhuis.info/tracked-regression/

Reminder for developers: When fixing the issue, add 'Link:' tags
pointing to the report (the mail this one replied to), as the kernel's
documentation call for; above page explains why this is important for
tracked regressions.

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)

P.S.: As the Linux kernel's regression tracker I deal with a lot of
reports and sometimes miss something important when writing mails like
this. If that's the case here, don't hesitate to tell me in a public
reply, it's in everyone's interest to set the public record straight.
Linux regression tracking (Thorsten Leemhuis) May 16, 2022, 12:40 p.m. UTC | #5
TWIMC: this mail is primarily send for documentation purposes and for
regzbot, my Linux kernel regression tracking bot. These mails usually
contain '#forregzbot' in the subject, to make them easy to spot and filter.

On 10.05.22 17:29, Thorsten Leemhuis wrote:
> On 10.05.22 12:36, Joey Corleone wrote:
>> On 24.02.22 21:08, Marcel Holtmann wrote:
> 
>>>> hci_update_accept_list_sync is returning the filter based on the error
>>>> but that gets overwritten by hci_le_set_addr_resolution_enable_sync
>>>> return instead of using the actual result of the likes of
>>>> hci_le_add_accept_list_sync which was intended.
>>>>
>>>> Fixes: ad383c2c65a5b ("Bluetooth: hci_sync: Enable advertising when
>>>> LL privacy is enabled")
>>>> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>>>> ---
>>>> v2: Use u8 filter_policy instead of int ret as variable to store the
>>>> result.
>>>>
>>>> net/bluetooth/hci_sync.c | 5 ++++-
>>>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> patch has been applied to bluetooth-stable tree.
>>>
>>> Regards
>>>
>>> Marcel
>>
>> Just to put you in the loop in case you have not noticed it yet: there
>> seems to be some kind of regression introduced by this patch. See
>> comment #5 of ticket 215768 where Damien Thébault bisected the kernel [1].
> 
> #regzbot ^introduced 80740ebb7e1ad
> #regzbot title net: bluetooth: can't suspend while bluetooth is enabled.
> #regzbot ignore-activity
> #regzbot from: plum <plumerlis@gmail.com>
> #regzbot link: https://bugzilla.kernel.org/show_bug.cgi?id=215768

#regzbot fixed-by: a9a347655d224fa284187

That fix landed in bluetooth-next. I wonder if that fix would better
have been merged in this cycle, as that will mean many users are exposed
to this for at least three more weeks, but whatever.

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)

P.S.: As the Linux kernel's regression tracker I deal with a lot of
reports and sometimes miss something important when writing mails like
this. If that's the case here, don't hesitate to tell me in a public
reply, it's in everyone's interest to set the public record straight.
diff mbox series

Patch

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index b66a2271c433..d146d4efae43 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -1845,6 +1845,7 @@  static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
 	u8 num_entries = 0;
 	bool pend_conn, pend_report;
 	int err;
+	u8 filter_policy;
 
 	/* Pause advertising if resolving list can be used as controllers are
 	 * cannot accept resolving list modifications while advertising.
@@ -1930,6 +1931,8 @@  static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
 		err = -EINVAL;
 
 done:
+	filter_policy = err ? 0x00 : 0x01;
+
 	/* Enable address resolution when LL Privacy is enabled. */
 	err = hci_le_set_addr_resolution_enable_sync(hdev, 0x01);
 	if (err)
@@ -1940,7 +1943,7 @@  static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
 		hci_resume_advertising_sync(hdev);
 
 	/* Select filter policy to use accept list */
-	return err ? 0x00 : 0x01;
+	return filter_policy;
 }
 
 /* Returns true if an le connection is in the scanning state */