Skip to contentSkip to conversation

Bluetooth:btintel: Do no pass vendor events to stack

PATCH Applied Kiran K 3 participants 4 messages Oct 17, 2024 Bluetooth drivers

v2 of 3 Applied 1/1 Latest is v3 →

lore
Share & tools
lore

Kiran K

author
#0 lore raw

PATCH v2 1/1 Bluetooth:btintel: Do no pass vendor events to stack

During firmware download, vendor specific events like boot up and secure send result are generated. These events can be safely processed at the driver level. Passing on these events to stack prints unnecessary below warning log.

--
Bluetooth: hci0: Malformed MSFT vendor event: 0x02 --

Fixes 3368aa357f3b ("Bluetooth: msft: Handle MSFT Monitor Device Event")
---
 drivers/bluetooth/btintel.c      | 6 ++++--
 drivers/bluetooth/btintel_pcie.c | 9 ++++++---
 2 files changed, 10 insertions(+), 5 deletions(-)
drivers/bluetooth/btintel.c +4 -2
index 2be6d48a2a65..e122dff855ba 100644
@@ -3395,7 +3395,8 @@ int btintel_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
 				 * indicating that the bootup completed.
 				 */
 				btintel_bootup(hdev, ptr, len);
-				break;
+				kfree_skb(skb);
+				return 0;
 			case 0x06:
 				/* When the firmware loading completes the
 				 * device sends out a vendor specific event
@@ -3403,7 +3404,8 @@ int btintel_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
 				 * loading.
 				 */
 				btintel_secure_send_result(hdev, ptr, len);
-				break;
+				kfree_skb(skb);
+				return 0;
 			}
 		}
 
drivers/bluetooth/btintel_pcie.c +6 -3
index e4ae8c898dfd..deed8052b482 100644
@@ -551,7 +551,8 @@ static int btintel_pcie_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
 				if (btintel_pcie_in_op(data)) {
 					btintel_pcie_wr_sleep_cntrl(data, BTINTEL_PCIE_STATE_D0);
 					data->alive_intr_ctxt = BTINTEL_PCIE_INTEL_HCI_RESET2;
-					break;
+					kfree_skb(skb);
+					return 0;
 				}
 
 				if (btintel_pcie_in_iml(data)) {
@@ -568,7 +569,8 @@ static int btintel_pcie_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
 						btintel_wake_up_flag(data->hdev,
 								     INTEL_WAIT_FOR_D0);
 				}
-				break;
+				kfree_skb(skb);
+				return 0;
 			case 0x06:
 				/* When the firmware loading completes the
 				 * device sends out a vendor specific event
@@ -576,7 +578,8 @@ static int btintel_pcie_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
 				 * loading.
 				 */
 				btintel_secure_send_result(hdev, ptr, len);
-				break;
+				kfree_skb(skb);
+				return 0;
 			}
 		}
 
Signature · 1 line
2.40.1
#1 lore raw

Dear Kiran,

Thank you for your patch. Please note, in the summary/title a space is missing before *btintel*.

Am 17.10.24 um 12:22 schrieb Kiran K:

Quoted 8 lines

During firmware download, vendor specific events like boot up and secure send result are generated. These events can be safely processed at the driver level. Passing on these events to stack prints unnecessary below warning log.

--
Bluetooth: hci0: Malformed MSFT vendor event: 0x02 --

I’d remove the -- and just indent the message by four characters to follow Markdown markup style.

On what device did you test this? Are there open reports about it?

Quoted 56 lines
Fixes 3368aa357f3b ("Bluetooth: msft: Handle MSFT Monitor Device Event")
---
  drivers/bluetooth/btintel.c      | 6 ++++--
  drivers/bluetooth/btintel_pcie.c | 9 ++++++---
  2 files changed, 10 insertions(+), 5 deletions(-)
drivers/bluetooth/btintel.c +4 -2
index 2be6d48a2a65..e122dff855ba 100644
@@ -3395,7 +3395,8 @@ int btintel_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
  				 * indicating that the bootup completed.
  				 */
  				btintel_bootup(hdev, ptr, len);
-				break;
+				kfree_skb(skb);
+				return 0;
  			case 0x06:
  				/* When the firmware loading completes the
  				 * device sends out a vendor specific event
@@ -3403,7 +3404,8 @@ int btintel_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
  				 * loading.
  				 */
  				btintel_secure_send_result(hdev, ptr, len);
-				break;
+				kfree_skb(skb);
+				return 0;
  			}
  		}
 
drivers/bluetooth/btintel_pcie.c +4 -2
index e4ae8c898dfd..deed8052b482 100644
@@ -551,7 +551,8 @@ static int btintel_pcie_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
  				if (btintel_pcie_in_op(data)) {
  					btintel_pcie_wr_sleep_cntrl(data, BTINTEL_PCIE_STATE_D0);
  					data->alive_intr_ctxt = BTINTEL_PCIE_INTEL_HCI_RESET2;
-					break;
+					kfree_skb(skb);
+					return 0;
  				}
 
  				if (btintel_pcie_in_iml(data)) {
@@ -568,7 +569,8 @@ static int btintel_pcie_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
  						btintel_wake_up_flag(data->hdev,
  								     INTEL_WAIT_FOR_D0);
  				}
