Received: by 10.213.65.16 with SMTP id m16csp300658imf; Mon, 12 Mar 2018 04:20:43 -0700 (PDT) X-Google-Smtp-Source: AG47ELtWdV9iODDolv3erfrrJqXxxtimRvq9q1P+3t5cN5wGaTAe3+rWkcZYdeBHe3Mqbx9k6bef X-Received: by 10.98.69.196 with SMTP id n65mr7690099pfi.29.1520853642965; Mon, 12 Mar 2018 04:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520853642; cv=none; d=google.com; s=arc-20160816; b=V1wjiF6RMLSRux7+gMVEbGDvfCv8PaBrCPYHz9gNGVHmXptpaY2NY0Xko5bINJnRFU VEMaP2S122i5Lxax82/owZ+4RgEUWt39sQ6uAJnEQMgbF1mM99t9cuSuJn9zezzTetgY vc2g42TMBBbK2tAqCvpJ0iLYrC23lOlvwrx9hPZllaHQ0nIazxlTcbEmcdBaOo0aryXo thGbtAdn5Ua3qBUnEjdHregZ13WYm/NY2ZFOUb12U2liQ5GZ+BRoydWuCwLwRbmqZyci iE027ezNgjS2dnZIc7lKIIiqCcuyAx68k4bBfXQEGp+jgdJr1SP3lmDVqdyIBZqUkBuR d0QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=zWlDHts65aHEQQwG8ryK/8RLB1+JZWG6cwtFcDeIIfc=; b=EpqKiZ+Ha31qnGOckRqs8cwwP1z4geqlHMGT7kMqe29VW5vICGFojpqFinv2afZYzW L+J3S7nsD59bISO2BJh5lkgNkap32BNl+Hduo1eb0v6JDvK32G/a8zn1VYT5ApK2B7Ih S4jMtUP8OVphCSI9MgjQ9c5cs+6Kqe3SiMmi2LGlpfOGClXmtrsD1S8DMOSsqWF/6yT6 A++aqQUglEY8VZ3/d3/ApkNj4Nh6PwuHCP3ASGVA8YbBMpPeG7kl3IQS0nawrnrxf397 w1bp971aQwpQOrZUesNaKnBq8uXGCH1xfDACiuWVZSQpdWB3DLMDUbQMoiXgo/5wR1Th nugg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si4805140pgn.373.2018.03.12.04.20.28; Mon, 12 Mar 2018 04:20:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751678AbeCLLTI (ORCPT + 99 others); Mon, 12 Mar 2018 07:19:08 -0400 Received: from mga09.intel.com ([134.134.136.24]:41259 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750794AbeCLLTH (ORCPT ); Mon, 12 Mar 2018 07:19:07 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Mar 2018 04:19:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,460,1515484800"; d="scan'208";a="23759459" Received: from anshuma1-pnp-server.iind.intel.com ([10.223.107.119]) by fmsmga008.fm.intel.com with ESMTP; 12 Mar 2018 04:19:03 -0700 From: Anshuman Gupta To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, anshuman.gupta@intel.com Subject: [PATCH] [sound] hdac-codec runtime suspended at PM:Suspend. Date: Mon, 12 Mar 2018 16:47:47 +0530 Message-Id: <1520853467-31653-1-git-send-email-anshuman.gupta@intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Keep hdac-codec to be in runtime suspended while entering to suspend. If hdac-codec is already in runtime suspend state skip its power down sequence in prepare, power up sequence in complete phase. Avoid resuming hdac controller PCI device 00:1f.3 from runtime suspend state in case hdac-codec already in runtime-suspend state, this is unnecessary and block the direct complete even for hdac controller PCI device 00:1f.3. This enabled direct complete path for hdac-codec and PCI device 00:1f.3. Signed-off-by: Anshuman Gupta --- sound/soc/codecs/hdac_hdmi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index f3b4f4d..810a8a6 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -1852,6 +1852,8 @@ static int hdmi_codec_prepare(struct device *dev) struct hdac_ext_device *edev = to_hda_ext_device(dev); struct hdac_device *hdac = &edev->hdac; + if (pm_runtime_status_suspended(dev)) + return 1; pm_runtime_get_sync(&edev->hdac.dev); /* @@ -1873,6 +1875,8 @@ static void hdmi_codec_complete(struct device *dev) struct hdac_hdmi_priv *hdmi = edev->private_data; struct hdac_device *hdac = &edev->hdac; + if (pm_runtime_status_suspended(dev)) + return; /* Power up afg */ snd_hdac_codec_read(hdac, hdac->afg, 0, AC_VERB_SET_POWER_STATE, AC_PWRST_D0); -- 2.7.4