Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3282112pxk; Mon, 21 Sep 2020 09:36:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCpprdA28k2kljAV3hxQUgBGr+oKz0n1ZVWej7ujWhW9iluc0UxmZ/GnjL+a3/jwPDSq/0 X-Received: by 2002:a50:e79c:: with SMTP id b28mr472506edn.371.1600706190959; Mon, 21 Sep 2020 09:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600706190; cv=none; d=google.com; s=arc-20160816; b=u+QkTtNpTPkRanrWQQn482REma/y4dJCu/0fH8w1pp7fNx564AG58J/cGnShp8jgIH /4jMs4ZXd82zINqKGCIEIcSd1dkYEvKYTzzIf/u6uCJ6PR8nd1GmHev8GRkipL+p2VjO Yf1yiUmNam5hjQ/budnL4bnIfCnb5kdrG8P3J1rXo535NlvKIIL07C81dA6ghdYxo/6n FW4NZECRpLiFixljOUTdPNZH4Yk5++U2ao0Wnzrm/gz+NNzhqok4zvs//HcT9JlSBYQ5 IFYOpb9qt2fXNzGMjFL292+M6pHaNoazizNKMgOnhQ5hIM4EbATFCbupMf0MuEuvHqjZ ophw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NXv4CWRKKAALytTsuGpfx7BrPEK8dJGCq8b+kPNA/2E=; b=o0stDjLe4Y8TX45UtPrh23IphtOCYVVAJfmPPZP8NLBZJjEjkW1foQEZB73tMfJfi8 dpL0by32GxRfx1yIKquohIya1JmIWz1IO0acET1mqJU6f3j/iEd7MCfAWhk8BaPD+7Xr c18i2cMCzr2oTHeVXltGd6VuBDYvn6aMB12IJVhygLqrs8tD/jJyQZEglcsrCRGpYOYi GtjkH6A7ghBoHq/N/D7eGOCYdP6FcdX4hGoalCTipCoRD1nyCnxV4cnvyJ+I+VhdT4Wy b2jn2vmkBF1+n+dVas7lHCk+vBEpsUfuBBSEnqAzQT3ES6gKjirtSRT+/sWcqanlmStX iLjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sq3gL1Jw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jp7si8462127ejb.742.2020.09.21.09.36.05; Mon, 21 Sep 2020 09:36:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sq3gL1Jw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728560AbgIUQdJ (ORCPT + 99 others); Mon, 21 Sep 2020 12:33:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:58914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728558AbgIUQdB (ORCPT ); Mon, 21 Sep 2020 12:33:01 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 82F19239A1; Mon, 21 Sep 2020 16:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600705976; bh=M0PtdWcYxeBelsDbpwDJEsRn7qwzPiUFqHU6byxnTwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sq3gL1JwXX69fvz7TvLR5DYq8foIYJylHMgu/Okcm4Wj9l0z/iAJa1XA1UhLLqvao EuR9CbpQNtqexF7nzu05WF/E8w25TG3HKCLhAQ7Y2a2wNwtnZmZmZ8gUF08EymYXN6 hP05c6mmM6FCy1bo2nBqZG+EE3u/ql0VG5K+nLmg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rander Wang , Ranjani Sridharan , Pierre-Louis Bossart , Bard Liao , Guennadi Liakhovetski , Kai Vehmanen , Takashi Iwai , Sasha Levin Subject: [PATCH 4.4 08/46] ALSA: hda: fix a runtime pm issue in SOF when integrated GPU is disabled Date: Mon, 21 Sep 2020 18:27:24 +0200 Message-Id: <20200921162033.750486651@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162033.346434578@linuxfoundation.org> References: <20200921162033.346434578@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rander Wang [ Upstream commit 13774d81f38538c5fa2924bdcdfa509155480fa6 ] In snd_hdac_device_init pm_runtime_set_active is called to increase child_count in parent device. But when it is failed to build connection with GPU for one case that integrated graphic gpu is disabled, snd_hdac_ext_bus_device_exit will be invoked to clean up a HD-audio extended codec base device. At this time the child_count of parent is not decreased, which makes parent device can't get suspended. This patch calls pm_runtime_set_suspended to decrease child_count in parent device in snd_hdac_device_exit to match with snd_hdac_device_init. pm_runtime_set_suspended can make sure that it will not decrease child_count if the device is already suspended. Signed-off-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Guennadi Liakhovetski Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200902154218.1440441-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/hda/hdac_device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c index e361024eabb63..020ec48f39048 100644 --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c @@ -123,6 +123,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_device_init); void snd_hdac_device_exit(struct hdac_device *codec) { pm_runtime_put_noidle(&codec->dev); + /* keep balance of runtime PM child_count in parent device */ + pm_runtime_set_suspended(&codec->dev); snd_hdac_bus_remove_device(codec->bus, codec); kfree(codec->vendor_name); kfree(codec->chip_name); -- 2.25.1