LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	linux-input@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 5/6] Input: evdev - Enable runtime PM of the evdev input handler
Date: Fri, 3 Apr 2015 15:03:43 +0200	[thread overview]
Message-ID: <CAAObsKDQoUR728pnadJGx229-rGBm2=sU3nN-a8xN_hWk4FM0A@mail.gmail.com> (raw)
In-Reply-To: <20150331203138.GB29015@dtor-ws>

On 31 March 2015 at 22:31, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On Tue, Mar 31, 2015 at 06:14:49PM +0200, Tomeu Vizoso wrote:
>> So ancestor 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 enabled.
>
> I am confused. Input devices are not runtime-PM-enabled, so what
> enabling this on evdev handler buys us?

The UVC driver would be enabling runtime PM for the input device that
it registers.

> And what about joydev and
> mousedev? Other handlers that might be attached?

Not sure, tbh. What I have ended up doing in v2 is descending the tree
from the UVC device and enabling runtime PM for all descendants. The
idea is that the UVC driver knows whether it should remain runtime
suspended and that its descendants should copy it.

> The stubbing of prepare also feels wrong: we do want to suspend/resume
> input devices since we want to shut off and restore their leds even if
> device (keyboard) happens to be sleeping.

Fair enough, I have introduced a flag that allows the creator of the
input device to decide that.

Thanks,

Tomeu

> Thanks.
>
>>
>> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
>> ---
>>  drivers/input/evdev.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
>> index a18f41b..3d60c20 100644
>> --- a/drivers/input/evdev.c
>> +++ b/drivers/input/evdev.c
>> @@ -26,6 +26,7 @@
>>  #include <linux/major.h>
>>  #include <linux/device.h>
>>  #include <linux/cdev.h>
>> +#include <linux/pm_runtime.h>
>>  #include "input-compat.h"
>>
>>  enum evdev_clock_type {
>> @@ -1201,6 +1202,8 @@ static int evdev_connect(struct input_handler *handler, struct input_dev *dev,
>>       if (error)
>>               goto err_cleanup_evdev;
>>
>> +     pm_runtime_enable(&evdev->dev);
>> +
>>       return 0;
>>
>>   err_cleanup_evdev:
>> --
>> 2.3.4
>>
>
> --
> Dmitry
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2015-04-03 13:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31 16:14 [PATCH 0/6] Allow UVC devices to remain runtime-suspended when sleeping Tomeu Vizoso
2015-03-31 16:14 ` [PATCH 1/6] [media] uvcvideo: Enable runtime PM of descendant devices Tomeu Vizoso
2015-03-31 16:14 ` [PATCH 2/6] [media] v4l2-core: Implement dev_pm_ops.prepare() Tomeu Vizoso
2015-03-31 16:14 ` [PATCH 3/6] Input: " Tomeu Vizoso
2015-03-31 16:14 ` [PATCH 4/6] [media] media-devnode: Implement dev_pm_ops.prepare callback Tomeu Vizoso
2015-03-31 16:14 ` [PATCH 5/6] Input: evdev - Enable runtime PM of the evdev input handler Tomeu Vizoso
2015-03-31 20:31   ` Dmitry Torokhov
2015-04-03 13:03     ` Tomeu Vizoso [this message]
2015-03-31 16:14 ` [PATCH 6/6] USB / PM: Allow USB devices to remain runtime-suspended when sleeping Tomeu Vizoso
2015-03-31 17:09   ` Alan Stern
2015-04-01 12:40     ` Oliver Neukum
2015-04-01 14:01       ` Alan Stern
2015-04-01 14:26         ` Oliver Neukum
2015-04-01 14:36           ` Alan Stern
2015-04-03 13:05     ` Tomeu Vizoso

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='CAAObsKDQoUR728pnadJGx229-rGBm2=sU3nN-a8xN_hWk4FM0A@mail.gmail.com' \
    --to=tomeu.vizoso@collabora.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --subject='Re: [PATCH 5/6] Input: evdev - Enable runtime PM of the evdev input handler' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).