From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Oliver Neukum <oliver@neukum.org>
Cc: linux-pm@lists.linux-foundation.org, pingc@wacom.com,
Jiri Slaby <jslaby@suse.cz>,
Linux kernel mailing list <linux-kernel@vger.kernel.org>,
linux-input@vger.kernel.org
Subject: Re: [linux-pm] wacom + runtime PM = AA deadlock
Date: Mon, 4 Oct 2010 22:41:40 -0700 [thread overview]
Message-ID: <20101005054139.GC15355@core.coreip.homeip.net> (raw)
In-Reply-To: <201010042124.24253.oliver@neukum.org>
On Mon, Oct 04, 2010 at 09:24:24PM +0200, Oliver Neukum wrote:
> Am Montag, 4. Oktober 2010, 20:38:49 schrieb Dmitry Torokhov:
> > On Mon, Oct 04, 2010 at 08:33:53PM +0200, Oliver Neukum wrote:
> > > Am Montag, 4. Oktober 2010, 18:13:20 schrieb Dmitry Torokhov:
> > > > Lost track of this issue for a while. So I think we still need to fix
> > > > the deadlock for .36 and I think that the following will do that. Then
> > > > we'll adjust the driver to actually enable runtime PM for .37.
> > >
> > > That's a viable plan.
> > >
> >
> > I take it as an "acked-by" for this patch, right?
>
> Sure. Just in case:
>
> Acked-by: Oliver Neukum <oneukum@suse.de>
>
Thanks Oliver. And the patch below is for .37 properly enabling runtime
PM for wacom.
--
Dmitry
Input: wacom - properly enable runtime PM
We need to always call usb_autopm_put_interface() in wacom_open(),
not only when initialization fails, otherwise the device will be
marked as PM-busy and will never be put in suspended state.
Based on patch by Oliver Neukum.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/tablet/wacom_sys.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 02de653..fc38149 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -120,14 +120,16 @@ static int wacom_open(struct input_dev *dev)
out:
mutex_unlock(&wacom->lock);
- if (retval)
- usb_autopm_put_interface(wacom->intf);
+ usb_autopm_put_interface(wacom->intf);
return retval;
}
static void wacom_close(struct input_dev *dev)
{
struct wacom *wacom = input_get_drvdata(dev);
+ int autopm_error;
+
+ autopm_error = usb_autopm_get_interface(wacom->intf);
mutex_lock(&wacom->lock);
usb_kill_urb(wacom->irq);
@@ -135,7 +137,8 @@ static void wacom_close(struct input_dev *dev)
wacom->intf->needs_remote_wakeup = 0;
mutex_unlock(&wacom->lock);
- usb_autopm_put_interface(wacom->intf);
+ if (!autopm_error)
+ usb_autopm_put_interface(wacom->intf);
}
static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hid_desc,
next prev parent reply other threads:[~2010-10-05 5:41 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-13 12:24 Jiri Slaby
2010-09-13 14:25 ` [linux-pm] " Alan Stern
2010-09-13 14:56 ` Oliver Neukum
2010-09-13 15:17 ` [linux-pm] " Alan Stern
2010-09-13 19:05 ` Oliver Neukum
2010-09-13 20:02 ` Alan Stern
2010-09-13 20:28 ` Dmitry Torokhov
2010-09-14 8:13 ` Oliver Neukum
2010-09-14 14:01 ` Alan Stern
2010-09-14 14:03 ` Oliver Neukum
2010-09-14 15:23 ` Alan Stern
2010-09-14 15:30 ` Oliver Neukum
2010-09-14 16:05 ` Alan Stern
2010-09-13 17:10 ` Dmitry Torokhov
2010-09-13 19:20 ` [linux-pm] " Oliver Neukum
2010-09-14 0:52 ` Dmitry Torokhov
2010-09-14 6:07 ` Oliver Neukum
2010-10-04 16:13 ` Dmitry Torokhov
2010-10-04 18:33 ` Oliver Neukum
2010-10-04 18:38 ` Dmitry Torokhov
2010-10-04 19:24 ` Oliver Neukum
2010-10-05 5:41 ` Dmitry Torokhov [this message]
2010-10-05 5:54 ` 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=20101005054139.GC15355@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=jslaby@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=oliver@neukum.org \
--cc=pingc@wacom.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
Powered by JetHome