diff mbox series

bluetooth: hci_event: don't print an error on vendor events

Message ID 20220302182352.441352-1-caleb.connolly@linaro.org (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series bluetooth: hci_event: don't print an error on vendor events | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 3 this patch: 3
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Caleb Connolly March 2, 2022, 6:23 p.m. UTC
Since commit 3e54c5890c87 ("Bluetooth: hci_event: Use of a function table to handle HCI events"),
some devices see errors being printed for vendor events, e.g.

[   75.806141] Bluetooth: hci0: setting up wcn399x
[   75.948311] Bluetooth: hci0: unexpected event 0xff length: 14 > 0
[   75.955552] Bluetooth: hci0: QCA Product ID   :0x0000000a
[   75.961369] Bluetooth: hci0: QCA SOC Version  :0x40010214
[   75.967417] Bluetooth: hci0: QCA ROM Version  :0x00000201
[   75.973363] Bluetooth: hci0: QCA Patch Version:0x00000001
[   76.000289] Bluetooth: hci0: QCA controller version 0x02140201
[   76.006727] Bluetooth: hci0: QCA Downloading qca/crbtfw21.tlv
[   76.986850] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.013574] Bluetooth: hci0: QCA Downloading qca/oneplus6/crnv21.bin
[   77.024302] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.032681] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.040674] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.049251] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.057997] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.066320] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.075065] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.083073] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.091250] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.099417] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.110166] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.118672] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.127449] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.137190] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.146192] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.154242] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.163183] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.171202] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.179364] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.187259] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
[   77.198451] Bluetooth: hci0: QCA setup on UART is completed

Use the quick-return path in hci_event_func() to avoid printing this
message for vendor events, this reverts to the previous behaviour which
didn't print an error for vendor events.

Fixes: 3e54c5890c87 ("Bluetooth: hci_event: Use of a function table to handle HCI events")
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
---
 net/bluetooth/hci_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marcel Holtmann March 2, 2022, 7:16 p.m. UTC | #1
Hi Caleb,

> Since commit 3e54c5890c87 ("Bluetooth: hci_event: Use of a function table to handle HCI events"),
> some devices see errors being printed for vendor events, e.g.
> 
> [   75.806141] Bluetooth: hci0: setting up wcn399x
> [   75.948311] Bluetooth: hci0: unexpected event 0xff length: 14 > 0
> [   75.955552] Bluetooth: hci0: QCA Product ID   :0x0000000a
> [   75.961369] Bluetooth: hci0: QCA SOC Version  :0x40010214
> [   75.967417] Bluetooth: hci0: QCA ROM Version  :0x00000201
> [   75.973363] Bluetooth: hci0: QCA Patch Version:0x00000001
> [   76.000289] Bluetooth: hci0: QCA controller version 0x02140201
> [   76.006727] Bluetooth: hci0: QCA Downloading qca/crbtfw21.tlv
> [   76.986850] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.013574] Bluetooth: hci0: QCA Downloading qca/oneplus6/crnv21.bin
> [   77.024302] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.032681] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.040674] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.049251] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.057997] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.066320] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.075065] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.083073] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.091250] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.099417] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.110166] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.118672] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.127449] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.137190] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.146192] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.154242] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.163183] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.171202] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.179364] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.187259] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
> [   77.198451] Bluetooth: hci0: QCA setup on UART is completed
> 
> Use the quick-return path in hci_event_func() to avoid printing this
> message for vendor events, this reverts to the previous behaviour which
> didn't print an error for vendor events.
> 
> Fixes: 3e54c5890c87 ("Bluetooth: hci_event: Use of a function table to handle HCI events")
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
> net/bluetooth/hci_event.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-stable tree.

Regards

Marcel
Caleb Connolly March 2, 2022, 7:18 p.m. UTC | #2
Hi Marcel,

On 02/03/2022 19:16, Marcel Holtmann wrote:
> Hi Caleb,
> 
>> Since commit 3e54c5890c87 ("Bluetooth: hci_event: Use of a function table to handle HCI events"),
>> some devices see errors being printed for vendor events, e.g.
>>
>> [   75.806141] Bluetooth: hci0: setting up wcn399x
>> [   75.948311] Bluetooth: hci0: unexpected event 0xff length: 14 > 0
>> [   75.955552] Bluetooth: hci0: QCA Product ID   :0x0000000a
>> [   75.961369] Bluetooth: hci0: QCA SOC Version  :0x40010214
>> [   75.967417] Bluetooth: hci0: QCA ROM Version  :0x00000201
>> [   75.973363] Bluetooth: hci0: QCA Patch Version:0x00000001
>> [   76.000289] Bluetooth: hci0: QCA controller version 0x02140201
>> [   76.006727] Bluetooth: hci0: QCA Downloading qca/crbtfw21.tlv
>> [   76.986850] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.013574] Bluetooth: hci0: QCA Downloading qca/oneplus6/crnv21.bin
>> [   77.024302] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.032681] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.040674] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.049251] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.057997] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.066320] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.075065] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.083073] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.091250] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.099417] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.110166] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.118672] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.127449] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.137190] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.146192] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.154242] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.163183] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.171202] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.179364] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.187259] Bluetooth: hci0: unexpected event 0xff length: 3 > 0
>> [   77.198451] Bluetooth: hci0: QCA setup on UART is completed
>>
>> Use the quick-return path in hci_event_func() to avoid printing this
>> message for vendor events, this reverts to the previous behaviour which
>> didn't print an error for vendor events.
>>
>> Fixes: 3e54c5890c87 ("Bluetooth: hci_event: Use of a function table to handle HCI events")
>> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
>> ---
>> net/bluetooth/hci_event.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> patch has been applied to bluetooth-stable tree.
I spotted an issue with this patch - the vendor events are actually processed, it's the warning which is printed and not 
the error, I sent a v2 which properly disables the printing - you probably want that one instead, apologies for the 
noise/inconvenience.
> 
> Regards
> 
> Marcel
>
diff mbox series

Patch

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index fc30f4c03d29..56cc41ea9f31 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -6809,7 +6809,7 @@  static void hci_event_func(struct hci_dev *hdev, u8 event, struct sk_buff *skb,
 	const struct hci_ev *ev = &hci_ev_table[event];
 	void *data;
 
-	if (!ev->func)
+	if (!ev->func || event == HCI_EV_VENDOR)
 		return;
 
 	if (skb->len < ev->min_len) {