2004-10-28 11:47:40

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] lockup problem with larger packets

Hi Erwin,

> > > 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
> > > ...
> >
> > 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.
> >
> 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


2004-10-28 17:30:51

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] lockup problem with larger packets

Hi Erwin,

> 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

2004-10-28 14:31:37

by Erwin Authried

[permalink] [raw]
Subject: Re: [Bluez-users] lockup problem with larger packets

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:
> Hi Erwin,
>
> > > > 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
> > > > ...
> > >
> > > 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.
> > >
> > 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


Attachments:
unslip.patch (5.28 kB)