Re: [PATCH 6/6 v2] arm: omap: usb: global Suspend and resume support of ehci and ohci

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 4 Jul 2011, Felipe Balbi wrote:

> sounds to me like a bug on pm runtime ? If you're calling
> pm_runtime_*_sync() family, shouldn't all calls be _sync() too ?

No.  This was a deliberate design decision.  It minimizes stack usage 
and it gives a chance for some other child to resume before the parent 
is powered down.

> > static int rpm_suspend(struct device *dev, int rpmflags)
> > 	__releases(&dev->power.lock) __acquires(&dev->power.lock)
> > {
> > .
> > .
> > .
> > no_callback:
> > .
> > .
> > .
> > 	/* Maybe the parent is now able to suspend. */
> > 	if (parent && !parent->power.ignore_children &&
> > !dev->power.irq_safe) {
> > 		spin_unlock(&dev->power.lock);
> > 
> > 		spin_lock(&parent->power.lock);
> > 		rpm_idle(parent, RPM_ASYNC);
> 
> to me this is bogus, if you called pm_runtime_put_sync() should should
> be sync too. Shouldn't it ?

No, it shouldn't.

> > 		spin_unlock(&parent->power.lock);
> > 
> > 		spin_lock(&dev->power.lock);
> > 	}
> > This is the reason of directly calling the parent Runtime PM calls from
> > the children.
> > If directly calling Runtime PM APIs with parent dev-pointer isn't
> > acceptable,
> > this can be achieved by exporting wrapper APIs from the
> > parent and calling them from the chidren .suspend/.resume routines.
> 
> Still no good, IMHO.

The real problem here is that you guys are trying to use the runtime PM
framework to carry out activities during system suspend.  That won't
work; it's just a bad idea all round.  Use the proper callbacks to do
what you want.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux