Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1327400pxu; Mon, 23 Nov 2020 18:41:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzH/8N1de5yZp3rdAp4JvaiO9cNjbIFiYlKTJD9SQvX8kcdcT2w82yTIY38LtPxGbc+PqRC X-Received: by 2002:a17:906:b143:: with SMTP id bt3mr2429524ejb.318.1606185695553; Mon, 23 Nov 2020 18:41:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606185695; cv=none; d=google.com; s=arc-20160816; b=FJRTA4seB8CYtexwIpTnpnXMuj5x4VI1OzY47xWgoaYEh1LXL3CLHpWvYbkmVOpRlb k0oOBKF90AB2HpVVLnx4MoxOxKSInge9qsT/aw+rOBxg2xPxxidoH8JPEXg9DHwxkN1r r1wbSY0yYcmLw0CMhkSAGccuOBuMxB+qQJHpdqtFzE804h2/yE/fvEGTvVSAz+l95v9R gJPZwBTn9Z43YYqGcLoWCPOetgCv4wPz9jj9KaNQwLtEDkD5QQILDeu9/QkPXJbuoe5e pmt2lrJkUIcFWF0qHNgwvTI/x54O4c7GQNTMix5vFYo6N5OkKrRrz1j/iQMbq5EGmTYb l4Cw== 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=8ZxHZU21NW8NRUTaVW73qar0WlvdyvwQmyXe8shv8AA=; b=vAO6z+cApjLrnVkM6WbFX0rFhH0VwlNypCtfG1Hqc8IHJL3s9RaDR4CGdg0sxcmkUR oLQmNbMi9CGJo3jPOKh5XVHvOiTuB3hgJEIacTRHK1sWzU0vMSjg+eAVocpuxkKZVxRK Hy+KVvElT2HpEaGVEaasi9V/V43zyPM/Oc85AEGG37nAsSt+9+iwKr0pOhs4eUaHlrYK e0unogv9s9b9s8K+tIcA06nUfMDpQ8rgxhbSUU3iGe0CHb+oLocedyXH2cT1OjdTNJ0N DXsj3aw/ONadx0YZ61qHED7eCqAdpSZBYR7+u89gYrNt/Mdb3h8o2XY7FfCGFby5F6ZK /bVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MGMJ+QHC; 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 i6si7582613ejx.303.2020.11.23.18.41.13; Mon, 23 Nov 2020 18:41:35 -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=MGMJ+QHC; 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 S2387857AbgKWMxL (ORCPT + 99 others); Mon, 23 Nov 2020 07:53:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:33626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730887AbgKWMsk (ORCPT ); Mon, 23 Nov 2020 07:48:40 -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 1FC4F21534; Mon, 23 Nov 2020 12:48:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135685; bh=I438DV60xVRmVmoGJmwtybb5r8nwMn/VyHQuolrT77c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MGMJ+QHCQGJb4/THK9h4ByAIVcSGsxNFI8zLd+PzDb8Pm7V+fyt4eAJFjF6yQywj5 16r0YvQFrlLG6EswQTBJZNOQvfYwyTl79GhQnUR4Ctc7eGZzey87OmspajL08B3d+3 1wA9GLI2YSTfEBHJuvxm4w21q2er01q1Ei82FaB4= 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.9 159/252] can: m_can: process interrupt only when not runtime suspended Date: Mon, 23 Nov 2020 13:21:49 +0100 Message-Id: <20201123121843.263104589@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121835.580259631@linuxfoundation.org> References: <20201123121835.580259631@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 e7264043f79a2..f3fc37e96b087 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -956,6 +956,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