Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp725481pxb; Tue, 2 Feb 2021 16:48:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwdFw43MST1lTtWQr3G6NjVwR5hAFLCW1y/HsXOgTgI9ERba//L7a8BlpkM1ndGJVZrtGUZ X-Received: by 2002:a17:906:2bc2:: with SMTP id n2mr579116ejg.381.1612313322535; Tue, 02 Feb 2021 16:48:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612313322; cv=none; d=google.com; s=arc-20160816; b=YVTBYw5JXvVXid8gWYlGUwjc0lU98IxcpeWjm3a+ZNODllJ2Eu0Ji1EPqism28/fwU IUn8tDtzTdQfXU6hxhplhJEhYbiTzmt3GoQOlLll7JQrIf4LcSOn7e0v2JVKUb8UsSg/ GqmbdeD71E9yWBQx+s60EMRMnnn3hSeF/58S6ygvf9hS2PsltMXt5V26Iy6rBwJQugEB Z/PoLq2FlrpR03Io8Vkf6Bwfty/Uz6pCv8yTZJz6aXjApW8tUCVJHsEq0pBSXvZa72MF 5Cit4eOgSlRFAJTIppfyrbouz3VNljmhRpE/f7YNA91PMkVPvdykdpbd/kxt4O0YCZ5+ Md/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QMraoUrxzNG7z/i3umBviPRmkDDWbxxES6AzL3mguF8=; b=vU42ZVpp8dgASxhICESDCPAltdGjROoamvtMP2lO3cJo4oipwGwGc38EX5UF6N7fYu WPSi2pSHMhjk9cpkOHO+kPtRb9PgBtW0vbh7L9uq6Y6p8pUuoy5/Wjzx1ye7cJxEFR8l 7FLwBM8/bbovpAnXkZxMB+L3hq02U+uipIBy0x8023WikxBO+tLgpsA33xL/0OG5qyJF BWkZ0aLovffdX6AONSVUrBxKNxqAotUfjmPAbJvicOOE5WZ3NN6scllnOGaAvck/ZjNY PYGmU2GPi7rRqfBBAorfWiqXbmjJp6cQmlwkRZBL+nwdexpBcnRphgVXNYYHHpYRYXKy A5nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WO1r5Kcq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k8si208377edx.303.2021.02.02.16.48.18; Tue, 02 Feb 2021 16:48:42 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=WO1r5Kcq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240154AbhBBTz6 (ORCPT + 99 others); Tue, 2 Feb 2021 14:55:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:40306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232280AbhBBNvN (ORCPT ); Tue, 2 Feb 2021 08:51:13 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 40D3A64FB5; Tue, 2 Feb 2021 13:43:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273391; bh=ufaMzL7TiqZe+u9GZOmZ3fEDwaLksqPXHlTmxfqAIe4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WO1r5KcqHZVA8aLU1RPv/+rHGyhnixlN3y+nFzUJsYiZQYkUmMgNJKrBRMNv9ixPe LeJ2kfAc9InPfggZ1DiNukiUQhBW5RGVvMhq1SwBBltMm5P1XmP3D7Gfuvt7H5V5iB aivg6UKX9jtk4H8mafs2FYkN6+ZgD3DFZZ66LlUI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, V Sujith Kumar Reddy , Srinivasa Rao Mandadapu , Mark Brown , Sasha Levin Subject: [PATCH 5.10 090/142] ASoC: qcom: Fix incorrect volatile registers Date: Tue, 2 Feb 2021 14:37:33 +0100 Message-Id: <20210202133001.418485443@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132957.692094111@linuxfoundation.org> References: <20210202132957.692094111@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivasa Rao Mandadapu [ Upstream commit 315fbe4cef98ee5fb6085bc54c7f25eb06466c70 ] MI2S and DMA control registers are not volatile, so remove these from volatile registers list. Registers reset state check by reading non volatile registers makes no use, so remove error check from cpu and platform trigger callbacks. Initialized map variable two times in lpass platform trigger API, so remove redundant initialization. Fixes commit b1824968221cc ("ASoC: qcom: Fix enabling BCLK and LRCLK in LPAIF invalid state") Signed-off-by: V Sujith Kumar Reddy Signed-off-by: Srinivasa Rao Mandadapu Link: https://lore.kernel.org/r/1608192514-29695-2-git-send-email-srivasam@codeaurora.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/qcom/lpass-cpu.c | 20 ++------------------ sound/soc/qcom/lpass-platform.c | 15 --------------- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index 426235a217ec6..97b920ab50685 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@ -270,18 +270,6 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream, struct lpaif_i2sctl *i2sctl = drvdata->i2sctl; unsigned int id = dai->driver->id; int ret = -EINVAL; - unsigned int val = 0; - - ret = regmap_read(drvdata->lpaif_map, - LPAIF_I2SCTL_REG(drvdata->variant, dai->driver->id), &val); - if (ret) { - dev_err(dai->dev, "error reading from i2sctl reg: %d\n", ret); - return ret; - } - if (val == LPAIF_I2SCTL_RESET_STATE) { - dev_err(dai->dev, "error in i2sctl register state\n"); - return -ENOTRECOVERABLE; - } switch (cmd) { case SNDRV_PCM_TRIGGER_START: @@ -454,20 +442,16 @@ static bool lpass_cpu_regmap_volatile(struct device *dev, unsigned int reg) struct lpass_variant *v = drvdata->variant; int i; - for (i = 0; i < v->i2s_ports; ++i) - if (reg == LPAIF_I2SCTL_REG(v, i)) - return true; for (i = 0; i < v->irq_ports; ++i) if (reg == LPAIF_IRQSTAT_REG(v, i)) return true; for (i = 0; i < v->rdma_channels; ++i) - if (reg == LPAIF_RDMACURR_REG(v, i) || reg == LPAIF_RDMACTL_REG(v, i)) + if (reg == LPAIF_RDMACURR_REG(v, i)) return true; for (i = 0; i < v->wrdma_channels; ++i) - if (reg == LPAIF_WRDMACURR_REG(v, i + v->wrdma_channel_start) || - reg == LPAIF_WRDMACTL_REG(v, i + v->wrdma_channel_start)) + if (reg == LPAIF_WRDMACURR_REG(v, i + v->wrdma_channel_start)) return true; return false; diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c index 80b09dede5f9c..232deee6fde56 100644 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@ -452,7 +452,6 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component, unsigned int reg_irqclr = 0, val_irqclr = 0; unsigned int reg_irqen = 0, val_irqen = 0, val_mask = 0; unsigned int dai_id = cpu_dai->driver->id; - unsigned int dma_ctrl_reg = 0; ch = pcm_data->dma_ch; if (dir == SNDRV_PCM_STREAM_PLAYBACK) { @@ -469,17 +468,7 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component, id = pcm_data->dma_ch - v->wrdma_channel_start; map = drvdata->lpaif_map; } - ret = regmap_read(map, LPAIF_DMACTL_REG(v, ch, dir, dai_id), &dma_ctrl_reg); - if (ret) { - dev_err(soc_runtime->dev, "error reading from rdmactl reg: %d\n", ret); - return ret; - } - if (dma_ctrl_reg == LPAIF_DMACTL_RESET_STATE || - dma_ctrl_reg == LPAIF_DMACTL_RESET_STATE + 1) { - dev_err(soc_runtime->dev, "error in rdmactl register state\n"); - return -ENOTRECOVERABLE; - } switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: @@ -500,7 +489,6 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component, "error writing to rdmactl reg: %d\n", ret); return ret; } - map = drvdata->hdmiif_map; reg_irqclr = LPASS_HDMITX_APP_IRQCLEAR_REG(v); val_irqclr = (LPAIF_IRQ_ALL(ch) | LPAIF_IRQ_HDMI_REQ_ON_PRELOAD(ch) | @@ -519,7 +507,6 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component, break; case MI2S_PRIMARY: case MI2S_SECONDARY: - map = drvdata->lpaif_map; reg_irqclr = LPAIF_IRQCLEAR_REG(v, LPAIF_IRQ_PORT_HOST); val_irqclr = LPAIF_IRQ_ALL(ch); @@ -563,7 +550,6 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component, "error writing to rdmactl reg: %d\n", ret); return ret; } - map = drvdata->hdmiif_map; reg_irqen = LPASS_HDMITX_APP_IRQEN_REG(v); val_mask = (LPAIF_IRQ_ALL(ch) | LPAIF_IRQ_HDMI_REQ_ON_PRELOAD(ch) | @@ -573,7 +559,6 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component, break; case MI2S_PRIMARY: case MI2S_SECONDARY: - map = drvdata->lpaif_map; reg_irqen = LPAIF_IRQEN_REG(v, LPAIF_IRQ_PORT_HOST); val_mask = LPAIF_IRQ_ALL(ch); val_irqen = 0; -- 2.27.0