linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: BUG: sleeping function called from invalid context
Date: Wed, 23 Nov 2011 19:36:40 +0100	[thread overview]
Message-ID: <20111123183640.GQ19986@pengutronix.de> (raw)
In-Reply-To: <CAOMZO5DSvLU0ACJPZ69tzY0PjMijibSzwCEwBhu=5=mg7ncF=g@mail.gmail.com>

Hello,

On Wed, Nov 23, 2011 at 10:44:50AM -0200, Fabio Estevam wrote:
> On Wed, Nov 23, 2011 at 9:36 AM, Peter Rusko <rusko.peter@prolan.hu> wrote:
> > While trying to use the LRADC and touchscreen functionality on imx28,
> > I've run into this problem:
> >
> > udevd[523]: starting version 171
> > BUG: sleeping function called from invalid context at kernel/mutex.c:271
> > in_atomic(): 1, irqs_disabled(): 128, pid: 523, name: udevd
> > no locks held by udevd/523.
> > irq event stamp: 956
> > hardirqs last ?enabled at (956): [<c032e56c>]
> > _raw_write_unlock_irqrestore+0x3c/0x68
> > hardirqs last disabled at (955): [<c032e6ec>]
> > _raw_write_lock_irqsave+0x1c/0x58
> > softirqs last ?enabled at (843): [<c0025c78>] irq_exit+0x54/0xb0
> > softirqs last disabled at (792): [<c0025c78>] irq_exit+0x54/0xb0
> > [<c0013238>] (unwind_backtrace+0x0/0xe0) from [<c032d198>]
> > (mutex_lock_nested+0x24/0x31c)
> > [<c032d198>] (mutex_lock_nested+0x24/0x31c) from [<c0017570>]
> > (clk_enable+0x20/0x48)
> > [<c0017570>] (clk_enable+0x20/0x48) from [<c023173c>]
> > (pl011_console_write+0x20/0x78)
> > [<c023173c>] (pl011_console_write+0x20/0x78) from [<c0020780>]
> > (__call_console_drivers+0x84/0x9c)
> > [<c0020780>] (__call_console_drivers+0x84/0x9c) from [<c0020ba0>]
> > (console_unlock+0xfc/0x1ec)
> > [<c0020ba0>] (console_unlock+0xfc/0x1ec) from [<c0021150>]
> > (vprintk+0x3b0/0x440)
> > [<c0021150>] (vprintk+0x3b0/0x440) from [<c032b4d4>] (printk+0x18/0x24)
> > [<c032b4d4>] (printk+0x18/0x24) from [<c0233a5c>] (kmsg_writev+0xd8/0xfc)
> > [<c0233a5c>] (kmsg_writev+0xd8/0xfc) from [<c008f58c>]
> > (do_sync_write+0x98/0xd4)
> > [<c008f58c>] (do_sync_write+0x98/0xd4) from [<c008fe98>]
> > (vfs_write+0xc8/0x138)
> > [<c008fe98>] (vfs_write+0xc8/0x138) from [<c00900e0>] (sys_write+0x3c/0x68)
> > [<c00900e0>] (sys_write+0x3c/0x68) from [<c000e180>]
> > (ret_fast_syscall+0x0/0x38)
> >
> > It seems that the printk calls cause the problem (it's not just with udev,
> > seems to have the problem with all printk calls). The touchscreen
> > works perfectly and I'd like to submit a patch which supports it, but I
> > keep getting the same messages. What can cause the problem, why is it an
> > atomic context within the udevd?
> 
> Looks like the same error I faced before:
> http://marc.info/?l=linux-arm-kernel&m=131914543319956&w=2
which resulted in some concerns about locking correctness. On i.MX28 we
usually use

	http://thread.gmane.org/gmane.linux.ports.arm.kernel/100744/focus=100746

(though this patch wasn't accepted either. The right fix is to convert
mxs to the upcoming clk framework, which didn't land into mainline yet.)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  parent reply	other threads:[~2011-11-23 18:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 11:36 BUG: sleeping function called from invalid context Peter Rusko
2011-11-23 12:44 ` Fabio Estevam
2011-11-23 13:05   ` Fabio Estevam
2011-11-23 18:36   ` Uwe Kleine-König [this message]
2011-11-23 22:51     ` Russell King - ARM Linux
2011-11-24  6:32       ` Shawn Guo
2011-11-24  7:14       ` Uwe Kleine-König
2011-11-24  9:01         ` Russell King - ARM Linux
2011-11-24  9:05           ` Uwe Kleine-König
2011-11-24 10:29             ` Russell King - ARM Linux
2011-11-24 14:16               ` Uwe Kleine-König
  -- strict thread matches above, loose matches on Subject: below --
2011-05-10  5:38 Amit Virdi
2011-05-10  9:32 ` Alan Cox

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=20111123183640.GQ19986@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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).