Skip to contentSkip to conversation

BCM43341B0 Frame reassembly failed

DISCUSSION Brennan Ashton 2 participants 6 messages Mar 21, 2018 – Mar 23, 2018 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

I recently brought an Intel Edison board with a BCM43341B0 chip up from 4.9 to 4.16.0-rc6 but I am having reliability issues when using btattach instead of the previous brcm_patchram_plus utility to attach the device.

The hci communication with the bluetooth chip gets corrupted almost always when creating a GATT connection. Thowing "Bluetooth: hci0:
Frame reassembly failed (-84)" and then requiring the device to be reset to communicate again.

Kernel logs interleaved with attaching the device:

# /usr/bin/btattach --bredr /dev/ttyS0 -P bcm -S 3000000 &
# Attaching Primary controller to /dev/ttyS0
[   53.148206] Bluetooth: HCI UART driver ver 2.3
[   53.152758] Bluetooth: HCI UART protocol H4 registered
[   53.157970] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   53.164512] hci_bcm hci_bcm: hci_bcm device registered.
[   53.170445] Bluetooth: HCI UART protocol Broadcom registered
Switched line discipline from 0 to 15
Device index 0 attached
[   53.333220] Bluetooth: hci0: BCM: chip id 82
[   53.340184] Bluetooth: hci0: BCM: features 0x2f
[   53.368421] Bluetooth: hci0: BCM43341B0
[   53.372338] Bluetooth: hci0: BCM43341B0 (002.001.014) build 0000
[   57.843684] Bluetooth: hci0: BCM (002.001.014) build 0166

Tail of the btmon while it is attached:

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 #299 [hci0]

62.947028

      Broadcom Write RAM (0x3f|0x004c) ncmd 1
        Status: Success (0x00)
< HCI Command: Broadcom Write RAM (0x3f|0x004c) plen 255  #300 [hci0]
62.947488
        Address: 0x000d7a7d
        0f 71 d0 09 dc bc f1 71 0f 6e d0 bc f1 73 0f
6c  .q.....q.n...s.l
        d0 bc f1 75 0f cb d1 29 e1 bc f1 79 0f 76 d0
bc  ...u...)...y.v..
        f1 85 0f 74 d0 bc f1 ad 0f c1 d1 12 e1 a8 78
10  ...t..........x.
        f0 60 0f 07 d1 e9 1c 38 46 fe f7 0b f8 60 f3
1f  .`.....8F....`..
        64 00 28 f2 d1 bd e8 f0 41 ff f7 c6 be e9 1c
