lkml.org 
[lkml]   [2008]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Bug 10030] Suspend doesn't work when SD card is inserted
Hi!

> > > @@ -25,6 +25,7 @@
> > > #include <linux/pm.h>
> > > #include <linux/resume-trace.h>
> > > #include <linux/rwsem.h>
> > > +#include <linux/sched.h>
> > >
> > > #include "../base.h"
> > > #include "power.h"
> > > @@ -59,6 +60,13 @@ static DECLARE_RWSEM(pm_sleep_rwsem);
> > >
> > > int (*platform_enable_wakeup)(struct device *dev, int is_on);
> > >
> > > +static struct task_struct *suspending_task;
> >
> > What locking protects this variable? What happens when suspending_task
> > exits? (Hmm, that would probably be bug, anyway?)
>
> It's protected by whatever existing locking scheme allows only one
> task to start a system sleep at a time. For example, the suspending
> task has to get a write lock on pm_sleep_rwsem.

And readers of suspending_task are protected by?

At the very least, you'd need rmb() before reading it and wmb() after
writing to it, but I'm not sure if that's enough on every obscure
architecture out there.

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2008-02-24 23:29    [W:0.100 / U:0.944 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site