All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Previn <alan.previn.teres.alexis@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH v3 1/7] mei: mei-me: resume device in prepare
Date: Wed, 21 Dec 2022 14:54:33 -0800	[thread overview]
Message-ID: <20221221225439.2714575-2-alan.previn.teres.alexis@intel.com> (raw)
In-Reply-To: <20221221225439.2714575-1-alan.previn.teres.alexis@intel.com>

From: Alexander Usyskin <alexander.usyskin@intel.com>

Async runtime resume is not possible while system is suspending.
The power management subsystem resumes device only in the
suspend phase, not in the prepare phase.
Force resume device in prepare to allow drivers on mei bus
to communicate in prepare callbacks.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
---
 drivers/misc/mei/pci-me.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
index 704cd0caa172..713c1acb931f 100644
--- a/drivers/misc/mei/pci-me.c
+++ b/drivers/misc/mei/pci-me.c
@@ -340,6 +340,12 @@ static void mei_me_remove(struct pci_dev *pdev)
 }
 
 #ifdef CONFIG_PM_SLEEP
+static int mei_me_pci_prepare(struct device *device)
+{
+	pm_runtime_resume(device);
+	return 0;
+}
+
 static int mei_me_pci_suspend(struct device *device)
 {
 	struct pci_dev *pdev = to_pci_dev(device);
@@ -396,6 +402,11 @@ static int mei_me_pci_resume(struct device *device)
 
 	return 0;
 }
+
+static void mei_me_pci_complete(struct device *device)
+{
+	pm_runtime_suspend(device);
+}
 #endif /* CONFIG_PM_SLEEP */
 
 #ifdef CONFIG_PM
@@ -499,6 +510,8 @@ static inline void mei_me_unset_pm_domain(struct mei_device *dev)
 }
 
 static const struct dev_pm_ops mei_me_pm_ops = {
+	.prepare = mei_me_pci_prepare,
+	.complete = mei_me_pci_complete,
 	SET_SYSTEM_SLEEP_PM_OPS(mei_me_pci_suspend,
 				mei_me_pci_resume)
 	SET_RUNTIME_PM_OPS(
-- 
2.34.1


  reply	other threads:[~2022-12-21 22:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29  0:48 [Intel-gfx] [PATCH v2 0/3] drm/i915/pxp: Add missing cleanup steps for PXP global-teardown Alan Previn
2022-11-29  0:48 ` [Intel-gfx] [PATCH v2 1/3] drm/i915/pxp: Invalidate all PXP fw sessions during teardown Alan Previn
2022-12-01  1:47   ` Juston Li
2022-12-01 18:07     ` Teres Alexis, Alan Previn
2022-11-29  0:48 ` [Intel-gfx] [PATCH v2 2/3] drm/i915/pxp: Trigger the global teardown for before suspending Alan Previn
2022-12-06  0:29   ` Juston Li
2022-11-29  0:48 ` [Intel-gfx] [PATCH v2 3/3] drm/i915/pxp: Pxp hw init should be in resume_complete Alan Previn
2022-11-29  1:48 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/pxp: Add missing cleanup steps for PXP global-teardown Patchwork
2022-11-29  2:12 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-11-29  8:36 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-12-21 22:54 ` [Intel-gfx] [PATCH v3 0/7] " Alan Previn
2022-12-21 22:54   ` Alan Previn [this message]
2022-12-21 22:54   ` [Intel-gfx] [PATCH v3 2/7] drm/i915/pxp: add device link between i915 and mei_pxp Alan Previn
2022-12-21 22:54   ` [Intel-gfx] [PATCH v3 3/7] mei: clean pending read with vtag on bus Alan Previn
2022-12-21 22:54   ` [Intel-gfx] [PATCH v3 4/7] drm/i915/pxp: Invalidate all PXP fw sessions during teardown Alan Previn
2022-12-21 22:54   ` [Intel-gfx] [PATCH v3 5/7] drm/i915/pxp: Trigger the global teardown for before suspending Alan Previn
2022-12-21 22:54   ` [Intel-gfx] [PATCH v3 6/7] drm/i915/pxp: Pxp hw init should be in resume_complete Alan Previn
2022-12-21 22:54   ` [Intel-gfx] [PATCH v3 7/7] HAX: force enable PXP Kconfig Alan Previn
2022-12-21 23:02   ` [Intel-gfx] [PATCH v3 0/7] drm/i915/pxp: Add missing cleanup steps for PXP global-teardown Teres Alexis, Alan Previn
2022-12-21 23:06 Alan Previn
2022-12-21 23:06 ` [Intel-gfx] [PATCH v3 1/7] mei: mei-me: resume device in prepare Alan Previn
2022-12-22  1:57   ` kernel test robot
2022-12-22  1:57     ` kernel test robot

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=20221221225439.2714575-2-alan.previn.teres.alexis@intel.com \
    --to=alan.previn.teres.alexis@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.