From patchwork Fri May 12 10:33:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 13239096 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 4B73DC77B75 for ; Fri, 12 May 2023 10:34:24 +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 D25D21D7; Fri, 12 May 2023 12:33:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D25D21D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1683887661; bh=Ftyf4sbuDJi3DulyOGGvMkBC2qDnzP+mxx8gm7PFVb0=; 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=cGfmz8JbqLshzxbduflPgT3ucGXNEk7NDvtY8YqIS4FbUU2ap9tXI+syuhFftM2Pf 8HdHdpr7izJjCJa631kaweM9NsfelmyJDgc1veHcy9tOxd3M/AxThlLxDPDqm1VuWI QUjmJ95qFEqapm0w4DM/42ro8siOFVFCczFtoJt8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D8AEEF80551; Fri, 12 May 2023 12:32:41 +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 6C2A5F8053D; Fri, 12 May 2023 12:32:41 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DFDFFF8053B; Fri, 12 May 2023 12:32:37 +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 30BE9F80087 for ; Fri, 12 May 2023 12:32:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 30BE9F80087 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=E5BnOKMY 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=Ftyf4sbuDJi3DulyOGGvMkBC2qDnzP+mxx8gm7PFVb0=; b=E5BnOKMYr3q+UMf4Deqd10DtFa5UfAEKio0ejD4c/B1Z8YiahI7NQGXz VIeBOipWg7EmpcSx3/7QFHDgos0ZVH5PBuSVRqD/jHO9kU1RX8FAhT+Yt OJJNL2JyqIo8P2axNC8LWDiJ0qpKQBpP9OgW4R14K2FZw/NzFSti3mJAx opw0IJAxsfY9cI8FkMLnnmRDvNhWgnDUmpWEvMR14TqglYRvAyfygSNpZ bSxG2iLFTSY8mCjC94gQNG5ijXpiv+eIhL8FG9Q+vF/1XOTkP28pYsVSI 2lLWPw/hbYXi/6l1CR/7FjZw6f+D+QwjhLo0BgBua5qcgng+Exz8yjhVH A==; X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="416390479" X-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208";a="416390479" 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:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="730774129" X-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208";a="730774129" 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:24 -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 1/3] ASoC: SOF: debug: conditionally bump runtime_pm counter on exceptions Date: Fri, 12 May 2023 13:33:13 +0300 Message-Id: <20230512103315.8921-2-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: 37YVK2MGO2TU2LCWQ2KG6JNK5GNI7HZR X-Message-ID-Hash: 37YVK2MGO2TU2LCWQ2KG6JNK5GNI7HZR 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 a firmware IPC error happens during a pm_runtime suspend, we ignore the error and suspend anyways. However, the code unconditionally increases the runtime_pm counter. This results in a confusing configuration where the code will suspend, resume but never suspend again due to the use of pm_runtime_get_noresume(). The intent of the counter increase was to prevent entry in D3, but if that transition to D3 is already started it cannot be stopped. In addition, there's no point in that case in trying to prevent anything, the firmware error is handled and the next resume will re-initialize the firmware completely. This patch changes the logic to prevent suspend when the device is pm_runtime active and has a use_count > 0. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Ranjani Sridharan Signed-off-by: Peter Ujfalusi --- sound/soc/sof/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c index b42b5982cbbc..d547318e0d32 100644 --- a/sound/soc/sof/debug.c +++ b/sound/soc/sof/debug.c @@ -438,8 +438,8 @@ void snd_sof_handle_fw_exception(struct snd_sof_dev *sdev, const char *msg) /* should we prevent DSP entering D3 ? */ if (!sdev->ipc_dump_printed) dev_info(sdev->dev, - "preventing DSP entering D3 state to preserve context\n"); - pm_runtime_get_noresume(sdev->dev); + "Attempting to prevent DSP from entering D3 state to preserve context\n"); + pm_runtime_get_if_in_use(sdev->dev); } /* dump vital information to the logs */ 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); From patchwork Fri May 12 10:33:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 13239107 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 9D666C77B7F for ; Fri, 12 May 2023 10:34:47 +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 13C3F1E4; Fri, 12 May 2023 12:33:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 13C3F1E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1683887685; bh=euyizZbQflA1FN/EBLxWYBuSUiyR+A6oIRnqD0hmsTM=; 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=M4XjxIRKphSDv5Te8WzmK2JkyD7pjnTLa8QTCc5SjYyzaf1cwNIvse0s46wbR3al4 47DEbpy/qtvCtLHlow4HU+6CrmsE+PilyigGuxTHMmgA2tzCflmzTY8THTiCiMrr/V WjUiKUjtSzKOQ4hMKY0PNGNu9H7wLeP3/KRHm+KI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1FC76F8056F; Fri, 12 May 2023 12:32:45 +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 57D5CF8057C; Fri, 12 May 2023 12:32:45 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EB760F8053D; Fri, 12 May 2023 12:32:40 +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 97308F802E8 for ; Fri, 12 May 2023 12:32:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 97308F802E8 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=f5zOpCix DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683887554; x=1715423554; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=euyizZbQflA1FN/EBLxWYBuSUiyR+A6oIRnqD0hmsTM=; b=f5zOpCixWWwad3el6Rn2o1NFTPs5djb5LcbHdbMLk6B9jkgNIOW0mD/f xxrhbiCC8oekI7xMSyI4kEH9ulhYMxEb5avn5AhC7Mg06PdwALTMCsMK6 I2BeMQ1PQ0/qzgwV9Nqx0ExvDUZoj49O4h/mnQ/Oa+xO9kB1TfERKNrG6 fK9feqFL7oY+Rei89+H7rBxnO+b1ekOs3I3SUBb4S11fU5fWe6In8SnOv AkpcmZpiRyuDiYal6lvlor2C1ck8VodcSvM9SrlkidmfL+SbABpKoMRh8 KRqSoTQykiJn+QVOenaTD6Ku3SfmyIPUbyWq1IrXkK6DjZN1XtANGRB4A w==; X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="416390495" X-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208";a="416390495" 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:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="730774141" X-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208";a="730774141" 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:29 -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 3/3] ASoC: SOF: sof-client-probes: fix pm_runtime imbalance in error handling Date: Fri, 12 May 2023 13:33:15 +0300 Message-Id: <20230512103315.8921-4-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: YOKEJFQQEUFFR4HY6TJYLJAQ7IKKMISK X-Message-ID-Hash: YOKEJFQQEUFFR4HY6TJYLJAQ7IKKMISK 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/sof-client-probes.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sound/soc/sof/sof-client-probes.c b/sound/soc/sof/sof-client-probes.c index fff126808bc0..8d9e9d5f40e4 100644 --- a/sound/soc/sof/sof-client-probes.c +++ b/sound/soc/sof/sof-client-probes.c @@ -218,12 +218,7 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to, ret = ipc->points_info(cdev, &desc, &num_desc); if (ret < 0) - goto exit; - - pm_runtime_mark_last_busy(dev); - err = pm_runtime_put_autosuspend(dev); - if (err < 0) - dev_err_ratelimited(dev, "debugfs read failed to idle %d\n", err); + goto pm_error; for (i = 0; i < num_desc; i++) { offset = strlen(buf); @@ -241,6 +236,13 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to, ret = simple_read_from_buffer(to, count, ppos, buf, strlen(buf)); kfree(desc); + +pm_error: + pm_runtime_mark_last_busy(dev); + err = pm_runtime_put_autosuspend(dev); + if (err < 0) + dev_err_ratelimited(dev, "debugfs read failed to idle %d\n", err); + exit: kfree(buf); return ret;