Re: [PATCH] PM / sleep: Don't unset parent's direct_complete
From: Alan Stern
Date: Wed Mar 25 2015 - 13:55:39 EST
On Wed, 25 Mar 2015, Tomeu Vizoso wrote:
> If a device isn't going to be fully-suspended because there isn't an
> implementation of the suspend callback, there's no need to make sure
> that its parent is going to be fully-suspended as well.
What do you mean by "fully-suspended"?
What if the parent has several children? Maybe some of them have
implementations of the suspend callback and the others don't. Will
your patch do the right thing then?
> Without this change, USB interface devices will always prevent the
> proper USB device to stay in runtime suspension when the system
> suspends.
For USB it doesn't matter; everything gets resumed when the system
wakes up.
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@xxxxxxxxxxxxx>
> ---
>
> Hi,
>
> I'm not sure if this is the right fix,
What are you trying to fix? Is something currently wrong?
> because I don't see why the USB
> interface devices are in the dpm_list in the first place, so any comments will
> be welcome.
_Every_ device is in the dpm_list, including USB interfaces.
If your goal is to prevent USB devices from being resumed when the
system wakes up, then the correct approach is to make usb_dev_prepare()
return 1 rather than 0 under the appropriate conditions, and to add a
dev_pm_ops to the usb_if_device_type structure with a prepare callback
that returns 1.
Alan Stern
--
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/