From patchwork Wed Mar 15 11:05:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Schneider-Pargmann X-Patchwork-Id: 70124 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2261794wrd; Wed, 15 Mar 2023 04:08:06 -0700 (PDT) X-Google-Smtp-Source: AK7set9FS8uA+znk6Iarv2PgsnIRd9oTJVYtHK9bfMVQra5lFf8mbsFueUV41LrcjmtiEQtT8R4w X-Received: by 2002:a17:902:f291:b0:19e:dc0e:126a with SMTP id k17-20020a170902f29100b0019edc0e126amr1751490plc.18.1678878485980; Wed, 15 Mar 2023 04:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678878485; cv=none; d=google.com; s=arc-20160816; b=zN1c+R5hCeVUdmLnP88s76Yd3RHgsW1eJrSWx6PVW/wW6Av7/XxRIxAXwQsPsTQVVo 5IlYtVY2vVHEXm3Ff8fhnKvm93lTCrrPii4h6Lr1alnws1Jh0opdr4YfGiJdjB0jsbs6 x/TBiGBYLM++qfHCVBfDW2/d7Qg99LpNmqBGZzC0mqgmxVCIyyK25MES5rspdp0Kpb9z hs/iOgvdXeew8VBiQsOUgZ88yNK+wGlTCTBNhLiDUQuSC3bRV64/jLlQXXyOFa25AnXX UXHD0oCsKAaAcMa1HR0oNyVBmnmfohO2hxgz8dleZ5L6f8U/ujy63Ypq1R2MS/3lBSxh qYdg== 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=Jd8Qw6tYWP8+UhEwcLFiF9jauK6KGSZvnf2iBpWLLhI=; b=Vszx7tN4czlQ99ejKhoL0o++ebVlT95NG5lUhBcAD5H3T1oZ9iXALPNyGo6GwyIZ9A ulyhU1sygwmuJwOiRyM0w8woGQQHoiqVrhV7wlM3onba5rwJeJb7Oq6dY3F5cMhRbiN1 EiqgPEoQGjzdrySfSnJsTA6zb7YDKS2Cusjn6UMYGChF/Q18+Rluy7q61tvV31dedSIn L7mZRQDDPXaiaza+uwqBZK3hlxxcwRuphitvOGxhMHbLJuQIYn1n5T/Rdb7yA+SxJ1Fn 3oYHGigOzhNspEvJT2RiBsG/EG+RR+JJG+s+4u0HTmzrDr2GCcuM1dGJD+MkIQtr3mJ3 bb8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=bFwVnfvJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jj21-20020a170903049500b0019a88f51635si4608737plb.534.2023.03.15.04.07.52; Wed, 15 Mar 2023 04:08:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=bFwVnfvJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231841AbjCOLGu (ORCPT + 99 others); Wed, 15 Mar 2023 07:06:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231545AbjCOLGi (ORCPT ); Wed, 15 Mar 2023 07:06:38 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E82FB8534A for ; Wed, 15 Mar 2023 04:06:29 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id y14so4248802wrq.4 for ; Wed, 15 Mar 2023 04:06:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1678878388; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Jd8Qw6tYWP8+UhEwcLFiF9jauK6KGSZvnf2iBpWLLhI=; b=bFwVnfvJ+2RaVkxVOt+DW/N4wkI25kazo0eEW1ub/25j6bkDQFg0tFKk/f/Cw5vQ9h J/RNV6QKkAGFZ/y+Kiq8T1oDguqEisdAQLpOVWUatyJvoflbkv3Jve2MT2Cif2HQS4ER w5IpcvwsU48czgn46o1G9RNRl7O4tmmd2GsTlnmTnf8Bu93NKR39eogx8Et2RhqF/VJH 7mQ8o/MnN2q24L00qA7jOMPPkPp0Nw9AXOyLln6mJUHyPBNrBqXDDpmCRpaYDqXPpLeg ifdnIcOJNxo+zXJn0JMuAy8QqkthgHP/hJl67rKIDNZFJTyuKYXfAnaARRdQQgBph4pd DAFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678878388; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jd8Qw6tYWP8+UhEwcLFiF9jauK6KGSZvnf2iBpWLLhI=; b=Kd1FRGmlGMQFrEVFF8B+Sc8kMIOn/r+QqMXzGKuGag29XEd1j2tHHlXwNsofgDdMOn 3g9rPj0zQSamCdKmyjZJc5BayBz4+8tvcz4XgMk+W/dU4D5ujuFme6Tl1oQx0zHeuVec C1q/VPYO4C6lZRbYzwOpe2foXS4cNmmK/iH4w1adWO3E6c5of95jEED0CS3poGV9yuvt LXsl0RKTrFO5SzjIgM8Pclt3Bg41rz8QEB3FLntJKfm0utMHJqqRScddK0hGSw5UYQAW TJRY3VZRlXU+/ZoXr2FKWDw/eZKSglEZYqB5dYY2S2lSBZT5994UYxP6BKQmAcXpVmLV BcDA== X-Gm-Message-State: AO0yUKUBf/7Wqz3sqJKua1U8dLwXPV3Ila+hrchjQvlF+fXziY/F4ERp x1/2uZdk+tiXTOn+fQ0cBOkxsA== X-Received: by 2002:adf:f183:0:b0:2cf:f30f:cc04 with SMTP id h3-20020adff183000000b002cff30fcc04mr1545606wro.27.1678878388478; Wed, 15 Mar 2023 04:06:28 -0700 (PDT) Received: from blmsp.fritz.box ([2001:4090:a247:8056:be7d:83e:a6a5:4659]) by smtp.gmail.com with ESMTPSA id l4-20020a7bc444000000b003eafc47eb09sm1460563wmi.43.2023.03.15.04.06.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 04:06:28 -0700 (PDT) From: Markus Schneider-Pargmann To: Marc Kleine-Budde , Chandrasekar Ramakrishnan , Wolfgang Grandegger Cc: Vincent MAILHOL , Simon Horman , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Markus Schneider-Pargmann Subject: [PATCH v3 04/16] can: m_can: Disable unused interrupts Date: Wed, 15 Mar 2023 12:05:34 +0100 Message-Id: <20230315110546.2518305-5-msp@baylibre.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315110546.2518305-1-msp@baylibre.com> References: <20230315110546.2518305-1-msp@baylibre.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760431687041659907?= X-GMAIL-MSGID: =?utf-8?q?1760431687041659907?= There are a number of interrupts that are not used by the driver at the moment. Disable all of these. Signed-off-by: Markus Schneider-Pargmann Reviewed-by: Simon Horman --- drivers/net/can/m_can/m_can.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index 5274d9642566..e7aceeba3759 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -1261,6 +1261,7 @@ static int m_can_set_bittiming(struct net_device *dev) static int m_can_chip_config(struct net_device *dev) { struct m_can_classdev *cdev = netdev_priv(dev); + u32 interrupts = IR_ALL_INT; u32 cccr, test; int err; @@ -1270,6 +1271,11 @@ static int m_can_chip_config(struct net_device *dev) return err; } + /* Disable unused interrupts */ + interrupts &= ~(IR_ARA | IR_ELO | IR_DRX | IR_TEFF | IR_TEFW | IR_TFE | + IR_TCF | IR_HPM | IR_RF1F | IR_RF1W | IR_RF1N | + IR_RF0F | IR_RF0W); + m_can_config_endisable(cdev, true); /* RX Buffer/FIFO Element Size 64 bytes data field */ @@ -1364,15 +1370,13 @@ static int m_can_chip_config(struct net_device *dev) m_can_write(cdev, M_CAN_TEST, test); /* Enable interrupts */ - if (!(cdev->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING)) + if (!(cdev->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING)) { if (cdev->version == 30) - m_can_write(cdev, M_CAN_IE, IR_ALL_INT & - ~(IR_ERR_LEC_30X)); + interrupts &= ~(IR_ERR_LEC_30X); else - m_can_write(cdev, M_CAN_IE, IR_ALL_INT & - ~(IR_ERR_LEC_31X)); - else - m_can_write(cdev, M_CAN_IE, IR_ALL_INT); + interrupts &= ~(IR_ERR_LEC_31X); + } + m_can_write(cdev, M_CAN_IE, interrupts); /* route all interrupts to INT0 */ m_can_write(cdev, M_CAN_ILS, ILS_ALL_INT0);