<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/include/net/bluetooth/hci.h, branch linux-5.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-08-17T12:41:10Z</updated>
<entry>
<title>Bluetooth: When HCI work queue is drained, only queue chained work</title>
<updated>2022-08-17T12:41:10Z</updated>
<author>
<name>Schspa Shi</name>
</author>
<published>2022-06-03T08:19:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4bf367fa1fefabdf14938d0ac9ed60020389112e'/>
<id>urn:sha1:4bf367fa1fefabdf14938d0ac9ed60020389112e</id>
<content type='text'>
[ Upstream commit 877afadad2dce8aae1f2aad8ce47e072d4f6165e ]

The HCI command, event, and data packet processing workqueue is drained
to avoid deadlock in commit
76727c02c1e1 ("Bluetooth: Call drain_workqueue() before resetting state").

There is another delayed work, which will queue command to this drained
workqueue. Which results in the following error report:

Bluetooth: hci2: command 0x040f tx timeout
WARNING: CPU: 1 PID: 18374 at kernel/workqueue.c:1438 __queue_work+0xdad/0x1140
Workqueue: events hci_cmd_timeout
RIP: 0010:__queue_work+0xdad/0x1140
RSP: 0000:ffffc90002cffc60 EFLAGS: 00010093
RAX: 0000000000000000 RBX: ffff8880b9d3ec00 RCX: 0000000000000000
RDX: ffff888024ba0000 RSI: ffffffff814e048d RDI: ffff8880b9d3ec08
RBP: 0000000000000008 R08: 0000000000000000 R09: 00000000b9d39700
R10: ffffffff814f73c6 R11: 0000000000000000 R12: ffff88807cce4c60
R13: 0000000000000000 R14: ffff8880796d8800 R15: ffff8880796d8800
FS:  0000000000000000(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c0174b4000 CR3: 000000007cae9000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 &lt;TASK&gt;
 ? queue_work_on+0xcb/0x110
 ? lockdep_hardirqs_off+0x90/0xd0
 queue_work_on+0xee/0x110
 process_one_work+0x996/0x1610
 ? pwq_dec_nr_in_flight+0x2a0/0x2a0
 ? rwlock_bug.part.0+0x90/0x90
 ? _raw_spin_lock_irq+0x41/0x50
 worker_thread+0x665/0x1080
 ? process_one_work+0x1610/0x1610
 kthread+0x2e9/0x3a0
 ? kthread_complete_and_exit+0x40/0x40
 ret_from_fork+0x1f/0x30
 &lt;/TASK&gt;

To fix this, we can add a new HCI_DRAIN_WQ flag, and don't queue the
timeout workqueue while command workqueue is draining.

Fixes: 76727c02c1e1 ("Bluetooth: Call drain_workqueue() before resetting state")
Reported-by: syzbot+63bed493aebbf6872647@syzkaller.appspotmail.com
Signed-off-by: Schspa Shi &lt;schspa@gmail.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: HCI: Add HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN quirk</title>
<updated>2022-06-09T08:29:44Z</updated>
<author>
<name>Luiz Augusto von Dentz</name>
</author>
<published>2022-04-01T23:38:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6a88f49a76b632e2ea2aea81e70fdcc92f035208'/>
<id>urn:sha1:6a88f49a76b632e2ea2aea81e70fdcc92f035208</id>
<content type='text'>
[ Upstream commit 05abad857277dda198063017b00ba5b9fed2c0cb ]

This adds HCI_QUIRK_BROKEN_ENHANCED_SETUP_SYNC_CONN quirk which can be
used to mark HCI_Enhanced_Setup_Synchronous_Connection as broken even
if its support command bit are set since some controller report it as
supported but the command don't work properly with some configurations
(e.g. BT_VOICE_TRANSPARENT/mSBC).

Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: hci_event: Fix checking for invalid handle on error status</title>
<updated>2022-04-26T18:09:07Z</updated>
<author>
<name>Luiz Augusto von Dentz</name>
</author>
<published>2022-04-22T19:58:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c86cc5a3ec70f5644f1fa21610b943d0441bc1f7'/>
<id>urn:sha1:c86cc5a3ec70f5644f1fa21610b943d0441bc1f7</id>
<content type='text'>
Commit d5ebaa7c5f6f6 introduces checks for handle range
(e.g HCI_CONN_HANDLE_MAX) but controllers like Intel AX200 don't seem
to respect the valid range int case of error status:

&gt; HCI Event: Connect Complete (0x03) plen 11
        Status: Page Timeout (0x04)
        Handle: 65535
        Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment&amp;
	Sound Products Inc)
        Link type: ACL (0x01)
        Encryption: Disabled (0x00)
[1644965.827560] Bluetooth: hci0: Ignoring HCI_Connection_Complete for invalid handle

Because of it is impossible to cleanup the connections properly since
the stack would attempt to cancel the connection which is no longer in
progress causing the following trace:

&lt; HCI Command: Create Connection Cancel (0x01|0x0008) plen 6
        Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment&amp;
	Sound Products Inc)
= bluetoothd: src/profile.c:record_cb() Unable to get Hands-Free Voice
	gateway SDP record: Connection timed out
&gt; HCI Event: Command Complete (0x0e) plen 10
      Create Connection Cancel (0x01|0x0008) ncmd 1
        Status: Unknown Connection Identifier (0x02)
        Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment&amp;
	Sound Products Inc)
