Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3354343pxf; Mon, 15 Mar 2021 07:50:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyce5g0/KwaWyiaSgsTo1gTn7k7Qs9HQD3CVYy48MW5EXhOFCQWFHLq5npCAOCTH79Q9r5 X-Received: by 2002:a17:906:f896:: with SMTP id lg22mr23442699ejb.124.1615819815811; Mon, 15 Mar 2021 07:50:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615819815; cv=none; d=google.com; s=arc-20160816; b=WgY29JS0as/C/OjVa0nUkF5D0c2FigFtsNLnQoRWKa2EG3EFf+Zw+FyM5wUMAodo/b 1X1kSH8St/nuH8jBoNAnAbEd3sSGFPNF5vMkANU84jJgnnCdByZMxsloCS+adYZzCAOh RzZeYEGEuJkSeLpCfn3Mk3xUh/wtBnKjbDwXXj3LrmJK9mIlt9KJwRG3cFMM5VOsxcym oYcWVnpk5B8GwT3xKUKVPMwTIhJgjcBJX9dR7myr6Qe+3or7BjwTHMGj8RBePQY6I4ym WwxzpUXlo8JB6d/2wcQoO1O033mcMiHzxIxfh2FghfnpGXC+uEsB0tdrEWqwCB8FqWSZ bxmQ== 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=1Z6cdJ1RumizYrANfBPnst7KETpek8wjHqrSttherZQ=; b=PTYC3wbDwHVU/2dwUymIas31VnL5AO43H0k901wfWsV4k1z2whHgfzsrv9IpvSJxYq Pq+n9fcfW26ed+zDZlDzzwYcRi6OoedhCgSds4wUN7D8Kt9+tXo/EzknHS4UY7hcSI9S RYZuLRArDf7PoQ/cRafDyEENJyxeyUScnfVUBPyfDvst+/br0E6JHuHoD32VYHcmwR6i jaGta8uQDqT11rzJ7Hhd4S4xGOrsxogavP3EMY4RcxRdCtRoN4u7/D6uzW1cQwxZE0ep P8K3q5uqDH2ck6HUxD7x1dfpjeSO8rbtluXn7hYLcUtkLRNQwHjMt4QQTdYICQ5mMDyb UVdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="qMr/0ECD"; 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 q5si10594406edg.176.2021.03.15.07.49.51; Mon, 15 Mar 2021 07:50:15 -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=@linuxfoundation.org header.s=korg header.b="qMr/0ECD"; 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 S239983AbhCOOrX (ORCPT + 99 others); Mon, 15 Mar 2021 10:47:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:37476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233104AbhCOOAj (ORCPT ); Mon, 15 Mar 2021 10:00:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4D4B364F25; Mon, 15 Mar 2021 14:00:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816808; bh=GTeUtwzfq/978IFxOmeHTwhMilYuUVY1oe7gQEu1PeU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qMr/0ECDpoT3/pXCX501Ho9dkVT3G2k5FW0AH50l0AgAcZ71rDw+xzi0V0zy07JeI aqrX7wIyFI20USY7WuCo5M8Am/pSVbekWlEz2kOszwvDrxJhYDv2GYI+Zg/uyhbmAI ZLOjiHXrIRo/sY6/lEXiOprzQ2OLVjPeJS8OeVvc= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alain Volmat , Mark Brown , Sasha Levin Subject: [PATCH 5.11 137/306] spi: stm32: make spurious and overrun interrupts visible Date: Mon, 15 Mar 2021 14:53:20 +0100 Message-Id: <20210315135512.278014099@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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: Greg Kroah-Hartman From: Alain Volmat [ Upstream commit c64e7efe46b7de21937ef4b3594d9b1fc74f07df ] We do not expect to receive spurious interrupts so rise a warning if it happens. RX overrun is an error condition that signals a corrupted RX stream both in dma and in irq modes. Report the error and abort the transfer in either cases. Signed-off-by: Alain Volmat Link: https://lore.kernel.org/r/1612551572-495-9-git-send-email-alain.volmat@foss.st.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-stm32.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c index 6eeb39669a86..53c4311cc6ab 100644 --- a/drivers/spi/spi-stm32.c +++ b/drivers/spi/spi-stm32.c @@ -928,8 +928,8 @@ static irqreturn_t stm32h7_spi_irq_thread(int irq, void *dev_id) mask |= STM32H7_SPI_SR_RXP; if (!(sr & mask)) { - dev_dbg(spi->dev, "spurious IT (sr=0x%08x, ier=0x%08x)\n", - sr, ier); + dev_warn(spi->dev, "spurious IT (sr=0x%08x, ier=0x%08x)\n", + sr, ier); spin_unlock_irqrestore(&spi->lock, flags); return IRQ_NONE; } @@ -956,15 +956,8 @@ static irqreturn_t stm32h7_spi_irq_thread(int irq, void *dev_id) } if (sr & STM32H7_SPI_SR_OVR) { - dev_warn(spi->dev, "Overrun: received value discarded\n"); - if (!spi->cur_usedma && (spi->rx_buf && (spi->rx_len > 0))) - stm32h7_spi_read_rxfifo(spi, false); - /* - * If overrun is detected while using DMA, it means that - * something went wrong, so stop the current transfer - */ - if (spi->cur_usedma) - end = true; + dev_err(spi->dev, "Overrun: RX data lost\n"); + end = true; } if (sr & STM32H7_SPI_SR_EOT) { -- 2.30.1