From patchwork Wed Jan 25 19:50:47 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: 48282 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp456396wrn; Wed, 25 Jan 2023 11:52:46 -0800 (PST) X-Google-Smtp-Source: AK7set/az4PJnyXb5n/GCYpiA+0ne9HvVgurK3Pr5VILDQ1TPrJPGnbuthK2vATdBEg6tP1oxPkn X-Received: by 2002:a05:6a00:1350:b0:591:2ead:8eb with SMTP id k16-20020a056a00135000b005912ead08ebmr201872pfu.11.1674676366445; Wed, 25 Jan 2023 11:52:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674676366; cv=none; d=google.com; s=arc-20160816; b=ZSc/Bbr+RMN7EnJNvQCyi4whfQ5GjukV756fMQt2qBIGD0Vc6Zcr5BCmkd/BzofYfU 7+YxbIinqmlFHOV+0pNe1/MgE5sh4irB0hoe5j4PP4wdnv4wIMo7SAQIOOj93+4WA9DE 7wwDkClqqlz4i4pzPG9U6T+jdsTWbCwT0yetGn8NNg2v/c3C1g1xzPrOrQ/CoWd5dcqh AWLPwkfGix+H8/PHYJdQVJQIueSz7mUJGcBB+pmD+QG2SKdBi6CjBXfBy9j+EzcYR2FQ JLLItlzdCfWAayaOLHLC4YMFa7Oh2yrMYfwE8AyK3jqIACnJxWCpFMHrkmkVXSimugX3 u9xQ== 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=j0FrFNu+fbId+cNGgF92T8X+IGYNGZVy8euZggQ4zwE=; b=qLSev+NUXUNqYr6zm3EsWhGUv8Z33KsY7T9p65xp86UeO8IAQWDrpajs9WSwR4Qg0W tKSw7ZXtqJhElTKrfcDOfQlgr3+QFvP6a/L7gkPoQMuZNzJfjKCtp1X9GX/Qkk4djFSo at63F/6jdqkdR84HtZOe84lQZxdsk6ylZX9oScNguAWTQVoU6hWpBAHDmKA7vh/RYeUY 9QefdFHgR0L+BHIDxGOZy7zMV+wnnKI2x7s3JkdTY5xqhddrmvkSMDKpu9eA4oHDcdhK R3ZRDQ+v2P/kO4QEPwqBqVoZR6PYxUugSLZEoTHVttVtS1ry/ktB25LR8wKhxsGSQceI oyWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=DaZ+wzH+; 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 m2-20020aa78a02000000b0058dd436a675si5965098pfa.365.2023.01.25.11.52.32; Wed, 25 Jan 2023 11:52:46 -0800 (PST) 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=DaZ+wzH+; 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 S235849AbjAYTva (ORCPT + 99 others); Wed, 25 Jan 2023 14:51:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235646AbjAYTvM (ORCPT ); Wed, 25 Jan 2023 14:51:12 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D38F45236 for ; Wed, 25 Jan 2023 11:51:11 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id mg12so50607039ejc.5 for ; Wed, 25 Jan 2023 11:51:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; 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=j0FrFNu+fbId+cNGgF92T8X+IGYNGZVy8euZggQ4zwE=; b=DaZ+wzH+2Q3D+0BuJOX48IXhzvKiRQR1S83MMuxEZvJ4b7dw9tTD4fC96gpNbj3ihi btCoEOgY+LXjwaGffue1LP6BmeM7yMMNpolZ+1rPnmaJU09AjLxfSy/1uZsavutP/2GO 8FfFX5JIoKW1uN26KIrUOWloMB+KjElisT4eqkSHGXL+LYnGVvNcQpSQQDGJqsuKjnII rWMMUSAccNeWGtdK6MkDrVWQZS84dmeZLHImUH1Yzde0Q7fPYxcnSDNnl7eFgGNEJBYg VTWEounuOr9d0Bk7HpcFWcCODFf5GhGe7/ILoknpLkW64/pEvYOMHFlI0MIfnMtWzK6L 4Sow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=j0FrFNu+fbId+cNGgF92T8X+IGYNGZVy8euZggQ4zwE=; b=39nQ7bV98XdA7MkZVQbirKq+UxNMfiaY/jxRgN/hpTH/Xt2cs0xvF4WX8jdFSmOj17 mtSlmx2ycJJH5xfGvIIMlJjH5folZCH4kzy980EmC4hMH7lDvTfPIfxk40ZSG3tZTdpk ZaMLqO5vUONVVWRGW9PUxakkLTKxQ/0SwGJkys97xMJlyfbxnbSNM9tVcQtYEb/UxrUv eXyVyb17xH3VWxZ2FF2Q0/AO2hZw8skd7TESOu4aXe7stXpXDOO1X2xbgugfQPUITqvW hv7+IlBKf4hXkA/55wkZcKL0mMrCgaHJEH02FzMdybN5VnvgrRGU4oIRY/lgR9PEngJc +MEQ== X-Gm-Message-State: AFqh2krJ47gH4bwVWZhPywvG+DsUj32rloBGiQvVn7/EC0Ps1aynqukb ymf390fSiKrDAnU6hWuwTvZcuA== X-Received: by 2002:a17:907:6746:b0:84d:1c67:97d7 with SMTP id qm6-20020a170907674600b0084d1c6797d7mr41138473ejc.30.1674676269778; Wed, 25 Jan 2023 11:51:09 -0800 (PST) Received: from blmsp.fritz.box ([2001:4091:a247:815f:ef74:e427:628a:752c]) by smtp.gmail.com with ESMTPSA id s15-20020a170906454f00b00872c0bccab2sm2778830ejq.35.2023.01.25.11.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 11:51:09 -0800 (PST) From: Markus Schneider-Pargmann To: Marc Kleine-Budde , Chandrasekar Ramakrishnan , Wolfgang Grandegger Cc: Vincent MAILHOL , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Markus Schneider-Pargmann Subject: [PATCH v2 06/18] can: m_can: Disable unused interrupts Date: Wed, 25 Jan 2023 20:50:47 +0100 Message-Id: <20230125195059.630377-7-msp@baylibre.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230125195059.630377-1-msp@baylibre.com> References: <20230125195059.630377-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?1756025445943521141?= X-GMAIL-MSGID: =?utf-8?q?1756025445943521141?= 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 --- 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 a668a5836cf8..ef5ca5d37b0d 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -1262,6 +1262,7 @@ static int m_can_chip_config(struct net_device *dev) { struct m_can_classdev *cdev = netdev_priv(dev); u32 cccr, test; + u32 interrupts = IR_ALL_INT; int err; err = m_can_init_ram(cdev); @@ -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);