linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Todd Brandt <todd.e.brandt@linux.intel.com>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	todd.e.brandt@intel.com
Subject: Re: [PATCH] serio: delay resume error handling til PM complete
Date: Wed, 25 Nov 2015 09:39:20 -0800	[thread overview]
Message-ID: <20151125173920.GA23632@dtor-ws> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1511251020430.1679-100000@iolanthe.rowland.org>

On Wed, Nov 25, 2015 at 10:24:07AM -0500, Alan Stern wrote:
> On Tue, 24 Nov 2015, Dmitry Torokhov wrote:
> 
> > On Tue, Nov 24, 2015 at 4:58 PM, Todd Brandt
> > <todd.e.brandt@linux.intel.com> wrote:
> > >  Delay the error rescan for serio devices until the PM
> > >  complete phase. PM complete requires locking each device
> > >  before checking for and executing the complete callbacks.
> > >  Serio rescan also locks the device in order to reinit on
> > >  error, so this can cause a conflict which will result in
> > >  unnecessary delay.
> > >
> > >  History:
> > >
> > >  The issue was discovered on an ivy bridge platform with
> > >  i8042 keyboard/mouse. The mouse resume fails
> > 
> > I'd first try to figure out why reconnect failed. What kind of
> > mouse/touchpad is that?
> > 
> > > and the serio
> > >  driver begins a full driver rescan in the resume phase. Since
> > >  the device is locked during re-initialization it conflicts
> > >  with the PM subsystem's attempt to lock the device to check
> > >  for a complete callback. Thus dpm_complete is delayed for
> > >  almost a second.
> > >
> > >  I've tried to fix this by altering the PM subsystem code
> > >  itself so that it doesn't have to lock a device in order to
> > >  check if it has a callback, but this was too much for an
> > >  isolated case. This approach attempts to fix the problem in
> > >  the serio driver itself.
> > 
> > Hmm, there is nothing specific to serio here. Any slow-to-probe device
> > might wedge the process like that.
> 
> USB is a little similar.  Probing can be slow, but it is carried out in 
> a workqueue thread.  Since the workqueue is marked as FREEZABLE, it 
> doesn't run at all during any stage of system sleep, so the problem 
> can't arise.

Serio used to have freezable workqueue, but because PS/2 protocol is
slow we want to start talking to the device as soon as possible to
minimize amount of time where UI is shown but user is "stuck" because
mouse does not move.

Thanks.

-- 
Dmitry

  reply	other threads:[~2015-11-25 17:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1448068686.git.todd.e.brandt@linux.intel.com>
2015-11-25  0:58 ` [PATCH] serio: delay resume error handling til PM complete Todd Brandt
2015-11-25  1:26   ` Dmitry Torokhov
2015-11-25 15:24     ` Alan Stern
2015-11-25 17:39       ` Dmitry Torokhov [this message]
2015-11-25 17:25     ` Todd E Brandt
2015-11-25 17:51       ` Dmitry Torokhov
2015-11-25 17:55         ` Todd E Brandt

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=20151125173920.GA23632@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=todd.e.brandt@intel.com \
    --cc=todd.e.brandt@linux.intel.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;
as well as URLs for NNTP newsgroup(s).