Skip to contentSkip to conversation

lockup problem with larger packets

Bluez-users Erwin Authried 2 participants 5 messages Oct 22, 2004 – Oct 28, 2004 1 message not in the archive Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

I have cross-compiled bluez for uClinux-2.4.20 for ARM7, with the bluez kernel patch applied, and bluez-utils 2.10. I'm using the Conceptronic CBT100C PCMCIA card on the system. The card is initialized with "hciattach ttyS2 bcsp". Basically, the system works fine, but I see occasional overrun errors on the UART, maybe because the ARM7 is running with 40MHz only. When I transmit larger packets (l2ping -s 300 ...), the number of overrun errors increases, and sometimes the system locks up. I'm getting an endless sequence of:

bcsp_pkt_cull: Peer acked invalid packet
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_pkt_cull: Peer acked invalid packet
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_pkt_cull: Peer acked invalid packet
...

Regards,
Erwin

-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

maintainer
#1 lore raw

Hi Erwin,

Quoted 9 lines

I have cross-compiled bluez for uClinux-2.4.20 for ARM7, with the bluez kernel patch applied, and bluez-utils 2.10. I'm using the Conceptronic CBT100C PCMCIA card on the system. The card is initialized with "hciattach ttyS2 bcsp". Basically, the system works fine, but I see occasional overrun errors on the UART, maybe because the ARM7 is running with 40MHz only. When I transmit larger packets (l2ping -s 300 ...), the number of overrun errors increases, and sometimes the system locks up. I'm getting an endless sequence of:

Quoted 6 lines

bcsp_pkt_cull: Peer acked invalid packet
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_pkt_cull: Peer acked invalid packet
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_pkt_cull: Peer acked invalid packet
...

I am not a BCSP or uClinux expert so I think that I can't help you here, but from my testing with the BCSP part of the hci_uart driver I never saw any problems like this.

Regards

Marcel

-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

A message that is not in the archive (sent off-list or not yet received): 1098928778.23859.32.camel@kabel

maintainer
#3 lore raw

Hi Erwin,

Quoted 20 lines
Quoted 16 lines
Quoted 9 lines

I have cross-compiled bluez for uClinux-2.4.20 for ARM7, with the bluez kernel patch applied, and bluez-utils 2.10. I'm using the Conceptronic CBT100C PCMCIA card on the system. The card is initialized with "hciattach ttyS2 bcsp". Basically, the system works fine, but I see occasional overrun errors on the UART, maybe because the ARM7 is running with 40MHz only. When I transmit larger packets (l2ping -s 300 ...), the number of overrun errors increases, and sometimes the system locks up. I'm getting an endless sequence of:

Quoted 6 lines

bcsp_pkt_cull: Peer acked invalid packet
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_pkt_cull: Peer acked invalid packet
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_pkt_cull: Peer acked invalid packet
...

Quoted 4 lines

I am not a BCSP or uClinux expert so I think that I can't help you here, but from my testing with the BCSP part of the hci_uart driver I never saw any problems like this.

Quoted 7 lines

After a lot of debugging, I found out that the serial irq routine calls tty_flip_buffer_push with the serial interrupt disabled. The processing of the input buffer in bcsp_recv (hci_bcsp.c) was too slow so that the characters that were buffered in the FIFO during that time caused an overrun (There is no RTS/CTS flowcontrol). I have done modifiations to hci_bcsp.c so that the processing is done much faster, and the problem seems to have gone.

please provide us a patch with your modifications.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#4 lore raw

Hi,
here's a patch that reduces the execution time for "unslipping" the received data considerably. The patch does NOT support packets with CRC! This would require a little bit of additional work, I think that it would be better to rewrite the crc routine to calculate the whole packet checksum at once for better performance. I have not done that because the CBT100C doesn't use crc's.
Please ignore the __fastram attribute, it's for uClinux on my specific board only. Functions with this attribute are placed into the cpu's internal 32-bit ram for faster execution.

Regards,
Erwin

Am Don, den 28.10.2004 schrieb Marcel Holtmann um 13:47:

Quoted 30 lines

Hi Erwin,

Quoted 20 lines
Quoted 16 lines
Quoted 9 lines

I have cross-compiled bluez for uClinux-2.4.20 for ARM7, with the bluez kernel patch applied, and bluez-utils 2.10. I'm using the Conceptronic CBT100C PCMCIA card on the system. The card is initialized with "hciattach ttyS2 bcsp". Basically, the system works fine, but I see occasional overrun errors on the UART, maybe because the ARM7 is running with 40MHz only. When I transmit larger packets (l2ping -s 300 ...), the number of overrun errors increases, and sometimes the system locks up. I'm getting an endless sequence of:

Quoted 6 lines

bcsp_pkt_cull: Peer acked invalid packet
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_pkt_cull: Peer acked invalid packet
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_pkt_cull: Peer acked invalid packet
...

Quoted 4 lines

I am not a BCSP or uClinux expert so I think that I can't help you here, but from my testing with the BCSP part of the hci_uart driver I never saw any problems like this.

Quoted 7 lines

After a lot of debugging, I found out that the serial irq routine calls tty_flip_buffer_push with the serial interrupt disabled. The processing of the input buffer in bcsp_recv (hci_bcsp.c) was too slow so that the characters that were buffered in the FIFO during that time caused an overrun (There is no RTS/CTS flowcontrol). I have done modifiations to hci_bcsp.c so that the processing is done much faster, and the problem seems to have gone.

Quoted 5 lines

please provide us a patch with your modifications.

Regards

Marcel

hci_bcsp.h renamed from hci_bcsp.h.orig +1 -0
diff -u hci_bcsp.h.orig hci_bcsp.h
@@ -42,6 +42,7 @@
 	struct sk_buff_head unrel;	/* Unreliable packets queue */
 
 	unsigned long rx_count;
+	unsigned char *rx_ptr;	
 	struct  sk_buff *rx_skb;
 	u8      rxseq_txack;		/* rxseq == txack. */
 	u8      rxack;			/* Last packet sent by us that the peer ack'ed */
hci_bcsp.c renamed from hci_bcsp.c.orig +66 -62

177 lines not on this page · raw message

maintainer
#5 lore raw

Hi Erwin,

Quoted 9 lines

here's a patch that reduces the execution time for "unslipping" the received data considerably. The patch does NOT support packets with CRC! This would require a little bit of additional work, I think that it would be better to rewrite the crc routine to calculate the whole packet checksum at once for better performance. I have not done that because the CBT100C doesn't use crc's.
Please ignore the __fastram attribute, it's for uClinux on my specific board only. Functions with this attribute are placed into the cpu's internal 32-bit ram for faster execution.

thanks for the patch, but I can't apply it. You don't follow the coding style and some parts are looking too hackish to me. However I don't have enough time to look at the performance problems of the BCSP driver, but it seems that this is necessary. So is anyone volunteering?

Regards

Marcel

-------------------------------------------------------
This Newsletter Sponsored by: Macrovision
For reliable Linux application installations, use the industry's leading setup authoring tool, InstallShield X. Learn more and evaluate today. http://clk.atdmt.com/MSI/go/ins0030000001msi/direct/01/
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users