2005-09-29 13:48:46

by Pavel Machek

[permalink] [raw]
Subject: Problems with CF bluetooth

Hi!

I have some problems with Billionton CF card: if I insert card,
hciattach to it, eject it, hciattach again, I get an oops.

[Pretty recent kernel: Linux amd 2.6.14-rc2-g5fb2493e #106 Thu Sep 29
01:35:25 CEST 2005 i686 GNU/Linux]

Another problem is that... it works well on my PC. When I try to do
the same hciattach on sharp zaurus handheld, I get

(I had to hack serial driver a bit to default to 921600 bitrate; it
does not have setserial).

# hciattach -s 921600 /dev/ttyS0 bcsp
BCSP initialization timed out
Pavel

Sep 29 15:42:34 amd kernel: EIP: 0060:[<c02d4e2c>] Not tainted
VLI
Sep 29 15:42:34 amd kernel: EFLAGS: 00010082 (2.6.14-rc2-g5fb2493e)
Sep 29 15:42:34 amd kernel: EIP is at uart_flush_buffer+0xc/0x30
Sep 29 15:42:34 amd kernel: eax: f658a000 ebx: f6741400 ecx:
00000282 edx: 00000000
Sep 29 15:42:34 amd kernel: esi: f658a000 edi: 00000000 ebp:
00000000 esp: f4b49d80
Sep 29 15:42:34 amd kernel: ds: 007b es: 007b ss: 0068
Sep 29 15:42:34 amd kernel: Process hciattach (pid: 5971,
threadinfo=f4b48000 task=f7141070)
Sep 29 15:42:34 amd kernel: Stack: c03f9df6 f6741400 f5e7ca00 c03f9e27
c03f9f86 f658a000 00000001 c02a5ed7
Sep 29 15:42:34 amd kernel: 0000000f f27f0424 00001000 f7384e00
00000000 00000000 00000000 00000001
Sep 29 15:42:34 amd kernel: 00000000 00000000 00000000 f7d58000
f4b49e14 f27f03c0 f70fde3c 00000000
Sep 29 15:42:34 amd kernel: Call Trace:
Sep 29 15:42:34 amd kernel: [<c03f9df6>] hci_uart_flush+0x66/0x80
Sep 29 15:42:34 amd kernel: [<c03f9e27>] hci_uart_close+0x17/0x20
Sep 29 15:42:34 amd kernel: [<c03f9f86>] hci_uart_tty_close+0x26/0x60
Sep 29 15:42:34 amd kernel: [<c02a5ed7>] release_dev+0x587/0x670
Sep 29 15:42:34 amd kernel: [<c016c521>] update_atime+0x51/0xa0
Sep 29 15:42:34 amd kernel: [<c0146a14>] free_pte_range+0x34/0x40
Sep 29 15:42:34 amd kernel: [<c0146af7>] free_pgd_range+0xd7/0x190
Sep 29 15:42:34 amd kernel: [<c0169b7e>] dput+0x1e/0x180
Sep 29 15:42:34 amd kernel: [<c02a63f7>] tty_release+0x7/0x10
Sep 29 15:42:34 amd kernel: [<c0155796>] __fput+0x136/0x150
Sep 29 15:42:34 amd kernel: [<c0153f03>] filp_close+0x43/0x70
Sep 29 15:42:34 amd kernel: [<c011e721>] put_files_struct+0x61/0x90
Sep 29 15:42:34 amd kernel: [<c011f24b>] do_exit+0xeb/0x350
Sep 29 15:42:34 amd kernel: [<c011f51f>] do_group_exit+0x2f/0x70
Sep 29 15:42:34 amd kernel: [<c012740a>]
get_signal_to_deliver+0x1ca/0x290
Sep 29 15:42:34 amd kernel: [<c0102c57>] do_signal+0x87/0x110
Sep 29 15:42:34 amd kernel: [<c0515c5e>] schedule+0x30e/0x590
Sep 29 15:42:34 amd kernel: [<c05165e1>] schedule_timeout+0x61/0xb0
Sep 29 15:42:34 amd kernel: [<c0231806>] copy_to_user+0x36/0x60
Sep 29 15:42:34 amd kernel: [<c01251e7>] sys_nanosleep+0xf7/0x140
Sep 29 15:42:34 amd kernel: [<c0102d17>] do_notify_resume+0x37/0x3c
Sep 29 15:42:34 amd kernel: [<c0102eaa>] work_notifysig+0x13/0x19
Sep 29 15:42:34 amd kernel: Code: 80 7c 09 00 00 8b 50 10 8b 42 08 8b
4a 0c 29 c8 25 ff 0f 00 00 c3 89 f6 8d bc 27 00 00 00 00 8b 90 7c 09
00 00 9c 59 fa 8b 52 10 <c7> 42 0c 00 00 00 00 c7 42 08 00 00 00
00 51 9d e9 ef f9 fc ff
Sep 29 15:42:34 amd kernel: <1>Fixing recursive fault but reboot is
needed!
Sep 29 15:43:10 amd pam_limits[5869]: wrong limit value 'unlimited'

