Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4002096pxu; Mon, 12 Oct 2020 07:06:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2S10HBMXTY9DJ1kFFd2AO0aJWuUC1xg2v2YXw+B0ncAS/QiRe4MuuZYRurhB0qRZ3mGuE X-Received: by 2002:adf:a501:: with SMTP id i1mr4594236wrb.162.1602511580985; Mon, 12 Oct 2020 07:06:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602511580; cv=none; d=google.com; s=arc-20160816; b=Q9QiWnKQ7DTG2qBG+ycqT2D4+CReZviW8y9H3q0wyCDtRclVUb4mU2Le0ibxE8pYCB 9UTFKFQRp7RiKVugUrC4b9hqiZaUXAnkupLYBi4rY/RWs4rdP48W0Hz+qNDqNAXfFKqF DA+tLidd/SVuiXsxNJkYDYwS/4Uk0672AMbCOg4Hwa23mOeGYG3LJ3Odp09rz0nLz2VX whxSBO2E8gAQuvnnRxk3p6ft/kqa8470LMDYZtl4eTYYzflj7QlWxCB1vlw/82dCMgDr 3dbZEocpmgtu7t4Hif70vYjSHnGf9XA8YNZNpPN5WoFeUdSykX+h9PZfDiCcOHAQ6rjR rFLA== 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=wDPztDADTU8AceiEfZ7HDvlVBU/0IcDO6onXlY4s53c=; b=LRQ75T3+FjWHs9oIZ5e4BLJsVGQQwxpmuGWKgc1Lwc68cv38i4j5F/MH1t2rNSBD2M gzqmxNIj0ggnI4ohfvIZ3ijUFc18Dyctg77nvKN0nCu7D4haEuyc3RaUdi2xHnOQH1+/ Vfec4X8YgsHu0DfBYxdjKQR/uifssaHHDSWulCsQEwKP4qaYRLmOUY31BYLx6YqQ/jZH f0GjuLIJRKTlUSNVsgeuzNYoXmsX8XiArI+VG23g6ke0iHdHzwB4gxQ5+kuJR0vaOumz SiIaUWeX2DA4qHEm1IKbAo4T7YhCkSxA6V726LcmYHjIy7Tle+h5m0+Zz/0qEVchfweC ewkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vWGc8ggp; 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=fail (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 l26si8928668edw.348.2020.10.12.07.05.57; Mon, 12 Oct 2020 07:06:20 -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=@kernel.org header.s=default header.b=vWGc8ggp; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390907AbgJLOEN (ORCPT + 99 others); Mon, 12 Oct 2020 10:04:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:38908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388626AbgJLNgO (ORCPT ); Mon, 12 Oct 2020 09:36:14 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 682FD204EA; Mon, 12 Oct 2020 13:36:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602509773; bh=kb/xDZY5HRtm/9Aad0YHn71BSrGa64+RJEGGTIQklS4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vWGc8ggpacg2/uUIpPKox1IWcQs+TgiDwBpVaL5Gzf/vf4Ias+rUIep11KAtGLsV1 WcvNwhEqjvpzAqURZAffKdxmT+yya98E9QvBZFrQUxNCy23um1gudve+28zb5hu8Xw YT40G2AvMWS9/ADdBUjuGI33JTXO0L1+Q4QR2kz8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Packham , Mark Brown , Sasha Levin Subject: [PATCH 4.14 16/70] spi: fsl-espi: Only process interrupts for expected events Date: Mon, 12 Oct 2020 15:26:32 +0200 Message-Id: <20201012132630.998887361@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012132630.201442517@linuxfoundation.org> References: <20201012132630.201442517@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: Chris Packham [ Upstream commit b867eef4cf548cd9541225aadcdcee644669b9e1 ] The SPIE register contains counts for the TX FIFO so any time the irq handler was invoked we would attempt to process the RX/TX fifos. Use the SPIM value to mask the events so that we only process interrupts that were expected. This was a latent issue exposed by commit 3282a3da25bd ("powerpc/64: Implement soft interrupt replay in C"). Signed-off-by: Chris Packham Link: https://lore.kernel.org/r/20200904002812.7300-1-chris.packham@alliedtelesis.co.nz Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-fsl-espi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index 1d332e23f6ede..6a39ba5840c2e 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -556,13 +556,14 @@ static void fsl_espi_cpu_irq(struct fsl_espi *espi, u32 events) static irqreturn_t fsl_espi_irq(s32 irq, void *context_data) { struct fsl_espi *espi = context_data; - u32 events; + u32 events, mask; spin_lock(&espi->lock); /* Get interrupt events(tx/rx) */ events = fsl_espi_read_reg(espi, ESPI_SPIE); - if (!events) { + mask = fsl_espi_read_reg(espi, ESPI_SPIM); + if (!(events & mask)) { spin_unlock(&espi->lock); return IRQ_NONE; } -- 2.25.1