Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1239328pxu; Mon, 23 Nov 2020 15:38:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGe3omrajlmN8FdEy42mQ8F0YSdS8zNaedmLl2Qlwa61pKDLYZDTtVkLZ2ZXJ3sEb6wOp2 X-Received: by 2002:a17:906:17d1:: with SMTP id u17mr1825552eje.6.1606174717246; Mon, 23 Nov 2020 15:38:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606174717; cv=none; d=google.com; s=arc-20160816; b=uD+XI14aVApPvFkSmrofijU9EaJSCUQLHEDWJm0zCtCk7p+fopl2opwAnfj+WWswLh d3U53f29YevA/YjitYLjvf8Ihjbr7TxBxGPGz2o35ZrzyCCri4R9YbEy2Fb/VDJ4oJH7 B3MDhSuDxJhuw52aFJHdTBbtZ7OrkmjCorlk7TLdaUT7F8oTbouQasK63bOl3FpKkM/W LMRaFAlIRwJVawgy4LyjRicjSvlP1UO/e3OXlxbsQdL2BmVvF3GgX8eGHNv2iV6OMIVo B0JFndT/Xxj3mmDEORiAS6gwmcBHUYyLWdWJSyzQub6ShPOIe/d2yesWRsOp8ZVktxxp BM3w== 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=cQkIsDpJoEUgch2qiKQbPqsUTnmgP4eEc1GT3AryTd0=; b=wxCAtWvxDaXmwDj2EqYc/dI09o+tNuYMyLs4ieZym00/2o6wMOTKbknQufyafZjt+w X8muSWGS3fPfkp7+5cZd8HMuHvexIPZ/jTBPmQ93mlMno707ygmrfBGHLcmDx9kE5g/M UltCaH79JJp6Wc8qIk7eevuryHJ6DJhB+c55bMwom8cI/2UAzmOTFyAIyzxWdgzN//We e29wCTR817M0emo8enR1ZMZpgDDgj93LxWLdBzDJWOlV7n+nSnecXnqJd8pmM/MApIUo LeqL2l57qugPNKJji4+Kt9LQrc8WVfMV2GxrNPkdv/DD98sLuSWnDeuFfCjQKo3Pe5aY ToDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T06t+Df0; 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 x18si7380135ejj.520.2020.11.23.15.38.15; Mon, 23 Nov 2020 15:38:37 -0800 (PST) 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=T06t+Df0; 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 S1732086AbgKWMiW (ORCPT + 99 others); Mon, 23 Nov 2020 07:38:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:50560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732025AbgKWMiH (ORCPT ); Mon, 23 Nov 2020 07:38:07 -0500 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 D4AB7208C3; Mon, 23 Nov 2020 12:38:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135087; bh=+/XInTxqoknupdebruEVQIZZbeJa9DLxTBHjIGoaWDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T06t+Df02z3kICeIOnO6Qks/Cptyavgrn2iUpTZNVT8SRPW1qWnttxDwEaHGS77+c mk4xf2Ps8iGZKupteYCJAzD44Ygc0JKdNwPYhgrwPgSPhLVuwRdtD40iNpJM409KSt FQKxvIiyFXRIXC6fVRmbGl/VhABaczJLKhVNDKzs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jarkko Nikula , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 5.4 100/158] can: m_can: process interrupt only when not runtime suspended Date: Mon, 23 Nov 2020 13:22:08 +0100 Message-Id: <20201123121824.756406776@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@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: Jarkko Nikula [ Upstream commit a1f634463aaf2c94dfa13001dbdea011303124cc ] Avoid processing bogus interrupt statuses when the HW is runtime suspended and the M_CAN_IR register read may get all bits 1's. Handler can be called if the interrupt request is shared with other peripherals or at the end of free_irq(). Therefore check the runtime suspended status before processing. Fixes: cdf8259d6573 ("can: m_can: Add PM Support") Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20200915134715.696303-1-jarkko.nikula@linux.intel.com Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/m_can/m_can.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index 661db85d569ce..246fa2657d744 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -913,6 +913,8 @@ static irqreturn_t m_can_isr(int irq, void *dev_id) struct net_device_stats *stats = &dev->stats; u32 ir; + if (pm_runtime_suspended(cdev->dev)) + return IRQ_NONE; ir = m_can_read(cdev, M_CAN_IR); if (!ir) return IRQ_NONE; -- 2.27.0