Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3515926pxf; Mon, 15 Mar 2021 11:15:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9CXwQ/nKyGStp0DG/yIzyDY37MWRbjnhoQJ7Zb8os0FDoh2NLBGkVt3bicSkE9IVKlUmg X-Received: by 2002:a17:906:400b:: with SMTP id v11mr25008878ejj.194.1615832158609; Mon, 15 Mar 2021 11:15:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832158; cv=none; d=google.com; s=arc-20160816; b=wv5NGHzqF/GtPRbMbxctFx3XS0Jvu+3GfPH0rSdfjliFZXyvZy2vg8RFCUA/3NVleQ mCfyqNTPZuYo8pfQmSEEDRbHj6QlFKB6RwQZYO4seyoQ3FUXRISHSI8L8QHwB8lrVZfF gJPA34dYTkHOg1OiTg3s7KNJgTNmKy5B5KChWkPIV+dEm+RixY68jVemRTmKHFid+hWc AJSPunqLeOk065bmLgnasZiophEMMLotsbrAZBhjcZkmlN59AeulDGYGfe4JwFbrJGex r3tOuHLJMnFCbXjuH2M6l+ledVauBFnWrru7suSBT8H4ONBnTaSVX9tYJ6wd6I/5EUHJ ajVw== 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=itmDn4QpoZEElIX+a3FMicDNOlx77azVG1XViifGkHM=; b=mzFQ5oTBMvFrn/RFA3opxMMWbMn8ZArS7gj03PBSpONuQG+t6APHiQShJ2qTsh9ekR IWKfevTlLA+6JRHNvnm52HE1Zb4V7rVZLyV/pBSvb8zcsDe/0+a0ZyUnFYKaG9URgEHk kNRtF7tZUu8Fw5TZwCuwo8S5/ON9akscc5JCE5hEnp5ytMXyZrOsPmfTo/14I8lGFF4g nXxi69D5a/v5hCoIcMHmTW0iQPiw1ldEwRLQ4KuBM2+FDqyfBcHR5Yqy25hmJ3mh96yS 4HnpoH/u14bXGtk3JSroRj4o44w76Wh+tVMv6dO/z5nZJYkMtmL9YpCbBdQojRJQdY3Q Eiwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=unchqKlU; 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 d21si11188223ejm.343.2021.03.15.11.15.36; Mon, 15 Mar 2021 11:15:58 -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=unchqKlU; 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 S230407AbhCOOPE (ORCPT + 99 others); Mon, 15 Mar 2021 10:15:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:35610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232525AbhCON7B (ORCPT ); Mon, 15 Mar 2021 09:59:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A8C0764EE5; Mon, 15 Mar 2021 13:58:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816724; bh=ghFUyYXA2Y/ZwjMH7eat5HszhmeuGBjHZ3X+Z2fUBd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=unchqKlUHGJ7URtMs62dL0tqDPjELMiJk6GXYKeCDKLFDG/axKmwuKm6E4FSNGd08 fCNJtd1mS5ENFUIWq/kyROWE+oYOCaSo5JbRgYyM8+pMuM3A58GJdET73egPMY7XGo okYmWn4H/U8qcJwZs20qjUDT1bGT8wErOwhpV0Yk= 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.4 069/168] spi: stm32: make spurious and overrun interrupts visible Date: Mon, 15 Mar 2021 14:55:01 +0100 Message-Id: <20210315135552.638932637@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@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 8622cf9d3f64..9e7a6de3c43d 100644 --- a/drivers/spi/spi-stm32.c +++ b/drivers/spi/spi-stm32.c @@ -924,8 +924,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; } @@ -952,15 +952,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