Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3441921pxk; Mon, 28 Sep 2020 18:36:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeDfaScImffxjVrz5OKgGThjoXvrVrb4/WWXOE+q7/vzI0/MKNw0s7NcfyrHd7vRE4OcVn X-Received: by 2002:a50:ec10:: with SMTP id g16mr813369edr.214.1601343364147; Mon, 28 Sep 2020 18:36:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601343364; cv=none; d=google.com; s=arc-20160816; b=V+F1HS6bD+MoCm9dM2sQ9MtW1zt8zHmKJFkHQfS9qtRd1HMmaD8TKTkNMo28vItcIw 13Y9Z79D4TouSlOwmM2glM8q0II2E+iRmq+KQJ76dth+3xau+szDBNRnT2IV5RSXX11T f6qqwcwQ1C5daIFdz2OmA0e1tIhzLpvXlbOhI46yNTCc83dhIOJkJBX3MGTNg4JKNQK+ OVtbYA6y+vs86TUn/TmxsQGvPpECJHaxbyXADSLe1dacjMSeCHJIBX7qw4PFpmPQ15FD lVzYjR8NBf1NF4zLIOMbJUeqQkg0/q/SG2TOATh8qwZaSkHpnqPQHuNDGOo6WIRBGJPL 7URQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0sysXz7jLO5QE5k/2O/c7a7uySfpXSygnswje9hDsBc=; b=LjvY3bmrKe1/iWVvzpXw4Yy2DvcSyWonlWIBGhSLbeCbK52Oj9HwDCd39EsbxTWoFT SAXhB7XuyDS6oYxvM8rKvojfHwEb4ac/LaTBJgLhthLslF/FQdU+8fLQsWdXh0fCUPEF bIbWg2OMzMzbh481QyQJNy24c9LROz1xMmf0qRhyYfmffvDqV9ftvo8vuUXUiPNTWs5h OludM0UgXM1EQJUhCMz4CjsFlnNzivCkVKPw/DufltUzPE2H8ZhvtUh84aM/kEM/QlEu H+U2MqbDdNVD3Tmk16hbzpdOKPbKlvrJKsAkjizVDBgZq4bAW+3dHEAsqCbQUD0DmnO2 Rgbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XOPpJZTG; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q26si415416ejx.691.2020.09.28.18.35.30; Mon, 28 Sep 2020 18:36:04 -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=XOPpJZTG; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727487AbgI2BbD (ORCPT + 99 others); Mon, 28 Sep 2020 21:31:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:40054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727460AbgI2Ba6 (ORCPT ); Mon, 28 Sep 2020 21:30:58 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 89F3721D92; Tue, 29 Sep 2020 01:30:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601343058; bh=21FkWTn97faQnwphOoikRmtJOI5pXA5VMosofT5D3sU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XOPpJZTGMWCRLvUGYw9hwzGersGSWVMbASEu/0f4DzKwfX2qDm5a2ORp7b5lnyALD AghnddGwrkObQdcsDBXEyjAjdiMzJn4RJ9ZTIkoYn54fw5SEB/0m9rcD/0fpB22mAv 3j/32NSsuj0tHTO7WnTv50jfvKH0MOF+TAEcSR+8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chris Packham , Mark Brown , Sasha Levin , linux-spi@vger.kernel.org Subject: [PATCH AUTOSEL 5.8 24/29] spi: fsl-espi: Only process interrupts for expected events Date: Mon, 28 Sep 2020 21:30:21 -0400 Message-Id: <20200929013027.2406344-24-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200929013027.2406344-1-sashal@kernel.org> References: <20200929013027.2406344-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 e60581283a247..6d148ab70b93e 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -564,13 +564,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