All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: Henrik Rydberg <rydberg@euromail.se>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	linux-input@vger.kernel.org, dtor@mail.ru
Subject: Re: [PATCH V3] input: Fix USB autosuspend on bcm5974
Date: Tue, 11 Oct 2011 13:09:21 +0200	[thread overview]
Message-ID: <201110111309.21132.oliver@neukum.org> (raw)
In-Reply-To: <20111011110421.GA21008@polaris.bitmath.org>

Am Dienstag, 11. Oktober 2011, 13:04:21 schrieb Henrik Rydberg:
> On Tue, Oct 11, 2011 at 06:10:12AM +0200, Oliver Neukum wrote:
> > Am Dienstag, 11. Oktober 2011, 02:11:03 schrieb Matthew Garrett:
> > 
> > > Ah, right, sorry - I wasn't trying to use the device after it had been 
> > > closed. In an ideal world we'd really want to be able to indicate that 
> > > we don't want a remote wakeup in that situation. Otherwise, the patch 
> > > looks good. Thank you!
> > 
> > It looks like we had exactly that capability until
> > 48826626263d4a61d06fd8c5805da31f925aefa0
> > removed it.
> 
> Hm. Throwing in another related question below.
> 
> Problem: the hid keyboard driver refuses to suspend while a key is
> pressed, which is fine per se, but there is no indication presented to the power layer,
> resulting in a failed suspend and (due to complex reasons it seems) disabled autosuspend.

That is a bug. Autosuspend at a later date should happen.

> Question:  If the hid interrupt handler were to actually prevent
> suspend during keypress, what would be the natural way to do it?

Firstly we must prevent autosuspension when a key is pressed
because most keyboards do not generate a wakeup upon key release
which is then lost.

Secondly a key pres triggers the mark_busy. We could do an async
get on every key press and an async put on every key release. But you
cannot beat the principal race here because the operation happen
in interrupt and must therefore be async. You must be prepared for
the window to be hit and return an error code.

	Regards
		Oliver

  reply	other threads:[~2011-10-11 11:09 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10 15:47 [PATCH V3] input: Fix USB autosuspend on bcm5974 Matthew Garrett
2011-10-10 21:05 ` Henrik Rydberg
2011-10-10 21:12   ` Matthew Garrett
2011-10-10 22:44     ` Henrik Rydberg
2011-10-11  0:11       ` Matthew Garrett
2011-10-11  4:10         ` Oliver Neukum
2011-10-11 11:04           ` Henrik Rydberg
2011-10-11 11:09             ` Oliver Neukum [this message]
2011-10-11 20:42               ` Matthew Garrett
2011-10-12  6:32                 ` Oliver Neukum
2011-10-12 14:33                   ` Alan Stern
2011-10-12 14:37                     ` Oliver Neukum
2011-10-12 15:28                       ` Alan Stern
2011-10-12 16:16                         ` Matthew Garrett
2011-10-12 16:56                           ` Oliver Neukum
2011-10-12 16:59                             ` Matthew Garrett
2011-10-12 17:24                               ` Alan Stern
2011-10-12 17:26                                 ` Matthew Garrett
2011-10-12 17:41                                   ` Alan Stern
2011-10-12 18:33                               ` Henrik Rydberg
2011-10-12 19:21                                 ` Alan Stern
2011-10-13  8:20                                   ` Henrik Rydberg
2011-10-13 15:49                                     ` Alan Stern
2011-10-13 17:21                                       ` Henrik Rydberg
2011-10-12 17:11                         ` Oliver Neukum
2011-10-12 19:18                           ` Alan Stern
2011-10-11 16:05           ` Dmitry Torokhov
2011-10-11 16:43             ` Alan Stern
2011-10-12  7:03               ` Oliver Neukum
2011-10-12 13:54                 ` Matthew Garrett
2011-10-12 14:18                   ` Alan Stern
2011-10-12 14:26                     ` Matthew Garrett
2011-10-12 14:38                       ` Oliver Neukum
2011-10-12 18:50                         ` Henrik Rydberg
2011-10-13  6:47                           ` Oliver Neukum
2011-10-10 21:16   ` Matthew Garrett

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=201110111309.21132.oliver@neukum.org \
    --to=oliver@neukum.org \
    --cc=dtor@mail.ru \
    --cc=linux-input@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=rydberg@euromail.se \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.