From patchwork Wed Dec 21 22:54:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Previn X-Patchwork-Id: 13079257 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 33C8AC4332F for ; Wed, 21 Dec 2022 22:52:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C76C110E135; Wed, 21 Dec 2022 22:51:52 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6B8C510E116 for ; Wed, 21 Dec 2022 22:51:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671663109; x=1703199109; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=rCTr22nuyWJndMmdoi54IWZm2UT7pyV0gYhgvO1306M=; b=kEtYao6FNwuCKoWWqpUjuShEQwSBWekrxGihmkSNGygRXmeaT0cFgVDp K771YL+RaNtMjrwEH/o+p8VEyee8tKn9SIXTP8kuEduwRCrcq/t9/+vBU n2rAOQtn64X3DiXoxDOcibagJFXKOQ0eZmtzPlEOwX0zkjMFYRWrStk2a Hpjib/vzFAOE4QJZtEQ+jRa/LSBTwrUuYeBXPhHvHTOzrgYvcjf66WMEC jDhzsRn8ik9+EpiQ1VpPCPS5R9vpIkqLJNqG9QaXafD6j3EJWWICLtKBj dS/r8aePpxboczUNR7DgNyit+V2j2fZlM+x+seEgQU4w7dO0bW81WSZ2J Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10568"; a="300328209" X-IronPort-AV: E=Sophos;i="5.96,263,1665471600"; d="scan'208";a="300328209" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2022 14:51:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10568"; a="682183969" X-IronPort-AV: E=Sophos;i="5.96,263,1665471600"; d="scan'208";a="682183969" Received: from aalteres-desk.fm.intel.com ([10.80.57.53]) by orsmga008.jf.intel.com with ESMTP; 21 Dec 2022 14:51:48 -0800 From: Alan Previn To: intel-gfx@lists.freedesktop.org Date: Wed, 21 Dec 2022 14:54:33 -0800 Message-Id: <20221221225439.2714575-2-alan.previn.teres.alexis@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221221225439.2714575-1-alan.previn.teres.alexis@intel.com> References: <20221129004832.3735764-1-alan.previn.teres.alexis@intel.com> <20221221225439.2714575-1-alan.previn.teres.alexis@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v3 1/7] mei: mei-me: resume device in prepare X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Alexander Usyskin 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 --- 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(