Received: by 10.213.65.68 with SMTP id h4csp1581678imn; Thu, 15 Mar 2018 04:02:23 -0700 (PDT) X-Google-Smtp-Source: AG47ELuGDGJWon2Zbya21MoFOVllzrczXUkKj22k3/q/Sab73jRwgsv++gntTtig/Uk/UNY2IEn+ X-Received: by 10.99.114.2 with SMTP id n2mr6535333pgc.274.1521111743888; Thu, 15 Mar 2018 04:02:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521111743; cv=none; d=google.com; s=arc-20160816; b=ToE+oXGVoU6EvA80h1jIAf3PqOLkfa7I/lXubVnA9C/P31T3zV+3SOt/RdoWdL/M0z sXj1etkPTFIl9fFf0mjFypeYovw5jExQklxqIKVsbcm1KRCfa/PbRksCIoLccwl3g+X1 zUmJUQ9Qd+8ETIpH3VelJQTDf0u6KUyPesNRcyLrLyrqcNfhY6KLd5cxmWt9OtzXEt9Y lr9tfslKPIFMB4898yU4b7sJpaI8CGmphy1ooSn9jC4UTt7FLdi4zo9xq0NKxrc6e/K5 eVP22kmhP0puDHhkZg17RY1pIJEmj0hzNOOxwXOv4YSQ86wOeY48B3VjQ89NbjyIRqqJ 35tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Hh8zu492rSs2W4/TVFnl5ZADbRU8hyyikSHlknRLbGk=; b=B7RsLfs67biCIquU7Y0k9zhSZhCk+RhtEbz5VXnOirzRr2VW+GyKuCflBxN8STJpWJ g96iTxu+x8izfCKNSp4yggvo2JwlV8Dre5DNGGOMtehG3DmFFddgFaQAEPyk8XrpUbX9 WuQgnNT5iNw4c6FJgRIXVIFZ11CtReo/ZCrlKhEG89nZ6c+UxLotrX0agwBU764au76a RX+Rny3pyL6xCPv+QBs1pibyGlATCOAWJRo39nORLMzPaaCCtbID21vLmrZrfB9d5AEw qsNbqHft0ulQZBZXtQJnDTYkhrJkvqYD296vxSgDKYcxTsVOHiw6rqxBcZTx/VLdlaN2 5oKw== 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 w2-v6si3672479plq.739.2018.03.15.04.02.08; Thu, 15 Mar 2018 04:02:23 -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 S1752038AbeCOK7r (ORCPT + 99 others); Thu, 15 Mar 2018 06:59:47 -0400 Received: from mga05.intel.com ([192.55.52.43]:8754 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751617AbeCOK7o (ORCPT ); Thu, 15 Mar 2018 06:59:44 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Mar 2018 03:59:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,310,1517904000"; d="scan'208";a="25912920" Received: from subhransu-desktop.iind.intel.com (HELO subhransu-desktop) ([10.223.96.100]) by orsmga006.jf.intel.com with ESMTP; 15 Mar 2018 03:59:40 -0700 Date: Thu, 15 Mar 2018 16:12:44 +0530 From: "Subhransu S. Prusty" To: Anshuman Gupta Cc: "Rafael J. Wysocki" , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Linux Kernel Mailing List , Linux PM Subject: Re: [PATCH] [sound] hdac-codec runtime suspended at PM:Suspend. Message-ID: <20180315104237.GB13659@subhransu-desktop> References: <1520853467-31653-1-git-send-email-anshuman.gupta@intel.com> <5aa8fbe9.4251620a.c3daa.3711SMTPIN_ADDED_BROKEN@mx.google.com> <20180314153714.GA11459@anshuman.gupta@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180314153714.GA11459@anshuman.gupta@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 14, 2018 at 09:07:14PM +0530, Anshuman Gupta wrote: > On Wed, Mar 14, 2018 at 11:53:58AM +0100, Rafael J. Wysocki wrote: > > On Wed, Mar 14, 2018 at 11:38 AM, Anshuman Gupta > > wrote: > > > On Mon, Mar 12, 2018 at 12:26:53PM +0100, Rafael J. Wysocki wrote: > > >> On Mon, Mar 12, 2018 at 12:17 PM, Anshuman Gupta > > >> wrote: > > >> > > > >> > + if (pm_runtime_status_suspended(dev)) > > >> > + return; > > >> > > >> That, again, is somewhat fragile from the concurrency perspective. > > >> > > > > And here you want to avoid the below if the device is still suspended. > Yes, if we do not avoid the code below, complete callback takes about > 3 seconds due to snd_hdac_codec_read timed out because hdac controller > would be in runtime suspend state. > > > > Why is the below code located in the ->complete callback anyway? > > Shouldn't it be there in the ->resume one? > > > Yes even i am also having same doubt, why these power down and power up > sequences are part of prepare and complete callback. > Adding driver author "Subhransu S. Prusty" to provide more inputs on this. This driver needs a late resume as it receives a jack notification from the i915 driver and the skl controller driver resume may not have happened and in turn hda controller may not ready. This ensures a synchronization for jack event during resume from S3. I think this patch defeats the purpose. Regards, Subhransu > > >> > /* Power up afg */ > > >> > snd_hdac_codec_read(hdac, hdac->afg, 0, AC_VERB_SET_POWER_STATE, > > >> > AC_PWRST_D0); > > >> > -- > > >> > 2.7.4 > > -- > Thanks, > Anshuman --