Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp784593pxb; Mon, 16 Aug 2021 18:14:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqnUegNZgACR2B58ZKEaHxUEnuqDoakyk8YxrFlX3G6rLs+jrCVK68G/zTlfjOHBAP432Y X-Received: by 2002:a05:6402:50c6:: with SMTP id h6mr1095948edb.1.1629162881001; Mon, 16 Aug 2021 18:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629162880; cv=none; d=google.com; s=arc-20160816; b=liheUwnjxydOybS5YJ9h33PTfa3d84poUAyq/vUHuI16FnkRyWhlGYWQAGLSEY/uI4 6G3XwQNAKvpomcOuJphJ2ZDXjdQZKDPq06PkyAa30bl/1PyM+YQizSXOcjPc6wHsfWpD u3LR6lwqQ/Um2v0qwrQPKohvFwEBl2jBFNK37cCd4gLjGzjhMWdJky2OGZR1a549IG29 gw4d8kLwUnlp9pxAY0f5h3RdeWKSUrPX7eNQmKFWdCHW8lDdhUtp3Shwl8kpjL2Bcaxg id3gX1YCA4bew33kjeC620Vaxg2pU1A4NXFuBa0fxKHt9TEZUCEmdxuw2JJTJ4fuST7H 12gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=LcDb6cdiTT2+/+iDeVpLBBojjo/JZmuIoI4va9to8jg=; b=SyG944hbRiGUm22qzU6LCs5KaXwPS9VIuPOnqtiJDDF0PWkxPJWyd/RuDkCFRV+8Ot 5hp5rmNCG/T7PkTvgr1fZgWsn8h9PQmv6O+J5EQlco4FVUVyggwpxXYMkECQB8e1V/fG LSX/zNlh/uld3NFO/ek8iIJPrevDQhNr3m4FplT6NP36Ib/fbI38OzotGLYzhykGHfyi EISvnmttjoBKKID/u7Dl8DIPKUo1wj3qUIoPr3mUsCHkut0b5nj1E5PEftsZzs9cIsEJ jDXkAVIJfC6sAP8z0qGU/yYusJ8weOC3gaOYBtVaTq2Wc+dKzggl/EN8tLtjbhJzdJmL QL2A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nd36si567488ejc.253.2021.08.16.18.14.16; Mon, 16 Aug 2021 18:14:40 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234958AbhHQBN3 (ORCPT + 99 others); Mon, 16 Aug 2021 21:13:29 -0400 Received: from mail-lj1-f181.google.com ([209.85.208.181]:36433 "EHLO mail-lj1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231649AbhHQBN3 (ORCPT ); Mon, 16 Aug 2021 21:13:29 -0400 Received: by mail-lj1-f181.google.com with SMTP id y7so30218495ljp.3; Mon, 16 Aug 2021 18:12:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LcDb6cdiTT2+/+iDeVpLBBojjo/JZmuIoI4va9to8jg=; b=s7Q58AH41jtWNx+HjVRBO/yPdKIkPd0j99QDF+d1kLGH8a9WkIj8oN3uMfE6DysDdx i52epGrdR3laBwYJfWM12utUDbtC4bNo19N2OuEQOF+67kItMNKGgxUVtzU8oYS9tgov 5zboQw/KvHzNBJ0Rl3S3jdB5UGyb46OVLYWl/oOXxD1k79wNcz2mRG9XO99aRKxuckOy zn/lbeUEvV2RhYqdl8YU3TRJ4wx61mlyORs60CcQxR0+IUcdf1lwDyqJO2h+jxGkeq6j HahxL+NfF4WgBjt5iyfBZ57HbggwJHI4RiG4KgDFQ+0aycthTKYoXmoZSwYlSdZp4Ekc SBjQ== X-Gm-Message-State: AOAM532YFqDheKFndnegdYjOHI+XfeBzJluAcZgtyfwirV+TGCKalBfl FXh2Jya1WWU6ILGUtEdYpYvzH3RSZrelqyeDX7E= X-Received: by 2002:a2e:9182:: with SMTP id f2mr820778ljg.57.1629162775444; Mon, 16 Aug 2021 18:12:55 -0700 (PDT) MIME-Version: 1.0 References: <20210815033248.98111-1-mailhol.vincent@wanadoo.fr> <20210815033248.98111-3-mailhol.vincent@wanadoo.fr> <20210816084235.fr7fzau2ce7zl4d4@pengutronix.de> <20210816122519.mme272z6tqrkyc6x@pengutronix.de> <20210816123309.pfa57tke5hrycqae@pengutronix.de> <20210816134342.w3bc5zjczwowcjr4@pengutronix.de> In-Reply-To: From: Vincent MAILHOL Date: Tue, 17 Aug 2021 10:12:44 +0900 Message-ID: Subject: Re: [PATCH v5 2/7] can: bittiming: allow TDC{V,O} to be zero and add can_tdc_const::tdc{v,o,f}_min To: Marc Kleine-Budde Cc: linux-can , =?UTF-8?Q?Stefan_M=C3=A4tje?= , netdev , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, This patch fixes the bug you just encountered: having both TDC_AUTO and TDC_MANUAL set at the same time. I also cleaned all garbage data in struct can_tdc because that was trivial. This patch is meant to be squashed into: commit ca7200319a90 ("can: netlink: add interface for CAN-FD Transmitter Delay Compensation (TDC)") For now, I am just sharing it here so that you can continue your testing. I will resend the full series after we finish current ongoing discussion. Signed-off-by: Vincent Mailhol --- drivers/net/can/dev/netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/dev/netlink.c b/drivers/net/can/dev/netlink.c index f05745c96b9c..d8cefe7d354c 100644 --- a/drivers/net/can/dev/netlink.c +++ b/drivers/net/can/dev/netlink.c @@ -204,6 +204,7 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[], } } + priv->ctrlmode &= ~CAN_CTRLMODE_TDC_MASK; if (data[IFLA_CAN_CTRLMODE]) { struct can_ctrlmode *cm; u32 ctrlstatic; @@ -239,8 +240,6 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[], dev->mtu = CAN_MTU; memset(&priv->data_bittiming, 0, sizeof(priv->data_bittiming)); - memset(&priv->tdc, 0, sizeof(priv->tdc)); - priv->ctrlmode &= ~CAN_CTRLMODE_TDC_MASK; } tdc_mask = cm->mask & CAN_CTRLMODE_TDC_MASK; @@ -326,6 +325,7 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[], priv->termination = termval; } + memset(&priv->tdc, 0, sizeof(priv->tdc)); if (data[IFLA_CAN_TDC]) { /* Use the provided TDC parameters */ err = can_tdc_changelink(dev, data[IFLA_CAN_TDC], extack); -- 2.31.1