Linux-Bluetooth Archive on lore.kernel.org
 help / Atom feed
* [PATCH] Bluetooth: hci_bcm: Handle specific unknown packets after firmware loading
@ 2018-12-05 19:45 Paweł Chmiel
  2018-12-05 21:02 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: Paweł Chmiel @ 2018-12-05 19:45 UTC (permalink / raw)
  To: marcel, johan.hedberg
  Cc: linux-bluetooth, linux-kernel, Jonathan Bakker, Paweł Chmiel

From: Jonathan Bakker <xc-racer2@live.ca>

The Broadcom controller on aries S5PV210 boards sends out a couple of
unknown packets after the firmware is loaded.  This will cause
logging of errors such as:
	Bluetooth: hci0: Frame reassembly failed (-84)

This is probably also the case with other boards, as there are related
Android userspace patches for custom ROMs such as
https://review.lineageos.org/#/c/LineageOS/android_system_bt/+/142721/
Since this appears to be intended behaviour, treated them as diagnostic
packets.

Note that this is another variant of commit 01d5e44ace8a 
("Bluetooth: hci_bcm: Handle empty packet after firmware loading")

Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
---
 drivers/bluetooth/hci_bcm.c | 32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index ddbd8c6a0ceb..ae271836dc26 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -51,6 +51,12 @@
 #define BCM_LM_DIAG_PKT 0x07
 #define BCM_LM_DIAG_SIZE 63
 
