Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7305208rwb; Tue, 6 Dec 2022 04:10:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf618elWrYoXpIxsJ/mk4/bATXv7goRx0anEwglL6zWEbSeH7MdtcKAuY6Cxo3WyuvwXnjum X-Received: by 2002:a17:907:874f:b0:7b5:e91:adf9 with SMTP id qo15-20020a170907874f00b007b50e91adf9mr47035945ejc.277.1670328617564; Tue, 06 Dec 2022 04:10:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670328617; cv=none; d=google.com; s=arc-20160816; b=R070k6cbKL30ectRCN3CNM+zbvjeDHDSjYjZteMzD3bvDC2td1uUfJz542M+csEKLg /1Jho1+YBlhPzrhREr6a27uEkxCHE3S6Lp0e7JcRGyfVli+VRi/We7nOGAToMO/L6eXm 5sbgNJRXzI/b6L2nhjAY8oMM3+fU65XTG/DhGp+N1ZknJW2GueAr2hzbbJ/gtBGxtzjJ RMIsEKqm2BfJJkXrkp6lt+l0o/bXraBJlkVsyzatjzHhMoYOr/kI5oVPt5pqrwaM50gP D5auTCCqWtyBPuXv2OZ37AjOM4phDkenhGXwmiZIjs3hwT/0V9OStE71cGg/pY77SMPd ODlQ== 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=JjYuBcD7jZlcMi+USU++Fjz73CmyNYItk4pm8+k3tKw=; b=vychz+XDyflO03VlBdxFXgW0YO1UL+G0HFX4vSkZymW3R2Y6sz7Sry/GBiaJglulVL 5C/xMH33Ur+AMkJrZO3wRUoMp5wskh55ikLV7g4PDnlhpDG6a8LUbE8RV65yNaxzribI Ng1AGp4723NBENhClR16YV9dzivUDu+nUIn6Hk8vB7Oi5pBWOh1ohQIg996Sq06ETQe0 jO2q85/fR2nNvO8R2ziJSYzyBFb6mNkptHke9i8eyQDkFUH+oBqJax8u2WTcXyW2AmP8 IpQYEmSD+l1ryJFRRyhELWhnDR0zoa2N4L8Qr8iHyevsYDsMQ+vI0gOy85EyMcqPZzoP Lc1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=nkfae4PG; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp24-20020a1709073e1800b0078e11cbb722si3471212ejc.92.2022.12.06.04.09.54; Tue, 06 Dec 2022 04:10:17 -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=nkfae4PG; 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 S235176AbiLFL6Z (ORCPT + 80 others); Tue, 6 Dec 2022 06:58:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235112AbiLFL5s (ORCPT ); Tue, 6 Dec 2022 06:57:48 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EEE8388C for ; Tue, 6 Dec 2022 03:57:44 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id ud5so5618297ejc.4 for ; Tue, 06 Dec 2022 03:57:43 -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=JjYuBcD7jZlcMi+USU++Fjz73CmyNYItk4pm8+k3tKw=; b=nkfae4PG+fak6KgW7NpaTgVTR1s5fmIbeyaIHwuH6k6RzMXAcjRf4MZT4xkRwBQJvj GC4TH5ZEFsU42Ruukc7h0vli299sxiDdAhBkQ4wX4fY7fcgXmAWumToF8jK9v2jFdG+n GdPFMB6sK4dF2HTrx1qpp1ZRdhkWvHYzTw5ic2CwPjRXKivWRPwE5sQvOwOXsJadgVH5 lElzZBdn6EJSHoirNtkAofdxX97Rc0cxtv+D63IXnow4sGs7WmmlYffD/Zs1wGPLxvCl 8QzqR6vE9los4tFcq91h3yrIGoQwVURZobC/WaKt09LqfZUtYZLZ63nskdeTStzoclAg SdQA== 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=JjYuBcD7jZlcMi+USU++Fjz73CmyNYItk4pm8+k3tKw=; b=QNHcNUO0J1TBd8QdonIGbMiaV5ZyYfF8lx9mOUxO20sl45Rh6x7kxhKrdjM0801Ygy 6AIGCpMJS7IkEOPxe2lHcwT/ZqZ6k7J9QvUrcjcVJwotrxcsdLLdC0B/IBr1iB6mJ5Od rc1b/32niE8kAw8SO17UA/9WPsrTkVMx1S3ZJY/3y+HJL8TWTxFb/HGv0XcoyKabQg/t 8G/0i0d7dEmnE48PcLu5vKRBNWjwNUHRfJ8uVPEhQMYHiNb8vQPPjjBLmv9Oc44O4suH IoElAyYZFlxeC7r6W7HmkO5X7ngGuaCqqAMtGoAMzlVzmG9LT8A774u0j5/oiZTEEEs3 XPfw== X-Gm-Message-State: ANoB5plMDlaxkMmM7aQx4xNPFcMuaAHsDQ8o6K8dq3aJOqpZUo6LbqTj vB6DyuFR5n9Y9o9iVx4m5G7YrA== X-Received: by 2002:a17:907:7884:b0:7c0:e6d8:6f22 with SMTP id ku4-20020a170907788400b007c0e6d86f22mr9275118ejc.670.1670327863538; Tue, 06 Dec 2022 03:57:43 -0800 (PST) Received: from blmsp.fritz.box ([2001:4091:a245:805c:8713:84e4:2a9e:cbe8]) by smtp.gmail.com with ESMTPSA id ky20-20020a170907779400b007c0ac4e6b6esm6472076ejc.143.2022.12.06.03.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Dec 2022 03:57:43 -0800 (PST) From: Markus Schneider-Pargmann To: Chandrasekar Ramakrishnan , Marc Kleine-Budde , Wolfgang Grandegger Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Markus Schneider-Pargmann Subject: [PATCH v2 09/11] can: tcan4x5x: Fix use of register error status mask Date: Tue, 6 Dec 2022 12:57:26 +0100 Message-Id: <20221206115728.1056014-10-msp@baylibre.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221206115728.1056014-1-msp@baylibre.com> References: <20221206115728.1056014-1-msp@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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=ham 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 TCAN4X5X_ERROR_STATUS is not a status register that needs clearing during interrupt handling. Instead this is a masking register that masks error interrupts. Writing TCAN4X5X_CLEAR_ALL_INT to this register effectively masks everything. Rename the register and mask all error interrupts only once by writing to the register in tcan4x5x_init. Fixes: 5443c226ba91 ("can: tcan4x5x: Add tcan4x5x driver to the kernel") Signed-off-by: Markus Schneider-Pargmann --- Notes: v2: - Add fixes tag drivers/net/can/m_can/tcan4x5x-core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/can/m_can/tcan4x5x-core.c b/drivers/net/can/m_can/tcan4x5x-core.c index 1fec394b3517..efa2381bf85b 100644 --- a/drivers/net/can/m_can/tcan4x5x-core.c +++ b/drivers/net/can/m_can/tcan4x5x-core.c @@ -10,7 +10,7 @@ #define TCAN4X5X_DEV_ID1 0x04 #define TCAN4X5X_REV 0x08 #define TCAN4X5X_STATUS 0x0C -#define TCAN4X5X_ERROR_STATUS 0x10 +#define TCAN4X5X_ERROR_STATUS_MASK 0x10 #define TCAN4X5X_CONTROL 0x14 #define TCAN4X5X_CONFIG 0x800 @@ -204,12 +204,7 @@ static int tcan4x5x_clear_interrupts(struct m_can_classdev *cdev) if (ret) return ret; - ret = tcan4x5x_write_tcan_reg(cdev, TCAN4X5X_INT_FLAGS, - TCAN4X5X_CLEAR_ALL_INT); - if (ret) - return ret; - - return tcan4x5x_write_tcan_reg(cdev, TCAN4X5X_ERROR_STATUS, + return tcan4x5x_write_tcan_reg(cdev, TCAN4X5X_INT_FLAGS, TCAN4X5X_CLEAR_ALL_INT); } @@ -229,6 +224,11 @@ static int tcan4x5x_init(struct m_can_classdev *cdev) if (ret) return ret; + ret = tcan4x5x_write_tcan_reg(cdev, TCAN4X5X_ERROR_STATUS_MASK, + TCAN4X5X_CLEAR_ALL_INT); + if (ret) + return ret; + /* Zero out the MCAN buffers */ ret = m_can_init_ram(cdev); if (ret) -- 2.38.1