--
if you have sharp zaurus hardware you don't need... you know my address


2005-09-29 15:45:57

by Marcel Holtmann

[permalink] [raw]
Subject: Re: Problems with CF bluetooth

Hi Pavel,

> I have some problems with Billionton CF card: if I insert card,
> hciattach to it, eject it, hciattach again, I get an oops.
>
> [Pretty recent kernel: Linux amd 2.6.14-rc2-g5fb2493e #106 Thu Sep 29
> 01:35:25 CEST 2005 i686 GNU/Linux]
>
> Another problem is that... it works well on my PC. When I try to do
> the same hciattach on sharp zaurus handheld, I get

I am not an expert for the Zaurus, but the oops looks like a problem in
the serial subsystem. Does somebody else has seen problems with the
uart_flush_buffer() and other architectures?

Regards

Marcel


2005-09-29 15:57:14

by Pavel Machek

[permalink] [raw]
Subject: Re: Problems with CF bluetooth

Hi!

> > I have some problems with Billionton CF card: if I insert card,
> > hciattach to it, eject it, hciattach again, I get an oops.
> >
> > [Pretty recent kernel: Linux amd 2.6.14-rc2-g5fb2493e #106 Thu Sep 29
> > 01:35:25 CEST 2005 i686 GNU/Linux]
> >
> > Another problem is that... it works well on my PC. When I try to do
> > the same hciattach on sharp zaurus handheld, I get
>
> I am not an expert for the Zaurus, but the oops looks like a problem in
> the serial subsystem. Does somebody else has seen problems with the
> uart_flush_buffer() and other architectures?

