From patchwork Fri Nov 15 22:33:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 179534 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp13126529ilf; Fri, 15 Nov 2019 14:34:17 -0800 (PST) X-Google-Smtp-Source: APXvYqy+fPKIRT7zb7vNPjcVyoKjxLPLQgHSsDoeYLYVHJjuIeFKz3860CeSlIHNn+Ss+PwyDV7k X-Received: by 2002:a17:906:c41:: with SMTP id t1mr4402851ejf.282.1573857257560; Fri, 15 Nov 2019 14:34:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573857257; cv=none; d=google.com; s=arc-20160816; b=Xkp2thiGtHsMc4g7ZmiQhVHC3sM3A0nvjcQ/Z2l/IYtMzyjl3iu8ThKBPJq8YfkX0C CYXxMxYDAxTuDxk2SnbyJCdJzSm5rBQl0Y8cT0WFhg7+mDvPlRkyWSI4TBz448r88WB2 f35+GpMyCwzoxSA05ofhJHGco7pf5P0jI998e7lduJ4b61w7LfEV8xn9xO0IKh3L4qZS uSWbec+Bgo3P48/+v8Lvz/OzQXa8qmAHYFyFHhsvZWoxy/Kldts/VWpmgAjUkRdLQkpx XywemtxCL5YWfwfRpOxZmIQqizFUSePLu4aJ++HBrgpxRTzZrKknDMAl81mx6lcMINW+ PzVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=K6EZMz28tei+A3Fv/t1+BOEFoAHrbvWtLCwNz1ul25g=; b=LlPfBtZvFBUyvO8Vl3gPYFMH8kfp7s2uL60TTbeNiDREpTcs7118QKPGDxB29Bv3Gm EQAKWexxkfWq68/rBXYlE4YGwtGoL5cD+/3xEY+QBFWYOwGeoif/NSPnX9rZhfjZ9pga Xk7/Tq36oj/OOsY9pOwv0y9NJM+dHD+yMxweEhMpFIbKudXT6kCPmmRqy1bwx0IA6o4W lxP24lp1uEFSFX8Li65DMZtUzVJi6FdpwG2vKZZpr6GgG+wjhp//2Q9/k45fa4E5sF7l pEpPnLO/aupOiBDj2ZM8tUdux9ECXVeLPJrFamWAC5R2sFXB4mT2r8razpKt1Zsgi6uH PvDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K+EFQOwv; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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. [209.132.180.67]) by mx.google.com with ESMTP id gq14si6458339ejb.190.2019.11.15.14.34.17; Fri, 15 Nov 2019 14:34:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K+EFQOwv; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1727420AbfKOWeP (ORCPT + 15 others); Fri, 15 Nov 2019 17:34:15 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40386 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727406AbfKOWeO (ORCPT ); Fri, 15 Nov 2019 17:34:14 -0500 Received: by mail-pf1-f196.google.com with SMTP id r4so7330267pfl.7 for ; Fri, 15 Nov 2019 14:34:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=K6EZMz28tei+A3Fv/t1+BOEFoAHrbvWtLCwNz1ul25g=; b=K+EFQOwvuF5Ea8JFTFkHmNjxaOLY3h/RqojbKXq9i/HQlhlztvlHNcN78FEt9TXC6o gSUamhTirK9XvaurkQpqxAGX9vGVxHMdQiaEQWdY4pU3qEj4HzoubKBVTea2SyfoaOJK BPCTKzxPUfEL6BWFoVxIfRmwHA4tUCwpDJ2n4SjysulPcZeL7QSTvBqV9U6sa5+BoRxN ByG3lYAWlD6MNyS7zATy/bbUyGMR05gPdPv2GsQzG7CJCDbPYpfG/4kCkSVGAS68F2K6 gbCm66gHeb8hSy4KH2drGGvctHA7MuK4Ym++2SmPIVbJl9j9cJZ4kkEEVL0bmc7yyJmw rdUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=K6EZMz28tei+A3Fv/t1+BOEFoAHrbvWtLCwNz1ul25g=; b=MScaxir+eN1s66nMwFPntzVyhDjFWdkfiPi5da3iPPZp1f0BToF6pBa8EeoI00eg8F KeuqAgFyaJCMSlV6hWcTpP/o3jUvVNgAzYDVNIezyWyqYOM2tLPMnWhumJxR1BReVoYB i0F0zZFFjFvyyn0Vpay6u28xCtuezOAAavYIFLuhmjypmEbamYV07WwLtfcjmsR+R60R OvjNzrs89BahR/pSTXa7sJAZPTtVCgkec7slM/nAymbBJh6g7BUvgm2uOpS8fRVMgoDA i3hWy207SQpDw7ZRYzFWIHK+DIK5fJWLYlMcIKxzlwFMCxIOkX5CR7iND+iJQQ3rWypj PM+Q== X-Gm-Message-State: APjAAAX6su7YzWaCq0VOhZ1UFJLw4dSLP5W70En30+1dh0A0i7fpbYIN D2s3Y8HDGE6J1EAV2cqX3NIeAtjbmpM= X-Received: by 2002:a62:447:: with SMTP id 68mr20154481pfe.70.1573857252596; Fri, 15 Nov 2019 14:34:12 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m15sm11699724pfh.19.2019.11.15.14.34.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2019 14:34:11 -0800 (PST) From: Mathieu Poirier To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [stable 4.19+][PATCH 17/20] ASoC: stm32: i2s: fix IRQ clearing Date: Fri, 15 Nov 2019 15:33:53 -0700 Message-Id: <20191115223356.27675-17-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191115223356.27675-1-mathieu.poirier@linaro.org> References: <20191115223356.27675-1-mathieu.poirier@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Olivier Moysan commit 8ba3c5215d69c09f5c39783ff3b78347769822ad upstream 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 Signed-off-by: Mark Brown Cc: stable # 4.19+ Signed-off-by: Mathieu Poirier --- sound/soc/stm/stm32_i2s.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index 004d83091505..aa2b1196171a 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -246,8 +246,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"); @@ -276,7 +276,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: @@ -547,8 +546,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, @@ -603,8 +602,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;