From: "Martin Kögler" <e9925248@student.tuwien.ac.at>
To: Andrew Morton <akpm@osdl.org>
Cc: rmk+lkml@arm.linux.org.uk, linux-kernel@vger.kernel.org
Subject: Re: Deadlock in serial driver 2.6.x
Date: Fri, 4 Feb 2005 12:07:25 +0100 [thread overview]
Message-ID: <20050204110725.GA16534@stud4.tuwien.ac.at> (raw)
In-Reply-To: <20050203102112.06c06fe7.akpm@osdl.org>
On Thu, Feb 03, 2005 at 10:21:12AM -0800, Andrew Morton wrote:
> The "echo method" method sounds good. Do we think that's feasible for
> 2.6.11, or would it be safer to disable low-latency mode for that driver?
As a temporary workaround, dropping the lock should also work:
--- linux-2.6.10/drivers/serial/8250.old.c 2005-02-03 14:07:48.557609200 +0100
+++ linux-2.6.10/drivers/serial/8250.c 2005-02-03 14:09:00.687887525 +0100
@@ -987,7 +987,11 @@
unsafe. It should be fixed ASAP */
if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) {
if(tty->low_latency)
- tty_flip_buffer_push(tty);
+ {
+ spin_unlock(&up->port.lock);
+ tty_flip_buffer_push(tty);
+ spin_lock(&up->port.lock);
+ }
/* If this failed then we will throw away the
bytes but must do so to clear interrupts */
}
@@ -1058,7 +1062,9 @@
ignore_char:
lsr = serial_inp(up, UART_LSR);
} while ((lsr & UART_LSR_DR) && (max_count-- > 0));
+ spin_unlock(&up->port.lock);
tty_flip_buffer_push(tty);
+ spin_lock(&up->port.lock);
*status = lsr;
}
An other serial interrupt can not disturbed, because it will be blocked by the interrupt lock.
All other direct access to the UART seems to be protected by the port lock, so they may be only
execectued, while tty_flip_buffer_push is running and is not accessing the port.
I have this patch running on a 2.6.10 Kernel (Fedora Core 2 Version) and low latency mode
works without any problems (with and without SMP).
If that patch works under all conditons, I can't say. It may cause degrade the performance,
but for my work, I can't see any effect.
mfg Martin Kögler
e9925248@stud4.tuwien.ac.at
PS: Please CC me on replies.
next prev parent reply other threads:[~2005-02-04 11:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-26 13:20 Martin Kögler
2005-01-27 7:13 ` Andrew Morton
2005-01-30 15:39 ` Alan Cox
2005-01-30 16:48 ` Russell King
2005-01-31 7:37 ` Alan Cox
2005-01-31 8:48 ` Andrew Morton
2005-02-03 10:02 ` Alan Cox
2005-02-03 18:21 ` Andrew Morton
2005-02-04 11:07 ` Martin Kögler [this message]
2005-02-04 13:50 ` Paul Fulghum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050204110725.GA16534@stud4.tuwien.ac.at \
--to=e9925248@student.tuwien.ac.at \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+lkml@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®