From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 From: Daniil Gnusarev To: devel-kernel@lists.altlinux.org Date: Mon, 14 Oct 2024 18:02:06 +0400 Message-ID: <20241014140221.535985-26-gnusarevda@basealt.ru> X-Mailer: git-send-email 2.42.2 In-Reply-To: <20241014140221.535985-1-gnusarevda@basealt.ru> References: <20241014140221.535985-1-gnusarevda@basealt.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [d-kernel] [PATCH 25/39] sound: dwc-i2s: paper over RX overrun warnings on Baikal-M X-BeenThere: devel-kernel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux kernel packages development List-Id: ALT Linux kernel packages development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Oct 2024 14:02:08 -0000 Archived-At: List-Archive: List-Post: From: Alexey Sheplyakov i2s_irq_handler: avoid flooding system with RX overrun warnings Signed-off-by: Alexey Sheplyakov X-feature-Baikal-M X-DONTUPSTREAM --- sound/soc/dwc/dwc-i2s.c | 9 +++++++-- sound/soc/dwc/local.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c index 9ea4be56d3b70..17b5fee698161 100644 --- a/sound/soc/dwc/dwc-i2s.c +++ b/sound/soc/dwc/dwc-i2s.c @@ -102,6 +102,7 @@ static inline void i2s_enable_irqs(struct dw_i2s_dev *dev, u32 stream, static irqreturn_t i2s_irq_handler(int irq, void *dev_id) { + unsigned int rxor_count; struct dw_i2s_dev *dev = dev_id; bool irq_valid = false; u32 isr[4]; @@ -138,9 +139,13 @@ static irqreturn_t i2s_irq_handler(int irq, void *dev_id) irq_valid = true; } - /* Error Handling: TX */ + /* Error Handling: RX */ if (isr[i] & ISR_RXFO) { - dev_err_ratelimited(dev->dev, "RX overrun (ch_id=%d)\n", i); + rxor_count = READ_ONCE(dev->rx_overrun_count); + if (!(rxor_count & 0x3ff)) + dev_err_ratelimited(dev->dev, "RX overrun (ch_id=%d)\n", i); + rxor_count++; + WRITE_ONCE(dev->rx_overrun_count, rxor_count); irq_valid = true; } } diff --git a/sound/soc/dwc/local.h b/sound/soc/dwc/local.h index dce88c9ad5f33..be7a026e5f918 100644 --- a/sound/soc/dwc/local.h +++ b/sound/soc/dwc/local.h @@ -149,6 +149,7 @@ struct dw_i2s_dev { bool *period_elapsed); unsigned int tx_ptr; unsigned int rx_ptr; + unsigned int rx_overrun_count; }; #if IS_ENABLED(CONFIG_SND_DESIGNWARE_PCM) -- 2.42.2