&lt; HCI Command: Create Connection Cancel (0x01|0x0008) plen 6
        Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment&amp;
	Sound Products Inc)

Fixes: d5ebaa7c5f6f6 ("Bluetooth: hci_event: Ignore multiple conn complete events")
Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: hci_sync: Add a new quirk to skip HCI_FLT_CLEAR_ALL</title>
<updated>2022-03-18T16:12:07Z</updated>
<author>
<name>Ismael Ferreras Morezuelas</name>
</author>
<published>2022-03-07T20:04:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0eaecfb2e4814d51ab172df3823e35d7c488b6d2'/>
<id>urn:sha1:0eaecfb2e4814d51ab172df3823e35d7c488b6d2</id>
<content type='text'>
Some controllers have problems with being sent a command to clear
all filtering. While the HCI code does not unconditionally
send a clear-all anymore at BR/EDR setup (after the state machine
refactor), there might be more ways of hitting these codepaths
in the future as the kernel develops.

Cc: stable@vger.kernel.org
Cc: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Ismael Ferreras Morezuelas &lt;swyterzone@gmail.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: hci_event: Rework hci_inquiry_result_with_rssi_evt</title>
<updated>2022-01-06T13:57:09Z</updated>
<author>
<name>Luiz Augusto von Dentz</name>
</author>
<published>2022-01-05T22:59:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=72279d17df54d5e4e7910b39c61a3f3464e36633'/>
<id>urn:sha1:72279d17df54d5e4e7910b39c61a3f3464e36633</id>
<content type='text'>
This rework the handling of hci_inquiry_result_with_rssi_evt to not use
a union to represent the different inquiry responses.

Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
Tested-by: Soenke Huster &lt;soenke.huster@eknoes.de&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: MGMT: Fix LE simultaneous roles UUID if not supported</title>
<updated>2021-12-22T22:01:35Z</updated>
<author>
<name>Luiz Augusto von Dentz</name>
</author>
<published>2021-12-22T20:22:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=76d0685bbac8ae017e5d12eba25fb3c4f0ec77ac'/>
<id>urn:sha1:76d0685bbac8ae017e5d12eba25fb3c4f0ec77ac</id>
<content type='text'>
If controller/driver don't support LE simultaneous roles its UUID shall
be omitted when responding to MGMT_OP_READ_EXP_FEATURES_INFO.

This also rework the support introducing HCI_LE_SIMULTANEOUS_ROLES flag
so it can be detected when userspace wants to use or not.

Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: hci_sync: Set Privacy Mode when updating the resolving list</title>
<updated>2021-12-07T16:05:51Z</updated>
<author>
<name>Luiz Augusto von Dentz</name>
</author>
<published>2021-12-03T22:07:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=853b70b506a20cddf96419e8ac198df92e51bc4c'/>
<id>urn:sha1:853b70b506a20cddf96419e8ac198df92e51bc4c</id>
<content type='text'>
This adds support for Set Privacy Mode when updating the resolving list
when HCI_CONN_FLAG_DEVICE_PRIVACY so the controller shall use Device
Mode for devices programmed in the resolving list, Device Mode is
actually required when the remote device are not able to use RPA as
otherwise the default mode is Network Privacy Mode in which only
allows RPAs thus the controller would filter out advertisement using
identity addresses for which there is an IRK.

Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: add quirk disabling LE Read Transmit Power</title>
<updated>2021-12-07T16:05:51Z</updated>
<author>
<name>Aditya Garg</name>
</author>
<published>2021-12-02T12:41:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d2f8114f9574509580a8506d2ef72e7e43d1a5bd'/>
<id>urn:sha1:d2f8114f9574509580a8506d2ef72e7e43d1a5bd</id>
<content type='text'>
Some devices have a bug causing them to not work if they query
LE tx power on startup. Thus we add a quirk in order to not query it
and default min/max tx power values to HCI_TX_POWER_INVALID.

Signed-off-by: Aditya Garg &lt;gargaditya08@live.com&gt;
Reported-by: Orlando Chamberlain &lt;redecorating@protonmail.com&gt;
Tested-by: Orlando Chamberlain &lt;redecorating@protonmail.com&gt;
Link:
https://lore.kernel.org/r/4970a940-211b-25d6-edab-21a815313954@protonmail.com
Fixes: 7c395ea521e6 ("Bluetooth: Query LE tx power on startup")
Cc: stable@vger.kernel.org
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: HCI: Use skb_pull_data to parse LE Direct Advertising Report event</title>
<updated>2021-12-07T16:05:50Z</updated>
<author>
<name>Luiz Augusto von Dentz</name>
</author>
<published>2021-12-01T18:55:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a3679649a19179813c3853b8bb397a801d9dd253'/>
<id>urn:sha1:a3679649a19179813c3853b8bb397a801d9dd253</id>
<content type='text'>
This uses skb_pull_data to check the LE Direct Advertising Report
events received have the minimum required length.

Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: HCI: Use skb_pull_data to parse LE Ext Advertising Report event</title>
<updated>2021-12-07T16:05:50Z</updated>
<author>
<name>Luiz Augusto von Dentz</name>
</author>
<published>2021-12-01T18:55:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b48b833f9e8aa0675820a3b5a0f30d7319590ea8'/>
<id>urn:sha1:b48b833f9e8aa0675820a3b5a0f30d7319590ea8</id>
<content type='text'>
This uses skb_pull_data to check the LE Extended Advertising Report
events received have the minimum required length.

Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
</feed>