-				break;
+				kfree_skb(skb);
+				return 0;
  			case 0x06:
  				/* When the firmware loading completes the
  				 * device sends out a vendor specific event

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_recv_event(struct hci_dev *hdev, struct sk_buff *skb) · line 584

Quoted 8 lines
drivers/bluetooth/btintel_pcie.c +2 -1
@@ -576,7 +578,8 @@ static int btintel_pcie_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
  				 * loading.
  				 */
  				btintel_secure_send_result(hdev, ptr, len);
-				break;
+				kfree_skb(skb);
+				return 0;
  			}
  		}

Kind regards,

Paul

author
#2 lore raw

Hi Paul,

Thanks for your comments. I will incorporate the changes in v3 version of the patch.

Quoted 102 lines

Subject: Re: [PATCH v2] Bluetooth:btintel: Do no pass vendor events to stack

Dear Kiran,

Thank you for your patch. Please note, in the summary/title a space is missing before *btintel*.

Am 17.10.24 um 12:22 schrieb Kiran K:

Quoted 8 lines

During firmware download, vendor specific events like boot up and secure send result are generated. These events can be safely processed at the driver level. Passing on these events to stack prints unnecessary below warning log.

--
Bluetooth: hci0: Malformed MSFT vendor event: 0x02 --

I’d remove the -- and just indent the message by four characters to follow Markdown markup style.

On what device did you test this? Are there open reports about it?

drivers/bluetooth/btintel.c int btintel_recv_event(struct hci_dev *hdev, struct

Quoted 13 lines
Fixes 3368aa357f3b ("Bluetooth: msft: Handle MSFT Monitor Device

Event")

---
  drivers/bluetooth/btintel.c      | 6 ++++--
  drivers/bluetooth/btintel_pcie.c | 9 ++++++---
  2 files changed, 10 insertions(+), 5 deletions(-)
drivers/bluetooth/btintel.c +0 -0
index 2be6d48a2a65..e122dff855ba 100644
@@ -3395,7 +3395,8 @@ int btintel_recv_event(struct hci_dev *hdev, struct

sk_buff *skb)

drivers/bluetooth/btintel.c int btintel_recv_event(struct hci_dev *hdev, struct sk_buff *skb) · line 3402

Quoted 9 lines
drivers/bluetooth/btintel.c +2 -1
  				 * indicating that the bootup completed.
  				 */
  				btintel_bootup(hdev, ptr, len);
-				break;
+				kfree_skb(skb);
+				return 0;
  			case 0x06:
  				/* When the firmware loading completes the
  				 * device sends out a vendor specific event

@@ -3403,7 +3404,8

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_recv_event(struct hci_dev

Quoted 16 lines

@@ int btintel_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
* loading.
*/
btintel_secure_send_result(hdev, ptr, len);

drivers/bluetooth/btintel.c +2 -1
-				break;
+				kfree_skb(skb);
+				return 0;
  			}
  		}
drivers/bluetooth/btintel_pcie.c +0 -0
index e4ae8c898dfd..deed8052b482 100644
@@ -551,7 +551,8 @@ static int btintel_pcie_recv_event(struct hci_dev

*hdev, struct sk_buff *skb)

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_recv_event(struct hci_dev · line 552

Quoted 2 lines
drivers/bluetooth/btintel_pcie.c +0 -0
  				if (btintel_pcie_in_op(data)) {
  					btintel_pcie_wr_sleep_cntrl(data,

BTINTEL_PCIE_STATE_D0);

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_recv_event(struct hci_dev · line 553

Quoted 1 line
drivers/bluetooth/btintel_pcie.c +0 -0
  					data->alive_intr_ctxt =

BTINTEL_PCIE_INTEL_HCI_RESET2;

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_recv_event(struct hci_dev · line 558

Quoted 6 lines
drivers/bluetooth/btintel_pcie.c +2 -1
-					break;
+					kfree_skb(skb);
+					return 0;
  				}
 
  				if (btintel_pcie_in_iml(data)) { @@ -568,7

+569,8 @@ static int

Quoted 4 lines

btintel_pcie_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
btintel_wake_up_flag(data-
hdev,

INTEL_WAIT_FOR_D0);

Quoted 7 lines
  				}
drivers/bluetooth/btintel_pcie.c +2 -1
-				break;
+				kfree_skb(skb);
+				return 0;
  			case 0x06:
  				/* When the firmware loading completes the
  				 * device sends out a vendor specific event
(quoted diff) +0 -0
@@ -576,7 +578,8 @@
 > static int btintel_pcie_recv_event(struct hci_dev *hdev, struct sk_buff *skb)

drivers/bluetooth/btintel_pcie.c

Quoted 8 lines

* loading.
*/
btintel_secure_send_result(hdev, ptr, len);

drivers/bluetooth/btintel_pcie.c +2 -1
-				break;
+				kfree_skb(skb);
+				return 0;
  			}
  		}

Kind regards,

Quoted 1 line

Paul

Thanks,
Kiran

#3 lore raw
In reply to Kiran K
This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

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

Quoted 5 lines · On Thu, 17 Oct 2024 15:52:36 +0530 you wrote:

During firmware download, vendor specific events like boot up and secure send result are generated. These events can be safely processed at the driver level. Passing on these events to stack prints unnecessary below warning log.

Quoted 7 lines

--
Bluetooth: hci0: Malformed MSFT vendor event: 0x02 --

Fixes 3368aa357f3b ("Bluetooth: msft: Handle MSFT Monitor Device Event")

[...]

Here is the summary with links:
- [v2] Bluetooth:btintel: Do no pass vendor events to stack

    https://git.kernel.org/bluetooth/bluetooth-next/c/4d67eb2b5444

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html