<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/bluetooth/btqca.c, branch v5.10.258</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>Bluetooth: btqca: Don't modify firmware contents in-place</title>
<updated>2021-07-14T14:55:34+00:00</updated>
<author>
<name>Connor Abbott</name>
<email>cwabbott0@gmail.com</email>
</author>
<published>2021-05-07T12:27:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=f5af19889ff0dad21309a8c6836148441151b3df'/>
<id>f5af19889ff0dad21309a8c6836148441151b3df</id>
<content type='text'>
commit b43ca511178ed0ab6fd2405df28cf9e100273020 upstream.

struct firmware::data is marked const, and when the firmware is
compressed with xz (default at least with Fedora) it's mapped read-only
which results in a crash:

BUG: unable to handle page fault for address: ffffae57c0ca5047
PGD 100000067 P4D 100000067 PUD 1001ce067 PMD 10165a067 PTE 8000000112bba161
Oops: 0003 [#1] SMP NOPTI
CPU: 3 PID: 204 Comm: kworker/u17:0 Not tainted 5.12.1-test+ #1
Hardware name: Dell Inc. XPS 13 9310/0F7M4C, BIOS 1.2.5 12/10/2020
Workqueue: hci0 hci_power_on [bluetooth]
RIP: 0010:qca_download_firmware+0x27c/0x4e0 [btqca]
Code: 1b 75 04 80 48 0c 01 0f b7 c6 8d 54 02 0c 41 39 d7 0f 8e 62 fe ff ff 48 63 c2 4c 01 e8 0f b7 38 0f b7 70 02 66 83 ff 11 75 d3 &lt;80&gt; 48 0c 80 41 83 fc 03 7e 6e 88 58 0d eb ce 41 0f b6 45 0e 48 8b
RSP: 0018:ffffae57c08dfc68 EFLAGS: 00010246
RAX: ffffae57c0ca503b RBX: 000000000000000e RCX: 0000000000000000
RDX: 0000000000000037 RSI: 0000000000000006 RDI: 0000000000000011
RBP: ffff978d9949e000 R08: ffff978d84ed7540 R09: ffffae57c0ca5000
R10: 000000000010cd00 R11: 0000000000000001 R12: 0000000000000005
R13: ffffae57c0ca5004 R14: ffff978d98ca8680 R15: 00000000000016a9
FS:  0000000000000000(0000) GS:ffff9794ef6c0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffae57c0ca5047 CR3: 0000000113d5a004 CR4: 0000000000770ee0
PKRU: 55555554
Call Trace:
 qca_uart_setup+0x2cb/0x1390 [btqca]
 ? qca_read_soc_version+0x136/0x220 [btqca]
 qca_setup+0x288/0xab0 [hci_uart]
 hci_dev_do_open+0x1f3/0x780 [bluetooth]
 ? try_to_wake_up+0x1c1/0x4f0
 hci_power_on+0x3f/0x200 [bluetooth]
 process_one_work+0x1ec/0x380
 worker_thread+0x53/0x3e0
 ? process_one_work+0x380/0x380
 kthread+0x11b/0x140
 ? kthread_associate_blkcg+0xa0/0xa0
 ret_from_fork+0x1f/0x30
Modules linked in: llc ip_set nf_tables nfnetlink snd_soc_skl_hda_dsp(+) ip6table_filter snd_soc_hdac_hdmi ip6_tables qrtr_mhi iptable_filter snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic s&gt;
 dell_wmi_sysman(+) dell_smbios snd dcdbas mhi vfat videobuf2_vmalloc i2c_i801 videobuf2_memops videobuf2_v4l2 dell_wmi_descriptor fat wmi_bmof soundcore i2c_smbus videobuf2_common libarc4 mei_me mei hid_se&gt;
 i2c_hid_acpi i2c_hid video pinctrl_tigerlake fuse
CR2: ffffae57c0ca5047

This also seems to fix a failure to suspend due to the firmware
download on bootup getting interrupted by the crash:

Bluetooth: hci0: SSR or FW download time out
PM: dpm_run_callback(): acpi_subsys_suspend+0x0/0x60 returns -110
PM: Device serial0-0 failed to suspend: error -110
PM: Some devices failed to suspend, or early wake event detected

Fixes: 83e8196 ("Bluetooth: btqca: Introduce generic QCA ROME support")
Cc: Venkata Lakshmi Narayana Gubba &lt;gubbaven@codeaurora.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Connor Abbott &lt;cwabbott0@gmail.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b43ca511178ed0ab6fd2405df28cf9e100273020 upstream.

struct firmware::data is marked const, and when the firmware is
compressed with xz (default at least with Fedora) it's mapped read-only
which results in a crash:

BUG: unable to handle page fault for address: ffffae57c0ca5047
PGD 100000067 P4D 100000067 PUD 1001ce067 PMD 10165a067 PTE 8000000112bba161
Oops: 0003 [#1] SMP NOPTI
CPU: 3 PID: 204 Comm: kworker/u17:0 Not tainted 5.12.1-test+ #1
Hardware name: Dell Inc. XPS 13 9310/0F7M4C, BIOS 1.2.5 12/10/2020
Workqueue: hci0 hci_power_on [bluetooth]
RIP: 0010:qca_download_firmware+0x27c/0x4e0 [btqca]
Code: 1b 75 04 80 48 0c 01 0f b7 c6 8d 54 02 0c 41 39 d7 0f 8e 62 fe ff ff 48 63 c2 4c 01 e8 0f b7 38 0f b7 70 02 66 83 ff 11 75 d3 &lt;80&gt; 48 0c 80 41 83 fc 03 7e 6e 88 58 0d eb ce 41 0f b6 45 0e 48 8b
RSP: 0018:ffffae57c08dfc68 EFLAGS: 00010246
RAX: ffffae57c0ca503b RBX: 000000000000000e RCX: 0000000000000000
RDX: 0000000000000037 RSI: 0000000000000006 RDI: 0000000000000011
RBP: ffff978d9949e000 R08: ffff978d84ed7540 R09: ffffae57c0ca5000
R10: 000000000010cd00 R11: 0000000000000001 R12: 0000000000000005
R13: ffffae57c0ca5004 R14: ffff978d98ca8680 R15: 00000000000016a9
FS:  0000000000000000(0000) GS:ffff9794ef6c0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffae57c0ca5047 CR3: 0000000113d5a004 CR4: 0000000000770ee0
PKRU: 55555554
Call Trace:
 qca_uart_setup+0x2cb/0x1390 [btqca]
 ? qca_read_soc_version+0x136/0x220 [btqca]
 qca_setup+0x288/0xab0 [hci_uart]
 hci_dev_do_open+0x1f3/0x780 [bluetooth]
 ? try_to_wake_up+0x1c1/0x4f0
 hci_power_on+0x3f/0x200 [bluetooth]
 process_one_work+0x1ec/0x380
 worker_thread+0x53/0x3e0
 ? process_one_work+0x380/0x380
 kthread+0x11b/0x140
 ? kthread_associate_blkcg+0xa0/0xa0
 ret_from_fork+0x1f/0x30
Modules linked in: llc ip_set nf_tables nfnetlink snd_soc_skl_hda_dsp(+) ip6table_filter snd_soc_hdac_hdmi ip6_tables qrtr_mhi iptable_filter snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic s&gt;
 dell_wmi_sysman(+) dell_smbios snd dcdbas mhi vfat videobuf2_vmalloc i2c_i801 videobuf2_memops videobuf2_v4l2 dell_wmi_descriptor fat wmi_bmof soundcore i2c_smbus videobuf2_common libarc4 mei_me mei hid_se&gt;
 i2c_hid_acpi i2c_hid video pinctrl_tigerlake fuse
CR2: ffffae57c0ca5047

This also seems to fix a failure to suspend due to the firmware
download on bootup getting interrupted by the crash:

Bluetooth: hci0: SSR or FW download time out
PM: dpm_run_callback(): acpi_subsys_suspend+0x0/0x60 returns -110
PM: Device serial0-0 failed to suspend: error -110
PM: Some devices failed to suspend, or early wake event detected

Fixes: 83e8196 ("Bluetooth: btqca: Introduce generic QCA ROME support")
Cc: Venkata Lakshmi Narayana Gubba &lt;gubbaven@codeaurora.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Connor Abbott &lt;cwabbott0@gmail.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: hci_qca: Disable SoC debug logging for WCN3991</title>
<updated>2020-06-12T13:17:47+00:00</updated>
<author>
<name>Balakrishna Godavarthi</name>
<email>bgodavar@codeaurora.org</email>
</author>
<published>2020-06-12T12:20:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=590deccf4c0690597ca69349fe46ee124944d8c5'/>
<id>590deccf4c0690597ca69349fe46ee124944d8c5</id>
<content type='text'>
By default, WCN3991 sent debug packets to HOST via ACL packet
with header 0xDC2E. This logging is not required on commercial
devices. With this patch SoC logging is disabled post fw
download.

Signed-off-by: Balakrishna Godavarthi &lt;bgodavar@codeaurora.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By default, WCN3991 sent debug packets to HOST via ACL packet
with header 0xDC2E. This logging is not required on commercial
devices. With this patch SoC logging is disabled post fw
download.

Signed-off-by: Balakrishna Godavarthi &lt;bgodavar@codeaurora.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: hci_qca: Improve controller ID info log level</title>
<updated>2020-06-01T06:04:28+00:00</updated>
<author>
<name>Zijun Hu</name>
<email>zijuhu@codeaurora.org</email>
</author>
<published>2020-05-29T14:46:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=4942857b015ede4fab8b262931244a3c1006a2a6'/>
<id>4942857b015ede4fab8b262931244a3c1006a2a6</id>
<content type='text'>
Controller ID info got by VSC EDL_PATCH_GETVER is very
important, so improve its log level from DEBUG to INFO.

Signed-off-by: Zijun Hu &lt;zijuhu@codeaurora.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Controller ID info got by VSC EDL_PATCH_GETVER is very
important, so improve its log level from DEBUG to INFO.

Signed-off-by: Zijun Hu &lt;zijuhu@codeaurora.org&gt;
Reviewed-by: Matthias Kaehlcke &lt;mka@chromium.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: hci_qca: Add support for Qualcomm Bluetooth SoC QCA6390</title>
<updated>2020-04-02T06:25:19+00:00</updated>
<author>
<name>Rocky Liao</name>
<email>rjliao@codeaurora.org</email>
</author>
<published>2020-03-25T02:26:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=e5d6468fe9d8dced9af0c548a359a7dbeb31c931'/>
<id>e5d6468fe9d8dced9af0c548a359a7dbeb31c931</id>
<content type='text'>
This patch adds support for QCA6390, including the devicetree and acpi
compatible hwid matching, and patch/nvm downloading.

Signed-off-by: Rocky Liao &lt;rjliao@codeaurora.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds support for QCA6390, including the devicetree and acpi
compatible hwid matching, and patch/nvm downloading.

Signed-off-by: Rocky Liao &lt;rjliao@codeaurora.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: btqca: Fix the NVM baudrate tag offcet for wcn3991</title>
<updated>2020-03-01T13:47:35+00:00</updated>
<author>
<name>Rocky Liao</name>
<email>rjliao@codeaurora.org</email>
</author>
<published>2020-03-01T10:11:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=b63882549b2bf2979cb1506bdf783edf8b45c613'/>
<id>b63882549b2bf2979cb1506bdf783edf8b45c613</id>
<content type='text'>
The baudrate set byte of wcn3991 in the NVM tag is byte 1, not byte 2.
This patch will set correct byte for wcn3991.

Signed-off-by: Rocky Liao &lt;rjliao@codeaurora.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The baudrate set byte of wcn3991 in the NVM tag is byte 1, not byte 2.
This patch will set correct byte for wcn3991.

Signed-off-by: Rocky Liao &lt;rjliao@codeaurora.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: hci_qca: Add support for Qualcomm Bluetooth SoC WCN3991</title>
<updated>2019-11-09T02:26:47+00:00</updated>
<author>
<name>Balakrishna Godavarthi</name>
<email>bgodavar@codeaurora.org</email>
</author>
<published>2019-11-06T09:48:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=7d250a062f75e6ee8368b64ac6ff1e09fbb6783d'/>
<id>7d250a062f75e6ee8368b64ac6ff1e09fbb6783d</id>
<content type='text'>
This patch add support for WCN3991 i.e. current values and fw download
support.

Signed-off-by: Balakrishna Godavarthi &lt;bgodavar@codeaurora.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch add support for WCN3991 i.e. current values and fw download
support.

Signed-off-by: Balakrishna Godavarthi &lt;bgodavar@codeaurora.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: btqca: Rename ROME specific variables to generic variables</title>
<updated>2019-11-09T02:26:47+00:00</updated>
<author>
<name>Balakrishna Godavarthi</name>
<email>bgodavar@codeaurora.org</email>
</author>
<published>2019-11-06T09:48:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=e303d124b70920ef86b26d792d8b959166a28f6e'/>
<id>e303d124b70920ef86b26d792d8b959166a28f6e</id>
<content type='text'>
Variables which are named with rome are commonly used for all the
BT SoC's. Instead of continuing further, renamed them to generic
name.

Signed-off-by: Balakrishna Godavarthi &lt;bgodavar@codeaurora.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Variables which are named with rome are commonly used for all the
BT SoC's. Instead of continuing further, renamed them to generic
name.

Signed-off-by: Balakrishna Godavarthi &lt;bgodavar@codeaurora.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: hci_qca: wait for Pre shutdown complete event before sending the Power off pulse</title>
<updated>2019-09-05T15:27:22+00:00</updated>
<author>
<name>Harish Bandi</name>
<email>c-hbandi@codeaurora.org</email>
</author>
<published>2019-08-30T12:28:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=010376ab7fd788a0eddb86b6de5869b3045b97e3'/>
<id>010376ab7fd788a0eddb86b6de5869b3045b97e3</id>
<content type='text'>
When SoC receives pre shut down command, it share the same
with other COEX shared clients. So SoC needs a short time
after sending VS pre shutdown command before turning off
the regulators and sending the power off pulse. Along with
short delay, needs to wait for command complete event for
Pre shutdown VS command

Signed-off-by: Harish Bandi &lt;c-hbandi@codeaurora.org&gt;
Reviewed-by: Balakrishna Godavarthi &lt;bgodavar@codeaurora.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When SoC receives pre shut down command, it share the same
with other COEX shared clients. So SoC needs a short time
after sending VS pre shutdown command before turning off
the regulators and sending the power off pulse. Along with
short delay, needs to wait for command complete event for
Pre shutdown VS command

Signed-off-by: Harish Bandi &lt;c-hbandi@codeaurora.org&gt;
Reviewed-by: Balakrishna Godavarthi &lt;bgodavar@codeaurora.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: btqca: Reset download type to default</title>
<updated>2019-08-12T17:07:15+00:00</updated>
<author>
<name>Balakrishna Godavarthi</name>
<email>bgodavar@codeaurora.org</email>
</author>
<published>2019-08-08T08:56:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=12072a68961af20e84ddb4aba2387ba5f70e8c14'/>
<id>12072a68961af20e84ddb4aba2387ba5f70e8c14</id>
<content type='text'>
This patch will reset the download flag to default value
before retrieving the download mode type.

Fixes: 32646db8cc28 ("Bluetooth: btqca: inject command complete event during fw download")
Signed-off-by: Balakrishna Godavarthi &lt;bgodavar@codeaurora.org&gt;
Tested-by: Claire Chang &lt;tientzu@chromium.org&gt;
Reviewed-by: Claire Chang &lt;tientzu@chromium.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch will reset the download flag to default value
before retrieving the download mode type.

Fixes: 32646db8cc28 ("Bluetooth: btqca: inject command complete event during fw download")
Signed-off-by: Balakrishna Godavarthi &lt;bgodavar@codeaurora.org&gt;
Tested-by: Claire Chang &lt;tientzu@chromium.org&gt;
Reviewed-by: Claire Chang &lt;tientzu@chromium.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: btqca: release_firmware after qca_inject_cmd_complete_event</title>
<updated>2019-08-12T16:36:09+00:00</updated>
<author>
<name>Claire Chang</name>
<email>tientzu@chromium.org</email>
</author>
<published>2019-08-06T09:56:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=c7c5ae2902bf8fe9acc75f798c0de75ac9295ccf'/>
<id>c7c5ae2902bf8fe9acc75f798c0de75ac9295ccf</id>
<content type='text'>
commit 32646db8cc28 ("Bluetooth: btqca: inject command complete event
during fw download") added qca_inject_cmd_complete_event() for certain
qualcomm chips. However, qca_download_firmware() will return without
calling release_firmware() in this case.

This leads to a memory leak like the following found by kmemleak:

unreferenced object 0xfffffff3868a5880 (size 128):
  comm "kworker/u17:5", pid 347, jiffies 4294676481 (age 312.157s)
  hex dump (first 32 bytes):
    ac fd 00 00 00 00 00 00 00 d0 7e 17 80 ff ff ff  ..........~.....
    00 00 00 00 00 00 00 00 00 59 8a 86 f3 ff ff ff  .........Y......
  backtrace:
    [&lt;00000000978ce31d&gt;] kmem_cache_alloc_trace+0x194/0x298
    [&lt;000000006ea0398c&gt;] _request_firmware+0x74/0x4e4
    [&lt;000000004da31ca0&gt;] request_firmware+0x44/0x64
    [&lt;0000000094572996&gt;] qca_download_firmware+0x74/0x6e4 [btqca]
    [&lt;00000000b24d615a&gt;] qca_uart_setup+0xc0/0x2b0 [btqca]
    [&lt;00000000364a6d5a&gt;] qca_setup+0x204/0x570 [hci_uart]
    [&lt;000000006be1a544&gt;] hci_uart_setup+0xa8/0x148 [hci_uart]
    [&lt;00000000d64c0f4f&gt;] hci_dev_do_open+0x144/0x530 [bluetooth]
    [&lt;00000000f69f5110&gt;] hci_power_on+0x84/0x288 [bluetooth]
    [&lt;00000000d4151583&gt;] process_one_work+0x210/0x420
    [&lt;000000003cf3dcfb&gt;] worker_thread+0x2c4/0x3e4
    [&lt;000000007ccaf055&gt;] kthread+0x124/0x134
    [&lt;00000000bef1f723&gt;] ret_from_fork+0x10/0x18
    [&lt;00000000c36ee3dd&gt;] 0xffffffffffffffff
unreferenced object 0xfffffff37b16de00 (size 128):
  comm "kworker/u17:5", pid 347, jiffies 4294676873 (age 311.766s)
  hex dump (first 32 bytes):
    da 07 00 00 00 00 00 00 00 50 ff 0b 80 ff ff ff  .........P......
    00 00 00 00 00 00 00 00 00 dd 16 7b f3 ff ff ff  ...........{....
  backtrace:
    [&lt;00000000978ce31d&gt;] kmem_cache_alloc_trace+0x194/0x298
    [&lt;000000006ea0398c&gt;] _request_firmware+0x74/0x4e4
    [&lt;000000004da31ca0&gt;] request_firmware+0x44/0x64
    [&lt;0000000094572996&gt;] qca_download_firmware+0x74/0x6e4 [btqca]
    [&lt;000000000cde20a9&gt;] qca_uart_setup+0x144/0x2b0 [btqca]
    [&lt;00000000364a6d5a&gt;] qca_setup+0x204/0x570 [hci_uart]
    [&lt;000000006be1a544&gt;] hci_uart_setup+0xa8/0x148 [hci_uart]
    [&lt;00000000d64c0f4f&gt;] hci_dev_do_open+0x144/0x530 [bluetooth]
    [&lt;00000000f69f5110&gt;] hci_power_on+0x84/0x288 [bluetooth]
    [&lt;00000000d4151583&gt;] process_one_work+0x210/0x420
    [&lt;000000003cf3dcfb&gt;] worker_thread+0x2c4/0x3e4
    [&lt;000000007ccaf055&gt;] kthread+0x124/0x134
    [&lt;00000000bef1f723&gt;] ret_from_fork+0x10/0x18
    [&lt;00000000c36ee3dd&gt;] 0xffffffffffffffff

Make sure release_firmware() is called aftre
qca_inject_cmd_complete_event() to avoid the memory leak.

Fixes: 32646db8cc28 ("Bluetooth: btqca: inject command complete event during fw download")
Signed-off-by: Claire Chang &lt;tientzu@chromium.org&gt;
Reviewed-by: Balakrishna Godavarthi &lt;bgodavar@codeaurora.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 32646db8cc28 ("Bluetooth: btqca: inject command complete event
during fw download") added qca_inject_cmd_complete_event() for certain
qualcomm chips. However, qca_download_firmware() will return without
calling release_firmware() in this case.

This leads to a memory leak like the following found by kmemleak:

unreferenced object 0xfffffff3868a5880 (size 128):
  comm "kworker/u17:5", pid 347, jiffies 4294676481 (age 312.157s)
  hex dump (first 32 bytes):
    ac fd 00 00 00 00 00 00 00 d0 7e 17 80 ff ff ff  ..........~.....
    00 00 00 00 00 00 00 00 00 59 8a 86 f3 ff ff ff  .........Y......
  backtrace:
    [&lt;00000000978ce31d&gt;] kmem_cache_alloc_trace+0x194/0x298
    [&lt;000000006ea0398c&gt;] _request_firmware+0x74/0x4e4
    [&lt;000000004da31ca0&gt;] request_firmware+0x44/0x64
    [&lt;0000000094572996&gt;] qca_download_firmware+0x74/0x6e4 [btqca]
    [&lt;00000000b24d615a&gt;] qca_uart_setup+0xc0/0x2b0 [btqca]
    [&lt;00000000364a6d5a&gt;] qca_setup+0x204/0x570 [hci_uart]
    [&lt;000000006be1a544&gt;] hci_uart_setup+0xa8/0x148 [hci_uart]
    [&lt;00000000d64c0f4f&gt;] hci_dev_do_open+0x144/0x530 [bluetooth]
    [&lt;00000000f69f5110&gt;] hci_power_on+0x84/0x288 [bluetooth]
    [&lt;00000000d4151583&gt;] process_one_work+0x210/0x420
    [&lt;000000003cf3dcfb&gt;] worker_thread+0x2c4/0x3e4
    [&lt;000000007ccaf055&gt;] kthread+0x124/0x134
    [&lt;00000000bef1f723&gt;] ret_from_fork+0x10/0x18
    [&lt;00000000c36ee3dd&gt;] 0xffffffffffffffff
unreferenced object 0xfffffff37b16de00 (size 128):
  comm "kworker/u17:5", pid 347, jiffies 4294676873 (age 311.766s)
  hex dump (first 32 bytes):
    da 07 00 00 00 00 00 00 00 50 ff 0b 80 ff ff ff  .........P......
    00 00 00 00 00 00 00 00 00 dd 16 7b f3 ff ff ff  ...........{....
  backtrace:
    [&lt;00000000978ce31d&gt;] kmem_cache_alloc_trace+0x194/0x298
    [&lt;000000006ea0398c&gt;] _request_firmware+0x74/0x4e4
    [&lt;000000004da31ca0&gt;] request_firmware+0x44/0x64
    [&lt;0000000094572996&gt;] qca_download_firmware+0x74/0x6e4 [btqca]
    [&lt;000000000cde20a9&gt;] qca_uart_setup+0x144/0x2b0 [btqca]
    [&lt;00000000364a6d5a&gt;] qca_setup+0x204/0x570 [hci_uart]
    [&lt;000000006be1a544&gt;] hci_uart_setup+0xa8/0x148 [hci_uart]
    [&lt;00000000d64c0f4f&gt;] hci_dev_do_open+0x144/0x530 [bluetooth]
    [&lt;00000000f69f5110&gt;] hci_power_on+0x84/0x288 [bluetooth]
    [&lt;00000000d4151583&gt;] process_one_work+0x210/0x420
    [&lt;000000003cf3dcfb&gt;] worker_thread+0x2c4/0x3e4
    [&lt;000000007ccaf055&gt;] kthread+0x124/0x134
    [&lt;00000000bef1f723&gt;] ret_from_fork+0x10/0x18
    [&lt;00000000c36ee3dd&gt;] 0xffffffffffffffff

Make sure release_firmware() is called aftre
qca_inject_cmd_complete_event() to avoid the memory leak.

Fixes: 32646db8cc28 ("Bluetooth: btqca: inject command complete event during fw download")
Signed-off-by: Claire Chang &lt;tientzu@chromium.org&gt;
Reviewed-by: Balakrishna Godavarthi &lt;bgodavar@codeaurora.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
