diff mbox series

[v3,1/7] mei: mei-me: resume device in prepare

Message ID 20221221230628.2715916-2-alan.previn.teres.alexis@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/pxp: Add missing cleanup steps for PXP global-teardown | expand

Commit Message

Alan Previn Dec. 21, 2022, 11:06 p.m. UTC
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(+)

Comments

kernel test robot Dec. 22, 2022, 1:57 a.m. UTC | #1
Hi Alan,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on cc44a1e87ea6b788868878295119398966f98a81]

url:    https://github.com/intel-lab-lkp/linux/commits/Alan-Previn/drm-i915-pxp-Add-missing-cleanup-steps-for-PXP-global-teardown/20221222-070545
base:   cc44a1e87ea6b788868878295119398966f98a81
patch link:    https://lore.kernel.org/r/20221221230628.2715916-2-alan.previn.teres.alexis%40intel.com
patch subject: [Intel-gfx] [PATCH v3 1/7] mei: mei-me: resume device in prepare
config: i386-randconfig-a004-20221219
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/75583493fe5716872f1d6e360197fe69b7b3b4b6
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Alan-Previn/drm-i915-pxp-Add-missing-cleanup-steps-for-PXP-global-teardown/20221222-070545
        git checkout 75583493fe5716872f1d6e360197fe69b7b3b4b6
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=i386 olddefconfig
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/misc/mei/pci-me.c:513:20: error: 'mei_me_pci_prepare' undeclared here (not in a function)
     513 |         .prepare = mei_me_pci_prepare,
         |                    ^~~~~~~~~~~~~~~~~~
>> drivers/misc/mei/pci-me.c:514:21: error: 'mei_me_pci_complete' undeclared here (not in a function); did you mean 'mei_cl_complete'?
     514 |         .complete = mei_me_pci_complete,
         |                     ^~~~~~~~~~~~~~~~~~~
         |                     mei_cl_complete


vim +/mei_me_pci_prepare +513 drivers/misc/mei/pci-me.c

   511	
   512	static const struct dev_pm_ops mei_me_pm_ops = {
 > 513		.prepare = mei_me_pci_prepare,
 > 514		.complete = mei_me_pci_complete,
   515		SET_SYSTEM_SLEEP_PM_OPS(mei_me_pci_suspend,
   516					mei_me_pci_resume)
   517		SET_RUNTIME_PM_OPS(
   518			mei_me_pm_runtime_suspend,
   519			mei_me_pm_runtime_resume,
   520			mei_me_pm_runtime_idle)
   521	};
   522
diff mbox series

Patch

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(