Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp871017pxx; Tue, 27 Oct 2020 02:32:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjS0nri7KXIxnMcy83W9tv6Om1b9eNhbAXgoxxyHZhJeLUfJ9hzichWG8M4r9JqCL20RAM X-Received: by 2002:a17:906:3a97:: with SMTP id y23mr1480578ejd.250.1603791131722; Tue, 27 Oct 2020 02:32:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603791131; cv=none; d=google.com; s=arc-20160816; b=omded0ajawAlZyi0y4a19PLDLA/y/HNSuVaozgPDqCiEEQZc3yFbEu0V0WjMg1NjjW Uzg0vz3LYz15WkwmiUIDu4Zq4ya0kPE9S8j/VaU19QcKFLddES/0UcjSRB+Hc1tyZ4UY MU+pm+zuvimQjhCyMy0ejcnd4MpWnXAXxBbvqCtEwgK1XBrYpu5kI8O/sZZO5vNSdbES HynSHoVraji9cWEu2QFI6a4bIn/xU8bZWkO3l5fKgNgPOpFGYkddyWwtSly+FmUpRA37 AbhQz5bGRZqyPEl0jTwq2S74FUQy5xGZo+IoFRiyk9ST7y2bKDMOCBdu2C49++gwptJB wtPQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Tdi+Aq4QfvRewK11dZt+kA1/ltwzw5OQ2DZyIuWn1Tw=; b=RrKSSjLWllAPycau+7bCU72cELqZdCq5dDjOpsT4m0Y4dOSQWHFpOtDzuzi+RDpo8Y M1BP5HwDsYlVpmqdEgZLxyrT+jkMomVRwx25AdJcvcFHlPsCIERqc2bWpYBTGtyMRTcV Eu1XmcXHexdS/idS8dnATfHdveLN/VjXMnwnrnrbMeSC6Oa8sun4CB70JxjsMXWy2kcg o9EifG1VkV/vO69iLNaJpvUFpQDDxHHwF8thW9YX+3piJQSTY5CMqx1+L88oz5XHppkG Ec1eA+v1ZAU92Dk58IeLsQFVhZD9XJiRL3luxux32FKTSODQ+qnzeOLsk3jaZe/InusD cs5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y2AdJ1WT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lh24si555961ejb.612.2020.10.27.02.31.49; Tue, 27 Oct 2020 02:32:11 -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=Y2AdJ1WT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2409110AbgJZXu0 (ORCPT + 99 others); Mon, 26 Oct 2020 19:50:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:48464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408906AbgJZXt4 (ORCPT ); Mon, 26 Oct 2020 19:49:56 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7F5AC20882; Mon, 26 Oct 2020 23:49:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603756195; bh=9C528tZoQ9h5NstXknIAS/BD9iT7n94wKg9f1AkabPU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y2AdJ1WTaaip6fR5ChBlE+H6jSCUy0L2SX00hAFxr079ipJ8MrnRDuaLpTyRjJzz3 4KHikIW42xMXS+142YFm1nBribQwYeeV6CX+nCWkSVtM8h2y4QsI5lHh+L3VQEqxFg FMKWpWML4TcbNmxO9bzXoKMoKdES5J1PqRjI3m0A= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Rander Wang , Pierre-Louis Bossart , Bard Liao , Guennadi Liakhovetski , Ranjani Sridharan , Mark Brown , Sasha Levin , sound-open-firmware@alsa-project.org, alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.9 039/147] ASoC: SOF: fix a runtime pm issue in SOF when HDMI codec doesn't work Date: Mon, 26 Oct 2020 19:47:17 -0400 Message-Id: <20201026234905.1022767-39-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026234905.1022767-1-sashal@kernel.org> References: <20201026234905.1022767-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rander Wang [ Upstream commit 6c63c954e1c52f1262f986f36d95f557c6f8fa94 ] When hda_codec_probe() doesn't initialize audio component, we disable the codec and keep going. However,the resources are not released. The child_count of SOF device is increased in snd_hdac_ext_bus_device_init but is not decrease in error case, so SOF can't get suspended. snd_hdac_ext_bus_device_exit will be invoked in HDA framework if it gets a error. Now copy this behavior to release resources and decrease SOF device child_count to release SOF device. Signed-off-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Guennadi Liakhovetski Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20200825235040.1586478-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sof/intel/hda-codec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c index 2c5c451fa19d7..c475955c6eeba 100644 --- a/sound/soc/sof/intel/hda-codec.c +++ b/sound/soc/sof/intel/hda-codec.c @@ -151,7 +151,7 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address, if (!hdev->bus->audio_component) { dev_dbg(sdev->dev, "iDisp hw present but no driver\n"); - return -ENOENT; + goto error; } hda_priv->need_display_power = true; } @@ -174,7 +174,7 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address, * other return codes without modification */ if (ret == 0) - ret = -ENOENT; + goto error; } return ret; -- 2.25.1