From: Oliver Neukum <oneukum@suse.com>
To: Martin Kepplinger <martink@posteo.de>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
USB list <linux-usb@vger.kernel.org>
Subject: regarding runtime PM in pegasus_notetaker
Date: Wed, 25 Mar 2026 15:00:32 +0100 [thread overview]
Message-ID: <59b2c482-06b4-48e6-addc-ba585b580006@suse.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 388 bytes --]
Hi,
the driver takes a PM reference in open(), yet it marks
the device busy in pegasus_irq(). These approaches contradict
each other. There is no point in marking a device as busy
while its PM count is elevated. It will not be runtime suspended
anyway.
Did you mean for the device to be subjected to runtime PM
while in use? If so, could you test the attached patch?
Regards
Oliver
[-- Attachment #2: 0001-hid-pegasus_notetaker-runtime-PM-while-open.patch --]
[-- Type: text/x-patch, Size: 1988 bytes --]
From 62e8faf509e2ad464b39b6bf7bc324d6d93c50d5 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum@suse.com>
Date: Wed, 25 Mar 2026 14:58:32 +0100
Subject: [PATCH] hid: pegasus_notetaker: runtime PM while open
This implements runtime PM while the device is open
by dropping the reference in open and using remote
wakeup.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
drivers/input/tablet/pegasus_notetaker.c | 25 +++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/drivers/input/tablet/pegasus_notetaker.c b/drivers/input/tablet/pegasus_notetaker.c
index 4ce20befc657..3a8493ed5e44 100644
--- a/drivers/input/tablet/pegasus_notetaker.c
+++ b/drivers/input/tablet/pegasus_notetaker.c
@@ -211,10 +211,21 @@ static void pegasus_init(struct work_struct *work)
struct pegasus *pegasus = container_of(work, struct pegasus, init);
int error;
+ error = usb_autopm_get_interface(pegasus->intf);
+ if (error)
+ goto bail;
error = pegasus_set_mode(pegasus, PEN_MODE_XY, NOTETAKER_LED_MOUSE);
if (error)
- dev_err(&pegasus->usbdev->dev, "pegasus_set_mode error: %d\n",
- error);
+ goto bail_pm;
+
+ usb_autopm_put_interface(pegasus->intf);
+ return;
+
+bail_pm:
+ usb_autopm_put_interface(pegasus->intf);
+bail:
+ dev_err(&pegasus->usbdev->dev, "pegasus_set_mode error: %d\n",
+ error);
}
static int __pegasus_open(struct pegasus *pegasus)
@@ -249,12 +260,10 @@ static int pegasus_open(struct input_dev *dev)
return error;
error = __pegasus_open(pegasus);
- if (error) {
- usb_autopm_put_interface(pegasus->intf);
- return error;
- }
+ pegasus->intf->needs_remote_wakeup = 1;
+ usb_autopm_put_interface(pegasus->intf);
- return 0;
+ return error;
}
static void pegasus_close(struct input_dev *dev)
@@ -267,8 +276,6 @@ static void pegasus_close(struct input_dev *dev)
pegasus->is_open = false;
}
-
- usb_autopm_put_interface(pegasus->intf);
}
static int pegasus_probe(struct usb_interface *intf,
--
2.53.0
reply other threads:[~2026-03-25 14:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=59b2c482-06b4-48e6-addc-ba585b580006@suse.com \
--to=oneukum@suse.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=martink@posteo.de \
/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