Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7334568imm; Tue, 28 Aug 2018 10:09:20 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbfa1+0P1aUgsvemBWORpj61G74MojjnopEFh4hMsdg2E3WbnWbXUf6Drxf2XUr6iveDJdF X-Received: by 2002:a63:b00f:: with SMTP id h15-v6mr2411463pgf.442.1535476160212; Tue, 28 Aug 2018 10:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535476160; cv=none; d=google.com; s=arc-20160816; b=NFVi+wutDsOKDaZUYyazPefa2ubwjBlYLWR77J+6o2PyEfWwxY0v4t07OwPs/zlE00 z0xW6tqVOhyKo7tPt6+U9kVzYB85r2oN7IlnDOeFSHudfMYMCQSqaMAq5UjwjPt+hbSE NNDmDtR+v674yH6cm8NA23Ou31yXqzHxX54hcrChthgGhJhvkFFur4ywoqzNlsd/TLYR t86B9iymbzjA4A+CWpzcwzx7cO8Qkv1IfEShCd3zffMmyZGclVdulCDWjdqdPMdjonuq BNqwW7V7NsJrU6vW1XMyoYIarmJqNJRAZfYaug1uwcz45y3GQnGFiYiiJzIt5cBPTFri SDrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date :arc-authentication-results; bh=KAwSaKeKN8ota7caYvH2XO3zO1D4wFd8oqtXL+xXbMs=; b=kAS5S7X8n5LaKml372KbWsJprn371xTkp4EBfS3KN2d+yQVKwV5xIUAtJWACZuVNFZ LjH8NaRtQjo1Udntejz1WSmIbl2VTxE97/xy8xqcw2aGawMD0DHU4/wzUnZCqnT+Ba3M Rv4/7YDQKKYLnUQBKu3zR68DQiu0jZMQKt0XtRmGuhBZLYKcOlqZjko3b1xUQ52A1ffm KZioCqsD/PcSYz3q9vgJyktWVsjTmfWqZ+fYLEtF8Qif0SxbUYHzihYAnZ90P1DtgJYO rC2o/XpKkEUtDFEk1eVOy6i9ms2nB0q7GojcQPOULZ0dDBQG9urfKVTbwd5VqJZXjlcL gdYQ== 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 x24-v6si1518000pgh.295.2018.08.28.10.08.41; Tue, 28 Aug 2018 10:09:20 -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 S1727523AbeH1U61 (ORCPT + 99 others); Tue, 28 Aug 2018 16:58:27 -0400 Received: from mx2.suse.de ([195.135.220.15]:44430 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726833AbeH1U61 (ORCPT ); Tue, 28 Aug 2018 16:58:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 52EB0AEEC; Tue, 28 Aug 2018 17:05:51 +0000 (UTC) Date: Tue, 28 Aug 2018 19:05:51 +0200 Message-ID: From: Takashi Iwai To: "Anshuman Gupta" Cc: , , , , , , , Subject: Re: [PATCH v2 1/1] hdac-codec runtime suspended at PM:Suspend. In-Reply-To: <1535474055-11763-1-git-send-email-anshuman.gupta@intel.com> References: <1534615923-8541-2-git-send-email-anshuman.gupta@intel.com> <1535474055-11763-1-git-send-email-anshuman.gupta@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/26 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Aug 2018 18:34:15 +0200, Anshuman Gupta wrote: > > 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. Actually, *this* should have been mentioned in the changelog, and the subject would be better phrased to reflect it. After all, you're trying to reduce / optimize the runtime PM latency. thanks, Takashi > 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. > >