From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: linux-pm@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/7] [media] uvcvideo: Enable runtime PM of descendant devices
Date: Sat, 04 Apr 2015 15:33:20 +0300 [thread overview]
Message-ID: <2185959.thXfDS86Vr@avalon> (raw)
In-Reply-To: <1428065887-16017-5-git-send-email-tomeu.vizoso@collabora.com>
Hi Tomeu,
Thank you for the patch.
Could you please CC me on the whole series for v3 ?
On Friday 03 April 2015 14:57:53 Tomeu Vizoso wrote:
> So UVC devices can remain runtime-suspended when the system goes into a
> sleep state, they and all of their descendant devices need to have
> runtime PM enable.
>
> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
> ---
> drivers/media/usb/uvc/uvc_driver.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/media/usb/uvc/uvc_driver.c
> b/drivers/media/usb/uvc/uvc_driver.c index cf27006..687e5fb 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -1855,6 +1855,15 @@ static int uvc_register_chains(struct uvc_device
> *dev) return 0;
> }
>
> +static int uvc_pm_runtime_enable(struct device *dev, void *data)
> +{
> + pm_runtime_enable(dev);
> +
> + device_for_each_child(dev, NULL, uvc_pm_runtime_enable);
How many recursion levels do we typically have with uvcvideo ?
> +
> + return 0;
> +}
The function isn't UVC-specific, how about renaming it to
pm_runtime_enable_recursive() (or something similar) and moving it to the
runtime PM core ?
> +
> /* ------------------------------------------------------------------------
> * USB probe, disconnect, suspend and resume
> */
> @@ -1959,6 +1968,8 @@ static int uvc_probe(struct usb_interface *intf,
> "supported.\n", ret);
> }
>
> + device_for_each_child(&dev->intf->dev, NULL, uvc_pm_runtime_enable);
You could just call uvc_pm_runtime_enable(&dev->intf->dev, NULL) here.
> +
> uvc_trace(UVC_TRACE_PROBE, "UVC device initialized.\n");
> usb_enable_autosuspend(udev);
> return 0;
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2015-04-04 12:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-03 12:57 [PATCH v2 0/7] Allow UVC devices to remain runtime-suspended when sleeping Tomeu Vizoso
2015-04-03 12:57 ` [PATCH v2 1/7] Input: Implement dev_pm_ops.prepare in input_class Tomeu Vizoso
2015-04-03 12:57 ` [PATCH v2 2/7] Input: Add input_dev.stay_runtime_suspended flag Tomeu Vizoso
2015-04-03 12:57 ` [PATCH v2 3/7] [media] uvcvideo: Set " Tomeu Vizoso
2015-04-03 12:57 ` [PATCH v2 4/7] [media] uvcvideo: Enable runtime PM of descendant devices Tomeu Vizoso
2015-04-04 12:33 ` Laurent Pinchart [this message]
2015-04-09 10:52 ` Tomeu Vizoso
2015-04-03 12:57 ` [PATCH v2 5/7] [media] v4l2-core: Implement dev_pm_ops.prepare() Tomeu Vizoso
2015-07-03 18:08 ` Mauro Carvalho Chehab
2015-04-03 12:57 ` [PATCH v2 6/7] [media] media-devnode: Implement dev_pm_ops.prepare callback Tomeu Vizoso
2015-04-03 12:57 ` [PATCH v2 7/7] USB / PM: Allow USB devices to remain runtime-suspended when sleeping Tomeu Vizoso
2015-04-03 20:44 ` Dmitry Torokhov
2015-04-03 21:23 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2185959.thXfDS86Vr@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
--cc=tomeu.vizoso@collabora.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox