diff mbox series

[v2,1/8] rcar-vin: Do not call pm_runtime_{resume,suspend}()

Message ID 20190516011417.10590-2-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
State New, archived
Headers show
Series rcar-vin: Merge Gen2 and Gen3 file operations | expand

Commit Message

Niklas Söderlund May 16, 2019, 1:14 a.m. UTC
The driver does not implement runtime resume and suspend function so
there is little point in trying to call them. This is a leftover from
the drivers soc_camera beginnings.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Geert Uytterhoeven May 16, 2019, 7:23 a.m. UTC | #1
Hi Niklas,

On Thu, May 16, 2019 at 3:46 AM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> The driver does not implement runtime resume and suspend function so
> there is little point in trying to call them. This is a leftover from
> the drivers soc_camera beginnings.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
> ---
>  drivers/media/platform/rcar-vin/rcar-v4l2.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> index 7cbdcbf9b090c638..b821ea01786eb1ff 100644
> --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> @@ -798,9 +798,6 @@ static int rvin_initialize_device(struct file *file)
>                 return ret;
>
>         pm_runtime_enable(&vin->vdev.dev);
> -       ret = pm_runtime_resume(&vin->vdev.dev);

Please pardon my ignorance, but which device is vin->vdev.dev?
Who calls pm_runtime_get_sync() on it, and where?

I see this function calls rvin_power_on(vin->v4l2_dev.dev) (before the
call to pm_runtime_enable()), but presumably that's a different device?

Thanks!

Gr{oetje,eeting}s,

                        Geert
Laurent Pinchart May 16, 2019, 11:32 a.m. UTC | #2
On Thu, May 16, 2019 at 09:23:41AM +0200, Geert Uytterhoeven wrote:
> On Thu, May 16, 2019 at 3:46 AM Niklas Söderlund wrote:
> > The driver does not implement runtime resume and suspend function so
> > there is little point in trying to call them. This is a leftover from
> > the drivers soc_camera beginnings.
> >
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
> > ---
> >  drivers/media/platform/rcar-vin/rcar-v4l2.c | 5 -----
> >  1 file changed, 5 deletions(-)
> >
> > diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> > index 7cbdcbf9b090c638..b821ea01786eb1ff 100644
> > --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> > +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> > @@ -798,9 +798,6 @@ static int rvin_initialize_device(struct file *file)
> >                 return ret;
> >
> >         pm_runtime_enable(&vin->vdev.dev);
> > -       ret = pm_runtime_resume(&vin->vdev.dev);
> 
> Please pardon my ignorance, but which device is vin->vdev.dev?

This is the V4L2 video node class device, we shouldn't call any runtime
PM function with this. I assume the current code works because the class
device is a child of the physical device.

> Who calls pm_runtime_get_sync() on it, and where?
> 
> I see this function calls rvin_power_on(vin->v4l2_dev.dev) (before the
> call to pm_runtime_enable()), but presumably that's a different device?

That one is the physical platform device.
diff mbox series

Patch

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 7cbdcbf9b090c638..b821ea01786eb1ff 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -798,9 +798,6 @@  static int rvin_initialize_device(struct file *file)
 		return ret;
 
 	pm_runtime_enable(&vin->vdev.dev);
-	ret = pm_runtime_resume(&vin->vdev.dev);
-	if (ret < 0 && ret != -ENOSYS)
-		goto eresume;
 
 	/*
 	 * Try to configure with default parameters. Notice: this is the
@@ -817,7 +814,6 @@  static int rvin_initialize_device(struct file *file)
 	return 0;
 esfmt:
 	pm_runtime_disable(&vin->vdev.dev);
-eresume:
 	rvin_power_off(vin);
 
 	return ret;
@@ -868,7 +864,6 @@  static int rvin_release(struct file *file)
 	 * Then de-initialize hw module.
 	 */
 	if (fh_singular) {
-		pm_runtime_suspend(&vin->vdev.dev);
 		pm_runtime_disable(&vin->vdev.dev);
 		rvin_power_off(vin);
 	}