38  d.(.....A......8
        46 fd f7 ff ff 28 78 40 1f c2 b2 eb 1d 03 e0
28  F....(x@.......(
        78 40 1e c2 b2 eb 1c a0 21 38 46 fe f7 b6 f9
ee  x@......!8F.....
        e0 e9 1c 38 46 fd f7 ed ff 28 78 40 1f c2 b2
eb  ...8F....(x@....
        1d 03 e0 28 78 40 1e c2 b2 eb 1c 00 21 ec e7
00  ...(x@......!...
        2e 6f d0 b7 70 ea 78 02 23 03 25 54 2a 26 d0
08  .o..p.x.#.%T*&..
        dc 3e 2a 35 d0 51 2a 15 d0 52 2a 08 d1 0a e0
c5  .>*5.Q*..R*.....
        e0 af e0 73 2a 36 d0 79 2a 3d d0 85 2a 42 d0
60  ...s*6.y*=..*B.`
        f3 1f 64 c8 e0 33 70 52 20 70 70 38 46 fd f7 89  ..d..3pR
pp8F...
        ff f0 70 c0 e0 05 20 30 70 51 20 70 70 f1 1c 38  ..p... 0pQ
pp..8
        46 fd f7 8a ff b7 e0 8d e0 62 e0 c4 e0 08 20 30  F........b....
0
        70 54 22 72 70 b0 70 f5 70 31

71 pT"rp.p.p1q
< HCI Command: Reset (0x03|0x0003) plen 0 #301 [hci0]
63.278672

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 #302 [hci0]

63.282869

      Reset (0x03|0x0003) ncmd 1
        Status: Success (0x00)

< HCI Command: Read Local Version.. (0x04|0x0001) plen 0 #303 [hci0] 63.390748

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 12 #304 [hci0]

63.393602

      Read Local Version Information (0x04|0x0001) ncmd 1
        Status: Success (0x00)
        HCI version: Bluetooth 4.0 (0x06) - Revision 166 (0x00a6)
        LMP version: Bluetooth 4.0 (0x06) - Subversion 16654 (0x410e)
        Manufacturer: Broadcom Corporation (15)
          Firmware: 002.001.014 (BCM43341B0)
          Build: 0166

< HCI Command: Read BD ADDR (0x04|0x0009) plen 0 #305 [hci0]
63.639173

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 10 #306 [hci0]

63.641588

      Read BD ADDR (0x04|0x0009) ncmd 1
        Status: Success (0x00)
        Address: 43:34:1B:00:1F:AC (OUI 43-34-1B)
< HCI Command: Broadcom Set Slee.. (0x3f|0x0027) plen 12  #307 [hci0]
63.641961
        Sleep mode: UART (0x01)
        02 02 01 01 01 01 00 00 00 00

00 ...........

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 #308 [hci0]

63.645219

      Broadcom Set Sleepmode Param (0x3f|0x0027) ncmd 1
        Status: Success (0x00)

< HCI Command: Reset (0x03|0x0003) plen 0 #309 [hci0]
63.645426

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 #310 [hci0]

63.663325

      Reset (0x03|0x0003) ncmd 1
        Status: Success (0x00)

bluetoothctl interleaved with btmon showing the device advertised and then the connection starting:

# bluetoothctl
[NEW] Controller 43:34:1B:00:1F:AC TestDevice [default]
Agent registered
[bluetooth]# advertise yes
[bluetooth]# @ Control Command:
0xffff                            {0x0002} [hci0] 111.701388
        3e 00 01 03 00 00 00 00 00 00 00 00
00           >............   
@ MGMT Event: Advertising Added (0x0023) plen 1      {0x0003} [hci0]
111.701423
        Instance: 1
@ MGMT Event: Advertising Added (0x0023) plen 1      {0x0001} [hci0]
111.701423
        Instance: 1
< HCI Command: LE Set Advertisi.. (0x08|0x0008) plen 32  #311 [hci0]
111.701986
        Length: 3
        Flags: 0x06
          LE General Discoverable Mode
          BR/EDR Not Supported
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 #312 [hci0]

111.723457

      LE Set Advertising Data (0x08|0x0008) ncmd 1
        Status: Success (0x00)

< HCI Command: LE Set Scan Resp.. (0x08|0x0009) plen 32 #313 [hci0] 111.723629
Length: 0

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 #314 [hci0]

111.728550

      LE Set Scan Response Data (0x08|0x0009) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Advertisi.. (0x08|0x0006) plen 15  #315 [hci0]
111.728805
        Min advertising interval: 1280.000 msec (0x0800)
        Max advertising interval: 1280.000 msec (0x0800)
        Type: Connectable undirected - ADV_IND (0x00)
        Own address type: Public (0x00)
        Direct address type: Public (0x00)
        Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
        Channel map: 37, 38, 39 (0x07)
        Filter policy: Allow Scan Request from Any, Allow Connect

Request from Any (0x00)

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 #316 [hci0]

111.732270

      LE Set Advertising Parameters (0x08|0x0006) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Advertise... (0x08|0x000a) plen 1  #317 [hci0]
111.732431
        Advertising: Enabled (0x01)
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 #318 [hci0]

111.734729

      LE Set Advertise Enable (0x08|0x000a) ncmd 1
        Status: Success (0x00)
@ Control Event: 0xffff                              {0x0002} [hci0]
111.734864
        01 00 3e 00 00 01                                ..>...    

[CHG] Controller 43:34:1B:00:1F:AC SupportedInstances: 0x04 [CHG] Controller 43:34:1B:00:1F:AC ActiveInstances: 0x01 Advertising object registered
[bluetooth]# [ 363.168061] Bluetooth: hci0: Frame reassembly failed (-
84)

[  363.426183] Bluetooth: hci0: ACL packet for unknown connection

handle 64

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 11 #319 [hci0]

122.280157

      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Primary Service (0x2800)
Quoted 1 line

HCI Event: LE Meta Event (0x3e) plen 10 #320 [hci0]

122.648076

      LE Connection Update Complete (0x03)
        Status: Success (0x00)
        Handle: 64
        Connection interval: 7.50 msec (0x0006)
        Connection latency: 0 (0x0000)
        Supervision timeout: 5000 msec (0x01f4)
[  368.353615] Bluetooth: hci0: ACL packet for unknown connection

handle 64

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 11 #321 [hci0]

127.207585

      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Primary Service (0x2800)
[  373.371672] Bluetooth: hci0: Frame reassembly failed (-84)
[  373.377296] Bluetooth: hci0: Frame reassembly failed (-84)
Quoted 1 line

HCI Event: Disconnect Complete (0x05) plen 4 #322 [hci0]

137.242761

        Status: Success (0x00)
        Handle: 64

If I change nothing but using this script instead of the btattach I do not notice any of these issues:

echo 71 > /sys/class/gpio/export || true
echo out > /sys/class/gpio/gpio71/direction
echo 184 > /sys/class/gpio/export || true
echo out > /sys/class/gpio/gpio184/direction

echo 0 > /sys/class/gpio/gpio71/value
echo 0 > /sys/class/gpio/gpio184/value
sleep 1
echo 1 > /sys/class/gpio/gpio71/value
echo 1 > /sys/class/gpio/gpio184/value

/usr/sbin/brcm-patchram-plus                    \
        --use_baudrate_for_download             \
        --no2bytes                              \
        --enable_lpm                            \
        --enable_hci                            \
        --baudrate 3000000                      \
        --patchram /lib/firmware/brcm/BCM43341B0.hcd   \
        --bd_addr "97:4F:EE:03:0F:E8"           \
        -d                                      \
        /dev/ttyS0

Let me know if there is further debugging I can provide on this.

Thanks,
Brennan

maintainer
#1 lore raw

Hi Brennan,

Quoted 12 lines

I recently brought an Intel Edison board with a BCM43341B0 chip up from 4.9 to 4.16.0-rc6 but I am having reliability issues when using btattach instead of the previous brcm_patchram_plus utility to attach the device.

The hci communication with the bluetooth chip gets corrupted almost always when creating a GATT connection. Thowing "Bluetooth: hci0:
Frame reassembly failed (-84)" and then requiring the device to be reset to communicate again.

Kernel logs interleaved with attaching the device:

Quoted 14 lines
# /usr/bin/btattach --bredr /dev/ttyS0 -P bcm -S 3000000 &
# Attaching Primary controller to /dev/ttyS0
[   53.148206] Bluetooth: HCI UART driver ver 2.3
[   53.152758] Bluetooth: HCI UART protocol H4 registered
[   53.157970] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   53.164512] hci_bcm hci_bcm: hci_bcm device registered.
[   53.170445] Bluetooth: HCI UART protocol Broadcom registered
Switched line discipline from 0 to 15
Device index 0 attached
[   53.333220] Bluetooth: hci0: BCM: chip id 82
[   53.340184] Bluetooth: hci0: BCM: features 0x2f
[   53.368421] Bluetooth: hci0: BCM43341B0
[   53.372338] Bluetooth: hci0: BCM43341B0 (002.001.014) build 0000
[   57.843684] Bluetooth: hci0: BCM (002.001.014) build 0166

if you have a chance, I like to see the complete binary btmon -w trace.log.

However I think we need to figure out what is causing the -EILSEQ error in the h4_recv_buf() in hci_h4.c. There are more than one in it and you have to do some printk debugging to figure out which one it is.

So if you do something like this, then we might be able to debug what is going on in the H:4 stream.

drivers/bluetooth/hci_h4.c +13 -1
index fb97a3bf069b..ba9b293f4948 100644
@@ -201,8 +201,13 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
                        }
 
                        /* Check for invalid packet type */
-                       if (!skb)
+                       if (!skb) {
+                               printk(KERN_INFO "H4: Invalid packet type\n");
+                               print_hex_dump(KERN_INFO, "  ",
+                                              DUMP_PREFIX_OFFSET, 16, 1,
+                                              buffer, count, true);
                                return ERR_PTR(-EILSEQ);
+                       }
 
                        count -= 1;
                        buffer += 1;
@@ -224,6 +229,9 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
                }
 
                if (i >= pkts_count) {
+                       printk(KERN_INFO "H4: Corrupted packet type\n");
+                       print_hex_dump(KERN_INFO, "  ", DUMP_PREFIX_OFFSET,
+                                      16, 1, skb->data, skb->len, true);
                        kfree_skb(skb);
                        return ERR_PTR(-EILSEQ);
                }
@@ -259,6 +267,10 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
                                break;
                        default:
                                /* Unsupported variable length */
+                               printk(KERN_INFO "H4: Invalid variable len\n");
+                               print_hex_dump(KERN_INFO, "  ",
+                                              DUMP_PREFIX_OFFSET, 16, 1,
+                                              skb->data, skb->len, true);
                                kfree_skb(skb);
                                return ERR_PTR(-EILSEQ);
                        }

If the H:4 stream fails for whatever reason, then that is pretty bad since there is no recovery.

In addition there are at least two fixes in net stable tree meant for 4.16 that might be affecting you as well.

commit e07c99b07ae85255d5c5bc2480fbd4c4e77f71bc

Author: Hans de Goede <[email protected]>
Date:   Wed Mar 14 23:06:03 2018 +0100

Bluetooth: hci_bcm: Set pulsed_host_wake flag in sleep parameters

commit b09c61522c81886c34966825f9e5afcbfafac446

Author: Hans de Goede <[email protected]>
Date:   Wed Mar 14 23:06:02 2018 +0100

Revert "Bluetooth: hci_bcm: Streamline runtime PM code"

You could cherry-pick these two and see if they make a difference.

Regards

Marcel

#2 lore raw
Quoted 32 lines · Marcel Holtmann

Hi Brennan,

Quoted 14 lines

I recently brought an Intel Edison board with a BCM43341B0 chip up from
4.9 to 4.16.0-rc6 but I am having reliability issues when using btattach instead of the previous brcm_patchram_plus utility to attach
the device.

The hci communication with the bluetooth chip gets corrupted almost always when creating a GATT connection. Thowing "Bluetooth: hci0:
Frame reassembly failed (-84)" and then requiring the device to be reset to communicate again.

Kernel logs interleaved with attaching the device:

Quoted 15 lines
# /usr/bin/btattach --bredr /dev/ttyS0 -P bcm -S 3000000 &
# Attaching Primary controller to /dev/ttyS0
[   53.148206] Bluetooth: HCI UART driver ver 2.3
[   53.152758] Bluetooth: HCI UART protocol H4 registered
[   53.157970] Bluetooth: HCI UART protocol Three-wire (H5)
registered
[   53.164512] hci_bcm hci_bcm: hci_bcm device registered.
[   53.170445] Bluetooth: HCI UART protocol Broadcom registered
Switched line discipline from 0 to 15
Device index 0 attached
[   53.333220] Bluetooth: hci0: BCM: chip id 82
[   53.340184] Bluetooth: hci0: BCM: features 0x2f
[   53.368421] Bluetooth: hci0: BCM43341B0
[   53.372338] Bluetooth: hci0: BCM43341B0 (002.001.014) build 0000
[   57.843684] Bluetooth: hci0: BCM (002.001.014) build 0166
Quoted 2 lines

if you have a chance, I like to see the complete binary btmon -w trace.log.

I have attached two traces starting the monitoring and then attaching the bluetooth device, first with btattach and second with the patchram.

btattach-trace.log patchram-trace.log

The with btattach you can see the failure on connect, with patchram the full connection is successful as is the disconnect.

Quoted 61 lines

However I think we need to figure out what is causing the -EILSEQ error in the h4_recv_buf() in hci_h4.c. There are more than one in it and you have to do some printk debugging to figure out which one it is.

So if you do something like this, then we might be able to debug what is going on in the H:4 stream.

drivers/bluetooth/hci_h4.c +6 -1
index fb97a3bf069b..ba9b293f4948 100644
@@ -201,8 +201,13 @@ struct sk_buff *h4_recv_buf(struct hci_dev
 *hdev, struct sk_buff *skb,
                        }
 
                        /* Check for invalid packet type */
-                       if (!skb)
+                       if (!skb) {
+                               printk(KERN_INFO "H4: Invalid packet
 type\n");
+                               print_hex_dump(KERN_INFO, "  ",
+                                              DUMP_PREFIX_OFFSET,
 16, 1,
+                                              buffer, count, true);
                                return ERR_PTR(-EILSEQ);
+                       }
 
                        count -= 1;
                        buffer += 1;
drivers/bluetooth/hci_h4.c +3 -0
@@ -224,6 +229,9 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev,
 struct sk_buff *skb,
                }
 
                if (i >= pkts_count) {
+                       printk(KERN_INFO "H4: Corrupted packet
 type\n");
+                       print_hex_dump(KERN_INFO, "  ",
 DUMP_PREFIX_OFFSET,
+                                      16, 1, skb->data, skb->len,
true);
                        kfree_skb(skb);
                        return ERR_PTR(-EILSEQ);
                }
drivers/bluetooth/hci_h4.c +4 -0
@@ -259,6 +267,10 @@ struct sk_buff *h4_recv_buf(struct hci_dev
 *hdev, struct sk_buff *skb,
                                break;
                        default:
                                /* Unsupported variable length */
+                               printk(KERN_INFO "H4: Invalid
 variable len\n");
+                               print_hex_dump(KERN_INFO, "  ",
+                                              DUMP_PREFIX_OFFSET,
 16, 1,
+                                              skb->data, skb->len,
true);
                                kfree_skb(skb);
                                return ERR_PTR(-EILSEQ);
                        }
Quoted 2 lines

If the H:4 stream fails for whatever reason, then that is pretty bad since there is no recovery.

Here are the results with the printk patch:
Kernel (btattach)

[   73.192554] Bluetooth: HCI UART driver ver 2.3
[   73.197063] Bluetooth: HCI UART protocol H4 registered
[   73.202268] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   73.208744] hci_bcm hci_bcm: hci_bcm device registered.
[   73.214382] Bluetooth: HCI UART protocol Broadcom registered
[   73.393060] Bluetooth: hci0: BCM: chip id 82
[   73.398965] Bluetooth: hci0: BCM: features 0x2f
[   73.624991] Bluetooth: hci0: BCM43341B0
[   73.747834] Bluetooth: hci0: BCM43341B0 (002.001.014) build 0000
[   74.317254] random: crng init done
[   78.234907] Bluetooth: hci0: BCM (002.001.014) build 0166
[  124.797242] H4: Invalid packet type
[  124.800808]   00000000: 90 9a 01 00 40 00 01 01 3e 54 00 18 45 69 24
00  ....@...>T..Ei$.
[  124.809049]   00000010: 00 00 f4 01
00                                   .....
[  124.816332] Bluetooth: hci0: Frame reassembly failed (-84)
[  125.091766] Bluetooth: hci0: ACL packet for unknown connection
handle 64
[  130.034240] Bluetooth: hci0: ACL packet for unknown connection
handle 64
[  135.036697] Bluetooth: hci0: ACL packet for unknown connection

handle 64

Kernel (patchram)

[   78.912606] Bluetooth: HCI UART driver ver 2.3
[   78.917168] Bluetooth: HCI UART protocol H4 registered
[   78.922374] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   78.928890] hci_bcm: probe of hci_bcm failed with error -16
[   78.934751] Bluetooth: HCI UART protocol Broadcom registered
Quoted 12 lines

In addition there are at least two fixes in net stable tree meant for 4.16 that might be affecting you as well.

commit e07c99b07ae85255d5c5bc2480fbd4c4e77f71bc

Author: Hans de Goede <[email protected]>
Date:   Wed Mar 14 23:06:03 2018 +0100

Bluetooth: hci_bcm: Set pulsed_host_wake flag in sleep parameters

Quoted 7 lines

commit b09c61522c81886c34966825f9e5afcbfafac446

Author: Hans de Goede <[email protected]>
Date:   Wed Mar 14 23:06:02 2018 +0100

Revert "Bluetooth: hci_bcm: Streamline runtime PM code"

You could cherry-pick these two and see if they make a difference.

There was no change with these patches.

I have not dug into this too much yet. But I figured I would send the information I have so far.

Quoted 5 lines

Regards

Marcel

btsnoop�""�� �A�D�l6Linux version 4.16.0-rc6 (x86_64)!!�� �A�D�lABluetooth subsystem version 2.22���A�D�mebtmon�A�Euǝhci0�A�Eu�+
�A�Eu�B�A�Eu�c �A�EvX� ##�� �A�Ewo� bluetoothdBluetooth daemon 5.48���A�Ew�.bluetoothd00�� �A�Ew�� bluetoothdkernel lacks bnep-protocol support44�� �A�EwͰ bluetoothdSystem does not support network plugin���A�Ew�� ���A�Ew� ==�� �A�Ew� bluetoothdBluetooth management interface 1.14 initialized���A�Ew������A�Ew�A#
 !"#$%&'()*+,-./0123456789:;<=>?@ABC
 !"#$%���A�Ew�� ���A�Ew���A�Ew���A�ExX  A�A�ExX�y� �A�Exa�
y�R����A�Exon��A�Exx� n�/�A�E{�G ���A�E{�� BCM43341B0�A�E}��.��A�E}��.����A�E~�WL���!�DrB�^�c���c��7VVWWXXYYZZ[[\\]]^^__aabbccddeeffgghhii(
�����@�4C
��!�A�E~��L��A�E~�2L����!A2BCM43340B0 37.4 MHz WLBGA_iTR Intel Edison-0122-N�(�1����l�����H�����8��8��8��8��8��8��8��8��8��8L�xP�yT�A�EZ�L��A�E[�L����!�WX�w\�Wt�kd�kh�kl�jp�jX����gT����gP����x�d�>�d��d�\d� 2�����>�dd@(288��1��������2��x2��������P�A�E�L��A�E�L��}�! �( �������@( �2���2��2�� 2�����= 4A2h2��i�$ ���� �����2

� ``((��00��88��@@H�A�E��L��A�E�YL��x�!H PP@@XX``���� ��@@��DD��HH��LL��ll����������̰�����������������������5
#<Zn}��@l�:JZjzz��@l�:JZjzz������������������A�E�x�L��A�E�zsL��s�!���@�x���p�8�x�H�L�<�@�L�P�T�X�\�t�d�h�l�p�1������DV ZI7'kkkjj##########��DV iiGG7kkkjj**********�
�Df �A�E���L��A�E��L��n�!xxggWkkkjj4444444444�
�Df ��ggWllkkj??????????� �Df��wwWllkkjIIIIIIIIII���f���vVllkkjllllll�b@������L����A�E�6mL��A�E�8L��i�!���P������T������X������\��������@`������p��?\� 
��l
��l\� 
�
�
f3��
( ���
8 
� C
� 


�( p�� ��
�( ��x����A�E���L��A�E���L��d�!
�) p�� ��
�) ��x���
��+ ��������������������������������������������
@8* 1 "  0<34�A�E��mL��A�E���L��_�!3$2"
@t*  

��5 O� @�=* +J��@�/79+h@�$���X�@c ] Mc(@$� �
�/�3@��,yz@�ܺ�/�e�@���ـ��� @Z/eD$�
f�!@�"5Vh*j�3�A�E�T�L��A�E�V�L��Z�!1@(!�OO#A
rd6 3 @�<�%@O/q��@3$�X@�; x&@p
� ,1@�
� ��@��[��(@��E�� @a,�A�u@F5U� �2@8HK�o!3�����
�� �����(� �����  ���z� 8�s�r�  �A�E��AL��A�E���L��U�!X ��h�, L����4 ����X�< ,�����L �v��ֽD  ����N�L �   � 
���T p � @  ���J�$  �
���h  � ���� |o���� h ���A�E�iL��A�E�oL��P�!�# ���ܕ���w�z�� l�w��� �y�_��$ ,�w�� ��w���� ��w���� ��w�"�� @���v�0% $���޺�& S����0( �T����� �U���A�E�sL��A�E�tDL��K�! �V��Y�r) �U��R��*  ����0� !Tp���t, "�p�j��, # p�z�- $, n�t� %|��м  &t���1 '<���v�, (����< )����I�N *����9 �8 +��A�E�ѹL��A�E���L��F�!j|�n�p9 ,Dk|�?��9 -�z��h�T .�����p /p!~��� 0�!~��� 1�!~��� 2�'}��� 3 ~�Թ� 4/]�\�� 5<0]�Թ� 6�?\�&�� 7@���� 8$>\��� 9�A�E�0�L��A�E�2�L�A�! ?\�8 ��A�E�@�L��A�E�BL��l} ������� % _ � ��9�AUM1.03B15Y �$�$'%=%�%�%�%&dd@@��1���d00Td����Pd pee� �A�E���L��A�E��sL��g~ �) ����COCO,0�$��� ����COCOd�1�@���1�P��4�1����@�)�����COCOY�����COCOU�0�1�����1���� ����COCO} ����COCO �A�E�L��A�E��L��b ���������1!����1@@��1��1�� ��������������A�E�_5L��A�E�oL��]� ��1����1@@��1��1����1�� p@`||||||�A�E���L��A�E��,L��X� <�: �= = -= "�
1U< u/ 10 �0 ��A���� ��?��(@���-��:!<�A�E�L��A�E�BL��S� �A�E���L��A�E��L��N� �A�E��IL��A�E��L��I� �f��� 3���fff�H �L �K oL �L �L "Urx� ����� � �A�E�^�L��A�E�`�L��D� �A�E���L��A�E���L��?� �A�E��L��A�E� %L��:� �A�E�~*L��A�E�cL��5� �A�E��yL��A�E���L��0� �A�E�=[L��A�E�>�L��+� �A�E���L��A�E���L��&� �A�E���L��A�E���L��!� �A�E�\TL��A�E�]�L��� �A�E��XL� �A�E���L� � �A�E��L� �A�E���L�0� �A�E�љL� �A�E���L�,� "�A�E�ܓL��A�E�ݽL�8� 
�A�E��L��A�E��yL�(� �A�E���L� �A�E��|L�4� �A�E��L� �A�E��L�#� �A�E��L��A�E�lL�"� �A�E�IL��A�E�L�!� (�A�E�%L��A�E�&�L� � �A�E�.�L� �A�E�0@L�� �A�E�9:L��A�E�; L��X HhJ�H@��!ApG�@��� p��L(���D���!h �p@�p!�QA�A���!@�pA�Q���!��p@O��D���(���D��� h!�q �PA�u@�F���R&O�2D�t�%�p&�A���!`p��JO��( ����p ����Hx�� �(�x���pG��K��� O�� (3�y(+ђ��*����p���Xp����A�E���L��A�E���L��S �p����p���q���Xq����������������������������������(��(���(�ѦH yxCx�x�xy@y)ђ������� �)�����r���2���B���R���b��JO��(�����( ��<AhP�i��O�O� apG(������(��P���<����LpG�Hx( ЅHh!�aAh!�aAhA��a�A�E���L��A�E��/L��N AhA��aA}I h}I hAO�pO�E��0O��D���pG-��ArH%x��%hO�E��0qK!h�� �|@�2mH@x(�FXh� �CB���fJ`P``IeHHO��pD�|�$@�7
�,�����%�8FD�o����0���(F����-��AWMKI( �(wx��*B�*w*"�*w��*B�*w*"�*wB�*B��A�E�V@L��A�E�WL��I *w*�F"� *w�(@� (w0!AHr���@O8FG���(|j�����C��C��@C"� ���r�+N0p� x(�0x(���A���e�0p��Ai8F�G���h F�G(��0x(���-�G�����@F)��p( ��� ��� ��� � (w��HI0I��pI�0I pHIx
pBxJpI~
p@~HppG�1�% F @ �A�E��+L�OO�A�E��L�LD �} � ��1� �   `e� C |e | 0 4  3
  �A�E��ZL��A�E��L� ��%�]��J����A�E��gL��A�E��L��� �HhO����hA��iA��J�h!�hA��i!��ah!��pG  �hA��i!��ah!�����i!��ah!����-��A�Hh� � O�����1hA��1u�������'� �<F�C���������2,������t����!O���a!pG�~Hh�U�O�Ih�P�O�H���J���(;(F�vK �A�E�F�L��A�E�H�L��� P���0tL##���0��d1qL#��d1#�@��d1��T1mL##��T1�m#��eCm#�Ceh#��i#��aKcI�#��a hC��c �_K�� 5��A�����(!���(��QHh)�!MHh@���g�C���\���\���\���\� ���@C�����@��AHh�*�@Hh(&�DHhDH`O���mA��eAmA�AehA��A�E��L��A�E���L���
�iA��a4I h���4I h��T1I h��d5Hh!�pG)Hh@ �O����,A���,�mA��epGp�*MO��(x(���( ���(&HhA�`��*���/�D������(x(���(@���(p��I �bI���������@��O�H����
��������� �jIbJ�S��
D
L
Ѐ P
2�>�H
2�A�E��L��A�E��L�} 2� (2�i �A�E��L��A�E�CL� ��J�x������A�E�%�L��A�E�',L��� O�Ih�� pGJ�>�� Hx( �o�D�Hh@ս�@K�c���@C�����
-��OO�F)!�(���'8ho�88h}I�(��'8h� �p88hxI x@�@�o�88huI hC8����̑����sI�� x��0��P��@ � ��O��
O���(A�iH,hr�. �
�xt������䃠���O�����l @�@��l�A�E���L��A�E���L��� �]JO�x_FuF ��hh%�@�F��@���B��SHhɲA��QJhA�q`h��ɲA�1�,?�^�
�xp������䃙�@���������l �@��l [FtF��h4�P@���B��8HhɲA��6Jh!�q�� ���,
�N�
�xq������䃈��� ����-��G&F�F%4FO��5�iF8FI�h�F%�A�E���L����A�E���L��� �jF9F FI�:�F��"� FH�����(������Bѳ/�I"I`H�����IF����H���&��D.��0F����@  < � Ԁ � 8  Td��1HhI����H��pG�1�� �A�E�&[L��A�E�'�L�  I x������ �A�E�4oL��A�E�6L��$ -��A&��������FI���{� F��^��l��!�P���O�F���[�/Ք�(�M�L��I�xA���)�� ���F FV����Ox{(ѡl8h����B�M�0�:{�8PT8{!@�����8s��?M� ���������A("���� ���� �����{������� F��a� F�����{)F( Fы������E� FX�@����2�A�E���L��A�E��DL�� ��l������h��l��Y�����I���P��I`��a)F F���� ��I��� x�B��{�@���� F���� F���A��<��F ��y�l@���� F�����{ ��l�������l��� V����l������C����l�"����B �D��1����������(ل�� �-��AFO�F���{�N����[�F�l�I�����A�E��L��A�E��NL�� ����������h AF��� ������B2x �@O�C�*��BC��h+�*��9F F��&����������{(Ѡ{��
� ��i�B�C���@�g Fo�_��{�����b��y(� F���As����p��lrK��� F�pJ����@��oM)i�B Ѡ{C���A�iC�r�(� ��Fp� F��p@��Z�)��)&��{(�j������:������ �A�E�S3L��A�E�T�L�� F��T� F����� FX�2� (pVHhO� hp��(�� F��p@����)�є�(�� F��p@��P�-��G�lF���DJ�����C��
��Q��@�l���P��I��(�:I�@DAxIAp�{O�O� O�Fع��y(oф�y�GF�{��]��l���B����lFFq����l�������!pW���� F����"I��@����A�E���L����A�E���L�� ��(��i �@�a��h ���h ��� �����h����8C-Ј|-���l �p��l ��d�#� I@��d�� � �e$ Tg �$ �� hB �� h�1�$ � ������� � F���� FN�N���� ��HF �@
���h ix �@@� ��h @F(p�����A�E�L��A�E��L� , �W�P����A�E� xL�kk�A�E��L�h� ��)pG-��AI x)�I& hO��9x �.�LFay V�<� h!���X�8� �q>p(F���A!O�/�����j$ �
�
� �A�E�:�L��A�E�;�L� 4 ���p��A�E�F�L����A�E�H�L��< p�F��� F��!����h�B*����"�h! F��p��&�I�|B��t����1FX����lI���J�hO�#Kp �@O�A�AA�`p��hO����)�Ք���1F��p@X�}�� �� h�1�A�E���L��A�E���L� < ���X�־�A�E��LL��A�E��L��� p�O�o�4Hh�y(�h��1H2Ix hP��p �r���Fr���V�+�V�� Fr���*Hh�&�)Hhx(�(H$h'M��(x�, �%H��^(�! _���,pp��Hh��X���Hh�y(�w�y�O��HIx(h�@�p� �p`Hhx(� W�z�(
� H��^(� _���I p�X$ �� �$ �� \$ �
�
�� �
�A�E��RL��A�E���L�� �A�E���L��A�E���L� D �F���A�E� �L�77�A�E�
�L�4� �F��#� Fl��� $�Da~ V�I�`i!���W�E� �v��A�E�#;L��A�E�%L� L �Z������A�E�0cL��A�E�1�L�p 0FAF���X��X����A�E�A�L��A�E�CdL�� p�=NF0h�{<H�����:H\���� �B�0h�{�(F\����\�p�3N0hy2H�����0H\���� �B�0hy�(FO����O���)H*Lhx( FЍ���(?� F\���(:Д�^(6�)F��p@ _�!�����O�0�H\�x��u�K��H����I"@�KFh�� x �(�
p��^( �#F !B�D��(F��p@E�_���p@ _�?�p�T$ �A�E���L�$$�A�E��L�!� p� X$ � \$ �� �
�
�A�E���L�--�A�E���L�*�: "(�(�(� (� )��)�
(�"FpG�A�E�ʹL��A�E�ϚL�� �%Hx!� p#HAh!�aA#H!I@�T"I�g�g!Ig������HhI����IH�w�I� pIHHa��IH������@I� ��m���oI`��#
H|8�I���I���I���IHpG� C  j � � �`,� l} �$ �$ / �� �} � � �!!�  )/ 2 � �IHHa �A�E�-~L����A�E�.�L�� N'V�0@b Q�"0���+CA�"0��RhKiB���Z"#� @(���8� 0� �� Fx I) �Qx)�HpG)��H0pG3)��H0pG��+I`pG��  �A�E�c\L��A�E�e'L�T ��(�O� ~�r�~�^��A�E�tWL��A�E�u�L��� h9)����@� pG pGpGp�F�� ��0@!hFq����$��@��@��@ ��� ����@� ���&��@r�E�(�� �����@�� @� ��
 �� � ��  �� � ��? ���H��`x�!C
F+�O��� O���O��� O�@rO�""O�b�� O� �O�#��C�� `"�+�O���@B��� �A�E�ӅL��A�E��L��� �O�����@��� �� � ������)xkF@"A�D����p��xkIt�1�p�hM��肱� F�x(�B�r��@BB�������`zhti|�
�A ��@R��@�+�+��X @j|�B�ؽ�p@���-��AF FFq���Fq��� F�B�JJ!h�@�C��(�رp!A�Ax>�A�Apɲ!� �!��A�E�39L��A�E�5L��� Apɲ!��Ap��C��!p8F���Aq���� F��!r�s�(Тyayh��@������0$�� �|C
+&�~*��n*�o*�s*6��* Ѐ*
Ё*�/���,�/���)�/���&�/���#��xIt������U��$��+��*в��в�������� ��������+�*������ F� ���I`pG� W T ��A�E��hL��A�E���L���  -��_F� F��!r��� _����4I��@���@��x��������������8l!@i40q��xl!@i40q��� ������9�=! C���1�8l"Ai� 41r���xl"Ai�41r�������1����5����9���� �p'gq�����x�q7 �p FC�6���0p��� 0p�����x�� �p��� � �A�E���L����A�E���L��� � � H�hH�|O�F)Ѿ!�}!��� pGhB p�F �
H�|��(F��!F(F^�3�,�HIhp�IHpG D x (�1؁ p Hh� pG�F�}( �H|�����(н�@Fn�պ�p�F �(F����!F(F��p@D���,"IH������)HaI`�8A1W �o&D� h �A�E�M,L�++�A�E�OL�(h ��jp��IO����p����� ��@���A�E�c�L��A�E�e L��p -��G�O�F�i�� � FF�F�B:Ш{B��@ �� �xA(Fk��1hF��B)Ӹ� Й��{l�H�й��;���I�{ h���B �xj��j( ��(Ѹj����,�$��0h�B�4��P������΋�iF.D�&�xF�a��;F����%��-��OtKvM�FF(x�i�FO�
A��|�|�BقB�ڎ��O��q�QF�h�F���|*�J|*Њ�A�E���L��A�E��YL��k |�|�BӂB��� F�������`O>h��{1(�} (�H|(Ј|�|�B �*x�B��� F�������6h�B��RO>h�{*x1�B Ӣ|�B��� F�����F�6h�B���(�GO>h�{*x1�B Ӣ|�B��� F�����.�6h�B������'�� �:F�B�"��`;F�B�#B�};F*�#�*�* �G��|�|�B�+x�B���p�A�E�"fL����A�E�$rL��f haE�Ѡ�0���B��PF�������������O��H�|)�)�)���� ���d �@���d@�@��d��H~�� C�5��� ��2�h�HhP�z���8��� � Hh� � �hB $�1� � � � � HX �� 8A1�A�E�m�L��A�E�o�L� � ��p@�H��A�E�{OL��A�E�|�L��$ p�F}&,M(�( �F� l��X�l��9���SF�1F2F(5Ѣ���S��"HhB���(� F��/� ��S(x(�(��)x�k)�)�hh@h����)Ѩh@�����(��h@�` }(p F��p@����( �)
� F���� l���`l���� }(pp�� � �ȇ����D� g���8FB� �"��FB���"��FB���"��A�E���L��A�E��\L�� K�FB�F�"�K�FB�@��B��F�B�
�}�����B������N!Fs|��@ ���@aD�B҃B��@0D��X('�(%�!F��@ ���@aD�B҃B��@0D��X(�(� F�B�*D�B ӐB �u��XP-�-� ��B ��A-�I(D�Bұ�C�� ��-��A�I�� |F)rЛI
h�Ih)l��{(iР�(fє��A�E�: L��A�E�:�L��! Y��X@Dz�{B���@�I@��i@��{8���0��@ �p@�"���*��A �p@���{iFB����{kFF�B����{kFF�B���&�����������pC@D!�pA��%D �p@�+��������� �xA�@B��($��AF�@A���@
��������0��* �D@D!�pA��mD �p@�����0��*�A�E���L��A�E��~L��" DhC�B��v��.�� ���F��f�RH��<(� F��X�OI������LI ��F����!��S�-��AF}&EM(�( �f� F�����~ �v��? xU�(O�.MР{A���@�iA���ዉ�B� F���1I��S1O��Ȁر1HhB�F�( � F��x�8���_ ���^ F���� ��S(x(�(�AF�(x(�(�8h@8�A�E���L����A�E��wL��# ���((�Д�)(�Ih@ }(p F���A��=�(�.�(pN��HL,"I F��l����``��7b����� b��� W ���hB � � � � � � p� � �k&p�F�z(�(�(�W�C�%�fz! Fo� �(ѭ�%���fr! Fo��(�%�fr F��p@!o� �p��A�E�OSL�__�A�E�P�L�\� ������� F� ��������������b��:� h����F��l�o���Fo�/i��p��� �F��@��־�A�E�wML��A�E�x�L���# p�EM(h�{A�L�)h@�nA���AJihh@NB@J�@KALh$h#CB�)h���I�)h��� �qx�Bٔx�Tx(h����Q\�B� F3I h ��x���IЀ{A��)h@���A���(�)hO��0����'Hx�B�FB,�(h���K����0x�$!F(hn�Q�Hx��+p��������(��!p�"��8�HIh hC I h@pG HIh h�A�E���L��A�E�ئL���$ CpG
HIh hCpGH Ih hCpG�� T �   � � � (� -��_%F���H�������h�h��x��@����x Д�t)�@����xч�<���t(
� FQ�3��I FZ�S���tP����_��pO� O�
=�_�I0:����(6�_�H0-�0��o)����B#������kPF�$�(�#c"}!�HB����A�E�6�L��A�E�9L���% �I �j�AA@@@C�0FQ����XF�1F FZ����H�x� ч�����t�PF��t��(V�|N0|��|Hi,�n�>�H�A�#���r��A��) Ӥ�r����{iFA����{A���hFm�m�����lJ�P �x@�����th�D �p@`��wȱ��wP��l���n��lO�FIAe��u)���!����A�������tP FM�E�X�(��(��A�E���L��A�E��pL���& �S�-��A%MNF��xP0|'��LHxx�r�'�@��A�B�DH��Ep��������@��x��nO�F0���l���n @�}���vp�He�{F����@����n�����0|�m��0|p�.Hi*�A�����r��A��)!Ӥ�r ���{iFA�H��{A�&�hFm������� J�Q �x@�����th�D �p@ nxdn�d��@���H�A�E��HL�[[�A�E���L�X�' �x��(�"F Fm�N�( �! ����K���!������!��(�1�]  D �� W C �� x �A�E� L�++�A�E�bL�(� *�*u���u��u����Xp/�u�D�u�R��A�E�3�L��A�E�5mL��0( -��O �I$`�o�\�d,���I|(w�'O��;���@>F=F�FXF�F�F
���X��A-�)"I�@�сF�HEo� "��
"�� ��� �"�� "�� �� ���� ��hFo�r����N�XF
�G �D����Dm��1�B��3�RF)�)��A�(F�G �D���Dm�q!�B���)�G ��J���A�E���L��A�E���L��+) ��Dm��3�B��C�(F�����Dm�q!�B���D�������wD� a�B��}�����-��_ ���F���F�F�FFFD� nE���� �V|����XpEF/ѯ��Xp��@$�D����XPGF=� �#�F�@-�)D�-��@-��U�-�-�-�+�aEٌF�F! F�@�D0FrE��@��E������@�D �ZH�A�E�� L��A�E���L��&* FFx���p�hFA�������
�@� �0�0p�� ���@@BKI������1A���V��FI�0�����@���@�1@BA����h������-��A�A���:NkF����@� F�A����A������
0D�����!F F Fr��X
�*
� �#%F*��A��R�*�* �[�"�BӗB��������B��#�A�A�E�R�L�~~�A�E�T�L�{!+ �IDr|�����D� b�B����p�J� �t|K!p�T|, ��Պ�Bђ�X@,�t r�r�r�����g�gY��X���p@����� W � �� �A�E��qL��A�E��1L�  �B������A�E�� L����A�E��vL���+ -��AFO�F��, ���E@�@����E� ������=( � r�]�-� ��=����(� ��=8�(6� ��=H'|����D��A�B�a���A��) �`� k c ���0g�{iFA�����B����Bp�������@0f��<(��� ����@�����-�� ��= r����W �A�E��L��A�E��L�  ��|��A�E��$L��A�E��L��t, �I
h����BѠH|�H��9��I x�B �@B�B ���I x�BܚI���B� pG pGp��I�L x)�0"a��@C�Ha�|.%x��I�� x�B�@B�B� F��f�(Хtp� �(��p�p�L"a��@C}Ha�|.%x�|I�� x�B�@B�B� F��G�(Хtp� �(��p�|�oL%��( �sI`j
l��D������)�@B���(G�mHh!�pA�A�E�U2L��A�E�WL��o- �Ah���O�qAaKO��xiFFA���cH��AbHh�����`VK"�3iFFA�������@�@ �p@� ���!@ �r�Z����hFA�7����@@BiFA���iFA�8���"����!�pA�����!&Q��w��!(�p �hFA��!�HC ��(T����(P��(���(J؄�!`G�hFA������@@B ��(=��A�E��iL��A�E��L��j. ��(����8��� ���(#� �H|��H�!�x��B��)�x���7@B�B� ����(��(�������w��w��hF�A������@@B>�A��� � �(� }(�-� Fj�?�|�d� W � | } ~ |X ȃ1�� � �r������IO�`a!H
F F�F�C �� Hh!��qAh!�Ai!�A�E�
L��A�E��L��e/ �0A�aapGC p�Fj���NJFQh {��A��� !ApQh�{�pHI x �!�I�!�!�pQh�{R�Ji i�� �i"A��a=I"�*���#��#�{��G�i"A��q�a5I1�*���#��#�{��G���"A�����+I1q�q��!��B�)F F��p@J�¸�!IIh�{* ���#��#�{��G!�iB��r�a�* ���#��#�A�E�u#L��A�E�vwL��`0 �{��G!��� B����� �i���*����{�{!B�����{) ѐ�� Ԑ�G)ӽ�@!y�L���@��|�� � C p�F p��F p�1�(D(� # ��i���(��( Fp���8� # F��p@"3!j�D��i ��� �a��! Fy����i� F��p@!y�e��Ԡk(�! ���� Ԡk( ڔ�G(�! F��p�A�E�ԬL��A�E��L�[1 @y��!F��p@ C�޿�A�E��vL��A�E��L�  (v0F!F�!�p��A�E��L��A�E��XL��l1 p�F Fhq���A���A H�hA��@�q!HCC������(�)F F��p@^�'�p�p�F�iIz���0�B� F��p@"FD�V� Fp��p� M��@ Fq�b�� (vF F��p@���� ! FB����� F��p@^�1�HX -��AF)�$�Hj�y�FNO�IHj�7�0�"(�H�O��W�  H�Gm��$�d �)�����$��dW��� F�����@ �A�E�RHL��A�E�T�L� g2 � �S&�A�E��L��A�E�b�L�, F����i����A�E�q"L�++�A�E�r�L�(p2 ���?�Hx(�HhA�`pG"� 6�A�E��L��A�E���L�< �������@L�����8��A�E��zL��A�E��L���2 I xI��
)�@����Q�9� pG pGF C�7�8� J���@SxŒ�%��C����a�+%)F#�#�a�+%)FKi�
�8�#� ��0��JO�hO��Ր�d ��+�‹*ѐ�X * ѐ�Y * ��JRh��2"�%��_P��Y@��d�� 0� 0�0��L|ch%#��C"*5ѐ� *��J��Jh*�F�C�"b"h�?"�|�A�E���L��A�E��GL���3 B�B"`�J)R\ѐ�*��0 DJ!*�Fbh�"�
C"�Aa`�{�A��0``0��|*��‹R���J!���A�#0�B��A�pGI)�� pG-��AF��������0F���A!M� �hx��!0FM��F�H�xhx����B(�$����Hh��T��O��H��O��<xhx��0FL����<x F����-��A FIx�{��B@��A�E�WRL��A�E�Y<L���4 �G8Fah@����N��1x�B�x ��px���8F�h@����x�B�x ��-�qx�B�x ��px�����B!(�(� x�@�hC��� x�@�h�C�����%F�*�)3�iF����/�*-�iFL�s�Hh8��($ї����P�qN�!F8F����x�0h ��P�@��P��08F��N�!(�F0h� �p@�0(F��3�A�E��>L��A�E���L���5 �_LF h�� ``h ��@``�(�(��(F����(F�����]H!hahA<��O�� ������AA��QI�h������YBɲ#���_O�ҡ�ɲ���^��SC����B�E��)�D��$����!���������1�%����O�� h�9HɲIph8I�@p X���m ��P`e3Hx(� ���
�!����A�E��L��A�E��L���6 (�( ������� ���� ���� ��t�gH@h���� X���o� `�``�p� J�!�@@�#(��H(!p@!Ap�!�p!�p$�HhHh��"$�� �  @ <  �� � � � �� � `e� � � $ ��1{I��
pѲ��ӲxJyMp��*pwM)p������-xA�!�����p�A�E�vML��A�E�wL��{7 hA�AO�aAO�X�!�lHDlH�lHx)�!p��J�X��X���O�O���ap�� �p�F��� F(Ѩ{@�_�O�Pa``x� ѕ�� � ���pp���� #���SJ.���B)� ��)� �p x�@�h�C�p� ��p�$xF���hC��{(����ipp���";M�*hF��B*<�;J2��iFK�����A�E�ՍL��A�E��YL��v8 (2і�������!F0F����!F0F����x�(h ��P�@��P��(0F����!(�F(h� �p@�� �|�?@�@ I(hhH�����0IfHh(Я�5!��w1Aa��apGI x)�I |�I z)
� J�h!�A�
IpG� � � �  � � � � e�i H � W �� p�A�E�5L����A�E�6IL��q9 �F��;�)M(h)I�H�@��'Ho��� ( O�����"H!�8o���L!�< Fo��� @� � F��p@l!o���p�HO�qhLMh�����(Fo����h��0F�h��0Fo���h��(Fo���HO��Ah��ThO�����p�Td,� 0 ^ `�A�E� �L�??�A�E�
2L�<� A�Hh�(�O�F�MF�FpC@�����w2
���O�Phe���"��A�E�%�L��A�E�'�L��P> -��OsH%�sH.F��\�rH,F��*8�"O�qO�8����O�bjIkHp�:�jH!AjIA`jI���BBe�n�n�n *�"dI�FJ��F�AAe�n�n�n (� _� A���X��� � >�pF��Dp��h��h��D ��h ��h ��D0��h0��h0�Y����@p��h ��h ��@�n�n��@��n�n���Be�n�n�A���e�n�n:I���=H1��A�E��HL��A�E��L���K ��$�%���� ��mF "�I�������������O�1&(]�� ����r�"� (Ud�,��hF�����)��H!x����=�F�������F����Hx�t!��=��@�5��JY���@9��I
i�B� ��FpG��)ѐ�0(ёHh!���:���H�I�hpG)�Ѻ� pG���=)�l�d�(ЀH8x( �����A�E���L��A�E��xL���L (������@����-��AwN�F>1xzL��)}Ђ�O��q����h��������� ����� �{jF�?���"kF�F?���'���0d ��:F�8F?���?�o�FbHh���{�B Д�0)�1i�BM��)�qi��i�������F�?�����0( �`�@�cA�B���@�a��� ���@�a�{�F?�c��{��A�E�EGL��A�E�FyL���M F�?�]��{�?��� �t��N(�`w0j!�B��
���0(��{*�(��s�
����s��=pj�B�*IHh ��|�|�B�O`�i�BҔ�0(� Fi��� Fk��� ��-��AFH L8x��F(>� ac��0*�%�F H�����<HI0P�%a.�& HAF�]�t8F���A �(� 8 " �!B�������1�7���A�E�/�L��A�E�2L��[g ����!����S�Y�� �" �����1����R�Q����"�"�M�N =Z6�0[۲�0+�3\C�3T)�0]@Ղ��Hx �C ��H�xA�p�xA�p p��IxB��@�p�I91��!��DAx)��~!Ap��-��G�N>�� 0��py(�� �������y �Z �@�0����p0�0���آ(�O$��Ђ0�
��A�E���L��A�E���L��Vh b
?���(@٘��бx�B�1�Z11�7� ���1��B%�( ХJ 27�+���B�2�0D'���H0�D'��y�BњI 9�� F��5�F F�������аx�B�0�Z80�d�,��5��y�K�!� �~�-��_�N�H> 8�y� �Ax8���������3y� ���
�������x�
:D+���A�E�e�L��A�E�gL��R �h!D!�|A��D�@��B(���@�I��B۠��@�I!�|A`�B�Ҙ��0� hh�B�[���e+D������B�[#�|C��Aa���40���L�!k�G��hF�����o�~AC� U�B���hF�������@�q"PC�@@����� ��@�q"PC�@@�����D���p�p��H�L 0x��%�!k��G�e������A�E�ĨL��A�E��L��[S ��H!k�0�G�����H�0����
p��J��ь�m����C� P��O�Q ��D�e��@���e@��A����o�rJC�K�B��3�N��J��Q�@
�O�C�B�Ќ ИB� pG pG��IhF k�G�IjF�1hF��M����� � �p�F F)�$�H�M�0�Uhk�G�y�B��u�k��p@Gp�F�H�L�0FAU`k�G�y�BѦu�A�E�sL����A�E��L��Bp (� x@� p��D��������
���b� � x@� p��B����1�)y )� ) ѿI�9
x"�
pA� � p������]���izD�������� x@����FF�ը� 0������0x��Ԩm�G p x��������A�E�]�L��A�E�_L���w ?I ppG���!��o!��9I��hFIh�G��-��G4OF$8x�F���FA� �8p ����O�0]�Ų-6�0�FiF��8x�� �8p� ���~�(� �����8x@�8piFHF��`�����IhFIh�GTE��8x �8pA� �8p��� ���� �� HxA�ppG
HxA�ppG���hF�����(��IhFIh��A�E��� �A�E��c �A�E�6��A�E�A� �A�A�Eĺ�  �A�E��I
 �4C�A�E���'� �A�E��`'��A�E��P �A�E�� �A�E�T�A�E�� ������{��A�E� /�A�G��>�A�G��#�A�G��###�A�G�� �A�G�<� ##�A�G�=� �A�G�Q� �A�G�R� �A�G�`� �A�G�aC
�A�G�jM


�A�G�j�>�A�H�=�@ ��( �A�H�ٯ>
@��A�Hب@ ��(�A�I��?�A�I��$�A�I��$�A�I�
�A�I


�A�IB?�A�I$��@ ��(

btsnoop�""�� �A�Cn��Linux version 4.16.0-rc6 (x86_64)!!�� �A�Cn��Bluetooth subsystem version 2.22���A�Cn�btmon�A�E��hci0�A�E�7��A�E�H��A�E�M! ������{��A�E�Mg�A�E�O� �A�A�E�O�  �A�E�Q�
 ��O��A�E�R� �A�E�T� �@�A�E�bI# �A�E�d`# �A�E�d� ���A�E�jo� BCM43340B0 37.4 MHz WLBGA_iTR Intel Edison-0122-N�A�E�j�% �A�E�l�% `�A�E�m8 �A�E�o�8 �A�E�p9

�A�E�rB9 3���A�E�r �A�E�t� �A�E�t� }�A�E�v� �A�E�w- �A�E�y� �A�E�y� �A�E�{�  �A�E�|7 �A�E�~�  ����A�E�~�FF�A�É�D�������������?���a��������A�Ê@R ��A�ĖsR �A�Ė�E �A�Ẻ�E �A�E̊X �A�Ě�X �A�Ě��A�Ȅ� �A�E̐ ������=�A�E̒Z

�A�E̒� 

�A�E̔� �A�E̕#�A�E̗-�A�E̗r

�A�E̙� �A�E̙�F �A�E̛�F �A�E̜ �A�E̞ �A�E̞Q �A�E̠� �A�E̠� �A�Ẹz ��A�Ẹ� �A�E̦& �A�E̦_�A�Ę� 

�A�E̩T �A�ḘN �A�Ḙ� �A�E̯�  �A�ḚR �A�E̲� ��-��-
�A�E̴S��O��A�E̴e##�� �A�E�� bluetoothdBluetooth daemon 5.48���A�E�%bluetoothd00�� �A�E��? bluetoothdkernel lacks bnep-protocol support44�� �A�E��� bluetoothdSystem does not support network plugin���A�E�Z ���A�E�Z(==�� �A�E�� bluetoothdBluetooth management interface 1.14 initialized���A�E�[������A�E�[�A#
 !"#$%&'()*+,-./0123456789:;<=>?@ABC
 !"#$%���A�E�\
 ���A�E�\�A�E�\�!!�A�E�\���O����BCM43340B0 37.4 MHz WLBGA_iTR Intel Edison-0122-N���A�E�_�bluetoothd�A�E�t� �A�E�u�A�E�u�=�A�E�u�= �A�E�v�4�A�E�v�4�A�E�w`  �A�E�wo �
�A�E�wv�

�A�E�wv��A�E�x�* �A�E�x�*

�A�E�x�

�A�E�x��A�E�y�- �A�E�y�-


�A�E�y�


�A�E�y�
�A�E�zH/ �A�E�zV/
�A�E�z��A�Eζ�m �A�Eθ�m ##�A�Eι( 
�A�Eλ� ##�A�Eμ BCM43340B0�A�E�� ���A�E��[ �BCM43340B0 37.4 MHz WLBGA_iTR Intel Edison-0122-N�A�E��� �A�E��?


�A�E��]


�A�E��]
�A�E�Ǔ �A�E�ǧ�A�E��A�4�_�� �A�E��S�A�E���4�_��  �A�E�� �A�E�ɮ' �A�E�ɾ �A�E�ɾ�A�E���' �A�E��m �A�E��{�A�E�� �A�E���A�E�˽0 �A�E���0�A�E��N5 �A�E��]5�A�E���(kF0 �A�E���(�A�E��o �A�E��~

�A�E��SniffyTest���A�E��G �SniffyTest�A�E�Ӡ 

�A�E���SniffyTest

�A�E���SniffyTest  �A�E��SniffyTest�A�E�՗  �A�E�ի 


�A�E�ճ


�A�E�ճ


�A�Eв�TestUnit1���A�EгC �TestUnit1�A�Eй� 

�A�EкPTestUnit1

�A�EкPTestUnit1  �A�Eк~TestUnit1�A�G�RW>�A�G�Rz#�A�G�Rz###�A�G�R� �A�G�V ##�A�G�VN �A�G�X� �A�G�X� �A�G�[g �A�G�[�
�A�G�^�


�A�G�^�>�A�IhL >@�����E$��A�IhL� �����E�A�IhL� �����E�A�IhL� �����E,,�� �A�Ih�� bluetoothdNo cache for 45:B9:89:B4:FD:A9 �A�Ih��@ �A�IjUO@ �A�IjW�@ ��(�A�IjX�@ ��(�A�IjY�@ �A�Ik�@�A�Ik��@ ���A�Ik��@ 
��( �A�Ik��@ 

�A�Ik�@ ��(�A�Ilf�@�A�Im�@ ( �A�Im�@  �A�Imc@ 
�A�Im�@ ��(�A�Imƨ@�A�Int�@ ( �A�Int�@ 
�A�Inv�@ **�A�Inw8@ ��(�A�Io&,@�A�Io��@ (�A�Io��@   *** �A�Io�1@ 
�A�Io�`@�*�A�Io�k@ ��(�A�Ip��@ �A�Ip��>
@��A�Ip�{@  ( �A�Ip��@ 
�A�Ip޽@ 
�A�Ip��@ ���A�Ip��@�A�IqV@  ( �A�Iq@ 
ee�� �A�IwyB bluetoothdCan't store services for private addressed device /org/bluez/hci0/dev_45_B9_89_B4_FD_A9dd�� �A�Iwy� bluetoothdCan't store GATT db for private addressed device /org/bluez/hci0/dev_45_B9_89_B4_FD_A9�A�Iq$L@   * �A�Iq%@
�A�Iq4�@�A�IqP�@  (�A�IqQ�@  Nexus 5X �A�IqTn@ 
�A�IqT�@
�A�Iqo�@ �A�Iq��@  �A�Iq�P@  �A�Iq�/@
 )�A�Iq�p@ �A�IsE�>
@$��A�I��C@�A�I��� �����E�A�I��� �����E�A�I��� �����E�A�I�I_ �A�I�L �A�I�Lu
�A�I�N�
�A�I��t?�A�I���$�A�I���$�A�I���
�A�I�k


�A�I��?

maintainer
#3 lore raw

Hi Brennan,

Quoted 118 lines
Quoted 30 lines
Quoted 14 lines

I recently brought an Intel Edison board with a BCM43341B0 chip up from
4.9 to 4.16.0-rc6 but I am having reliability issues when using btattach instead of the previous brcm_patchram_plus utility to attach
the device.

The hci communication with the bluetooth chip gets corrupted almost always when creating a GATT connection. Thowing "Bluetooth: hci0:
Frame reassembly failed (-84)" and then requiring the device to be reset to communicate again.

Kernel logs interleaved with attaching the device:

Quoted 15 lines
# /usr/bin/btattach --bredr /dev/ttyS0 -P bcm -S 3000000 &
# Attaching Primary controller to /dev/ttyS0
[   53.148206] Bluetooth: HCI UART driver ver 2.3
[   53.152758] Bluetooth: HCI UART protocol H4 registered
[   53.157970] Bluetooth: HCI UART protocol Three-wire (H5)
registered
[   53.164512] hci_bcm hci_bcm: hci_bcm device registered.
[   53.170445] Bluetooth: HCI UART protocol Broadcom registered
Switched line discipline from 0 to 15
Device index 0 attached
[   53.333220] Bluetooth: hci0: BCM: chip id 82
[   53.340184] Bluetooth: hci0: BCM: features 0x2f
[   53.368421] Bluetooth: hci0: BCM43341B0
[   53.372338] Bluetooth: hci0: BCM43341B0 (002.001.014) build 0000
[   57.843684] Bluetooth: hci0: BCM (002.001.014) build 0166
Quoted 2 lines

if you have a chance, I like to see the complete binary btmon -w trace.log.

I have attached two traces starting the monitoring and then attaching the bluetooth device, first with btattach and second with the patchram.

btattach-trace.log patchram-trace.log

The with btattach you can see the failure on connect, with patchram the full connection is successful as is the disconnect.

Quoted 61 lines

However I think we need to figure out what is causing the -EILSEQ error in the h4_recv_buf() in hci_h4.c. There are more than one in it and you have to do some printk debugging to figure out which one it is.

So if you do something like this, then we might be able to debug what is going on in the H:4 stream.

drivers/bluetooth/hci_h4.c +6 -1
index fb97a3bf069b..ba9b293f4948 100644
@@ -201,8 +201,13 @@ struct sk_buff *h4_recv_buf(struct hci_dev
 *hdev, struct sk_buff *skb,
                       }
 
                       /* Check for invalid packet type */
-                       if (!skb)
+                       if (!skb) {
+                               printk(KERN_INFO "H4: Invalid packet
 type\n");
+                               print_hex_dump(KERN_INFO, "  ",
+                                              DUMP_PREFIX_OFFSET,
 16, 1,
+                                              buffer, count, true);
                               return ERR_PTR(-EILSEQ);
+                       }
                       count -= 1;
                       buffer += 1;
drivers/bluetooth/hci_h4.c +3 -0
@@ -224,6 +229,9 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev,
 struct sk_buff *skb,
               }
 
               if (i >= pkts_count) {
+                       printk(KERN_INFO "H4: Corrupted packet
 type\n");
+                       print_hex_dump(KERN_INFO, "  ",
 DUMP_PREFIX_OFFSET,
+                                      16, 1, skb->data, skb->len,
true);
                       kfree_skb(skb);
                       return ERR_PTR(-EILSEQ);
               }
drivers/bluetooth/hci_h4.c +4 -0
@@ -259,6 +267,10 @@ struct sk_buff *h4_recv_buf(struct hci_dev
 *hdev, struct sk_buff *skb,
                               break;
                       default:
                               /* Unsupported variable length */
+                               printk(KERN_INFO "H4: Invalid
 variable len\n");
+                               print_hex_dump(KERN_INFO, "  ",
+                                              DUMP_PREFIX_OFFSET,
 16, 1,
+                                              skb->data, skb->len,
true);
                               kfree_skb(skb);
                               return ERR_PTR(-EILSEQ);
                       }
Quoted 2 lines

If the H:4 stream fails for whatever reason, then that is pretty bad since there is no recovery.

Here are the results with the printk patch:
Kernel (btattach)

[   73.192554] Bluetooth: HCI UART driver ver 2.3
[   73.197063] Bluetooth: HCI UART protocol H4 registered
[   73.202268] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   73.208744] hci_bcm hci_bcm: hci_bcm device registered.
[   73.214382] Bluetooth: HCI UART protocol Broadcom registered
[   73.393060] Bluetooth: hci0: BCM: chip id 82
[   73.398965] Bluetooth: hci0: BCM: features 0x2f
[   73.624991] Bluetooth: hci0: BCM43341B0
[   73.747834] Bluetooth: hci0: BCM43341B0 (002.001.014) build 0000
Quoted 8 lines
[   74.317254] random: crng init done
[   78.234907] Bluetooth: hci0: BCM (002.001.014) build 0166
[  124.797242] H4: Invalid packet type
[  124.800808]   00000000: 90 9a 01 00 40 00 01 01 3e 54 00 18 45 69 24
00  ....@...>T..Ei$.
[  124.809049]   00000010: 00 00 f4 01
00                                   .....
[  124.816332] Bluetooth: hci0: Frame reassembly failed (-84)

so here is the problem, we detect a 0x90 packet type in the stream. If we detect that, we would need to re-synchronize to a H:4 valid packet type. Can you compare timestamps and see what the packet before and after of this is. btmon and dmesg can print absolute timestamps.

Regards

Marcel

#4 lore raw
Quoted 151 lines · Marcel Holtmann

Hi Brennan,

Quoted 140 lines
Quoted 35 lines
Quoted 18 lines

I recently brought an Intel Edison board with a BCM43341B0 chip up
from
4.9 to 4.16.0-rc6 but I am having reliability issues when using btattach instead of the previous brcm_patchram_plus utility to attach
the device.

The hci communication with the bluetooth chip gets corrupted almost
always when creating a GATT connection. Thowing "Bluetooth:
hci0:
Frame reassembly failed (-84)" and then requiring the device to be
reset to communicate again.

Kernel logs interleaved with attaching the device:

Quoted 16 lines
# /usr/bin/btattach --bredr /dev/ttyS0 -P bcm -S 3000000 &
# Attaching Primary controller to /dev/ttyS0
[   53.148206] Bluetooth: HCI UART driver ver 2.3
[   53.152758] Bluetooth: HCI UART protocol H4 registered
[   53.157970] Bluetooth: HCI UART protocol Three-wire (H5)
registered
[   53.164512] hci_bcm hci_bcm: hci_bcm device registered.
[   53.170445] Bluetooth: HCI UART protocol Broadcom registered
Switched line discipline from 0 to 15
Device index 0 attached
[   53.333220] Bluetooth: hci0: BCM: chip id 82
[   53.340184] Bluetooth: hci0: BCM: features 0x2f
[   53.368421] Bluetooth: hci0: BCM43341B0
[   53.372338] Bluetooth: hci0: BCM43341B0 (002.001.014) build
0000
[   57.843684] Bluetooth: hci0: BCM (002.001.014) build 0166
Quoted 2 lines

if you have a chance, I like to see the complete binary btmon -w trace.log.

I have attached two traces starting the monitoring and then attaching
the bluetooth device, first with btattach and second with the patchram.

btattach-trace.log patchram-trace.log

The with btattach you can see the failure on connect, with patchram the
full connection is successful as is the disconnect.

Quoted 67 lines

However I think we need to figure out what is causing the -EILSEQ error in the h4_recv_buf() in hci_h4.c. There are more than one in it
and you have to do some printk debugging to figure out which one it
is.

So if you do something like this, then we might be able to debug what
is going on in the H:4 stream.

drivers/bluetooth/hci_h4.c +2 -1
index fb97a3bf069b..ba9b293f4948 100644
@@ -201,8 +201,13 @@ struct sk_buff *h4_recv_buf(struct hci_dev
 *hdev, struct sk_buff *skb,
                       }
 
                       /* Check for invalid packet type */
-                       if (!skb)
+                       if (!skb) {
+                               printk(KERN_INFO "H4: Invalid

packet
type\n");

drivers/bluetooth/hci_h4.c +2 -0
+                               print_hex_dump(KERN_INFO, "  ",
+                                              DUMP_PREFIX_OFFSET

,
16, 1,
+ buffer, count,

true);
                               return ERR_PTR(-EILSEQ);
drivers/bluetooth/hci_h4.c +3 -0
+                       }
 
                       count -= 1;
                       buffer += 1;
@@ -224,6 +229,9 @@ struct sk_buff *h4_recv_buf(struct hci_dev
 *hdev,
 struct sk_buff *skb,
               }
 
               if (i >= pkts_count) {
+                       printk(KERN_INFO "H4: Corrupted packet
 type\n");
+                       print_hex_dump(KERN_INFO, "  ",

DUMP_PREFIX_OFFSET,
+ 16, 1, skb->data, skb-

Quoted 1 line

len,

true);
                       kfree_skb(skb);
                       return ERR_PTR(-EILSEQ);
               }
drivers/bluetooth/hci_h4.c +3 -0
@@ -259,6 +267,10 @@ struct sk_buff *h4_recv_buf(struct hci_dev
 *hdev, struct sk_buff *skb,
                               break;
                       default:
                               /* Unsupported variable length */
+                               printk(KERN_INFO "H4: Invalid
 variable len\n");
+                               print_hex_dump(KERN_INFO, "  ",
+                                              DUMP_PREFIX_OFFSET
 ,

16, 1,
+ skb->data, skb-

Quoted 1 line

len,

Quoted 8 lines
true);
                               kfree_skb(skb);
                               return ERR_PTR(-EILSEQ);
                       }

If the H:4 stream fails for whatever reason, then that is pretty bad
since there is no recovery.

Here are the results with the printk patch:
Kernel (btattach)

[   73.192554] Bluetooth: HCI UART driver ver 2.3
[   73.197063] Bluetooth: HCI UART protocol H4 registered
[   73.202268] Bluetooth: HCI UART protocol Three-wire (H5)
registered
[   73.208744] hci_bcm hci_bcm: hci_bcm device registered.
[   73.214382] Bluetooth: HCI UART protocol Broadcom registered
[   73.393060] Bluetooth: hci0: BCM: chip id 82
[   73.398965] Bluetooth: hci0: BCM: features 0x2f
[   73.624991] Bluetooth: hci0: BCM43341B0
[   73.747834] Bluetooth: hci0: BCM43341B0 (002.001.014) build 0000
[   74.317254] random: crng init done
Quoted 8 lines
[   78.234907] Bluetooth: hci0: BCM (002.001.014) build 0166
[  124.797242] H4: Invalid packet type
[  124.800808]   00000000: 90 9a 01 00 40 00 01 01 3e 54 00 18 45
69 24
00  ....@...>T..Ei$.
[  124.809049]   00000010: 00 00 f4 01
00                                   .....
[  124.816332] Bluetooth: hci0: Frame reassembly failed (-84)
Quoted 6 lines

so here is the problem, we detect a 0x90 packet type in the stream. If we detect that, we would need to re-synchronize to a H:4 valid packet type. Can you compare timestamps and see what the packet before and after of this is. btmon and dmesg can print absolute timestamps.

I am worried we are going to far away looking at this, since attaching to the device differently seems to be triggering this. Maybe the serial interface is being configured differently here:
https://github.com/01org/edison-firmware/blob/master/broadcom_cws/bluet
ooth/firmware/brcm_patchram_plus.c

I think this is what you are asking for though. I aligned the time- stamps of the kernel and btmon messages:

< HCI Command: LE Set Adve.. (0x08|0x0006) plen 15 #312 [hci0] 23:35:24.170102

        Min advertising interval: 1280.000 msec (0x0800)
        Max advertising interval: 1280.000 msec (0x0800)
        Type: Connectable undirected - ADV_IND (0x00)
        Own address type: Public (0x00)
        Direct address type: Public (0x00)
        Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
        Channel map: 37, 38, 39 (0x07)
        Filter policy: Allow Scan Request from Any, Allow Connect

Request from Any (0x00)

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 #313 [hci0]

23:35:24.173680

      LE Set Advertising Parameters (0x08|0x0006) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Adver.. (0x08|0x000a) plen 1  #314 [hci0]
23:35:24.173990
        Advertising: Enabled (0x01)
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 #315 [hci0]

23:35:24.176283

      LE Set Advertise Enable (0x08|0x000a) ncmd 1
        Status: Success (0x00)
@ Control Event: 0xffff                         {0x0003} [hci0]
23:35:24.176434
        01 00 3e 00 00 01            
2018-03-22T23:35:34,770131+0000 H4: Invalid packet type
2018-03-22T23:35:34,773701+0000   00000000: 90 9a 01 00 40 00 01 01 0e
e7 86 49 6f 4d 24 00  [email protected]$.
2018-03-22T23:35:34,781939+0000   00000010: 00 00 f4 01
00                                   .....
2018-03-22T23:35:34,789248+0000 Bluetooth: hci0: Frame reassembly
failed (-84)
2018-03-22T23:35:35,025555+0000 Bluetooth: hci0: ACL packet for unknown

connection handle 64

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 11 #316 [hci0]

23:35:36.025425

      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Primary Service (0x2800)
Quoted 1 line

HCI Event: LE Meta Event (0x3e) plen 10 #317 [hci0]

23:35:36.393267

      LE Connection Update Complete (0x03)
        Status: Success (0x00)
        Handle: 64
        Connection interval: 7.50 msec (0x0006)
        Connection latency: 0 (0x0000)
        Supervision timeout: 5000 msec (0x01f4)
2018-03-22T23:35:39,952909+0000 Bluetooth: hci0: ACL packet for unknown

connection handle 64

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 11 #318 [hci0]

23:35:40.952760

      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Primary Service (0x2800)
2018-03-22T23:35:44,970395+0000 Bluetooth: hci0: ACL packet for unknown

connection handle 64

Quoted 1 line

ACL Data RX: Handle 64 flags 0x02 dlen 11 #319 [hci0]

23:35:45.970242

      ATT: Read By Group Type Request (0x10) len 6
        Handle range: 0x0001-0xffff
        Attribute group type: Primary Service (0x2800)
Quoted 1 line

HCI Event: Disconnect Complete (0x05) plen 4 #320 [hci0]

23:35:50.995471

        Status: Success (0x00)
        Handle: 64
        Reason: Remote User Terminated Connection (0x13)
maintainer
#5 lore raw

Hi Brennan,

Quoted 203 lines
Quoted 149 lines
Quoted 140 lines
Quoted 35 lines
Quoted 18 lines

I recently brought an Intel Edison board with a BCM43341B0 chip up
from
4.9 to 4.16.0-rc6 but I am having reliability issues when using btattach instead of the previous brcm_patchram_plus utility to attach
the device.

The hci communication with the bluetooth chip gets corrupted almost
always when creating a GATT connection. Thowing "Bluetooth:
hci0:
Frame reassembly failed (-84)" and then requiring the device to be
reset to communicate again.

Kernel logs interleaved with attaching the device:

Quoted 16 lines
# /usr/bin/btattach --bredr /dev/ttyS0 -P bcm -S 3000000 &
# Attaching Primary controller to /dev/ttyS0
[   53.148206] Bluetooth: HCI UART driver ver 2.3
[   53.152758] Bluetooth: HCI UART protocol H4 registered
[   53.157970] Bluetooth: HCI UART protocol Three-wire (H5)
registered
[   53.164512] hci_bcm hci_bcm: hci_bcm device registered.
[   53.170445] Bluetooth: HCI UART protocol Broadcom registered
Switched line discipline from 0 to 15
Device index 0 attached
[   53.333220] Bluetooth: hci0: BCM: chip id 82
[   53.340184] Bluetooth: hci0: BCM: features 0x2f
[   53.368421] Bluetooth: hci0: BCM43341B0
[   53.372338] Bluetooth: hci0: BCM43341B0 (002.001.014) build
0000
[   57.843684] Bluetooth: hci0: BCM (002.001.014) build 0166
Quoted 2 lines

if you have a chance, I like to see the complete binary btmon -w trace.log.

I have attached two traces starting the monitoring and then attaching
the bluetooth device, first with btattach and second with the patchram.

btattach-trace.log patchram-trace.log

The with btattach you can see the failure on connect, with patchram the
full connection is successful as is the disconnect.

Quoted 67 lines

However I think we need to figure out what is causing the -EILSEQ error in the h4_recv_buf() in hci_h4.c. There are more than one in it
and you have to do some printk debugging to figure out which one it
is.

So if you do something like this, then we might be able to debug what
is going on in the H:4 stream.

drivers/bluetooth/hci_h4.c +2 -1
index fb97a3bf069b..ba9b293f4948 100644
@@ -201,8 +201,13 @@ struct sk_buff *h4_recv_buf(struct hci_dev
 *hdev, struct sk_buff *skb,
                      }
 
                      /* Check for invalid packet type */
-                       if (!skb)
+                       if (!skb) {
+                               printk(KERN_INFO "H4: Invalid

packet
type\n");

drivers/bluetooth/hci_h4.c +2 -0
+                               print_hex_dump(KERN_INFO, "  ",
+                                              DUMP_PREFIX_OFFSET

,
16, 1,
+ buffer, count,

true);
                              return ERR_PTR(-EILSEQ);
drivers/bluetooth/hci_h4.c +3 -0
+                       }
 
                      count -= 1;
                      buffer += 1;
@@ -224,6 +229,9 @@ struct sk_buff *h4_recv_buf(struct hci_dev
 *hdev,
 struct sk_buff *skb,
              }
 
              if (i >= pkts_count) {
+                       printk(KERN_INFO "H4: Corrupted packet
 type\n");
+                       print_hex_dump(KERN_INFO, "  ",

DUMP_PREFIX_OFFSET,
+ 16, 1, skb->data, skb-

Quoted 1 line

len,

true);
                      kfree_skb(skb);
                      return ERR_PTR(-EILSEQ);
              }
drivers/bluetooth/hci_h4.c +3 -0
@@ -259,6 +267,10 @@ struct sk_buff *h4_recv_buf(struct hci_dev
 *hdev, struct sk_buff *skb,
                              break;
                      default:
                              /* Unsupported variable length */
+                               printk(KERN_INFO "H4: Invalid
 variable len\n");
+                               print_hex_dump(KERN_INFO, "  ",
+                                              DUMP_PREFIX_OFFSET
 ,

16, 1,
+ skb->data, skb-

Quoted 1 line

len,

Quoted 8 lines
true);
                              kfree_skb(skb);
                              return ERR_PTR(-EILSEQ);
                      }

If the H:4 stream fails for whatever reason, then that is pretty bad
since there is no recovery.

Here are the results with the printk patch:
Kernel (btattach)

[   73.192554] Bluetooth: HCI UART driver ver 2.3
[   73.197063] Bluetooth: HCI UART protocol H4 registered
[   73.202268] Bluetooth: HCI UART protocol Three-wire (H5)
registered
[   73.208744] hci_bcm hci_bcm: hci_bcm device registered.
[   73.214382] Bluetooth: HCI UART protocol Broadcom registered
[   73.393060] Bluetooth: hci0: BCM: chip id 82
[   73.398965] Bluetooth: hci0: BCM: features 0x2f
[   73.624991] Bluetooth: hci0: BCM43341B0
[   73.747834] Bluetooth: hci0: BCM43341B0 (002.001.014) build 0000
[   74.317254] random: crng init done
Quoted 8 lines
[   78.234907] Bluetooth: hci0: BCM (002.001.014) build 0166
[  124.797242] H4: Invalid packet type
[  124.800808]   00000000: 90 9a 01 00 40 00 01 01 3e 54 00 18 45
69 24
00  ....@...>T..Ei$.
[  124.809049]   00000010: 00 00 f4 01
00                                   .....
[  124.816332] Bluetooth: hci0: Frame reassembly failed (-84)
Quoted 6 lines

so here is the problem, we detect a 0x90 packet type in the stream. If we detect that, we would need to re-synchronize to a H:4 valid packet type. Can you compare timestamps and see what the packet before and after of this is. btmon and dmesg can print absolute timestamps.

I am worried we are going to far away looking at this, since attaching to the device differently seems to be triggering this. Maybe the serial interface is being configured differently here:
https://github.com/01org/edison-firmware/blob/master/broadcom_cws/bluet
ooth/firmware/brcm_patchram_plus.c

I think this is what you are asking for though. I aligned the time- stamps of the kernel and btmon messages:

< HCI Command: LE Set Adve.. (0x08|0x0006) plen 15 #312 [hci0] 23:35:24.170102

       Min advertising interval: 1280.000 msec (0x0800)
       Max advertising interval: 1280.000 msec (0x0800)
       Type: Connectable undirected - ADV_IND (0x00)
       Own address type: Public (0x00)
       Direct address type: Public (0x00)
       Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
       Channel map: 37, 38, 39 (0x07)
       Filter policy: Allow Scan Request from Any, Allow Connect

Request from Any (0x00)

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 #313 [hci0]

23:35:24.173680

     LE Set Advertising Parameters (0x08|0x0006) ncmd 1
       Status: Success (0x00)
< HCI Command: LE Set Adver.. (0x08|0x000a) plen 1  #314 [hci0]
23:35:24.173990
       Advertising: Enabled (0x01)
Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4 #315 [hci0]

23:35:24.176283

     LE Set Advertise Enable (0x08|0x000a) ncmd 1
       Status: Success (0x00)
@ Control Event: 0xffff                         {0x0003} [hci0]
23:35:24.176434
       01 00 3e 00 00 01            
2018-03-22T23:35:34,770131+0000 H4: Invalid packet type
2018-03-22T23:35:34,773701+0000   00000000: 90 9a 01 00 40 00 01 01 0e
e7 86 49 6f 4d 24 00  [email protected]$.
2018-03-22T23:35:34,781939+0000   00000010: 00 00 f4 01
00                                   .....
2018-03-22T23:35:34,789248+0000 Bluetooth: hci0: Frame reassembly
failed (-84)
2018-03-22T23:35:35,025555+0000 Bluetooth: hci0: ACL packet for unknown
Quoted 1 line

connection handle 64

so this packet is your LE Connection Complete event, but it is for some reason garbled up.

struct bt_hci_evt_hdr {                                                          
        uint8_t  evt;                               = 0x90
        uint8_t  plen;                              = 0x9a
} __attribute__ ((packed));

#define BT_HCI_EVT_LE_CONN_COMPLETE = 0x01

struct bt_hci_evt_le_conn_complete {
        uint8_t  status;                            = 0x00
        uint16_t handle;                            = 0x40 0x00
        uint8_t  role;                              = 0x01
        uint8_t  peer_addr_type;                    = 0x01
        uint8_t  peer_addr[6];                      = 0x0e 0xe7 0x86 0x49 0x6f 0x4d
        uint16_t interval;                          = 0x24 0x00
        uint16_t latency;                           = 0x00 0x00
        uint16_t supv_timeout;                      = 0xf4 0x01
        uint8_t  clock_accuracy;                    = 0x00
} __attribute__ ((packed));

The header part of that is totally garbage and also one octet short since it is missing the 0x04 in front of it. This accidentally doesn’t make the whole stream fall flat on its face, because we drop the whole SKB and don’t try to re-synchronize.

So I assume you have an incoming connection and you are trying to act as peripheral.

Maybe the hu->padding and hu->alignment is causing some issue in h4_recv_buf. So you might want remove this part and see if that makes any difference.

                /* remove padding bytes from buffer */
                for (; hu->padding && count > 0; hu->padding--) {
                        count--;
                        buffer++;
                }

Other than that it will be most likely some issue in the transport. Maybe it is as simple as having the operational speed configured. I saw in the trace that for the Edison board, we seem to skip it.

drivers/bluetooth/hci_bcm.c +2 -0
index ff8435ce163c..5f8d78cb7e64 100644
@@ -1024,6 +1024,8 @@ static int bcm_probe(struct platform_device *pdev)
                        return ret;
        }
 
+       dev->oper_speed = 115200;
+
        ret = bcm_get_resources(dev);
        if (ret)
                return ret;

If I am not mistaken, then the above should do that for the Edison platform device. You can set it higher, but I would try with the default one and then check if it shows up in the btmon trace. It could be well that it needs to be faster so that the ACL packets and HCI event packets can leave the controller as fast as possible. So by all means try to set it to 3000000 as well.

My main problem with Edison is that the platform is not yet serdev enabled. Nobody wants to spend any time in making it done properly. So if the dev->oper_speed does not result in the HCI UART speed change command as first command, we need to figure out where to put this information.

Regards

Marcel