Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3088925pxu; Mon, 19 Oct 2020 03:46:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzXgVDuN0ld9SJHGCOPs8DywcYw+CM2/QUbd0QMYO1sAuHNJAjbMUM63XK7qqbHLNDXOW6 X-Received: by 2002:a17:906:6dc6:: with SMTP id j6mr17550826ejt.354.1603104391965; Mon, 19 Oct 2020 03:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603104391; cv=none; d=google.com; s=arc-20160816; b=cEwzCdalnd1hJ+kmbMm3jC6efYEevkHkIypODDSQlqKkEjRtHWwtmv3KuRbfLZMQMM cu8lowID+QZlnbrZ0V9FVn35jVKZQTVY9vU/JTdZ/BaAHwDZbpnk6SLSqJUAjt2R6rA/ FfJA82xwjpEdtPbT9d3diddBMWqVNTLEztPYSPMMUx8mAcGSlj/fppv94sWJijrVhXrT E2Wsf68nU99wiSe22UIVo76glkVzisM+o4ry2juLHwYvhqBl2z84Br5+2MoKRsGXR0t4 fA9WOMcX/LL9kj+bGq4O6n0FjiZNNG8Qt3YPBsEtHrgrMQbxT1DMMozXVQQi9FnQX87/ A7gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:dmarc-filter :sender:dkim-signature; bh=CSSINleGh6w/76KIFdxve8Idpf2dccGeHvGZNRQeQPU=; b=QtONL6A1Ps4/A0X8V0RZ0/O9mX9+0Crnso1unOWJQ/gLwjU5yuQ7e1xF/yURywmgzm j6VesP7j0SViOSjZRbFKAHpAH2XFMKY+DslWb2UTOOowzb9cvpiDuDXDuzCNkG+wj9Xp rrM5hYAqETuqu2wnvle+PVw2jKL/x53VtAj3U336Lx0E/FUpZBg5yVS/yWmezsaFCH9L FHg5GiAlzeDHI3VUKlhvXGCdPKt+Cbf2Ccc4FvcNwkJkMkltOwJtSHYLYND/sNdhjgig uneT+MhYkBS5T1dD2UWCqXiKnKRc24bDPvvQDqfpHV3d0fn+qQk4woN73+0YjlLU2wDX 8iDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=pQgKzs0Q; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n17si7155041eje.315.2020.10.19.03.46.09; Mon, 19 Oct 2020 03:46:31 -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=@mg.codeaurora.org header.s=smtp header.b=pQgKzs0Q; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729745AbgJSJGW (ORCPT + 99 others); Mon, 19 Oct 2020 05:06:22 -0400 Received: from z5.mailgun.us ([104.130.96.5]:30702 "EHLO z5.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727235AbgJSJGV (ORCPT ); Mon, 19 Oct 2020 05:06:21 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1603098381; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=CSSINleGh6w/76KIFdxve8Idpf2dccGeHvGZNRQeQPU=; b=pQgKzs0QQkVotxq1jJ44C2bK3ouL1ok0TaQrkk11Kpn1iM+vv6exF1dl0zYDjYP4xLE01VVu ynPOw0d34jJZ1Wwth8ayc/3h9YHDI4lKSn4E4orpE41HYoZg75c9w/f1z1uYVYsimvpjE/AI w+lfAEsJgZA3Wb6sFWp/0t4d1Do= X-Mailgun-Sending-Ip: 104.130.96.5 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 5f8d570c3711fec7b1445056 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 19 Oct 2020 09:06:20 GMT Sender: srivasam=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 00D72C433FE; Mon, 19 Oct 2020 09:06:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from hyd-lnxbld210.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: srivasam) by smtp.codeaurora.org (Postfix) with ESMTPSA id 60CBEC433CB; Mon, 19 Oct 2020 09:06:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 60CBEC433CB Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=srivasam@codeaurora.org From: Srinivasa Rao Mandadapu To: agross@kernel.org, bjorn.andersson@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, plai@codeaurora.org, bgoswami@codeaurora.org, perex@perex.cz, tiwai@suse.com, srinivas.kandagatla@linaro.org, rohitkr@codeaurora.org, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: V Sujith Kumar Reddy , Srinivasa Rao Mandadapu Subject: [PATCH v2] Asoc: qcom: lpass-cpu: Fix clock disable failure Date: Mon, 19 Oct 2020 14:36:03 +0530 Message-Id: <1603098363-9251-1-git-send-email-srivasam@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: V Sujith Kumar Reddy Disable MI2S bit clock from PAUSE/STOP/SUSPEND usecase instead of shutdown time. Acheive this by invoking clk_disable API from cpu daiops trigger instead of cpu daiops shutdown. Change non-atomic API "clk_prepare_enable" to atomic API "clk_enable" in trigger, as trigger is being called from atomic context. Fixes: commit 7e6799d8f87d ("ASoC: qcom: lpass-cpu: Enable MI2S BCLK and LRCLK together") Signed-off-by: V Sujith Kumar Reddy Signed-off-by: Srinivasa Rao Mandadapu --- sound/soc/qcom/lpass-cpu.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index 78de888..6001049 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@ -80,6 +80,12 @@ static int lpass_cpu_daiops_startup(struct snd_pcm_substream *substream, dev_err(dai->dev, "error in enabling mi2s osr clk: %d\n", ret); return ret; } + ret = clk_prepare(drvdata->mi2s_bit_clk[dai->driver->id]); + if (ret) { + dev_err(dai->dev, "error in enabling mi2s bit clk: %d\n", ret); + clk_disable_unprepare(drvdata->mi2s_osr_clk[dai->driver->id]); + return ret; + } return 0; } @@ -88,9 +94,8 @@ static void lpass_cpu_daiops_shutdown(struct snd_pcm_substream *substream, { struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai); - clk_disable_unprepare(drvdata->mi2s_bit_clk[dai->driver->id]); - clk_disable_unprepare(drvdata->mi2s_osr_clk[dai->driver->id]); + clk_unprepare(drvdata->mi2s_bit_clk[dai->driver->id]); } static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream, @@ -303,10 +308,10 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream, dev_err(dai->dev, "error writing to i2sctl reg: %d\n", ret); - ret = clk_prepare_enable(drvdata->mi2s_bit_clk[id]); + ret = clk_enable(drvdata->mi2s_bit_clk[id]); if (ret) { dev_err(dai->dev, "error in enabling mi2s bit clk: %d\n", ret); - clk_disable_unprepare(drvdata->mi2s_osr_clk[id]); + clk_disable(drvdata->mi2s_osr_clk[id]); return ret; } @@ -324,6 +329,7 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream, if (ret) dev_err(dai->dev, "error writing to i2sctl reg: %d\n", ret); + clk_disable(drvdata->mi2s_bit_clk[dai->driver->id]); break; } -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.