Received: by 10.213.65.68 with SMTP id h4csp780253imn; Tue, 27 Mar 2018 08:38:05 -0700 (PDT) X-Google-Smtp-Source: AG47ELtOL2mn6a3KUWvNAHDamB6KIIdQZG+DnAgVIPqWro6E6krlnQ3D7+B3AKF6+dC9dJj+Yvf7 X-Received: by 10.98.14.215 with SMTP id 84mr32659990pfo.168.1522165085177; Tue, 27 Mar 2018 08:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522165085; cv=none; d=google.com; s=arc-20160816; b=yTin6xJ6x1K2C2RC+i7dXzFmkhNJkFGcTrcJemULVqPB14SrO00ARzDG8r7RZa0I7Z 0KzdRGDKVDHNu5F/IpGWWJJTUUFgTZ6Wiv2PXBYZ/QcWuHoLevmcehrSZND3J37n7pbs oEzdbjgGRxsfC6DNtY+WXm6ZodonXhLOqxpL1eq1dk2e6wWKSthvrno+F53yCCMlZirv YY9OX3YA2EeCLDxassobWevQqUr8HjucopSKOs/INnPBijw/rokgEQytayjRE8iUQf4A 9xSpmVwCN09gNiOEFrZJLl5/digGtupkabYF3HUH2m910faKlKHvQ/XS6Sggux6oTYBg GD5Q== 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=B37ubz6dmdkZQrmjratEQdskW82TJLTCq933RNXFw6Y=; b=RQuwZXQUDFRFT1F0JbpB6JNKWWgJv2J/ImeV62crKER+rnj00vT2orZUfui3ncf9Ag 7pQkPzINfHXhj5NVZRyQyA7yzkR6eCd1CBgnI6pNnwX7ZVOO2gPqNShLzAHLZxHzK6M6 2BJaJXjXj2jXxHXDFtcj1DYrUS+yio7Gyyj83qgieSfmnsQMyd94JtKssH4zcrnobk0s 1q2v0wHvpuadADJFfL9/lKflcKdYNXxLOkNdyRG3uUJ+M/abhNQW6bX3RsSCMlKE+4CD 5zUpW8jSYuvqrky+HF8bUh561sWL+CY+ywvyI8IU4rLVRZPPoVcEAjQlA/ZmyoGpMi6k QSCA== 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 1si1026889pgf.512.2018.03.27.08.37.50; Tue, 27 Mar 2018 08:38:05 -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 S1752593AbeC0Pgk (ORCPT + 99 others); Tue, 27 Mar 2018 11:36:40 -0400 Received: from bmailout2.hostsharing.net ([83.223.90.240]:52151 "EHLO bmailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752343AbeC0Pgi (ORCPT ); Tue, 27 Mar 2018 11:36:38 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id 274722800B1C8; Tue, 27 Mar 2018 17:36:37 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id CB95C4102F; Tue, 27 Mar 2018 17:36:36 +0200 (CEST) Date: Tue, 27 Mar 2018 17:36:36 +0200 From: Lukas Wunner To: Takashi Iwai Cc: " Subhransu S. Prusty " , Anshuman Gupta , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Liam Girdwood , Mark Brown , "Rafael J. Wysocki" , Jaroslav Kysela , Linux Kernel Mailing List , Linux PM Subject: Re: [PATCH] [sound] hdac-codec runtime suspended at PM:Suspend. Message-ID: <20180327153636.GA4588@wunner.de> References: <1520853467-31653-1-git-send-email-anshuman.gupta@intel.com> <5aa8fbe9.4251620a.c3daa.3711SMTPIN_ADDED_BROKEN@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 26, 2018 at 09:30:36AM +0200, Takashi Iwai wrote: > On Mon, 26 Mar 2018 09:03:55 +0200, Subhransu S. Prusty wrote: > > On Thu, Mar 15, 2018 at 09:02:30PM +0530, Anshuman Gupta wrote: > > > On Thu, Mar 15, 2018 at 04:12:44PM +0530, Subhransu S. Prusty wrote: > > > > 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. > > > > > > Let me give you insight of the issue, this driver blocks the direct > > > complete of hda controller PCI 00:1f.3, sometimes it takes 280ms to > > > resume hda controller from S3 and s2idle. So it does not make sense > > > to suspend/resume hda controller when it is already in runtime > > > suspend. > > If it's about the power well issue, it had been fixed in multiple > ways. In i915 side, every relevant component callback is wrapped with > power domain get/put. And, at least HD-audio legacy side, such a > spurious notification is filtered out in the eld notifier: > > static void intel_pin_eld_notify(void *audio_ptr, int port, int pipe) > { > .... > /* skip notification during system suspend (but not in runtime PM); > * the state will be updated at resume > */ > if (snd_power_get_state(codec->card) != SNDRV_CTL_POWER_D0) > return; > /* ditto during suspend/resume process itself */ > if (atomic_read(&(codec)->core.in_pm)) > return; > > snd_hdac_i915_set_bclk(&codec->bus->core); > check_presence_and_report(codec, pin_nid, dev_id); > } > > Last but not least, the jack state is explicitly updated via reading > the ELD at resume callback. > > In that way, we can live with the standard suspend/resume procedure. FWIW, the i915 folks have put on their todo list to migrate the i915/hda_intel interaction to device links: https://git.kernel.org/next/linux-next/c/7b3b61b62a58 Something similar has already been done for HDA controllers integrated into AMD / Nvidia GPUs with: https://git.kernel.org/next/linux-next/c/07f4f97d7b4b With device links, direct_complete will be used naturally, so time is probably best spent working towards this approach. Thanks, Lukas