No, oops is from normal PC. (And I believe it is reproducible). On
zaurus, hciattach just fails (and I have no idea how to debug that :-(
).

Pavel
--
if you have sharp zaurus hardware you don't need... you know my address

2005-09-29 16:29:09

by Marcel Holtmann

[permalink] [raw]
Subject: Re: Problems with CF bluetooth

Hi Pavel,

> > > I have some problems with Billionton CF card: if I insert card,
> > > hciattach to it, eject it, hciattach again, I get an oops.
> > >
> > > [Pretty recent kernel: Linux amd 2.6.14-rc2-g5fb2493e #106 Thu Sep 29
> > > 01:35:25 CEST 2005 i686 GNU/Linux]
> > >
> > > Another problem is that... it works well on my PC. When I try to do
> > > the same hciattach on sharp zaurus handheld, I get
> >
> > I am not an expert for the Zaurus, but the oops looks like a problem in
> > the serial subsystem. Does somebody else has seen problems with the
> > uart_flush_buffer() and other architectures?
>
> No, oops is from normal PC. (And I believe it is reproducible). On
> zaurus, hciattach just fails (and I have no idea how to debug that :-(
> ).

I think that I have such a card at home, but I don't know when I have
time to pick it up. Anybody else out there to debug this.

Regards

Marcel


2005-09-29 17:54:30

by Pavel Machek

[permalink] [raw]
Subject: Re: Problems with CF bluetooth

Hi!

> > > > I have some problems with Billionton CF card: if I insert card,
> > > > hciattach to it, eject it, hciattach again, I get an oops.
> > > >
> > > > [Pretty recent kernel: Linux amd 2.6.14-rc2-g5fb2493e #106 Thu Sep 29
> > > > 01:35:25 CEST 2005 i686 GNU/Linux]
> > > >
> > > > Another problem is that... it works well on my PC. When I try to do
> > > > the same hciattach on sharp zaurus handheld, I get
> > >
> > > I am not an expert for the Zaurus, but the oops looks like a problem in
> > > the serial subsystem. Does somebody else has seen problems with the
> > > uart_flush_buffer() and other architectures?
> >
> > No, oops is from normal PC. (And I believe it is reproducible). On
> > zaurus, hciattach just fails (and I have no idea how to debug that :-(
> > ).
>
> I think that I have such a card at home, but I don't know when I have
> time to pick it up. Anybody else out there to debug this.

I believe it would happen with any other CF card, too. Can you
hciattach it, unplug, hciattach again?
Pavel
--
if you have sharp zaurus hardware you don't need... you know my address

2005-09-29 17:58:19

by Marcel Holtmann

[permalink] [raw]
Subject: Re: Problems with CF bluetooth

Hi Pavel,

> > > > > I have some problems with Billionton CF card: if I insert card,
> > > > > hciattach to it, eject it, hciattach again, I get an oops.
> > > > >
> > > > > [Pretty recent kernel: Linux amd 2.6.14-rc2-g5fb2493e #106 Thu Sep 29
> > > > > 01:35:25 CEST 2005 i686 GNU/Linux]
> > > > >
> > > > > Another problem is that... it works well on my PC. When I try to do
> > > > > the same hciattach on sharp zaurus handheld, I get
> > > >
> > > > I am not an expert for the Zaurus, but the oops looks like a problem in
> > > > the serial subsystem. Does somebody else has seen problems with the
> > > > uart_flush_buffer() and other architectures?
> > >
> > > No, oops is from normal PC. (And I believe it is reproducible). On
> > > zaurus, hciattach just fails (and I have no idea how to debug that :-(
> > > ).
> >
> > I think that I have such a card at home, but I don't know when I have
> > time to pick it up. Anybody else out there to debug this.
>
> I believe it would happen with any other CF card, too. Can you
> hciattach it, unplug, hciattach again?

actually I don't have any of them with me and I don't saw a problem with
my Casira of a serial port.

Regards

Marcel


2005-09-29 21:32:30

by Pavel Machek

[permalink] [raw]
Subject: Re: Problems with CF bluetooth

Hi!

> > I believe it would happen with any other CF card, too. Can you
> > hciattach it, unplug, hciattach again?
>
> actually I don't have any of them with me and I don't saw a problem with
> my Casira of a serial port.

Following patch seems to work around it. And yes, printk() triggers
twice after

root@amd:~# ~pavel/bin/billionton_start
hciattach: no process killed
hci0: Type: UART
BD Address: 00:10:60:AB:25:9A ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:201 acl:0 sco:0 events:9 errors:0
TX bytes:168 acl:0 sco:0 commands:8 errors:0

root@amd:~# ~pavel/bin/billionton_start
no state->info
no state->info
hci0: Type: UART
BD Address: 00:10:60:AB:25:9A ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:201 acl:0 sco:0 events:9 errors:0
TX bytes:168 acl:0 sco:0 commands:8 errors:0

root@amd:~#

Pavel

Workaround billionton eject problem.

---
commit 81a2889a21eb2bfdf8b242f2cc2cc1d6ad424ea2
tree 35187ac07854fda50f07e9de3eb1c46db2cdd0a7
parent 5fb2493e110ff081e4463e7ab65eff487a3a14f6
author <pavel@amd.(none)> Thu, 29 Sep 2005 23:21:18 +0200
committer <pavel@amd.(none)> Thu, 29 Sep 2005 23:21:18 +0200

drivers/serial/serial_core.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -521,7 +521,9 @@ static void uart_flush_buffer(struct tty
DPRINTK("uart_flush_buffer(%d) called\n", tty->index);

spin_lock_irqsave(&port->lock, flags);
- uart_circ_clear(&state->info->xmit);
+ if (!state->info)
+ printk(KERN_CRIT "no state->info\n");
+ else uart_circ_clear(&state->info->xmit);
spin_unlock_irqrestore(&port->lock, flags);
tty_wakeup(tty);
}


--
if you have sharp zaurus hardware you don't need... you know my address


Attachments:
(No filename) (1.86 kB)
billionton_start (260.00 B)
Download all attachments

2005-09-29 21:37:17

by Russell King

[permalink] [raw]
Subject: Re: Problems with CF bluetooth

On Thu, Sep 29, 2005 at 11:32:19PM +0200, Pavel Machek wrote:
> Hi!
>
> > > I believe it would happen with any other CF card, too. Can you
> > > hciattach it, unplug, hciattach again?
> >
> > actually I don't have any of them with me and I don't saw a problem with
> > my Casira of a serial port.
>
> Following patch seems to work around it. And yes, printk() triggers
> twice after

What's the problem this patch is trying to address?

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core

2005-09-29 21:43:54

by Pavel Machek

[permalink] [raw]
Subject: Re: Problems with CF bluetooth

Hi!

> > > > I believe it would happen with any other CF card, too. Can you
> > > > hciattach it, unplug, hciattach again?
> > >
> > > actually I don't have any of them with me and I don't saw a problem with
> > > my Casira of a serial port.
> >
> > Following patch seems to work around it. And yes, printk() triggers
> > twice after
>
> What's the problem this patch is trying to address?

I get oops after starting my bluetooth subsystem for second
time. billionton_start, unplug CF, billionton_start will oops the
system. That patch prevents it.
Pavel
--
if you have sharp zaurus hardware you don't need... you know my address

2005-09-29 21:46:08

by Russell King

[permalink] [raw]
Subject: Re: Problems with CF bluetooth

On Thu, Sep 29, 2005 at 11:43:40PM +0200, Pavel Machek wrote:
> Hi!
>
> > > > > I believe it would happen with any other CF card, too. Can you
> > > > > hciattach it, unplug, hciattach again?
> > > >
> > > > actually I don't have any of them with me and I don't saw a problem with
> > > > my Casira of a serial port.
> > >
> > > Following patch seems to work around it. And yes, printk() triggers
> > > twice after
> >
> > What's the problem this patch is trying to address?
>
> I get oops after starting my bluetooth subsystem for second
> time. billionton_start, unplug CF, billionton_start will oops the
> system. That patch prevents it.

More details please. I don't have the ability to run bluetooth myself.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core

2005-09-29 21:52:53

by Pavel Machek

[permalink] [raw]
Subject: Re: Problems with CF bluetooth

Hi!

> > > > > > I believe it would happen with any other CF card, too. Can you
> > > > > > hciattach it, unplug, hciattach again?
> > > > >
> > > > > actually I don't have any of them with me and I don't saw a problem with
> > > > > my Casira of a serial port.
> > > >
> > > > Following patch seems to work around it. And yes, printk() triggers
> > > > twice after
> > >
> > > What's the problem this patch is trying to address?
> >
> > I get oops after starting my bluetooth subsystem for second
> > time. billionton_start, unplug CF, billionton_start will oops the
> > system. That patch prevents it.
>
> More details please. I don't have the ability to run bluetooth myself.

Unfortunately I do not know much about bluetooth. The card is
basically CF serial with bluetooth chip attached to that. billionton
start does setserial, then attaches bluetooth subsystem to that chip,
and enables bluetooth.

Pavel
--
if you have sharp zaurus hardware you don't need... you know my address

2005-09-29 22:01:41

by Russell King

[permalink] [raw]
Subject: Re: Problems with CF bluetooth

On Thu, Sep 29, 2005 at 11:52:34PM +0200, Pavel Machek wrote:
> Hi!
>
> > > > > > > I believe it would happen with any other CF card, too. Can you
> > > > > > > hciattach it, unplug, hciattach again?
> > > > > >
> > > > > > actually I don't have any of them with me and I don't saw a problem with
> > > > > > my Casira of a serial port.
> > > > >
> > > > > Following patch seems to work around it. And yes, printk() triggers
> > > > > twice after
> > > >
> > > > What's the problem this patch is trying to address?
> > >
> > > I get oops after starting my bluetooth subsystem for second
> > > time. billionton_start, unplug CF, billionton_start will oops the
> > > system. That patch prevents it.
> >
> > More details please. I don't have the ability to run bluetooth myself.
>
> Unfortunately I do not know much about bluetooth. The card is
> basically CF serial with bluetooth chip attached to that. billionton
> start does setserial, then attaches bluetooth subsystem to that chip,
> and enables bluetooth.

How about showing the oops? The patch is definitely wrong btw - there's
no way state->info should be NULL here.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core

2005-09-29 22:04:12

by Pavel Machek

[permalink] [raw]
Subject: Re: Problems with CF bluetooth

On Čt 29-09-05 23:01:34, Russell King wrote:
> On Thu, Sep 29, 2005 at 11:52:34PM +0200, Pavel Machek wrote:
> > Hi!
> >
> > > > > > > > I believe it would happen with any other CF card, too. Can you
> > > > > > > > hciattach it, unplug, hciattach again?
> > > > > > >
> > > > > > > actually I don't have any of them with me and I don't saw a problem with
> > > > > > > my Casira of a serial port.
> > > > > >
> > > > > > Following patch seems to work around it. And yes, printk() triggers
> > > > > > twice after
> > > > >
> > > > > What's the problem this patch is trying to address?
> > > >
> > > > I get oops after starting my bluetooth subsystem for second
> > > > time. billionton_start, unplug CF, billionton_start will oops the
> > > > system. That patch prevents it.
> > >
> > > More details please. I don't have the ability to run bluetooth myself.
> >
> > Unfortunately I do not know much about bluetooth. The card is
> > basically CF serial with bluetooth chip attached to that. billionton
> > start does setserial, then attaches bluetooth subsystem to that chip,
> > and enables bluetooth.
>
> How about showing the oops? The patch is definitely wrong btw - there's
> no way state->info should be NULL here.

I realize it is probably wrong... forwarding you the original report
... with the oops :-).
Pavel

--
if you have sharp zaurus hardware you don't need... you know my address