lkml.org 
[lkml]   [2008]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [Bug 10030] Suspend doesn't work when SD card is inserted
    Date
    On Monday, 25 of February 2008, Alan Stern wrote:
    > On Sun, 24 Feb 2008, Rafael J. Wysocki wrote:
    >
    > > > Very subtly wrong ;-).
    > > >
    > > > imagine suspending_task == 0xabcdef01. Now task "R" with current ==
    > > > 0xabcd0000 reads suspending_task while the other cpu is writing to it,
    > > > and sees 0xabcd0000 (0xef01 was not yet written) -- and mistakenly
    > > > believes that "R" == suspending_task.
    > > >
    > > > I agree it is very unlikely, and it will not happen on i386. But what
    > > > about just using atomic_t suspending_task, and store current->pid into
    > > > it?
    > >
    > > I'd rather use a lock, frankly. For example, we can require the readers to
    > > take pm_sleep_rwsem for reading in order to access that.
    >
    > That certainly won't work. Imagine what would happen when the reader
    > _was_ the suspending task.

    Yeah, I've already realized it was a stupid idea. :-)

    > But if you really twist my arm, I'll go along with Pavel's suggestion.

    So can you do that, pretty please?

    Thanks,
    Rafael


    \
     
     \ /
      Last update: 2008-02-25 12:45    [W:0.020 / U:59.328 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site