linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.de>
To: Matthew Garrett <mjg@redhat.com>
Cc: linux-input@vger.kernel.org, rydberg@euromail.se, dtor@mail.ru
Subject: Re: [PATCH V2] input: Fix USB autosuspend on bcm5974
Date: Mon, 10 Oct 2011 16:06:37 +0200	[thread overview]
Message-ID: <201110101606.37878.oneukum@suse.de> (raw)
In-Reply-To: <1318254086-22752-1-git-send-email-mjg@redhat.com>

Am Montag, 10. Oktober 2011, 15:41:26 schrieb Matthew Garrett:
> The bcm5974 code takes a USB autosuspend reference on device open and
> releases it on device close. This means that the hardware won't sleep when
> anything holds it open. This is sensible for input devices that don't
> support remote wakeups on normal use (like most mice), but this hardware
> trigger wakeups on touch and so can suspend transparently to the user. Doing
> so allows the USB host controller to sleep when the machine is idle, giving
> measurable power savings.
> 
> Signed-off-by: Matthew Garrett <mjg@redhat.com>
> ---
> 
> Got rid of the unbalanced put on the close path, and added usb_mark_last_busy()
> calls to make sure the device doesn't go to sleep while in use. This works fine
> on my hardware now, and I don't see any warning messages being generated.

This is odd, because the hardware shouldn't generate remote wakeups unless you
request them, like this (usbhid)

int usbhid_open(struct hid_device *hid)
{
        struct usbhid_device *usbhid = hid->driver_data;
        int res;

        mutex_lock(&hid_open_mut);
        if (!hid->open++) {
                res = usb_autopm_get_interface(usbhid->intf);
                /* the device must be awake to reliably request remote wakeup */
                if (res < 0) {
                        hid->open--;
                        mutex_unlock(&hid_open_mut);
                        return -EIO;
                }
                usbhid->intf->needs_remote_wakeup = 1;

	Regards
		Oliver

  reply	other threads:[~2011-10-10 14:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10 13:41 [PATCH V2] input: Fix USB autosuspend on bcm5974 Matthew Garrett
2011-10-10 14:06 ` Oliver Neukum [this message]
2011-10-10 14:16   ` Matthew Garrett
2011-10-10 14:34     ` Oliver Neukum
2011-10-10 14:38       ` Matthew Garrett
2011-10-10 14:42         ` Oliver Neukum

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=201110101606.37878.oneukum@suse.de \
    --to=oneukum@suse.de \
    --cc=dtor@mail.ru \
    --cc=linux-input@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=rydberg@euromail.se \
    /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).