Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7303288imm; Tue, 28 Aug 2018 09:37:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbjI75to3S8cyVqxGhx+XSvQiNhrsOG71DVDkVVOkjoEqNwd8Nag3lTU/NvYVN5Bn38to/M X-Received: by 2002:a17:902:bd44:: with SMTP id b4-v6mr2315106plx.144.1535474272332; Tue, 28 Aug 2018 09:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535474272; cv=none; d=google.com; s=arc-20160816; b=IC8D6t1zmOljYzfjTbaAKEiZns9kAjjZyeNo7AQigYZr7geFgHUZZF8efAna+yERyv 3UqmOzEMturH9YF/39R5DcrXbEHd9/LgDeEAUSfkY4HwKrfffJ9qCMKCUbtI1pdzXDs2 kzRo/fLtNi/lE0bV051BQCPDeurFia4s7nQBkZFCS0XtFnkhwV7AJ3Ib1dKmkSQRtZeb NkZ4aJLbjdm7r6jlDXFSfVhXEXnUjaaBgoXs9Uu67R7FNvgEvFn8AxQCZB8D2CFmo/5M 2Uw+0UgVaKauEK8nsjH4Be+L4q07T1Vp32CFzkc+ZaIbCfN4bJ+LSoHxc4M+W+X0t7WM GLSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=/Cn5CaVG5lKriG+tL71/9DMkcyxe0m6MMxLrWXgPuR8=; b=yIJ7KNAa2y2PZlCawPsC/RGGPcQkQU1JjkIxcGnST3QLCj+2ITZzO2CbcH0GSnmzSe tN8OtEA5aDEErFeDMv9hkOBMPRmj+LZatgxSBRSw2YmWjn1c9Ty9yHAzNvgp0LQcKZwc KasUU9YZYzJYRkfkyhjpxKvOL0iU3vY508fL0+dSHpgRz0n8C+rYSNuj9+T8xVzb0bJI q2g43REVt64SRhSvq3Pwp674D2haB50r+C0IIKszifxb86rDZRJ1DjpTlZOJaPVApbtg v6w7Y1Zh5rlrmJJJtczXRK3F2rUPOFnWFZIqdiyMUDCR9N8v8l2pFGxrkk8uIYniAlXV lQVQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a27-v6si1459256pfh.164.2018.08.28.09.37.36; Tue, 28 Aug 2018 09:37:52 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727162AbeH1U25 (ORCPT + 99 others); Tue, 28 Aug 2018 16:28:57 -0400 Received: from mga12.intel.com ([192.55.52.136]:24978 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726807AbeH1U25 (ORCPT ); Tue, 28 Aug 2018 16:28:57 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Aug 2018 09:36:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,300,1531810800"; d="scan'208";a="252611609" Received: from anshuma1-pnp-server.iind.intel.com ([10.223.107.119]) by orsmga005.jf.intel.com with ESMTP; 28 Aug 2018 09:36:26 -0700 From: Anshuman Gupta To: puneethx.prabhu@intel.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, rafael@kernel.org Cc: alsa-devel@alsa-project.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, anshuman.gupta@intel.com Subject: Re: [PATCH v2 1/1] hdac-codec runtime suspended at PM:Suspend. Date: Tue, 28 Aug 2018 22:04:15 +0530 Message-Id: <1535474055-11763-1-git-send-email-anshuman.gupta@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534615923-8541-2-git-send-email-anshuman.gupta@intel.com> References: <1534615923-8541-2-git-send-email-anshuman.gupta@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Is this patch not in consideration, there are no review comment for it. this patch fixes an issue with hdac hdmi codec driver. On one of our platform HD audio controller takes arounf 300ms. Below are the snippet of dmesg log. [ 3778.461888] calling 0000:00:0e.0+ @ 3667, parent: pci0000:00, cb: pci_pm_resume [ 3778.775273] call 0000:00:0e.0+ returned 0 after 306016 usecs When HD audio controller is in runtime suspend state, with direct complete, we can improve overall system wide resume latency. On Sat, Aug 18, 2018 at 11:42:03PM +0530, Anshuman Gupta wrote: > 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 > --- > 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 > -- Thanks, Anshuman.