Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4989391pxj; Wed, 9 Jun 2021 06:50:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvIF0k7en2JTZUtzN06wm2B7b9OE2A0HBKBaOi+LlZija8qCintgGs/3Ep/MDclMd0xGtz X-Received: by 2002:a05:6402:10c9:: with SMTP id p9mr30948394edu.370.1623246623105; Wed, 09 Jun 2021 06:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623246623; cv=none; d=google.com; s=arc-20160816; b=TFFGFKQrCercf/PTM6qH+EWWJPfjYJDopExn7MgAcjXArG/bFmYNYoaoEQEDsV8DJ1 QPvykDlSnX31iZwzenUNkyAeoaAdSus1xGUvFMpNwz/pz4MDTzFE2wpDxC1gM+QLWUMi goG3+zevHNYxcGOnQahu5SeMFXDD+0pGQE8i4PsNFaxW/Olw1b3k2WsPq+uknPS0fIVr 8z8onQqcBMVzJCPy2gX98rUT0GmwBSx8mjxjfk6DXx81Mk9PQFV8R7SrXZBfaHj26C7M rO6VAAnKxnjdiEgKLnvCBrTtSuDQEZvdM/uxpdR4liv0dJZqtaClIUyKPr1N91aDhH7X l2MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=G2EK7hq7OuAZ8vK1o6rU1XG0kTRV9Kntzv3xlza+n0A=; b=dZC4EgXEz7QUkcpi7l6UKiDBZEpwYVieWXD68sB5c+n/b/q0zrJtUdHPylkLF8edyD WxAzoQJLRmoh0Gqth8PwnLVKEw+A//Y5fVRBtBL7c8MAtvwWCp86uaMH4Wx+jLg2w7LF znMTaIiderwlsR658+LXqPcQBE8ePMbI/T3M68b7LTp56bUdI/vHcXNyokeAEf8S/ct6 ZYemBwjj8DcPtamwHNAIUKWEfsBLvkuXO9fW1L0pt3jPymn2inPtWMBganIk4Ji9VrFM UqiaH1WeFMydpzFOENsIvTfvwlfvAismAZRQySDNIPeE2YpUMrpxlJPf7RVdePELcxKS 4+dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QfFOHuv4; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r16si2547064ejs.266.2021.06.09.06.49.59; Wed, 09 Jun 2021 06:50:23 -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=@linaro.org header.s=google header.b=QfFOHuv4; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237509AbhFIIDv (ORCPT + 99 others); Wed, 9 Jun 2021 04:03:51 -0400 Received: from mail-wr1-f42.google.com ([209.85.221.42]:45951 "EHLO mail-wr1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237434AbhFIIDU (ORCPT ); Wed, 9 Jun 2021 04:03:20 -0400 Received: by mail-wr1-f42.google.com with SMTP id z8so24341292wrp.12 for ; Wed, 09 Jun 2021 01:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=G2EK7hq7OuAZ8vK1o6rU1XG0kTRV9Kntzv3xlza+n0A=; b=QfFOHuv40ZGJkmXc7S7b/QxXuUItWu1HFIvmg/6K2HiGj6AdgllxXtIKShavGF4sF7 A+YU1CCxsSxAO2qnWKJ1wAaajH7OkrQEjRcshVZESRYj3zFVS08MWDZI4+FHfXOrpAqR AbWSwSWt7iPxkW4lVLzCKLC/VAytorCFe+A13wcDv1UNel4sxRb2kADMMXTLwt7CApMC N9O+Bqmyx1FDzxa1+LX7aevzSKZn9mYrvW8Kk15N5N4vibIHU38CZF29zv2YImIppEKp 8jXFmJJmyLqbENa/3dzXA3XsxefpI2yBOaiuh1Qw3xwlaFyTNFmFJPsSxVOPo8SPMD7u U5Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=G2EK7hq7OuAZ8vK1o6rU1XG0kTRV9Kntzv3xlza+n0A=; b=MMAGbmy76T3cxhlXQCvhXIcAOTgNdNYxO++SS/q8R+ge+bVNRWfdWRf5B5zR7p5lP5 L3twEZe3CjBIGVAKM++Z5F9R7xVMYmg4h1r1wwMmrgRiSXq3mV2yFSKAhEaDR4ftXvjY QKWz4udWxEDsYLmtZ8WsPotgP1VkFrenVbT5Sqh8PcUxgV6iBJ0teOQzlOQx9u58K9X7 Pz/L4xnhZDZgWPxvhpKLVInW07izBTR264Hy2nWpnYyi0HM3Td+LM+FFMxhUkvo/XHY2 7QY4MIuIVNrnuinDDHJxQeIVroxXEki1IwTxIUrhzko7/YrqTlMz+X3JIvi4eccAxZCH UyPQ== X-Gm-Message-State: AOAM533dpChIa80iGivlT4JnGUldSsd0WOATI9UP4FnaG2pc2hvNoB2X E/5fqUWKPs7WwYtJ4DbEEmS/nQ== X-Received: by 2002:a5d:4bc9:: with SMTP id l9mr27231725wrt.97.1623225625800; Wed, 09 Jun 2021 01:00:25 -0700 (PDT) Received: from [192.168.86.34] (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.googlemail.com with ESMTPSA id l13sm15145069wrz.34.2021.06.09.01.00.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jun 2021 01:00:25 -0700 (PDT) Subject: Re: [PATCH v3] ASoC: qcom: Fix for DMA interrupt clear reg overwriting To: Srinivasa Rao Mandadapu , 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, rohitkr@codeaurora.org, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, swboyd@chromium.org, judyhsiao@chromium.org References: <20210609072310.26099-1-srivasam@codeaurora.org> From: Srinivas Kandagatla Message-ID: Date: Wed, 9 Jun 2021 09:00:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20210609072310.26099-1-srivasam@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/06/2021 08:23, Srinivasa Rao Mandadapu wrote: > The DMA interrupt clear register overwritten during > simultaneous playback and capture in lpass platform > interrupt handler. It's causing playback or capture stuck > in similtaneous plaback on speaker and capture on dmic test. > Update appropriate reg fields of corresponding channel instead > of entire register write. > > Fixes: commit c5c8635a04711 ("ASoC: qcom: Add LPASS platform driver") > > Signed-off-by: Srinivasa Rao Mandadapu LGTM Reviewed-by: Srinivas Kandagatla --srini > --- > Changes since v2: > -- Removed redundant variables. > Changes since v1: > -- Subject lines changed. > sound/soc/qcom/lpass-platform.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c > index 0df9481ea4c6..f9df76d37858 100644 > --- a/sound/soc/qcom/lpass-platform.c > +++ b/sound/soc/qcom/lpass-platform.c > @@ -526,7 +526,7 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component, > return -EINVAL; > } > > - ret = regmap_write(map, reg_irqclr, val_irqclr); > + ret = regmap_update_bits(map, reg_irqclr, val_irqclr, val_irqclr); > if (ret) { > dev_err(soc_runtime->dev, "error writing to irqclear reg: %d\n", ret); > return ret; > @@ -650,10 +650,11 @@ static irqreturn_t lpass_dma_interrupt_handler( > struct lpass_variant *v = drvdata->variant; > irqreturn_t ret = IRQ_NONE; > int rv; > - unsigned int reg = 0, val = 0; > + unsigned int reg, val, mask; > struct regmap *map; > unsigned int dai_id = cpu_dai->driver->id; > > + mask = LPAIF_IRQ_ALL(chan); > switch (dai_id) { > case LPASS_DP_RX: > map = drvdata->hdmiif_map; > @@ -676,8 +677,7 @@ static irqreturn_t lpass_dma_interrupt_handler( > return -EINVAL; > } > if (interrupts & LPAIF_IRQ_PER(chan)) { > - > - rv = regmap_write(map, reg, LPAIF_IRQ_PER(chan) | val); > + rv = regmap_update_bits(map, reg, mask, (LPAIF_IRQ_PER(chan) | val)); > if (rv) { > dev_err(soc_runtime->dev, > "error writing to irqclear reg: %d\n", rv); > @@ -688,7 +688,7 @@ static irqreturn_t lpass_dma_interrupt_handler( > } > > if (interrupts & LPAIF_IRQ_XRUN(chan)) { > - rv = regmap_write(map, reg, LPAIF_IRQ_XRUN(chan) | val); > + rv = regmap_update_bits(map, reg, mask, (LPAIF_IRQ_XRUN(chan) | val)); > if (rv) { > dev_err(soc_runtime->dev, > "error writing to irqclear reg: %d\n", rv); > @@ -700,7 +700,7 @@ static irqreturn_t lpass_dma_interrupt_handler( > } > > if (interrupts & LPAIF_IRQ_ERR(chan)) { > - rv = regmap_write(map, reg, LPAIF_IRQ_ERR(chan) | val); > + rv = regmap_update_bits(map, reg, mask, (LPAIF_IRQ_ERR(chan) | val)); > if (rv) { > dev_err(soc_runtime->dev, > "error writing to irqclear reg: %d\n", rv); >