* 21285 serial driver deadlock(?) fix
@ 2009-12-28 22:27 Steve Moskovchenko
2010-01-01 20:29 ` Russell King - ARM Linux
2010-01-04 8:11 ` Simon Kagstrom
0 siblings, 2 replies; 6+ messages in thread
From: Steve Moskovchenko @ 2009-12-28 22:27 UTC (permalink / raw)
To: linux-arm-kernel
Hello
I've got a board with a StrongARM SA-110 and a 21285 "footbrtidge" on
it. The kernel's 21285 serial driver works for kernel messages but not
for I/O from userspace.
My kernel experience is pretty limited, but I believe the problem lies
in drivers/serial/21285.c.
As I understand it:
serial21285_tx_chars looks like an ISR, which likes to call
serial21285_stop_tx every once in a while.
serial21285_stop_tx, in turn, calls disable_irq(), which waits for the
current instance of the ISR to finish before disabling that interrupt.
But, calling this from within an ISR results in deadlock and makes the
puppy very sad.
I've modified the ISR to call a different version of stop_tx, which uses
disable_irq_nosync() instead. This gave me a working console.
Another issue with the driver is the baud rate calculation, which seems
broken for me. I had to comment out the lines that write to the BRG
register (not in this patch), but this may be a result of my board using
a different clock rate than a real EBSA285. Maybe I will look into that
later.
I have attached the relevant patch. I am also using this with my
previous CONFIG_MMU patch and a minor modification to ignore the machine
detection, or else my kernel wouldn't boot at all.
What do you guys think?
Thanks
Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: footbridge-serial-deadlock.patch
Type: text/x-patch
Size: 777 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20091228/2b57160b/attachment.bin>
^ permalink raw reply [flat|nested] 6+ messages in thread
* 21285 serial driver deadlock(?) fix
2009-12-28 22:27 21285 serial driver deadlock(?) fix Steve Moskovchenko
@ 2010-01-01 20:29 ` Russell King - ARM Linux
2010-01-04 8:11 ` Simon Kagstrom
1 sibling, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2010-01-01 20:29 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 28, 2009 at 05:27:06PM -0500, Steve Moskovchenko wrote:
> I've modified the ISR to call a different version of stop_tx, which uses
> disable_irq_nosync() instead. This gave me a working console.
That's right - however, I'm not sure whether the stop_rx also needs
to be a _nosync version.
> Another issue with the driver is the baud rate calculation, which seems
> broken for me. I had to comment out the lines that write to the BRG
> register (not in this patch), but this may be a result of my board using
> a different clock rate than a real EBSA285. Maybe I will look into that
> later.
Works for me. Could be that your 21285 is clocked at a different rate,
in which case the 21285 timers are also going to be wrong. You need to
specify the 21285 clock rate to the booting kernel via ATAGs or the
"mem_fclk_21285=" command line option.
There is no way for the kernel to autodetect this; it must be passed to
the kernel in some manner from something like a boot loader.
^ permalink raw reply [flat|nested] 6+ messages in thread
* 21285 serial driver deadlock(?) fix
2009-12-28 22:27 21285 serial driver deadlock(?) fix Steve Moskovchenko
2010-01-01 20:29 ` Russell King - ARM Linux
@ 2010-01-04 8:11 ` Simon Kagstrom
[not found] ` <20dd1d411001051037o74fb1187j608889fae0271547@mail.gmail.com>
1 sibling, 1 reply; 6+ messages in thread
From: Simon Kagstrom @ 2010-01-04 8:11 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 28 Dec 2009 17:27:06 -0500
Steve Moskovchenko <stevenm86@gmail.com> wrote:
> I've got a board with a StrongARM SA-110 and a 21285 "footbrtidge" on
> it. The kernel's 21285 serial driver works for kernel messages but not
> for I/O from userspace.
>
> My kernel experience is pretty limited, but I believe the problem lies
> in drivers/serial/21285.c.
>
> As I understand it:
> serial21285_tx_chars looks like an ISR, which likes to call
> serial21285_stop_tx every once in a while.
> serial21285_stop_tx, in turn, calls disable_irq(), which waits for the
> current instance of the ISR to finish before disabling that interrupt.
> But, calling this from within an ISR results in deadlock and makes the
> puppy very sad.
>
> I've modified the ISR to call a different version of stop_tx, which uses
> disable_irq_nosync() instead. This gave me a working console.
I sent a similar patch some weeks ago:
http://www.spinics.net/lists/arm-kernel/msg77006.html
which fixes the same problem for me. It would be good to get at least
one of these in I think. My patch also uses _nosync for stop_rx.
// Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-01-13 8:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-28 22:27 21285 serial driver deadlock(?) fix Steve Moskovchenko
2010-01-01 20:29 ` Russell King - ARM Linux
2010-01-04 8:11 ` Simon Kagstrom
[not found] ` <20dd1d411001051037o74fb1187j608889fae0271547@mail.gmail.com>
2010-01-11 9:57 ` Simon Kagstrom
2010-01-12 17:12 ` Steve M
2010-01-13 8:17 ` Simon Kagstrom
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).