From patchwork Thu Jun 16 22:04:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12884935 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 53A0FC433EF for ; Thu, 16 Jun 2022 22:06:27 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 936BE1B11; Fri, 17 Jun 2022 00:05:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 936BE1B11 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655417185; bh=dtS68tJQspJzkn5mxiwBgJrb7I6MfCT13tBpLas9pUs=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Tb4kqi2UYRF6ciVb4ST/160421MlHiI8DIclFml3HhiK1HmAtOfHlQ/Jvp4j2vuM7 xU1RDoKpYeBMJvXW8jpYJmRBhc0INjrfgXvxd+vLkJvV7jfrad7JfqlSdskSSuLLwa 65kvqQ71hQQ4DLXdmXRQ5SuJWDIjPUwUNL4g0+P8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E4BF0F80529; Fri, 17 Jun 2022 00:04:48 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 068D2F8052E; Fri, 17 Jun 2022 00:04:48 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 26A38F8012A for ; Fri, 17 Jun 2022 00:04:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 26A38F8012A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hrnlO5xa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655417082; x=1686953082; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dtS68tJQspJzkn5mxiwBgJrb7I6MfCT13tBpLas9pUs=; b=hrnlO5xa2vSdrSNm8U1zwFg0mop0OQH1tdKO/kBW0jZZykfefRr3Q7pP SrvMZH6HjeReB9xaqj0/C/3ymeDM78AFfgbbk/vcAOOjra5AKNWWGxNl0 ZJP90z7wled5/wXLh1FYnMnHSCRQ8HfsbS5uyAtG353SXtJgM7a81iK7P pm4cGjU/XL1NrSYTpjV0tYRqSRKvolnyQqNIEGTjn0SYqoOwAYWSxcU4L 3CiDaS/m3Z4RgzNOtuNDEg0hZnDOQAfFWdizD/H/YloaM3cB7fqY5lOi6 NvN2HGsBLf9otOHaWW/+csrX1/5LR5g5M3+LmTdUYt8pOyd/GyIul9vZC w==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="304810898" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="304810898" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:38 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="728084954" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:37 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 01/11] ASoC: Intel: catpt: use pm_runtime_resume_and_get() Date: Thu, 16 Jun 2022 17:04:17 -0500 Message-Id: <20220616220427.136036-2-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> References: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , Kai Vehmanen , tiwai@suse.de, Peter Ujfalusi , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , Liam Girdwood , broonie@kernel.org, Lianjie Zhang , =?utf-8?q?Amadeusz_S=C5=82awi?= =?utf-8?q?=C5=84ski?= , Bard Liao , open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The current code does not check for errors and does not release the reference on errors. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Acked-by: Cezary Rojewski --- sound/soc/intel/catpt/pcm.c | 26 ++++++++++++++++++++------ sound/soc/intel/catpt/sysfs.c | 4 +++- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/sound/soc/intel/catpt/pcm.c b/sound/soc/intel/catpt/pcm.c index a26000cd5cebc..30ca5416c9a3f 100644 --- a/sound/soc/intel/catpt/pcm.c +++ b/sound/soc/intel/catpt/pcm.c @@ -667,7 +667,9 @@ static int catpt_dai_pcm_new(struct snd_soc_pcm_runtime *rtm, if (!memcmp(&cdev->devfmt[devfmt.iface], &devfmt, sizeof(devfmt))) return 0; - pm_runtime_get_sync(cdev->dev); + ret = pm_runtime_resume_and_get(cdev->dev); + if (ret < 0 && ret != -EACCES) + return ret; ret = catpt_ipc_set_device_format(cdev, &devfmt); @@ -853,9 +855,12 @@ static int catpt_mixer_volume_get(struct snd_kcontrol *kcontrol, snd_soc_kcontrol_component(kcontrol); struct catpt_dev *cdev = dev_get_drvdata(component->dev); u32 dspvol; + int ret; int i; - pm_runtime_get_sync(cdev->dev); + ret = pm_runtime_resume_and_get(cdev->dev); + if (ret < 0 && ret != -EACCES) + return ret; for (i = 0; i < CATPT_CHANNELS_MAX; i++) { dspvol = catpt_mixer_volume(cdev, &cdev->mixer, i); @@ -876,7 +881,9 @@ static int catpt_mixer_volume_put(struct snd_kcontrol *kcontrol, struct catpt_dev *cdev = dev_get_drvdata(component->dev); int ret; - pm_runtime_get_sync(cdev->dev); + ret = pm_runtime_resume_and_get(cdev->dev); + if (ret < 0 && ret != -EACCES) + return ret; ret = catpt_set_dspvol(cdev, cdev->mixer.mixer_hw_id, ucontrol->value.integer.value); @@ -897,6 +904,7 @@ static int catpt_stream_volume_get(struct snd_kcontrol *kcontrol, struct catpt_dev *cdev = dev_get_drvdata(component->dev); long *ctlvol = (long *)kcontrol->private_value; u32 dspvol; + int ret; int i; stream = catpt_stream_find(cdev, pin_id); @@ -906,7 +914,9 @@ static int catpt_stream_volume_get(struct snd_kcontrol *kcontrol, return 0; } - pm_runtime_get_sync(cdev->dev); + ret = pm_runtime_resume_and_get(cdev->dev); + if (ret < 0 && ret != -EACCES) + return ret; for (i = 0; i < CATPT_CHANNELS_MAX; i++) { dspvol = catpt_stream_volume(cdev, stream, i); @@ -937,7 +947,9 @@ static int catpt_stream_volume_put(struct snd_kcontrol *kcontrol, return 0; } - pm_runtime_get_sync(cdev->dev); + ret = pm_runtime_resume_and_get(cdev->dev); + if (ret < 0 && ret != -EACCES) + return ret; ret = catpt_set_dspvol(cdev, stream->info.stream_hw_id, ucontrol->value.integer.value); @@ -1013,7 +1025,9 @@ static int catpt_loopback_switch_put(struct snd_kcontrol *kcontrol, return 0; } - pm_runtime_get_sync(cdev->dev); + ret = pm_runtime_resume_and_get(cdev->dev); + if (ret < 0 && ret != -EACCES) + return ret; ret = catpt_ipc_mute_loopback(cdev, stream->info.stream_hw_id, mute); diff --git a/sound/soc/intel/catpt/sysfs.c b/sound/soc/intel/catpt/sysfs.c index 9579e233a15db..1bdbcc04dc712 100644 --- a/sound/soc/intel/catpt/sysfs.c +++ b/sound/soc/intel/catpt/sysfs.c @@ -15,7 +15,9 @@ static ssize_t fw_version_show(struct device *dev, struct catpt_fw_version version; int ret; - pm_runtime_get_sync(cdev->dev); + ret = pm_runtime_resume_and_get(cdev->dev); + if (ret < 0 && ret != -EACCES) + return ret; ret = catpt_ipc_get_fw_version(cdev, &version); From patchwork Thu Jun 16 22:04:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12884934 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 2832CC43334 for ; Thu, 16 Jun 2022 22:06:11 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 494941B07; Fri, 17 Jun 2022 00:05:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 494941B07 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655417169; bh=8yDu8pljCT7lbter28rnZGmrSNHwi6FSg6lKKzg7Hfs=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ZZ5jtrArshis1hSUlCAegVHqiiq7ng3J+iPaRMhEHdeWeX6HZCa4NnG+Xo28Qov+5 RwWSaKk/PZstHoTdcC6NFh4Xmnu6/SdQdn2JIlANEWmsQLRrG1SLph03Ebip8VNH2Y Lwt4bJ7RIK6BPepeV6g0zmlb2NBkuxdlBKNONofo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1E0E6F80310; Fri, 17 Jun 2022 00:04:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C8411F800D3; Fri, 17 Jun 2022 00:04:44 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 CCB38F800D3 for ; Fri, 17 Jun 2022 00:04:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CCB38F800D3 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TMSNs6Rc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655417083; x=1686953083; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8yDu8pljCT7lbter28rnZGmrSNHwi6FSg6lKKzg7Hfs=; b=TMSNs6Rcn5dK+INJU4G8xNmC0IR7pT+D9R+B5gg98xER3DMCifD1tQST GrNuaLprWrAx/acancJgG4pPLwdOHwYuDhpdLxGHHbE+8QORpC1mBmHVs D67plAh2yn6NxGWzd21Qa/FCxD9UJv6K/QO3p5rAsOjhiFACE5nR91gql q1EQcRe4sPHPR3smKNk+gdRpjt1hnqihl4Yqm+72sAOpIRsQ7wUWeCikK sl0BbtTItkARZ7jbxrUllomp/uvtz2b3w84+UH/2n6xkzmXCiG7+qRqdX ygU2SVt1auJE70DjgMnFqO+y9pUFOlkKkXJjDO2Eaj/ar/0Ul4W7ZpY8H g==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="304810909" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="304810909" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:40 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="728084970" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:39 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 02/11] ASoC: Intel: skylake: skl-pcm: use pm_runtime_resume_and_get() Date: Thu, 16 Jun 2022 17:04:18 -0500 Message-Id: <20220616220427.136036-3-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> References: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Gustaw Lewandowski , Cezary Rojewski , Kai Vehmanen , tiwai@suse.de, Peter Ujfalusi , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , Liam Girdwood , broonie@kernel.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Thomas Gleixner , Bard Liao , open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The current code does not check for errors and does not release the reference on errors. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Acked-by: Cezary Rojewski --- sound/soc/intel/skylake/skl-pcm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index 55f310e91b55c..9d72ebd812af9 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -1380,7 +1380,10 @@ static int skl_platform_soc_probe(struct snd_soc_component *component) const struct skl_dsp_ops *ops; int ret; - pm_runtime_get_sync(component->dev); + ret = pm_runtime_resume_and_get(component->dev); + if (ret < 0 && ret != -EACCES) + return ret; + if (bus->ppcap) { skl->component = component; From patchwork Thu Jun 16 22:04:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12884947 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 0A153C43334 for ; Thu, 16 Jun 2022 22:08:57 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 45FF81B09; Fri, 17 Jun 2022 00:08:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 45FF81B09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655417335; bh=EB2/ghYX0CjgXaTRz9Ew0BwzZE1/EU2YhFYqdXMaUyA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sFEEy/FzYB6Nkq2Eez6VocVi3ubt70LARd3t1HYqUrCoMCX/YZDN15xhtvjqJ1gZs q3GOvZ1jHyeu0h5u8vvzSjpuGNGKamdAWV0npRpj70U0CdtTP9uOe4ItA3ItVI8BGi 1zQT0FW2yie9jEdNCPQdUyn1D2dL3OkHNZ66T2Fg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5A448F8057C; Fri, 17 Jun 2022 00:05:04 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 22D7FF80548; Fri, 17 Jun 2022 00:04:56 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 3EE3AF800F0 for ; Fri, 17 Jun 2022 00:04:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3EE3AF800F0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="CWco0UfK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655417084; x=1686953084; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EB2/ghYX0CjgXaTRz9Ew0BwzZE1/EU2YhFYqdXMaUyA=; b=CWco0UfKS1h6ZAjZk26Wp5QsbC4es9EfZzWh8izwhhgnEWurx06jZJhM hvaJ/GjLTvLolPqBdTnhNoajyows+ahXZzixoawcfpIO2scsXsorPRRR1 6pndfn2IEwlZTCPqSQda2wMAu141/NPVwfSBdFFl8xeZFUwJ9oMs1zF4F 0qT8INkILyufUt1YdeIoZnjaiJHvqQRv/JHEbqEiqOWKaixoA15smeOb6 0uB3l85DUulZRQ+gEOxUYIFRPQn4zax8BbPO9jehgZdpiDuRSTrwSJaT1 IjW8OhkaulBRJdXxd23nMOeM5cedLohozWt0/J8B2g8+1DuIqQx3cDPAO Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="304810920" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="304810920" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:41 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="728084980" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:40 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 03/11] ASoC: soc-component: use pm_runtime_resume_and_get() Date: Thu, 16 Jun 2022 17:04:19 -0500 Message-Id: <20220616220427.136036-4-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> References: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , Kai Vehmanen , Liam Girdwood , tiwai@suse.de, open list , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , broonie@kernel.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" simplify the flow. No functionality change, except that on -EACCESS the reference count will be decreased. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan --- sound/soc/soc-component.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index e12f8244242b9..cb92e002c38bc 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -1213,11 +1213,11 @@ int snd_soc_pcm_component_pm_runtime_get(struct snd_soc_pcm_runtime *rtd, int i; for_each_rtd_components(rtd, i, component) { - int ret = pm_runtime_get_sync(component->dev); - if (ret < 0 && ret != -EACCES) { - pm_runtime_put_noidle(component->dev); + int ret = pm_runtime_resume_and_get(component->dev); + + if (ret < 0 && ret != -EACCES) return soc_component_ret(component, ret); - } + /* mark stream if succeeded */ soc_component_mark_push(component, stream, pm); } From patchwork Thu Jun 16 22:04:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12884938 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 EC19CC433EF for ; Thu, 16 Jun 2022 22:07:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 33EA61B2B; Fri, 17 Jun 2022 00:06:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 33EA61B2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655417236; bh=l2zzEpI/NGYD3sJTCPiXWhJ1G6S1YXmPElHQQZQzDlU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kJDFkYpEND2rF73K0nablUfvG7uSvx4V99rUCKMhZXAdD/s6eg77KA3juDha2H5AC fNWx6RAVtpeZxfd9k/+pVUvLUi4e2RdlqXhevkEVkmNmoxcsLARFREq+LxrYMBEvDI 2yZZ0RgLosXKnZdia8eFvhEhvLweT7aouxKXaSnw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D6107F8053A; Fri, 17 Jun 2022 00:04:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 61AF3F80539; Fri, 17 Jun 2022 00:04:53 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 3570EF8051F for ; Fri, 17 Jun 2022 00:04:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3570EF8051F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NoZnjH47" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655417086; x=1686953086; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=l2zzEpI/NGYD3sJTCPiXWhJ1G6S1YXmPElHQQZQzDlU=; b=NoZnjH47tLvQ5jvFYpwuNU7tlPIMvSnt6lMJjelrqADdYn7kOqXoiPhC 0e2PcgUeqkWUJf4l1/1jq5+Kgn57IBnNBxsJH5+57Zctd0KLG1Z2xMYuJ Q33E1diddLum1YrFpjgU9MAIsyZoJzbS4PI7V7XuLv50dzLECn04NzcZs gERYnHZQ5Bo68TT2QgtHEms1kKIKOnMZxtxxkTLB0us8BZHUTntlJT5ms l3/ke9NNj19alFnnpJO3P4DTkOEBiQzNqQbmn+IG9EanmblM9UrdAhhXy nEKXLsVykr9bkzSA+noumM5Ru1wN9szNHED7LxDM5C0tJjWeEfqygsLr/ w==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="304810925" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="304810925" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:43 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="728084991" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:42 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 04/11] ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get() Date: Thu, 16 Jun 2022 17:04:20 -0500 Message-Id: <20220616220427.136036-5-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> References: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , Srinivasa Rao Mandadapu , Kai Vehmanen , Liam Girdwood , tiwai@suse.de, open list , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , broonie@kernel.org, Srinivas Kandagatla , =?utf-8?q?Amadeusz_S?= =?utf-8?q?=C5=82awi=C5=84ski?= , Christophe JAILLET , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" simplify the flow. No functionality change, except that on -EACCESS the reference count will be decreased. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Reviewed-by: Srinivas Kandagatla --- sound/soc/codecs/wcd-mbhc-v2.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c index 31009283e7d4a..98baef594bf31 100644 --- a/sound/soc/codecs/wcd-mbhc-v2.c +++ b/sound/soc/codecs/wcd-mbhc-v2.c @@ -714,12 +714,11 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc) struct snd_soc_component *component = mbhc->component; int ret; - ret = pm_runtime_get_sync(component->dev); + ret = pm_runtime_resume_and_get(component->dev); if (ret < 0 && ret != -EACCES) { dev_err_ratelimited(component->dev, - "pm_runtime_get_sync failed in %s, ret %d\n", + "pm_runtime_resume_and_get failed in %s, ret %d\n", __func__, ret); - pm_runtime_put_noidle(component->dev); return ret; } @@ -1097,12 +1096,11 @@ static void wcd_correct_swch_plug(struct work_struct *work) mbhc = container_of(work, struct wcd_mbhc, correct_plug_swch); component = mbhc->component; - ret = pm_runtime_get_sync(component->dev); + ret = pm_runtime_resume_and_get(component->dev); if (ret < 0 && ret != -EACCES) { dev_err_ratelimited(component->dev, - "pm_runtime_get_sync failed in %s, ret %d\n", + "pm_runtime_resume_and_get failed in %s, ret %d\n", __func__, ret); - pm_runtime_put_noidle(component->dev); return; } micbias_mv = wcd_mbhc_get_micbias(mbhc); From patchwork Thu Jun 16 22:04:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12884940 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 BA078C433EF for ; Thu, 16 Jun 2022 22:07:44 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 00FC11AEE; Fri, 17 Jun 2022 00:06:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 00FC11AEE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655417263; bh=HodmLaeije9RtxZHyILx5m7Ze8bov7hZMNKhqP0nbhw=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CdH7BAWlaCeLCqltdYt6y23UXB+P6T39za0TaDWnBThd0wOo39IMmKGGmmOfGR5Uo 70+uk8E1cLraBx3pHyuiZtgGrncBLrQSz7SSzrZijSQX/VJ5JD1lrAZizwrj5AZRAA 20V/MAFvQgzi0ulgXY+p/3+NBhIOf2CLSbmFlIWg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4BD57F80557; Fri, 17 Jun 2022 00:04:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6ED7BF8053E; Fri, 17 Jun 2022 00:04:54 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 2DEFDF80528 for ; Fri, 17 Jun 2022 00:04:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2DEFDF80528 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Oq0eMQfY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655417087; x=1686953087; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HodmLaeije9RtxZHyILx5m7Ze8bov7hZMNKhqP0nbhw=; b=Oq0eMQfYUl0MrGlFv5+JfRWac+GE3M6WeqxZD+2+CmwdD6CsliLsa/mr EyDxnDa2CesNCxZW24DZ/53LUze8CtSGXvvvCqOaMBV9Bhp+HcTEcd95o oT5QbtxKjd1UybGXD7dBvNeRc5l+SCafLumS70anrSBP7Pl6sVbJL/jLt m7TJbGOB2dWfvIxtv9LfOv5ue7XEdc3oIUm5q9ewnbZ0wGzcrga9wOjqD OAlHrdlRsnzb/V/6vsVs9FIXmOw9lVN3wb5/d7yLwXfII37GcHEN4mfU0 Xc5ZBiX4VMEQmFCWOk3cSVRbaz6H1z7Lfw2CPhITvtG1/T8pkQ4JyEoli Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="304810933" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="304810933" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:44 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="728084999" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:43 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 05/11] ASoC: wsa881x: use pm_runtime_resume_and_get() Date: Thu, 16 Jun 2022 17:04:21 -0500 Message-Id: <20220616220427.136036-6-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> References: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , Banajit Goswami , Kai Vehmanen , Liam Girdwood , tiwai@suse.de, open list , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , broonie@kernel.org, Srinivas Kandagatla , =?utf-8?q?Amadeusz_S?= =?utf-8?q?=C5=82awi=C5=84ski?= , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" simplify the flow. No functionality change, except that on -EACCESS the reference count will be decreased. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Reviewed-by: Srinivas Kandagatla --- sound/soc/codecs/wsa881x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c index f3a56f3ce4871..dc954b85a9881 100644 --- a/sound/soc/codecs/wsa881x.c +++ b/sound/soc/codecs/wsa881x.c @@ -749,11 +749,9 @@ static int wsa881x_put_pa_gain(struct snd_kcontrol *kc, unsigned int mask = (1 << fls(max)) - 1; int val, ret, min_gain, max_gain; - ret = pm_runtime_get_sync(comp->dev); - if (ret < 0 && ret != -EACCES) { - pm_runtime_put_noidle(comp->dev); + ret = pm_runtime_resume_and_get(comp->dev); + if (ret < 0 && ret != -EACCES) return ret; - } max_gain = (max - ucontrol->value.integer.value[0]) & mask; /* From patchwork Thu Jun 16 22:04:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12884936 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 32D5EC433EF for ; Thu, 16 Jun 2022 22:06:37 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3B38B1B1C; Fri, 17 Jun 2022 00:05:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3B38B1B1C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655417195; bh=SBkbKyAS6K43AKtjdQ9J3OQe/d/Pnk74N8+Pm9fPK3w=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Oz2c1idQBakqlcxquoBTbaNQXT07zMeQF/vlS4cAYGkn5Sf+vIQr5OV4KdFCE8yKW EZSgdzmGUKqqKfrQleN+YkopN6uSS3bynbcDuIfgaSRZ5j1QxNt3FkOiXPwjP6fzB/ /bFog5QAug3zUykZkudbJnHwu3rS5Y5NMnVKMxcA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E85A1F80535; Fri, 17 Jun 2022 00:04:52 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5A889F8012A; Fri, 17 Jun 2022 00:04:51 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 4D480F8012A for ; Fri, 17 Jun 2022 00:04:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4D480F8012A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="G+K+8oj6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655417088; x=1686953088; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SBkbKyAS6K43AKtjdQ9J3OQe/d/Pnk74N8+Pm9fPK3w=; b=G+K+8oj69Qr+hQsSijM0G+kCt6BO1DYR/2PfcZEAyaUPQ3nHApfhDZe2 UO2h9PoqDO8GMpKVUuHqdqiYvoamXm29Z6WcmCpG+y3vFg3ntfzd17RG0 AawRueBYkrXlkwT2qHrLh7VZ9puZmcsppM2c7O9rCvvakYr21o7ls6dge vwjJsrwhjWmMDUbo+Bb8ArcjI0a7NQ8aJo9AhnHMQc4yxWPqaS1dDrkAC cc2OoERZyUYvMFldXjQCq9b/1b38t2zYbOXdj/rpmTWVIwyU7AePmVb1z 1eBGQf9225Bd4pRXaIUfALypyQyeBohNpc8t0AhHrTRb7dekqneLeF05b A==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="304810942" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="304810942" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:46 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="728085004" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:45 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 06/11] ASoC: rockchip: i2s_tdm: use pm_runtime_resume_and_get() Date: Thu, 16 Jun 2022 17:04:22 -0500 Message-Id: <20220616220427.136036-7-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> References: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , Heiko Stuebner , Kai Vehmanen , Liam Girdwood , tiwai@suse.de, open list , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , Nicolas Frattaroli , "open list:ROCKCHIP I2S TDM DRIVER" , broonie@kernel.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Bard Liao , "moderated list:ARM/Rockchip SoC support" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" simplify the flow. No functionality change, except that on -EACCESS the reference count will be decreased. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan --- sound/soc/rockchip/rockchip_i2s_tdm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index 48b3ecfa58b46..70542a402477e 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -404,11 +404,9 @@ static int rockchip_i2s_tdm_set_fmt(struct snd_soc_dai *cpu_dai, int ret; bool is_tdm = i2s_tdm->tdm_mode; - ret = pm_runtime_get_sync(cpu_dai->dev); - if (ret < 0 && ret != -EACCES) { - pm_runtime_put_noidle(cpu_dai->dev); + ret = pm_runtime_resume_and_get(cpu_dai->dev); + if (ret < 0 && ret != -EACCES) return ret; - } mask = I2S_CKR_MSS_MASK; switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { From patchwork Thu Jun 16 22:04:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12884937 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 D35D4C43334 for ; Thu, 16 Jun 2022 22:06:52 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0BC9E1B18; Fri, 17 Jun 2022 00:06:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0BC9E1B18 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655417211; bh=mgfbQdH7LkLZ3RlGaDZtyj0rFiPiNajkmYCTJgUFnDY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qOhX6XsGSKNOr7QpGPuntcR+Nqkcp0Eb2pyDK4oSrDvmZztzm0A1Z/7Eg3on+uZmM O5FoJCb5OpYKK3m2V+Y6zvtSNrRi9GXxh6AzkgWAU+ezuyVoddRg/D3Xj6sBR1ExMy zSEbLQHqjmJZPhTj+aGLmEXzExdWoEX4LQQpUthc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 98D61F80536; Fri, 17 Jun 2022 00:04:53 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6A14AF8052F; Fri, 17 Jun 2022 00:04:52 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 E6AE4F8052F for ; Fri, 17 Jun 2022 00:04:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E6AE4F8052F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Zj7Xwq/I" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655417089; x=1686953089; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mgfbQdH7LkLZ3RlGaDZtyj0rFiPiNajkmYCTJgUFnDY=; b=Zj7Xwq/IpCNFK5IrQsF7kAhAwZAHYvKJJw84wdbNkSmONGadZ0AVLBVZ nxzrwR5l9qKSZcch7rktpzievIHwiIFPRQoQjERkLvw11yoNAy6a8xfcm lNIEVP2WhvFHdXzfViYgg8FCDhDQPjpyjG93YYG3Csxklp+b7HmYGftmW 9U9oW8WMaWE0FpnCBhVoOaBwReA9Cy7FgL1/8+LWWx2o9F0lVaIXi0ohh S4HdksqWcdHvpAwERZDE/jbDi1v7qsgRbrdeOcQd+4LpHH2uoWonJ/mHQ jGWX4yE7HdqAZLuYcyNpIsaqW+r2BhVs696qkTfOdoDlUPqfLMoZv2p97 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="304810947" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="304810947" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:47 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="728085009" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:46 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 07/11] ASoC: fsl: fsl_sai: use pm_runtime_resume_and_get() Date: Thu, 16 Jun 2022 17:04:23 -0500 Message-Id: <20220616220427.136036-8-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> References: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , Liam Girdwood , Kai Vehmanen , Xiubo Li , tiwai@suse.de, Shengjiu Wang , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , Nicolin Chen , "open list:FREESCALE SOC SOUND DRIVERS" , broonie@kernel.org, Fabio Estevam , =?utf-8?q?Amadeusz_?= =?utf-8?q?S=C5=82awi=C5=84ski?= , Bard Liao , open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Simplify the flow. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan --- sound/soc/fsl/fsl_sai.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 4f5bd9597c746..b6407d4d3e09d 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -1141,11 +1141,9 @@ static int fsl_sai_probe(struct platform_device *pdev) goto err_pm_disable; } - ret = pm_runtime_get_sync(dev); - if (ret < 0) { - pm_runtime_put_noidle(dev); + ret = pm_runtime_resume_and_get(dev); + if (ret < 0) goto err_pm_get_sync; - } /* Get sai version */ ret = fsl_sai_check_version(dev); From patchwork Thu Jun 16 22:04:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12884939 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 9738CC43334 for ; Thu, 16 Jun 2022 22:07:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CF50C1B2C; Fri, 17 Jun 2022 00:06:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CF50C1B2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655417246; bh=/a6xHCENUfZj9j10Aqoo/Athc0o1eiMxR95TofNjmTI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bkLEx6NFZpZylVpTAK3srllef5KlnCfXPRncZKVdh/XhX5uoeCccvreaXE88efsEP 6VRUVLCRFcjTxIWab0JZjUAyVsG0+4mUDNQJVdWzR7O0v/Y45R3jWDNihNJuKicGbx pNgq5HqpUqLG0iVljNfio81jcEpzCWiXju7tN3EE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 779A2F8054A; Fri, 17 Jun 2022 00:04:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D8BC5F8053C; Fri, 17 Jun 2022 00:04:53 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 D89F3F80534 for ; Fri, 17 Jun 2022 00:04:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D89F3F80534 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="T45zlEav" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655417091; x=1686953091; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/a6xHCENUfZj9j10Aqoo/Athc0o1eiMxR95TofNjmTI=; b=T45zlEavj3VnsgJXRqZSKe7R28JKsM/HPwEqsifx0ngQnctS3Q7cZNAL 5G7N3tOVNgdgnWtetSKyVMWKEzqk6GZEBx4UuGAUO0h64N9u6CQgzC8Xy sxzDrOoC8J1xx42vZk+r/5E7Zy+uU+MnS5gENzZHr/YJLZtxtiSeC1gUH qzZMMzo69RLNPkf3DzjEv+pm/svXTTcSKYAsaAN4V/Ps8LoQqCQu3aP20 jgBy7CAgfJFWPD19VspOGrMPTzI4mIZIxIhAWknhCNMhh9ETzJt7BlUf8 /kiVwoyXoV/5nEZPIn7C2p8d+/SMwi42ikINi1lh2cthU+EZsEywGor9/ Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="304810959" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="304810959" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:49 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="728085020" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:48 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 08/11] ASoC: img: img-i2s-out: use pm_runtime_resume_and_get() Date: Thu, 16 Jun 2022 17:04:24 -0500 Message-Id: <20220616220427.136036-9-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> References: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , Charles Keepax , Kuninori Morimoto , Kai Vehmanen , Liam Girdwood , tiwai@suse.de, open list , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , broonie@kernel.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Simplify the flow. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan --- sound/soc/img/img-i2s-out.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/soc/img/img-i2s-out.c b/sound/soc/img/img-i2s-out.c index 9ec6fc528e2b4..50a522aca419a 100644 --- a/sound/soc/img/img-i2s-out.c +++ b/sound/soc/img/img-i2s-out.c @@ -346,11 +346,9 @@ static int img_i2s_out_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) chan_control_mask = IMG_I2S_OUT_CHAN_CTL_CLKT_MASK; - ret = pm_runtime_get_sync(i2s->dev); - if (ret < 0) { - pm_runtime_put_noidle(i2s->dev); + ret = pm_runtime_resume_and_get(i2s->dev); + if (ret < 0) return ret; - } img_i2s_out_disable(i2s); @@ -482,11 +480,9 @@ static int img_i2s_out_probe(struct platform_device *pdev) if (ret) goto err_pm_disable; } - ret = pm_runtime_get_sync(&pdev->dev); - if (ret < 0) { - pm_runtime_put_noidle(&pdev->dev); + ret = pm_runtime_resume_and_get(&pdev->dev); + if (ret < 0) goto err_suspend; - } reg = IMG_I2S_OUT_CTL_FRM_SIZE_MASK; img_i2s_out_writel(i2s, reg, IMG_I2S_OUT_CTL); From patchwork Thu Jun 16 22:04:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12884946 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 8E1CFC433EF for ; Thu, 16 Jun 2022 22:08:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D151D1B32; Fri, 17 Jun 2022 00:07:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D151D1B32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655417308; bh=16VgkFnDUAPnUMogOVCeb93snA9dZAeCyiMXw7+CLi0=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vZvxpVtfQMSDdXqgIXa6WqTFqiFTzl/mz5pBJcyWY0sScZ8TSE0o1t4+hDoWyBDAU RQNo8Jqm3NmxsJWkh/o9/aegEbo2jvDjqqFIvgAsEroIih4dZAGAtmlyMCUlWd/clP TJqXQ2uaYSweV3yOH10u4EygZaECvIg1wK/uPD9I= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 15518F80568; Fri, 17 Jun 2022 00:05:01 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D6A5AF8055A; Fri, 17 Jun 2022 00:04:58 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 441EEF800F0 for ; Fri, 17 Jun 2022 00:04:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 441EEF800F0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="k+jKpu7A" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655417096; x=1686953096; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=16VgkFnDUAPnUMogOVCeb93snA9dZAeCyiMXw7+CLi0=; b=k+jKpu7AH8T21swmoljZHZM3ziL3C/zPElvZcTI2bBwSlQM17ytle0rv VZ9yBBQO3OPxny1e4LUmZZd0IxDg6m6GFSluB/UHr08PpeZRBX7nBh06t zJH3tnfew8OUJg0qcN3zZMgwV6uZrdHfAyN62DJrHzBv+EZ9K8ZSTKm/G FVDdaCkcITmd34rFDWHA8wcMp8Maon0zqBGi5hC4BeAQGUqCarbqXfEq5 bfH+dQUd55Sc2cXz34HwOflyNyAAYi9Uod5aS50OmAMEAr2D1XKKTBug6 DydS48WTbLB8fkskYahZ9nRd9OzZKPfBKLCK6IiT3J/1Vo6KbkQAsWOti A==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="304810968" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="304810968" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:50 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="728085027" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:49 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 09/11] ASoC: rockchip: pdm: use pm_runtime_resume_and_get() Date: Thu, 16 Jun 2022 17:04:25 -0500 Message-Id: <20220616220427.136036-10-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> References: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , Heiko Stuebner , Kai Vehmanen , Liam Girdwood , tiwai@suse.de, open list , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , "open list:ARM/Rockchip SoC support" , broonie@kernel.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Bard Liao , "moderated list:ARM/Rockchip SoC support" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Simplify the flow. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan --- sound/soc/rockchip/rockchip_pdm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index 64d9891b6434f..066e29b7879d1 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -688,11 +688,9 @@ static int rockchip_pdm_resume(struct device *dev) struct rk_pdm_dev *pdm = dev_get_drvdata(dev); int ret; - ret = pm_runtime_get_sync(dev); - if (ret < 0) { - pm_runtime_put(dev); + ret = pm_runtime_resume_and_get(dev); + if (ret < 0) return ret; - } ret = regcache_sync(pdm->regmap); From patchwork Thu Jun 16 22:04:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12884941 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 70BA6C433EF for ; Thu, 16 Jun 2022 22:08:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 962101B08; Fri, 17 Jun 2022 00:07:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 962101B08 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655417281; bh=96P6uvGDTDGFtAFSYZWWSlbmSlPk/R9jOmty2SHjkCU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UW7p5B2csyqDL8zHcfwVOKPhr52HJa0GKAi5T7zpG9X2vsq5gFv77bdHrOQ4SJkHD ii+RpLqa9lT/JmihZ+kDkLoHL4KuV0mM8MUTnmKVJItAhv5NOOVrRk6F5ttfSmDEf9 gEckz3IsLG+aGvrzRDbUwIYt3kFpmmcsE6b6BwQc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id EAD7AF80558; Fri, 17 Jun 2022 00:04:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BDA07F80543; Fri, 17 Jun 2022 00:04:55 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 B71B7F8053A for ; Fri, 17 Jun 2022 00:04:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B71B7F8053A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="LiSaGJVm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655417093; x=1686953093; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=96P6uvGDTDGFtAFSYZWWSlbmSlPk/R9jOmty2SHjkCU=; b=LiSaGJVmtW6QU10TajeCmDTZKpgIev1zYz8EU7fZ8Uf7TJr9UAm3g86r 6fcG8PTKpWIQ/h9A9fKhkU3R1X0hqclpzT6+hNJx9nuz3OHHGxJGbo1aj oKPXbesGchv4dz0rb+Kd6XKwHv7K6VbqD//S12eBf1Cqm75AtSlLJq4UL ZoeriQRahWTEsrJB7u/HoLE0wZVeCUUnL9sCwFdZvLwFcR/Bm3yxqWQ9V WsgJCX8RfcV1NOHRqbxl6nnNTn1Q5gWK8yqCtd+5Py90+4Bnlu3bxX/C+ ttkRCyT4ozkB0nBuifRbvSeNEvOY5YVYv1ajHhNHuceffmPdrnWFBYxzM g==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="304810975" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="304810975" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:52 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="728085035" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:51 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 10/11] ASoC: tas2552: use pm_runtime_resume_and_get() Date: Thu, 16 Jun 2022 17:04:26 -0500 Message-Id: <20220616220427.136036-11-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> References: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , Stephen Kitt , Kai Vehmanen , Liam Girdwood , tiwai@suse.de, open list , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , broonie@kernel.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The use of pm_runtime_get_sync() is buggy with no use of put_noidle() on error. Use pm_runtime_resume_and_get() instead. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan --- sound/soc/codecs/tas2552.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index c98a9332dcc0e..da744cfae611c 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c @@ -581,7 +581,7 @@ static int tas2552_component_probe(struct snd_soc_component *component) gpiod_set_value(tas2552->enable_gpio, 1); - ret = pm_runtime_get_sync(component->dev); + ret = pm_runtime_resume_and_get(component->dev); if (ret < 0) { dev_err(component->dev, "Enabling device failed: %d\n", ret); From patchwork Thu Jun 16 22:04:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 12884942 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 75AE7C43334 for ; Thu, 16 Jun 2022 22:08:19 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BB1B91B27; Fri, 17 Jun 2022 00:07:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BB1B91B27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655417297; bh=ZERpvGk6JBzFwOx//nRfYnj+hzodvXoYEt05yQtBDw4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kAqHF563u+TiBGGs0stqY2pDTGx5x/V/bsw+Lg9DuC6rncAq5tkuPB11e0inyXhbo u6Bii1u4WL8Mri4aB58F2TqROMGSQfMKaTkAuJeKPVi0Ew4+v/7jBav1uVB1/x0voM SMKtLOHy8W9aerdkbG1HC86+3ITq3ZQwaNCXh//w= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7255EF80563; Fri, 17 Jun 2022 00:05:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6D5A6F8055B; Fri, 17 Jun 2022 00:04:58 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 AC6D5F8053E for ; Fri, 17 Jun 2022 00:04:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AC6D5F8053E Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="nZBUeLyf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655417095; x=1686953095; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZERpvGk6JBzFwOx//nRfYnj+hzodvXoYEt05yQtBDw4=; b=nZBUeLyfNbGJZwOxA4HsTmHeLmzgf2UQkC+0FI5tDsWzw+u/sSJUVzCj RJiQ6Xx03OiYs1ceZwnB0asWZdFq9ZrfuYLAQqqiTDy0OVZpA0GoafmXr DMaTCbtnotv2OfS02mNdmSM/d552T/oGlVOfjA33idArV65lXVF7y6ut4 83i6zmbmQXcKDkDlgJXr4AZZZr3qZGAzgUBeqJbSaxs0RzmCuBHh81KEm Wxk3QXi/6TWwSTA0PSQxhV5V9NsqpwKco1QVbFghyNXKJiIMSRkb4SG97 xSpG7L/b3m5IHbkBc04yK/CFgyAMYWOKvnqwxzC0ozjysDoqEfj6d8ugM A==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="304810981" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="304810981" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:53 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="728085042" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 15:04:52 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 11/11] ASoC: ti: davinci-mcasp: use pm_runtime_resume_and_get() Date: Thu, 16 Jun 2022 17:04:27 -0500 Message-Id: <20220616220427.136036-12-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> References: <20220616220427.136036-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , Kai Vehmanen , Liam Girdwood , tiwai@suse.de, Peter Ujfalusi , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , broonie@kernel.org, =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Bard Liao , open list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The use of pm_runtime_get_sync() is buggy with no use of put_noidle on error. Use pm_runtime_resume_and_get() instead. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Acked-by: Peter Ujfalusi --- sound/soc/ti/davinci-mcasp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c index e2aab4729f3ab..0201000b619f6 100644 --- a/sound/soc/ti/davinci-mcasp.c +++ b/sound/soc/ti/davinci-mcasp.c @@ -2111,8 +2111,7 @@ static int davinci_mcasp_gpio_request(struct gpio_chip *chip, unsigned offset) } /* Do not change the PIN yet */ - - return pm_runtime_get_sync(mcasp->dev); + return pm_runtime_resume_and_get(mcasp->dev); } static void davinci_mcasp_gpio_free(struct gpio_chip *chip, unsigned offset)