From mboxrd@z Thu Jan 1 00:00:00 1970 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 12FDFC7EE29 for ; Thu, 25 May 2023 18:36:37 +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 B411A83A; Thu, 25 May 2023 20:35:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B411A83A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1685039794; bh=9ifQ7dhO9nVieclCl710GA67oMuMIARBDij0rO5gZc4=; 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=hwo1bjUrGGhAahFg2F9tOQX8nsada1pqMCtafOyBSc1uITk8tRAQEmxcOyNA5Mmw2 xssu3iic9DH9G7Hb/WpyoMcdXFueg4PLl7DwLfaHinUALVt4KfLIzil7d7ta4utF7T tQ0ohlDQr8aTwk7T4Vh9j3/TMnt7w4GNbywr5Fb8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 68E2AF805CB; Thu, 25 May 2023 20:34:25 +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 E47C8F805C5; Thu, 25 May 2023 20:34:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C71D5F805C1; Thu, 25 May 2023 20:34:15 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3E35AF80249; Thu, 25 May 2023 20:34:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3E35AF80249 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=LKrl2y1t Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CAA75648AA; Thu, 25 May 2023 18:34:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA55CC4339C; Thu, 25 May 2023 18:34:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685039645; bh=9ifQ7dhO9nVieclCl710GA67oMuMIARBDij0rO5gZc4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LKrl2y1t7KzCTWDWmj2DMB9asedpM4rZxAhqSAGfQicPJWe7uQ+2VutlCxunljbR7 4g+K6D2GzSZPJ6iHv6B8NqeVXbVEjb+BJL2q15S+oISFlp/BFCvAoKiDocsHJ+pD5Y bPKhz2NecLTm/BzIK/aO4ZXgUW73s5THdKhtToOW7hf56+5SRnS419Cp6if//gJ/px hWZ7AcRcYsyC9lAoLEYWNCu/59szM1cIR4ULw8H9K9xQFf3RcV3crCGp0wOshebNi+ LOI2uYRfXLSo20AH4VWlNrKv2lcU3ju/N67+ngtGjQyHXo3qzzF1e3wSLArXeSeIFM U0ooEflCnlY6Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pierre-Louis Bossart , Sasha Levin , lgirdwood@gmail.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, daniel.baluta@nxp.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, sound-open-firmware@alsa-project.org, alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 6.3 33/67] ASoC: SOF: sof-client-probes: fix pm_runtime imbalance in error handling Date: Thu, 25 May 2023 14:31:10 -0400 Message-Id: <20230525183144.1717540-33-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230525183144.1717540-1-sashal@kernel.org> References: <20230525183144.1717540-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Message-ID-Hash: DZBL2DV4H2RCWI3VLIEUIUQ4DLFS64WR X-Message-ID-Hash: DZBL2DV4H2RCWI3VLIEUIUQ4DLFS64WR X-MailFrom: sashal@kernel.org 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 [ Upstream commit bc424273c74c1565c459c8f2a6ed95caee368d0a ] 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 --- 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 fff126808bc04..8d9e9d5f40e45 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; -- 2.39.2