mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Usyskin <alexander.usyskin@intel.com>
To: Arnd Bergmann <arnd@arndb.de>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
	 Alexander Usyskin <alexander.usyskin@intel.com>,
	 Menachem Adin <menachem.adin@intel.com>
Subject: [PATCH char-misc-next 1/4] mei: make polling wait interruptible
Date: Mon, 31 Aug 2026 14:38:31 +0300	[thread overview]
Message-ID: <20260831-cri_polling-v1-1-d927315e6598@intel.com> (raw)
In-Reply-To: <20260831-cri_polling-v1-0-d927315e6598@intel.com>

Polling thread wait should be interruptible to avoid stuck task.

Reviewed-by: Menachem Adin <menachem.adin@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
---
 drivers/misc/mei/gsc-me.c | 2 +-
 drivers/misc/mei/hw-me.c  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/mei/gsc-me.c b/drivers/misc/mei/gsc-me.c
index 376840b2c354..b38ddb04f2e8 100644
--- a/drivers/misc/mei/gsc-me.c
+++ b/drivers/misc/mei/gsc-me.c
@@ -242,7 +242,7 @@ static int __maybe_unused mei_gsc_pm_runtime_resume(struct device *device)
 
 	if (mei_me_hw_use_polling(hw)) {
 		hw->is_active = true;
-		wake_up(&hw->wait_active);
+		wake_up_interruptible(&hw->wait_active);
 	}
 
 	mutex_unlock(&dev->device_lock);
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
index e7fbc02fb70f..ef7e1289ad7e 100644
--- a/drivers/misc/mei/hw-me.c
+++ b/drivers/misc/mei/hw-me.c
@@ -1441,9 +1441,9 @@ int mei_me_polling_thread(void *_dev)
 		struct mei_me_hw *hw = to_me_hw(dev);
 		u32 hcsr;
 
-		wait_event_timeout(hw->wait_active,
-				   hw->is_active || kthread_should_stop(),
-				   msecs_to_jiffies(MEI_POLLING_TIMEOUT_IDLE));
+		wait_event_interruptible_timeout(hw->wait_active,
+						 hw->is_active || kthread_should_stop(),
+						 msecs_to_jiffies(MEI_POLLING_TIMEOUT_IDLE));
 
 		if (kthread_should_stop())
 			break;

-- 
2.53.0


  reply	other threads:[~2026-08-31 11:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 11:38 [PATCH char-misc-next 0/4] mei: csc: add and enable polling option Alexander Usyskin
2026-08-31 11:38 ` Alexander Usyskin [this message]
2026-08-31 11:38 ` [PATCH char-misc-next 2/4] mei: csc: add option for polling and enable it Alexander Usyskin
2026-08-31 11:38 ` [PATCH char-misc-next 3/4] mei: me: avoid hw access in polling when not active Alexander Usyskin
2026-08-31 11:38 ` [PATCH char-misc-next 4/4] mei: me: reduce active polling timeout to 20 ms Alexander Usyskin

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=20260831-cri_polling-v1-1-d927315e6598@intel.com \
    --to=alexander.usyskin@intel.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=menachem.adin@intel.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

all inboxes | Powered by JetHome®