+#define BCM_UNKNOWN_PKT 0x31
+#define BCM_UNKNOWN_SIZE 0
+
+#define BCM_UNKNOWN2_PKT 0x34
+#define BCM_UNKNOWN2_SIZE 0
+
 #define BCM_AUTOSUSPEND_DELAY	5000 /* default autosleep delay */
 
 /**
@@ -561,12 +567,28 @@ static int bcm_setup(struct hci_uart *hu)
 	.lsize = 0, \
 	.maxlen = BCM_NULL_SIZE
 
+#define BCM_RECV_UNKNOWN \
+	.type = BCM_UNKNOWN_PKT, \
+	.hlen = BCM_UNKNOWN_SIZE, \
+	.loff = 0, \
+	.lsize = 0, \
+	.maxlen = BCM_UNKNOWN_SIZE
+
+#define BCM_RECV_UNKNOWN2 \
+	.type = BCM_UNKNOWN2_PKT, \
+	.hlen = BCM_UNKNOWN2_SIZE, \
+	.loff = 0, \
+	.lsize = 0, \
+	.maxlen = BCM_UNKNOWN2_SIZE
+
 static const struct h4_recv_pkt bcm_recv_pkts[] = {
-	{ H4_RECV_ACL,      .recv = hci_recv_frame },
-	{ H4_RECV_SCO,      .recv = hci_recv_frame },
-	{ H4_RECV_EVENT,    .recv = hci_recv_frame },
-	{ BCM_RECV_LM_DIAG, .recv = hci_recv_diag  },
-	{ BCM_RECV_NULL,    .recv = hci_recv_diag  },
+	{ H4_RECV_ACL,       .recv = hci_recv_frame },
+	{ H4_RECV_SCO,       .recv = hci_recv_frame },
+	{ H4_RECV_EVENT,     .recv = hci_recv_frame },
+	{ BCM_RECV_LM_DIAG,  .recv = hci_recv_diag  },
+	{ BCM_RECV_NULL,     .recv = hci_recv_diag  },
+	{ BCM_RECV_UNKNOWN,  .recv = hci_recv_diag  },
+	{ BCM_RECV_UNKNOWN2, .recv = hci_recv_diag  },
 };
 
 static int bcm_recv(struct hci_uart *hu, const void *data, int count)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: hci_bcm: Handle specific unknown packets after firmware loading
  2018-12-05 19:45 [PATCH] Bluetooth: hci_bcm: Handle specific unknown packets after firmware loading Paweł Chmiel
@ 2018-12-05 21:02 ` Marcel Holtmann
  2018-12-05 21:24   ` Paweł Chmiel
  0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2018-12-05 21:02 UTC (permalink / raw)
  To: Paweł Chmiel
  Cc: Johan Hedberg, Bluez mailing list, linux-kernel, Jonathan Bakker

Hi Pawel,

> The Broadcom controller on aries S5PV210 boards sends out a couple of
> unknown packets after the firmware is loaded.  This will cause
> logging of errors such as:
> 	Bluetooth: hci0: Frame reassembly failed (-84)
> 
> This is probably also the case with other boards, as there are related
> Android userspace patches for custom ROMs such as
> https://review.lineageos.org/#/c/LineageOS/android_system_bt/+/142721/
> Since this appears to be intended behaviour, treated them as diagnostic
> packets.
> 
> Note that this is another variant of commit 01d5e44ace8a 
> ("Bluetooth: hci_bcm: Handle empty packet after firmware loading")
> 
> Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
> Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
> ---
> drivers/bluetooth/hci_bcm.c | 32 +++++++++++++++++++++++++++-----
> 1 file changed, 27 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
> index ddbd8c6a0ceb..ae271836dc26 100644
> --- a/drivers/bluetooth/hci_bcm.c
> +++ b/drivers/bluetooth/hci_bcm.c
> @@ -51,6 +51,12 @@
> #define BCM_LM_DIAG_PKT 0x07
> #define BCM_LM_DIAG_SIZE 63
> 
> +#define BCM_UNKNOWN_PKT 0x31
> +#define BCM_UNKNOWN_SIZE 0
> +
> +#define BCM_UNKNOWN2_PKT 0x34
> +#define BCM_UNKNOWN2_SIZE 0
> +

lets use BCM_TYPE49_ and BCM_TYPE52_

> #define BCM_AUTOSUSPEND_DELAY	5000 /* default autosleep delay */
> 
> /**
> @@ -561,12 +567,28 @@ static int bcm_setup(struct hci_uart *hu)
> 	.lsize = 0, \
> 	.maxlen = BCM_NULL_SIZE
> 
> +#define BCM_RECV_UNKNOWN \
> +	.type = BCM_UNKNOWN_PKT, \
> +	.hlen = BCM_UNKNOWN_SIZE, \
> +	.loff = 0, \
> +	.lsize = 0, \
> +	.maxlen = BCM_UNKNOWN_SIZE
> +
> +#define BCM_RECV_UNKNOWN2 \
> +	.type = BCM_UNKNOWN2_PKT, \
> +	.hlen = BCM_UNKNOWN2_SIZE, \
> +	.loff = 0, \
> +	.lsize = 0, \
> +	.maxlen = BCM_UNKNOWN2_SIZE

Same here, BCM_RECV_TYPE49 and BCM_RECV_TYPE52.

> +
> static const struct h4_recv_pkt bcm_recv_pkts[] = {
> -	{ H4_RECV_ACL,      .recv = hci_recv_frame },
> -	{ H4_RECV_SCO,      .recv = hci_recv_frame },
> -	{ H4_RECV_EVENT,    .recv = hci_recv_frame },
> -	{ BCM_RECV_LM_DIAG, .recv = hci_recv_diag  },
> -	{ BCM_RECV_NULL,    .recv = hci_recv_diag  },
> +	{ H4_RECV_ACL,       .recv = hci_recv_frame },
> +	{ H4_RECV_SCO,       .recv = hci_recv_frame },
> +	{ H4_RECV_EVENT,     .recv = hci_recv_frame },
> +	{ BCM_RECV_LM_DIAG,  .recv = hci_recv_diag  },
> +	{ BCM_RECV_NULL,     .recv = hci_recv_diag  },
> +	{ BCM_RECV_UNKNOWN,  .recv = hci_recv_diag  },
> +	{ BCM_RECV_UNKNOWN2, .recv = hci_recv_diag  },
> };
> 
> static int bcm_recv(struct hci_uart *hu, const void *data, int count)

Regards

Marcel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: hci_bcm: Handle specific unknown packets after firmware loading
  2018-12-05 21:02 ` Marcel Holtmann
@ 2018-12-05 21:24   ` Paweł Chmiel
  0 siblings, 0 replies; 3+ messages in thread
From: Paweł Chmiel @ 2018-12-05 21:24 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: Johan Hedberg, Bluez mailing list, linux-kernel, Jonathan Bakker

Dnia środa, 5 grudnia 2018 22:02:30 CET Marcel Holtmann pisze:
> Hi Pawel,
> 
> > The Broadcom controller on aries S5PV210 boards sends out a couple of
> > unknown packets after the firmware is loaded.  This will cause
> > logging of errors such as:
> > 	Bluetooth: hci0: Frame reassembly failed (-84)
> > 
> > This is probably also the case with other boards, as there are related
> > Android userspace patches for custom ROMs such as
> > https://review.lineageos.org/#/c/LineageOS/android_system_bt/+/142721/
> > Since this appears to be intended behaviour, treated them as diagnostic
> > packets.
> > 
> > Note that this is another variant of commit 01d5e44ace8a 
> > ("Bluetooth: hci_bcm: Handle empty packet after firmware loading")
> > 
> > Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
> > Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
> > ---
> > drivers/bluetooth/hci_bcm.c | 32 +++++++++++++++++++++++++++-----
> > 1 file changed, 27 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
> > index ddbd8c6a0ceb..ae271836dc26 100644
> > --- a/drivers/bluetooth/hci_bcm.c
> > +++ b/drivers/bluetooth/hci_bcm.c
> > @@ -51,6 +51,12 @@
> > #define BCM_LM_DIAG_PKT 0x07
> > #define BCM_LM_DIAG_SIZE 63
> > 
> > +#define BCM_UNKNOWN_PKT 0x31
> > +#define BCM_UNKNOWN_SIZE 0
> > +
> > +#define BCM_UNKNOWN2_PKT 0x34
> > +#define BCM_UNKNOWN2_SIZE 0
> > +
> 
> lets use BCM_TYPE49_ and BCM_TYPE52_
> 
> > #define BCM_AUTOSUSPEND_DELAY	5000 /* default autosleep delay */
> > 
> > /**
> > @@ -561,12 +567,28 @@ static int bcm_setup(struct hci_uart *hu)
> > 	.lsize = 0, \
> > 	.maxlen = BCM_NULL_SIZE
> > 
> > +#define BCM_RECV_UNKNOWN \
> > +	.type = BCM_UNKNOWN_PKT, \
> > +	.hlen = BCM_UNKNOWN_SIZE, \
> > +	.loff = 0, \
> > +	.lsize = 0, \
> > +	.maxlen = BCM_UNKNOWN_SIZE
> > +
> > +#define BCM_RECV_UNKNOWN2 \
> > +	.type = BCM_UNKNOWN2_PKT, \
> > +	.hlen = BCM_UNKNOWN2_SIZE, \
> > +	.loff = 0, \
> > +	.lsize = 0, \
> > +	.maxlen = BCM_UNKNOWN2_SIZE
> 
> Same here, BCM_RECV_TYPE49 and BCM_RECV_TYPE52.
> 
> > +
> > static const struct h4_recv_pkt bcm_recv_pkts[] = {
> > -	{ H4_RECV_ACL,      .recv = hci_recv_frame },
> > -	{ H4_RECV_SCO,      .recv = hci_recv_frame },
> > -	{ H4_RECV_EVENT,    .recv = hci_recv_frame },
> > -	{ BCM_RECV_LM_DIAG, .recv = hci_recv_diag  },
> > -	{ BCM_RECV_NULL,    .recv = hci_recv_diag  },
> > +	{ H4_RECV_ACL,       .recv = hci_recv_frame },
> > +	{ H4_RECV_SCO,       .recv = hci_recv_frame },
> > +	{ H4_RECV_EVENT,     .recv = hci_recv_frame },
> > +	{ BCM_RECV_LM_DIAG,  .recv = hci_recv_diag  },
> > +	{ BCM_RECV_NULL,     .recv = hci_recv_diag  },
> > +	{ BCM_RECV_UNKNOWN,  .recv = hci_recv_diag  },
> > +	{ BCM_RECV_UNKNOWN2, .recv = hci_recv_diag  },
> > };
> > 
> > static int bcm_recv(struct hci_uart *hu, const void *data, int count)
> 
> Regards
> 
> Marcel
> 
Hi
Fixed in v2 version of patch.

Thanks for review.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05 19:45 [PATCH] Bluetooth: hci_bcm: Handle specific unknown packets after firmware loading Paweł Chmiel
2018-12-05 21:02 ` Marcel Holtmann
2018-12-05 21:24   ` Paweł Chmiel

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable: git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org linux-bluetooth@archiver.kernel.org
	public-inbox-index linux-bluetooth


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/ public-inbox