public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: a.zummo@towertech.it,
	Linux Kernel List <linux-kernel@vger.kernel.org>,
	David Brownell <david-b@pacbell.net>
Subject: Re: [BUG] rtc uie emulation deadlocks
Date: Tue, 19 Aug 2008 00:53:20 -0700	[thread overview]
Message-ID: <20080819005320.00075dba.akpm@linux-foundation.org> (raw)
In-Reply-To: <20080811134339.GA21967@flint.arm.linux.org.uk>

On Mon, 11 Aug 2008 14:43:39 +0100 Russell King <rmk+lkml@arm.linux.org.uk> wrote:

> With CONFIG_RTC_INTF_DEV_UIE_EMUL=y, hwclock deadlocks in rtc_read_time
> due to:
> 
> static long rtc_dev_ioctl(struct file *file,
>                 unsigned int cmd, unsigned long arg)
> {
>         err = mutex_lock_interruptible(&rtc->ops_lock);
>         if (err)
>                 return err;
> ...
>         switch (cmd) {
> #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
>         case RTC_UIE_OFF:
>                 clear_uie(rtc);
>                 break;
> 
>         case RTC_UIE_ON:
>                 err = set_uie(rtc);
> #endif
> }
> 
> static int set_uie(struct rtc_device *rtc)
> {
>         err = rtc_read_time(rtc, &tm);
> ...
> 
> int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm)
> {
>         err = mutex_lock_interruptible(&rtc->ops_lock);
> 
> So we try to take the same lock twice...  Not good.
> 
> The locking looks a rather random in there, so I'm not going to try to
> create a patch.
> 

Looks like this was caused by

commit 5ad31a575157147b43fa84ef1e21471661653878
Author: David Brownell <david-b@pacbell.net>
Date:   Wed Jul 23 21:30:33 2008 -0700

    rtc: remove BKL for ioctl()
    


  reply	other threads:[~2008-08-19  7:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-11 13:43 [BUG] rtc uie emulation deadlocks Russell King
2008-08-19  7:53 ` Andrew Morton [this message]
2008-08-19 17:12   ` David Brownell
2008-08-19 20:15     ` Andrew Morton
2008-08-20 13:27       ` Atsushi Nemoto

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=20080819005320.00075dba.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.zummo@towertech.it \
    --cc=david-b@pacbell.net \
    --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