From: Thomas Gleixner <tglx@linutronix.de>
To: Tim Sander <tim@krieglstein.org>
Cc: "linux-rt-users@vger.kernel.org" <linux-rt-users@vger.kernel.org>
Subject: Re: 3.4.28-rt40 arm freescale imx35 pcm43 - patch 86236252d2449313bdbac790023cbc957bf6e426 is cause
Date: Wed, 13 Feb 2013 13:13:53 +0100 (CET) [thread overview]
Message-ID: <alpine.LFD.2.02.1302131301580.11905@ionos> (raw)
In-Reply-To: <1525614.TvuV6qqnEF@dabox>
On Thu, 7 Feb 2013, Tim Sander wrote:
> Hi
>
> Just another update on this stuff. I noticed that there has been a patch added*
> with spinlocks to the imx.c serial driver. I reverted this patch and now my
> serialfuz programm "only" kills the serial port with a not so nice oom
> condition. But at least it does not show the runaway interrupt problem.
That does not make any sense, really. The runnaway interrupt issue is
completely unrelated to this commit.
Though the commit in question introduces a recursive locking problem
in imx_console_write().
imx_rxint()
{
spin_lock_irqsave(&sport->port.lock,flags);
...
uart_handle_sysrq_char();
sysrq_function();
printk();
imx_console_write();
spin_lock_irqsave(&sport->port.lock,flags); <--- BOOOM
Now the kernel cannot tell you, what happened because it's stuck dead.
Find below a completely untested patch which should fix that issue.
Thanks,
tglx
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 0de7ed7..e1069b4 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1225,8 +1225,12 @@ imx_console_write(struct console *co, const char *s, unsigned int count)
struct imx_port_ucrs old_ucr;
unsigned int ucr1;
unsigned long flags;
+ int locked = 1;
- spin_lock_irqsave(&sport->port.lock, flags);
+ if (sport->port.sysrq || oops_in_progress || in_kdb_printk())
+ locked = spin_trylock_irqsave(&sport->port.lock, flags);
+ else
+ spin_lock_irqsave(&sport->port.lock, flags);
/*
* First, save UCR1/2/3 and then disable interrupts
@@ -1253,7 +1257,8 @@ imx_console_write(struct console *co, const char *s, unsigned int count)
imx_port_ucrs_restore(&sport->port, &old_ucr);
- spin_unlock_irqrestore(&sport->port.lock, flags);
+ if (locked)
+ spin_unlock_irqrestore(&sport->port.lock, flags);
}
/*
next prev parent reply other threads:[~2013-02-13 12:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 16:10 3.4.28-rt40 arm freescale imx35 pcm43 Tim Sander
2013-02-06 16:43 ` Tim Sander
2013-02-07 8:57 ` 3.4.28-rt40 arm freescale imx35 pcm43 - patch 86236252d2449313bdbac790023cbc957bf6e426 is cause Tim Sander
2013-02-13 12:13 ` Thomas Gleixner [this message]
2013-02-13 17:07 ` Tim Sander
2013-02-13 17:25 ` Thomas Gleixner
2013-02-13 17:40 ` Thomas Gleixner
2013-02-14 15:38 ` [PATCH] 3.4.28-rt40 tglx fix imx.c spinlock Tim Sander
2013-02-14 22:35 ` Thomas Gleixner
2013-02-15 1:13 ` Paul Gortmaker
2013-02-15 7:05 ` [PATHC] 3.6 spinlock fix Tim Sander
2013-02-15 10:18 ` Thomas Gleixner
2013-02-13 11:59 ` 3.4.28-rt40 arm freescale imx35 pcm43 Thomas Gleixner
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=alpine.LFD.2.02.1302131301580.11905@ionos \
--to=tglx@linutronix.de \
--cc=linux-rt-users@vger.kernel.org \
--cc=tim@krieglstein.org \
/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;
as well as URLs for NNTP newsgroup(s).