linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Dr. H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Lukas M?rdian <lukas@goldelico.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Marek Belisko <marek@goldelico.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	stern@rowland.harvard.edu
Subject: Re: [PATCH] gpio_keys, twl4030-pwrbutton: stay awake for 1sec on resume
Date: Sat, 28 Jun 2014 22:04:10 +0200	[thread overview]
Message-ID: <20140628200410.GA7561@amd.pavel.ucw.cz> (raw)
In-Reply-To: <BD5D0538-BD03-4CD8-8E12-2344AD7ED669@goldelico.com>

Hi!

> >> This gives the userspace (Replicant) a chance to fully handle the
> >> pm_wakeup_event, before autosleep suspends the system alltogether
> >> again.
> >> 
> >> This fixes suspend/resume on the OpenPhoenux GTA04, in combination with
> >> the Replicant 4.2.2 userspace, which needs to execute this to stay
> >> awake: 'echo on > /sys/power/state'
> >> 
> >> Signed-off-by: Lukas Märdian <lukas@goldelico.com>
> >> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> > 
> > I'm sorry, but we should not be doing this.
> > 
> > You basically put a delay in driver to work around userspace bug.
> 
> Do you think it is a user-space bug if the kernel goes to sleep again
> before giving user space any chance to react to an event?

Well, who says 1000msec is enough? Some userspace may need
more. ... for example on PC when you keyboard-handling deamon is
swapped out.

> And the msec parameter is described as:
> 
> @msec: Anticipated event processing time (in milliseconds).
> 
> Isn't calling pm_wakeup_event() with a non-zero msec the standard
> method to handle this situation? And it is used in other drivers. E.g. in
> _mmc_detect_change() or hub_suspend().

 * Notify the PM core of a wakeup event whose source is @ws that will
   take                    
 * approximately @msec milliseconds to be processed by the kernel.  If
   @ws is                 
 * not active, activate it.  If @msec is nonzero, set up the @ws'
   timer to                    
 * execute pm_wakeup_timer_fn() in future.                                                    

Will take @msec milliseconds to be processed by the _kernel_. Yes, USB
probing takes a lot of time in kernel. But you are using this
parameter to wait for userspace...

> > There must be better
> > solution....
>  
> I am not sure how it could look like.

Rafael, do you have any idea how this is supposed to work?

Original patch is at https://lkml.org/lkml/2014/4/10/156 .
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2014-06-28 20:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27 21:55 [PATCH] gpio_keys, twl4030-pwrbutton: stay awake for 1sec on resume Lukas Märdian
2014-06-28 17:08 ` Pavel Machek
2014-06-28 17:57   ` Dr. H. Nikolaus Schaller
2014-06-28 20:04     ` Pavel Machek [this message]
2014-06-28 21:58       ` Alan Stern
2014-07-04 10:39       ` Lukas Maerdian
2014-07-04 12:03         ` NeilBrown
2014-07-07 10:42           ` NeilBrown
  -- strict thread matches above, loose matches on Subject: below --
2014-04-10  9:29 Dr. H. Nikolaus Schaller

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=20140628200410.GA7561@amd.pavel.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hns@goldelico.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas@goldelico.com \
    --cc=marek@goldelico.com \
    --cc=rjw@rjwysocki.net \
    --cc=stern@rowland.harvard.edu \
    /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;
as well as URLs for NNTP newsgroup(s).