linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Gupta <anshuman.gupta@intel.com>
To: puneethx.prabhu@intel.com, lgirdwood@gmail.com,
	broonie@kernel.org, perex@perex.cz, rafael@kernel.org
Cc: alsa-devel@alsa-project.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, anshuman.gupta@intel.com
Subject: [PATCH v2 1/1] hdac-codec runtime suspended at PM:Suspend.
Date: Sat, 18 Aug 2018 23:42:03 +0530	[thread overview]
Message-ID: <1534615923-8541-2-git-send-email-anshuman.gupta@intel.com> (raw)
In-Reply-To: <1534615923-8541-1-git-send-email-anshuman.gupta@intel.com>

Keep hdac hdmi codec to be in runtime suspended while entering to
system wide suspend. Currently hdac hdmi codec driver using its
suspend and resume operation in prepare and complete PM callbacks,
and it resumes the hd audio controller (parent of self) from runtime
suspend and blocks the direct complete for hd audio controller.

If hdac-codec is already in runtime suspend state skip its power down
sequence in prepare, power up sequence in complete phase. It enables
direct complete path for hdac-codec and hd audio controller
PCI device.

Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
Changes in v2
- Changed the commit message.
- Using pm_runtime_suspended instead of pm_runtime_status_suspended
  in order to handle any race condition. 
 
sound/soc/codecs/hdac_hdmi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 84f7a7a..e965338 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -1859,6 +1859,9 @@ static int hdmi_codec_prepare(struct device *dev)
 	struct hdac_ext_device *edev = to_hda_ext_device(dev);
 	struct hdac_device *hdev = &edev->hdev;
 
+	if (pm_runtime_suspended(dev))
+		return 1;
+
 	pm_runtime_get_sync(&edev->hdev.dev);
 
 	/*
@@ -1880,6 +1883,9 @@ static void hdmi_codec_complete(struct device *dev)
 	struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(&edev->hdev);
 	struct hdac_device *hdev = &edev->hdev;
 
+	if (pm_runtime_suspended(dev))
+		return;
+
 	/* Power up afg */
 	snd_hdac_codec_read(hdev, hdev->afg, 0,	AC_VERB_SET_POWER_STATE,
 							AC_PWRST_D0);
-- 
2.7.4


  reply	other threads:[~2018-08-18 18:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12 11:17 [PATCH] [sound] hdac-codec runtime suspended at PM:Suspend Anshuman Gupta
2018-03-12 11:26 ` Rafael J. Wysocki
     [not found]   ` <5aa8fbe9.4251620a.c3daa.3711SMTPIN_ADDED_BROKEN@mx.google.com>
2018-03-14 10:53     ` Rafael J. Wysocki
     [not found]       ` <20180314153714.GA11459@anshuman.gupta@intel.com>
2018-03-15 10:42         ` Subhransu S. Prusty
     [not found]           ` <20180315153230.GA16531@anshuman.gupta@intel.com>
2018-03-26  7:03             ` Subhransu S. Prusty
2018-03-26  7:30               ` Takashi Iwai
2018-03-27 15:36                 ` Lukas Wunner
2018-08-18 18:12   ` [PATCH v2 0/1] cover-letter " Anshuman Gupta
2018-08-18 18:12     ` Anshuman Gupta [this message]
2018-08-28 16:34       ` [PATCH v2 1/1] " Anshuman Gupta
2018-08-28 17:05         ` Takashi Iwai

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=1534615923-8541-2-git-send-email-anshuman.gupta@intel.com \
    --to=anshuman.gupta@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=puneethx.prabhu@intel.com \
    --cc=rafael@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).