Re: [PATCH 1/5] PM: Make the initcall_debug style timing for suspend/resume complete

From: Rafael J. Wysocki
Date: Mon Dec 21 2009 - 17:39:44 EST


On Monday 21 December 2009, Alan Stern wrote:
> On Mon, 21 Dec 2009, Rafael J. Wysocki wrote:
>
> > From: Rafael J. Wysocki <rjw@xxxxxxx>
> >
> > Commit f2511774863487e61b56a97da07ebf8dd61d7836
> > (PM: Add initcall_debug style timing for suspend/resume) introduced
> > basic timing instrumentation, needed for a scritps/bootgraph.pl
> > equivalent or humans, but it missed the fact that bus types and
> > device classes which haven't been switched to using struct dev_pm_ops
> > objects yet need special handling. As a result, the suspend/resume
> > timing information is only available for devices whose bus types or
> > device classes use struct dev_pm_ops objects, so the majority of
> > devices is not covered.
> >
> > Fix this by adding basic suspend/resume timing instrumentation for
> > devices whose bus types and device classes still don't use struct
> > dev_pm_ops objects for power management. To reduce code duplication
> > move the timing code to helper functions.
>
> A minor complaint...
>
> > +/**
> > * device_resume - Execute "resume" callbacks for given device.
> > * @dev: Device to handle.
> > * @state: PM transition of the system being carried out.
> > @@ -427,7 +465,7 @@ static int device_resume(struct device *
> > error = pm_op(dev, dev->bus->pm, state);
> > } else if (dev->bus->resume) {
> > pm_dev_dbg(dev, state, "legacy ");
> > - error = dev->bus->resume(dev);
> > + error = legacy_resume(dev, dev->bus->resume);
> > }
> > if (error)
> > goto End;
> > @@ -448,7 +486,7 @@ static int device_resume(struct device *
> > error = pm_op(dev, dev->class->pm, state);
> > } else if (dev->class->resume) {
> > pm_dev_dbg(dev, state, "legacy class ");
> > - error = dev->class->resume(dev);
> > + error = legacy_resume(dev, dev->class->resume);
> > }
> > }
>
> If none of the method callbacks are non-NULL, this won't print
> anything. The same is true for device_suspend().
>
> Now maybe you don't _want_ to print anything in that case, but for
> debugging purposes it could be useful.

I'm going to add that in a separate patch.

Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/