lkml.org 
[lkml]   [2009]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [RFC][PATCH 2/3] PM: Asynchronous suspend of devices
    Date
    On Friday 14 August 2009, Pavel Machek wrote:
    > > @@ -659,26 +674,61 @@ static pm_message_t resume_event(pm_mess
    > > }
    > >
    > > /**
    > > - * device_suspend_noirq - Shut down one device (late suspend).
    > > - * @dev: Device.
    > > - * @state: PM transition of the system being carried out.
    > > + * __device_suspend_noirq - Execute a "late" suspend callback for given device.
    > > + * @dev: Device to suspend.
    > > + * @state: PM transition of the system being carried out.
    >
    > > *
    > > - * This is called with interrupts off and only a single CPU running.
    >
    > that still looks like useful comment... why delete it?

    Because it's not valid any more.

    > > + * The driver of the device won't receive interrupts while this function is
    > > + * being executed.
    > > */
    > > @@ -696,13 +746,19 @@ int dpm_suspend_noirq(pm_message_t state
    > > suspend_device_irqs();
    > > mutex_lock(&dpm_list_mtx);
    > > list_for_each_entry_reverse(dev, &dpm_list, power.entry) {
    > > + dev->power.status = DPM_OFF_IRQ;
    > > error = device_suspend_noirq(dev, state);
    > > if (error) {
    > > pm_dev_err(dev, state, " late", error);
    > > + dev->power.status = DPM_OFF;
    > > + break;
    > > + }
    > > + if (async_error) {
    > > + error = async_error;
    > > break;
    >
    > async_error is 'interesting'. How does locking work in noirq case?

    It's racy, a little bit. :-)

    If two async drivers return errors exactly at the same time, one of them will
    win the race, but it doesn't really matter which one wins as long as
    async_error is different from zero as a result. And it will be, since it's
    an 'int' and the integrity of these is guaranteed.

    Thanks,
    Rafael


    \
     
     \ /
      Last update: 2009-08-15 23:07    [W:0.021 / U:62.336 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site