Bluetooth:btintel: Do no pass vendor events to stack
PATCH 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 --
--- drivers/bluetooth/btintel.c | 6 ++++-- drivers/bluetooth/btintel_pcie.c | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-)
drivers/bluetooth/btintel.c +4 -2
@@ -3383,7 +3383,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
@@ -3391,7 +3392,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
@@ -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
Luiz Augusto von Dentz
maintainerHi Kiran,
Quoted 11 lines · Kiran K
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--Signed-off-by Kiran K <[email protected]>
We need the Fixes tag.
Quoted 20 lines
--- drivers/bluetooth/btintel.c | 6 ++++-- drivers/bluetooth/btintel_pcie.c | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-)drivers/bluetooth/btintel.c +2
-1@@ -3383,7 +3383,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
drivers/bluetooth/btintel.c int btintel_recv_event(struct hci_dev *hdev, struct sk_buff *skb) · line 3396
Quoted 6 lines
drivers/bluetooth/btintel.c +2
-1@@ -3391,7 +3392,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 ;
Perhaps we should have a common way to drop the skb e.g. goto drop.
Quoted 28 lines
drivers/bluetooth/btintel.c +0
-0} }drivers/bluetooth/btintel_pcie.c +4
-2@@ -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 582
Quoted 6 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 ;
Ditto.
Quoted 7 lines
drivers/bluetooth/btintel_pcie.c +0
-1} } --2.40.1
Signature · 1 line
Luiz Augusto von Dentz
Hi Luiz,
Quoted 11 lines
Subject: Re: [PATCH v1] Bluetooth:btintel: Do no pass vendor events to stack
Hi Kiran,
Quoted 6 lines · Kiran K
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 8 lines
Quoted 5 lines
--
Bluetooth: hci0: Malformed MSFT vendor event:0x02--Signed-off-by Kiran K <[email protected]>We need the Fixes tag.
Ack. I will include it in the v2 version of the patch.
Quoted 77 lines
drivers/bluetooth/btintel.c int btintel_recv_event(struct hci_dev *hdev, struct
Quoted 10 lines
--- drivers/bluetooth/btintel.c | 6 ++++-- drivers/bluetooth/btintel_pcie.c | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-)drivers/bluetooth/btintel.c +0
-0@@ -3383,7 +3383,8 @@ int btintel_recv_event(struct hci_dev *hdev, struct
sk_buff*skb)Quoted 10 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 @@ -3391,7 +3392,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 3387
Quoted 6 lines
* loading. */ btintel_secure_send_result(hdev, ptr, len);drivers/bluetooth/btintel.c +2
-1-break ; +kfree_skb (skb); +return 0 ;Perhaps we should have a common way to drop the skb e.g. goto drop.
drivers/bluetooth/btintel_pcie.c static int btintel_pcie_recv_event(struct hci_dev
Quoted 9 lines
} }drivers/bluetooth/btintel_pcie.c +0
-0@@ -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
-0if (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
-0data->alive_intr_ctxt =
BTINTEL_PCIE_INTEL_HCI_RESET2;drivers/bluetooth/btintel_pcie.c static int btintel_pcie_recv_event(struct hci_dev
Quoted 7 lines
drivers/bluetooth/btintel_pcie.c +2
-2-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)Quoted 10 lines
btintel_wake_up_flag(data->hdev, INTEL_WAIT_FOR_D0); }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 @@ -576,7 +578,8 @@ static int btintel_pcie_recv_event(struct
hci_dev*hdev, struct
sk_buff*skb)drivers/bluetooth/btintel_pcie.c
Quoted 6 lines
* loading. */ btintel_secure_send_result(hdev, ptr, len);drivers/bluetooth/btintel_pcie.c +2
-1-break ; +kfree_skb (skb); +return 0 ;Ditto.
Quoted 3 lines
} }
Quoted 8 lines
Quoted 4 lines
--
2.40.1--
Luiz Augusto von Dentz
Thanks,
Kiran