All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Problems with CF bluetooth (fwd) (fwd)
@ 2005-09-29 22:37 Pavel Machek
  2005-09-30  7:43 ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2005-09-29 22:37 UTC (permalink / raw)
  To: marcel, bluez-devel, kernel list

Hi!

Thanks, Russell. Marcel, this is probably solution to that oops.

							Pavel

----- Forwarded message from Russell King

X-Original-To: pavel@atrey.karlin.mff.cuni.cz
To: Pavel Machek <pavel@ucw.cz>, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: Problems with CF bluetooth (fwd)
X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on 
	atrey.karlin.mff.cuni.cz
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=failed 
	version=3.0.2
X-CRM114-Status: Good  ( pR: 34.1646 )

On Fri, Sep 30, 2005 at 12:04:28AM +0200, Pavel Machek wrote:
> (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

Ok, you're in uart_flush_buffer(), and we got there through the
ldisc being closed.

> 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

Looking at release_dev(), it does things in the following order:

1. various sanity checks
2. close the driver
3. more sanity checks and other housekeeping
4. close the ldisc
5. reset the ldisc for the tty to N_TTY

This means that bluetooth is calling into a TTY driver with a tty
for which the driver has already shut down.  No surprise it oopses.
Bluetooth should not call the driver during it's closedown.

(There also appears to be an interesting race condition between the
driver shutting down and the ldisc write functions getting to know
about it... Alan?)

-- 
Russell King

----- End forwarded message -----

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

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

* Re: Problems with CF bluetooth (fwd) (fwd)
  2005-09-29 22:37 Problems with CF bluetooth (fwd) (fwd) Pavel Machek
@ 2005-09-30  7:43 ` Marcel Holtmann
  2005-09-30  8:00   ` Pavel Machek
  0 siblings, 1 reply; 4+ messages in thread
From: Marcel Holtmann @ 2005-09-30  7:43 UTC (permalink / raw)
  To: Pavel Machek; +Cc: bluez-devel, kernel list

Hi Pavel,

> Thanks, Russell. Marcel, this is probably solution to that oops.

cool that you worked something out. Do you have a patch for me?

Regards

Marcel



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

* Re: Problems with CF bluetooth (fwd) (fwd)
  2005-09-30  7:43 ` Marcel Holtmann
@ 2005-09-30  8:00   ` Pavel Machek
  2005-09-30  8:08     ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2005-09-30  8:00 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: bluez-devel, kernel list

Hi!

> > Thanks, Russell. Marcel, this is probably solution to that oops.
> 
> cool that you worked something out. Do you have a patch for me?

Well, I have that ugly workaround that helps me, but is wrong (as rmk
confirmed). His comment was:

|> 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
|
|Looking at release_dev(), it does things in the following order:
|
|1. various sanity checks
|2. close the driver
|3. more sanity checks and other housekeeping
|4. close the ldisc
|5. reset the ldisc for the tty to N_TTY
|
|This means that bluetooth is calling into a TTY driver with a tty
|for which the driver has already shut down.  No surprise it oopses.
|Bluetooth should not call the driver during it's closedown.
|
|(There also appears to be an interesting race condition between the
|driver shutting down and the ldisc write functions getting to know
|about it... Alan?)

But no, I do not have patch for that.
								Pavel

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

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

* Re: Problems with CF bluetooth (fwd) (fwd)
  2005-09-30  8:00   ` Pavel Machek
@ 2005-09-30  8:08     ` Marcel Holtmann
  0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2005-09-30  8:08 UTC (permalink / raw)
  To: Pavel Machek; +Cc: bluez-devel, kernel list

Hi Pavel,

> > > Thanks, Russell. Marcel, this is probably solution to that oops.
> > 
> > cool that you worked something out. Do you have a patch for me?
> 
> Well, I have that ugly workaround that helps me, but is wrong (as rmk
> confirmed). His comment was:
> 
> |> 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
> |
> |Looking at release_dev(), it does things in the following order:
> |
> |1. various sanity checks
> |2. close the driver
> |3. more sanity checks and other housekeeping
> |4. close the ldisc
> |5. reset the ldisc for the tty to N_TTY
> |
> |This means that bluetooth is calling into a TTY driver with a tty
> |for which the driver has already shut down.  No surprise it oopses.
> |Bluetooth should not call the driver during it's closedown.
> |
> |(There also appears to be an interesting race condition between the
> |driver shutting down and the ldisc write functions getting to know
> |about it... Alan?)
> 
> But no, I do not have patch for that.

I won't have time to look at it for the next two weeks. So if someone
comes up with a patch I am happy to create another -mh patch to make it
available for testing.

Regards

Marcel



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

end of thread, other threads:[~2005-09-30  8:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-29 22:37 Problems with CF bluetooth (fwd) (fwd) Pavel Machek
2005-09-30  7:43 ` Marcel Holtmann
2005-09-30  8:00   ` Pavel Machek
2005-09-30  8:08     ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.