public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG] rtc uie emulation deadlocks
@ 2008-08-11 13:43 Russell King
  2008-08-19  7:53 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King @ 2008-08-11 13:43 UTC (permalink / raw)
  To: a.zummo, Linux Kernel List

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.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] rtc uie emulation deadlocks
  2008-08-11 13:43 [BUG] rtc uie emulation deadlocks Russell King
@ 2008-08-19  7:53 ` Andrew Morton
  2008-08-19 17:12   ` David Brownell
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2008-08-19  7:53 UTC (permalink / raw)
  To: Russell King; +Cc: a.zummo, Linux Kernel List, David Brownell

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()
    


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] rtc uie emulation deadlocks
  2008-08-19  7:53 ` Andrew Morton
@ 2008-08-19 17:12   ` David Brownell
  2008-08-19 20:15     ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: David Brownell @ 2008-08-19 17:12 UTC (permalink / raw)
  To: Andrew Morton, Russell King; +Cc: a.zummo, Linux Kernel List, David Brownell


--- Andrew Morton <akpm@linux-foundation.org> wrote:

> On Mon, 11 Aug 2008 14:43:39 +0100 Russell King
> <rmk+lkml@arm.linux.org.uk> wrote:
> 
> > 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()

I'm sure I saw someone else's fixup patch for that a couple weeks ago.
(Looks).  Yes:

http://groups.google.com/group/rtc-linux/browse_thread/thread/ad65b883739f8c92#

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] rtc uie emulation deadlocks
  2008-08-19 17:12   ` David Brownell
@ 2008-08-19 20:15     ` Andrew Morton
  2008-08-20 13:27       ` Atsushi Nemoto
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2008-08-19 20:15 UTC (permalink / raw)
  To: David Brownell; +Cc: rmk+lkml, a.zummo, linux-kernel, david-b, Atsushi Nemoto

On Tue, 19 Aug 2008 10:12:04 -0700 (PDT)
David Brownell <david-b@pacbell.net> wrote:

> 
> --- Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> > On Mon, 11 Aug 2008 14:43:39 +0100 Russell King
> > <rmk+lkml@arm.linux.org.uk> wrote:
> > 
> > > 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()
> 
> I'm sure I saw someone else's fixup patch for that a couple weeks ago.
> (Looks).  Yes:
> 
> http://groups.google.com/group/rtc-linux/browse_thread/thread/ad65b883739f8c92#

argh, so a fix for a serious regression has been languishing in the
backwaters of the rtc list for two weeks.

Guys, please: regressions are serious, top-priority emergencies.  We
drop everything and run around with our hair on fire when we hear about
one (don't we?).  Please, if you have a report of a regression or a fix
for one, Cc: everyone in the world on it.

I'd prefer not to go fishing through HTML to piece that patch together,
but as my hair is on fire I guess I'd better do so.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] rtc uie emulation deadlocks
  2008-08-19 20:15     ` Andrew Morton
@ 2008-08-20 13:27       ` Atsushi Nemoto
  0 siblings, 0 replies; 5+ messages in thread
From: Atsushi Nemoto @ 2008-08-20 13:27 UTC (permalink / raw)
  To: akpm; +Cc: david-b, rmk+lkml, a.zummo, linux-kernel

On Tue, 19 Aug 2008 13:15:46 -0700, Andrew Morton <akpm@linux-foundation.org> wrote:
> > I'm sure I saw someone else's fixup patch for that a couple weeks ago.
> > (Looks).  Yes:
> > 
> > http://groups.google.com/group/rtc-linux/browse_thread/thread/ad65b883739f8c92#
> 
> argh, so a fix for a serious regression has been languishing in the
> backwaters of the rtc list for two weeks.
> 
> Guys, please: regressions are serious, top-priority emergencies.  We
> drop everything and run around with our hair on fire when we hear about
> one (don't we?).  Please, if you have a report of a regression or a fix
> for one, Cc: everyone in the world on it.

Oh, I had thought I CC-ed it to LKML but actually I didn't.  Thank you
for catching it up anyway.

---
Atsushi Nemoto

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-08-20 13:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-11 13:43 [BUG] rtc uie emulation deadlocks Russell King
2008-08-19  7:53 ` Andrew Morton
2008-08-19 17:12   ` David Brownell
2008-08-19 20:15     ` Andrew Morton
2008-08-20 13:27       ` Atsushi Nemoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox