Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp613555img; Tue, 26 Feb 2019 05:52:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IYB+ry9J71J8A78Wtz3XPAjnn2EjIVbCVT96AnypAKqQDclJcGJTPdOsZvgEC5nCTh4zd25 X-Received: by 2002:aa7:81c5:: with SMTP id c5mr26649210pfn.217.1551189158219; Tue, 26 Feb 2019 05:52:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551189158; cv=none; d=google.com; s=arc-20160816; b=yxTzyWmdT5j8tDgfRau4JBZjpDlVHU74UZvxDUXlE4+olexfVFWcOlOqV+0Qu2khOA 55vKXNxDSBz4EiDk/RrqsPb549Ci+0dKsSKXwPhAI/inPW8BoaMPxH8FVLlty49YrYnn D1MNPx9BAs3APBj/9q1SY9OVDlbnIB8pg9ipLELzuO0gvvRGEhET8F3p1y+8gr6SaNqt yLXmq/GbVYksBHJCVGojwmMu0qGr5aPhr5Li5/RxQPH9eKjkyvZBxOapeNuLbVpS6wSQ TumMSOAkWIaojqQ9HYHo/To0gapl8h6TXHxh3iJBU9xqH38D2nE0cq6Micrct7MMgP0p 0cYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=xRw7voqAIDTjorXE1Gyzn163uS0BiXfq+p8kUoeS+24=; b=M4SNHS1Xm+iFx9sr0f/egvOblgc4DasYnK/CmFOGQDasIlIQDGe3HIMIvMTJxixcXq n4dnGHCyzWyfgNuqF4Lv0BEQMb67I47EHB7crkpXvOVkW2ard59+jP/XynwO1UqOmhc9 bq5bbilHpVdyp0p80cjeEC7Dx/ICpl+egxBXnr0LTiOhHsNGa52oGi9OP9us0VKiSC86 DP8RjGu37Br7+toks+NssGGrK0yK/HN2pnomBpxBHXy4ohW+egj9uHXruPJI15KTlUss lEtsUskHCecN3CiaNsNUb25fLEeFjlM95COL/Zc8uZupOsow7dFgVM8TqgjOM0cj7Jnr dBMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s9si12800594pgm.133.2019.02.26.05.52.23; Tue, 26 Feb 2019 05:52:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727252AbfBZNvk (ORCPT + 99 others); Tue, 26 Feb 2019 08:51:40 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:39433 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727036AbfBZNvj (ORCPT ); Tue, 26 Feb 2019 08:51:39 -0500 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1QDlEJ2028522; Tue, 26 Feb 2019 14:51:15 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2qtvh3g8p6-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 26 Feb 2019 14:51:15 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D4ADD3A; Tue, 26 Feb 2019 13:51:14 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id AC7945476; Tue, 26 Feb 2019 13:51:14 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 26 Feb 2019 14:51:14 +0100 Received: from localhost (10.201.23.16) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 26 Feb 2019 14:51:14 +0100 From: Olivier Moysan To: , , , , , , , , , , , , Subject: [PATCH 1/7] ASoC: stm32: i2s: fix IRQ clearing Date: Tue, 26 Feb 2019 14:51:04 +0100 Message-ID: <1551189070-15469-2-git-send-email-olivier.moysan@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1551189070-15469-1-git-send-email-olivier.moysan@st.com> References: <1551189070-15469-1-git-send-email-olivier.moysan@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.16] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-26_09:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Because of regmap cache, interrupts may not be cleared as expected. Declare IFCR register as write only and make writings to IFCR register unconditional. Signed-off-by: Olivier Moysan --- sound/soc/stm/stm32_i2s.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index a25919d32187..339cd4715b2e 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -247,8 +247,8 @@ static irqreturn_t stm32_i2s_isr(int irq, void *devid) return IRQ_NONE; } - regmap_update_bits(i2s->regmap, STM32_I2S_IFCR_REG, - I2S_IFCR_MASK, flags); + regmap_write_bits(i2s->regmap, STM32_I2S_IFCR_REG, + I2S_IFCR_MASK, flags); if (flags & I2S_SR_OVR) { dev_dbg(&pdev->dev, "Overrun\n"); @@ -277,7 +277,6 @@ static bool stm32_i2s_readable_reg(struct device *dev, unsigned int reg) case STM32_I2S_CFG2_REG: case STM32_I2S_IER_REG: case STM32_I2S_SR_REG: - case STM32_I2S_IFCR_REG: case STM32_I2S_TXDR_REG: case STM32_I2S_RXDR_REG: case STM32_I2S_CGFR_REG: @@ -559,8 +558,8 @@ static int stm32_i2s_startup(struct snd_pcm_substream *substream, i2s->refcount++; spin_unlock(&i2s->lock_fd); - return regmap_update_bits(i2s->regmap, STM32_I2S_IFCR_REG, - I2S_IFCR_MASK, I2S_IFCR_MASK); + return regmap_write_bits(i2s->regmap, STM32_I2S_IFCR_REG, + I2S_IFCR_MASK, I2S_IFCR_MASK); } static int stm32_i2s_hw_params(struct snd_pcm_substream *substream, @@ -611,8 +610,8 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd, return ret; } - regmap_update_bits(i2s->regmap, STM32_I2S_IFCR_REG, - I2S_IFCR_MASK, I2S_IFCR_MASK); + regmap_write_bits(i2s->regmap, STM32_I2S_IFCR_REG, + I2S_IFCR_MASK, I2S_IFCR_MASK); if (playback_flg) { ier = I2S_IER_UDRIE; -- 2.7.4