From patchwork Fri May 12 10:33:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 13239097 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3362BC77B7F for ; Fri, 12 May 2023 10:34:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D22F91E9; Fri, 12 May 2023 12:33:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D22F91E9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1683887667; bh=MPgrHMLUbG4Vd58W+9vxfi2Cia/7lpvOS4HhrEm6MP0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=e/xmLkYFqLdLgxCL/KcBjterjd25gnvCMy/g0E+fUm4QfAUfzqCH+n+jBsvSdXKam FSKB03z4wAPnJWMLW3h0qIF54jbGe7AdwPMaZC/fqs/AmeRKZMKCpvcB7huu88bzJ5 1F1XcgGDhQrxlwEmJoLLDW+lb+FTET0CnRo0MEV4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 00D78F8057A; Fri, 12 May 2023 12:32:43 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id DAC18F80567; Fri, 12 May 2023 12:32:42 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3F5EBF80534; Fri, 12 May 2023 12:32:39 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 995C5F8052E for ; Fri, 12 May 2023 12:32:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 995C5F8052E Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Up3ZO9su DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683887550; x=1715423550; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MPgrHMLUbG4Vd58W+9vxfi2Cia/7lpvOS4HhrEm6MP0=; b=Up3ZO9suPiK6ArFgWZjZKkkl2ob5L+FHyYkn4T+VdWa6N/UP69qHbTIZ mS1orndcTW6+WPkfXjp+LpbNYBxFYM82fVT9ZTle6DKWCCRnuN4xlRAoc W7UhfuXeTpWH+MQsZt5PyLVbxjYBQHgIIpZNOGMfeKUoYYi0rUDwFh1Rt 6Oe/E3PEZ7tOYHjofAySnUNDT5aiklRYqJchQEBJ2/Kt5hJbsN7HFejsK ujzEAKAlAGmv4ywiFc6J0SdAy4rDVGiiMurycvhCjGm03tfSEMwMtRN8h yUT4SQ/kXLLBSZPt3rGAbEHH1crGBzI1kZ2neh/pU9i74zU6Jq8GMRX0e g==; X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="416390487" X-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208";a="416390487" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2023 03:32:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="730774134" X-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208";a="730774134" Received: from nhanph1x-mobl.amr.corp.intel.com (HELO pujfalus-desk.ger.corp.intel.com) ([10.249.38.84]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2023 03:32:26 -0700 From: Peter Ujfalusi To: lgirdwood@gmail.com, broonie@kernel.org Cc: alsa-devel@alsa-project.org, pierre-louis.bossart@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, daniel.baluta@nxp.com Subject: [PATCH 2/3] ASoC: SOF: pcm: fix pm_runtime imbalance in error handling Date: Fri, 12 May 2023 13:33:14 +0300 Message-Id: <20230512103315.8921-3-peter.ujfalusi@linux.intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230512103315.8921-1-peter.ujfalusi@linux.intel.com> References: <20230512103315.8921-1-peter.ujfalusi@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: VP6LT7337D5QHMIAVYJAAP63KQ2IABYV X-Message-ID-Hash: VP6LT7337D5QHMIAVYJAAP63KQ2IABYV X-MailFrom: peter.ujfalusi@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Pierre-Louis Bossart When an error occurs, we need to make sure the device can pm_runtime suspend instead of keeping it active. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Ranjani Sridharan Signed-off-by: Peter Ujfalusi --- sound/soc/sof/pcm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c index 567db32173a8..d0ab6f390734 100644 --- a/sound/soc/sof/pcm.c +++ b/sound/soc/sof/pcm.c @@ -643,16 +643,17 @@ static int sof_pcm_probe(struct snd_soc_component *component) "%s/%s", plat_data->tplg_filename_prefix, plat_data->tplg_filename); - if (!tplg_filename) - return -ENOMEM; + if (!tplg_filename) { + ret = -ENOMEM; + goto pm_error; + } ret = snd_sof_load_topology(component, tplg_filename); - if (ret < 0) { + if (ret < 0) dev_err(component->dev, "error: failed to load DSP topology %d\n", ret); - return ret; - } +pm_error: pm_runtime_mark_last_busy(component->dev); pm_runtime_put_autosuspend(component->dev);