Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3524485pxf; Mon, 15 Mar 2021 11:28:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNeXZN9bjMafyqoSHNJUg1VGOuuzaXJ8mgjcDSKEK/aSpfVvxR3APrO/VZ8TKoOFW7Kv4P X-Received: by 2002:a17:907:9858:: with SMTP id jj24mr24849402ejc.212.1615832925155; Mon, 15 Mar 2021 11:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832925; cv=none; d=google.com; s=arc-20160816; b=Jp8zJ9LpsENR2giD0js8mOUQBQvxBWO6hvj4s8ZqNhdFqVPg+eE5HAdE4M+18LW4Qk v8+BPSoF0lBvS8/2AK8c7uiLBuHGP65KHEN87oBRzhFTBpr/dYIm6UmVP4FgWFFdP1D5 mNhHXdIilJAp/NGfI+UwQk/OxE6QmYd7etU4S82N9Rs8vy6/46tIxv1XbqOucATcWC3N IRzUIQLqTw2z7P3yI2uze1jKvPq5qo2aeGSb87EyO0OD6iMSapiGCcTmnSCLXa07Mhix fpuXccvG5QQHr10TFOYXM5vmbD6IYX28r6IMI0iqiTMnS+ANx7TJjayW5LrEZoLMqUrA NLTg== 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=WKFG8cg5TlYVdVx+MSKeMtKcgwdsM53pqXUHx0Xuj7ighLtgX8PmU2gqr70ZU58zf1 K5tcBNH+D5RpjhAfBQrmY1wS6T36FURf9bfvp7IzK06h8OvWmKIWpkWiLomKPNTDiNLU 6VmwGFU5Gg/aSD2Fu+xq4Dr8tkqWygtmKxCbZHuNWq5tgND3Dv4pSXEXqXsH4LNZcLL8 VtKa/4yEqu+OS7PN1aRgQpM+qhaAprwP4egKiWvxG+WaNU3wIeLJpuoWiDnLWBzcV1dH okdYS7speCVdISqC9bnhjQhiaLS1xUfvgjm9k2s4YasxVodSZYsqhBdb7+w+ojbUYwPA kKeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T1tZju5b; 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 b65si12547416edf.391.2021.03.15.11.28.15; Mon, 15 Mar 2021 11:28:45 -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=T1tZju5b; 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 S239388AbhCOOcV (ORCPT + 99 others); Mon, 15 Mar 2021 10:32:21 -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 S230192AbhCOOBK (ORCPT ); Mon, 15 Mar 2021 10:01:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 152BE61477; Mon, 15 Mar 2021 14:00:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816835; bh=GTeUtwzfq/978IFxOmeHTwhMilYuUVY1oe7gQEu1PeU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T1tZju5bfeeMaAcNV/Zt1bhx9wi4OtuRNTKZKYSVWlpuah/TgfxjUtQdBJOxSM/++ a16P3dNC48rvZhCV4TO5uESf+nH3Ep0h7L+pCIJGFgv5wb4UOwIKzydHCYtasQ6WB7 0ER3wQthCXvx1/JLYOaQuPLtUEWhjC/PMpbp7ZdY= 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.10 141/290] spi: stm32: make spurious and overrun interrupts visible Date: Mon, 15 Mar 2021 14:53:54 +0100 Message-Id: <20210315135546.680216630@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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