From: "Henrik Rydberg" <rydberg@euromail.se>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Oliver Neukum <oliver@neukum.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: Wed, 12 Oct 2011 20:33:06 +0200 [thread overview]
Message-ID: <20111012183306.GA10397@polaris.bitmath.org> (raw)
In-Reply-To: <20111012165905.GA29313@srcf.ucam.org>
On Wed, Oct 12, 2011 at 05:59:05PM +0100, Matthew Garrett wrote:
> On Wed, Oct 12, 2011 at 06:56:32PM +0200, Oliver Neukum wrote:
> > Am Mittwoch, 12. Oktober 2011, 18:16:51 schrieb Matthew Garrett:
> > > Yeah. Plausibly the model we have in hid is wrong at the moment - rather
> > > than set flags that block suspend, it might make more sense to take
> > > references. It'd complicate things a little, in that we'd have to take
> > > more care in terms of keeping track of the state.
> >
> > I am afraid references are very hard to take there because it needs to be done
> > in interrupt.
>
> True. That makes things rather more awkward.
I was looking at usb_autopm_get_interface_no_resume() yesterday for
the same reason, it seemed light-weight enough. No?
Btw, I wonder if the patch below would make sense or if calling put*()
is always a bug at zero usage count.
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 34e3da5..4857e76 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1516,7 +1516,7 @@ void usb_autopm_put_interface_no_suspend(struct usb_interface *intf)
struct usb_device *udev = interface_to_usbdev(intf);
usb_mark_last_busy(udev);
- atomic_dec(&intf->pm_usage_cnt);
+ atomic_add_unless(&intf->pm_usage_cnt, -1, 0);
pm_runtime_put_noidle(&intf->dev);
}
EXPORT_SYMBOL_GPL(usb_autopm_put_interface_no_suspend);
Henrik
next prev parent reply other threads:[~2011-10-12 18:26 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
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 [this message]
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=20111012183306.GA10397@polaris.bitmath.org \
--to=rydberg@euromail.se \
--cc=dtor@mail.ru \
--cc=linux-input@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=oliver@neukum.org \
--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).