Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp46355pxk; Tue, 15 Sep 2020 17:20:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6gsfz3omn5om8f8wjY3vg5A5TO2laqJul636NHX+mOJ76ENufwER8Hh6dhyg1t/Zw94fQ X-Received: by 2002:a17:906:d78d:: with SMTP id pj13mr23377998ejb.15.1600215653051; Tue, 15 Sep 2020 17:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600215653; cv=none; d=google.com; s=arc-20160816; b=cMQ8IRi5hEpPX10S6VsoSQm4cTYWxCKGz9ytV2zz0sa1unDpjivU8JaUIiBbkWYcVE lpU5bTYNplkJoS5zJPshYBGrjOU/+SWfR1AW/Qyb66ZIi6qJxqBY+YQP4vl80AzsWybY Fv4HtVWVIyGcbBWWUZ4HSg4Yxx50j5P/7aV/LAhFG4LzWHmnz7NvvPRaV2Ye56gZKcZZ 6qc9sHzKgM8WcEBThvqLguI8G3oQa0Z6Co8YuvWYmqSO2SsiVpp3nyDb5xWseUdD3vpR 3Jo7Z1ErfOIWuR41GAzN0E/CyTUipImI1N1J3zkJGp8sgIkTlss2PTIldq2IaZ54pIvs EeIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=f7+hRdl6abOufBULXuxu9SksfQfn4uH9VsQrewswRQs=; b=H1abftIRvXEg5hsZH51AhpDpzjsTp9nT5bGV5psgefDecKRc4JOHW14nzBnZBz/dNn LvtJGUd4padnL8yW7vyKaKjozuE8bUSePr36BL+g3syd8Q18jJsfKUGjK72eKCPVMr3b K0F+87+C88gozvowuKpqWpAfBaYnpJaBMvV1WIh97j8bgSIDhuSswvf1wQ8NLnI2Bww3 kKpDrL50dXXKyFzJ73plNoTv8uXOOK3zeSnt9uM49UPyuStXLHzAEIaK6StmzjBFc8sk Rdi71h6kLjmUk0JEQcAjPzIDjTi4ZDf2jUeNzEdTXIa5iyL/kgHru/J9eOX+lNPxcECD qQng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WNu9BG9t; 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 r10si10786717ejr.168.2020.09.15.17.20.30; Tue, 15 Sep 2020 17:20:53 -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=WNu9BG9t; 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 S1727269AbgIPAUA (ORCPT + 99 others); Tue, 15 Sep 2020 20:20:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:37984 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726877AbgIOOWM (ORCPT ); Tue, 15 Sep 2020 10:22:12 -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 D009B22274; Tue, 15 Sep 2020 14:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179453; bh=gQ/r9nT52mFFpeLsACX5otx/KZQnQjH7GkASuar6/dQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WNu9BG9tR6aH7O2x6Wtv4AMFr4YOzjp1Zyz+1FUtXKv/hCUeqkc8/kpK+vQp3yImr JGfdk6MBGEqS90fHRAbN1a6svQ1/8M8T+8mKbqRb50EwU6s8WVm7IaFNsq+mHt9H0/ GY5M9/i0khaGW4qWNnj8L4UG8z7xEfmG9DdoxhO8= 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.19 36/78] ALSA: hda: fix a runtime pm issue in SOF when integrated GPU is disabled Date: Tue, 15 Sep 2020 16:13:01 +0200 Message-Id: <20200915140635.384245885@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140633.552502750@linuxfoundation.org> References: <20200915140633.552502750@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org 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 dbf02a3a8d2f2..58b53a4bc4d01 100644 --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c @@ -124,6 +124,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