Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp267803pxb; Wed, 18 Aug 2021 01:44:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2E/OCVJPU5Ps7zdwhLAQR0FJCr8SFkEg+KFhv8KS313vBd2rwtYRYPRJmMsLSToDf/7+B X-Received: by 2002:a92:c80e:: with SMTP id v14mr5602054iln.57.1629276254293; Wed, 18 Aug 2021 01:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629276254; cv=none; d=google.com; s=arc-20160816; b=LqM58avc+Iv12QXuAgVVC1HfAcs8fNnjpvF76zsd02T1cwFfR/lpQLEfIgOoG9TUNt nUaEw1Jle8G7Zhu41NAzF6UE2Age4eXlL6H8PGHGJ7SOy6UmaeU0jxHjiS8DIYv5Nisp e6NdJvknrW0CftI5Ns/IkF4KhOTeP3LnlDFz8hCfSUezvTBLz6pTCo3l7lU2G6gtkfJt K0fKTBVZlx+//HOkn4EVTSjST86FGlMNu2mnuoKKvFVdBFzGBqcNHPd7/GRKZWXCSc0R cyd8/D4+1A86noILukyOmhWSfaaF/hOBX6FqO9O/C516yXpUtKHyFrsjUICwiu15+w84 KwRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=xvNoFYRyB7V49kqhCeljJd0QmytkG+LaJOPU67L/AFo=; b=WX3qNIMWNH7LQ9sdYLw6yZ9X0CXz95SsratGhokQqh+7nnuouxlZkxS0BK+YibSnHQ c7jAwToh7ys4HA635xyWHUQRNZAqr9ZodetL6H2VO80RGNV8RYvlyO2QAlXmJsg6RuiN XOvCLZkgQnyDG4+cuR6TWbE4WhR4yLPHlq/JzdbGSqo6Vk9VKfI7XTbpgeNHLRpj3aSl W4yTm3CRv0b7ftvZVvWpDuboiHmDwmxJc5fPv/e1m+wWRhi+be41MpmiNspPZ7hkB9Oq 1yxnVsV+7n9pV2j2KwpO+LeUINEwValtejT/bhMrc5QNpMuZjK/jqFfnjj9QMvlUQZBu 9tmQ== 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 f2si4390364ilk.141.2021.08.18.01.44.02; Wed, 18 Aug 2021 01:44:14 -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 S238582AbhHRInw (ORCPT + 99 others); Wed, 18 Aug 2021 04:43:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238621AbhHRInv (ORCPT ); Wed, 18 Aug 2021 04:43:51 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42910C0613CF for ; Wed, 18 Aug 2021 01:43:17 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGHAI-0008Ur-Vx; Wed, 18 Aug 2021 10:43:15 +0200 Received: from pengutronix.de (unknown [IPv6:2a02:810a:8940:aa0:ed04:8488:5061:54d4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id 98574669912; Wed, 18 Aug 2021 08:43:13 +0000 (UTC) Date: Wed, 18 Aug 2021 10:43:12 +0200 From: Marc Kleine-Budde To: Vincent MAILHOL Cc: linux-can , Stefan =?utf-8?B?TcOkdGpl?= , netdev , open list Subject: Re: [PATCH v5 5/7] can: netlink: add interface for CAN-FD Transmitter Delay Compensation (TDC) Message-ID: <20210818084312.6i5buvdp7hsu4kmy@pengutronix.de> References: <20210815033248.98111-1-mailhol.vincent@wanadoo.fr> <20210815033248.98111-6-mailhol.vincent@wanadoo.fr> <20210817195551.wwgu7dnhb6qyvo7n@pengutronix.de> <20210818081934.6f23ghoom2dkv53m@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3r4tcmh4k4j2lcbt" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --3r4tcmh4k4j2lcbt Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 18.08.2021 17:37:17, Vincent MAILHOL wrote: > > It's not a race. Consider this command: > > > > | ip up tdc-mode manual tdco 111 tdcv 33 # 111 is out of range, 33 is = valid > > > > tdcv is checked first and valid, then it's assigned to the priv->tdc. > > tdco is checked second and invalid, then can_tdc_changelink() returns -= EINVAL. > > > > tdc ends up being half set :( > > > > So the setting of tdc is inconsistent and when you do a "ip down" "ip > > up" then it results in a tdco=3D0 tdcv=3D33 mode=3Dmanual. >=20 > My bad. Now I understand the issue. > I was confused because tdco=3D111 is in the valid range of my driver... :D > I will squash your patch. >=20 > Actually, I think that there is one more thing which needs to be > fixed: If can_tdc_changelink() fails (e.g. value out of range), > the CAN_CTRLMODE_TDC_AUTO or CAN_CTRLMODE_TDC_MANUAL would still > be set, meaning that can_tdc_is_enabled() would return true. So I > will add a "fail" branch to clear the flags. Ok. regard, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --3r4tcmh4k4j2lcbt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmEcyB0ACgkQqclaivrt 76kHAwgAm3PmoaSEpiGOXV7SOe2m3Km3x1QNacwkyJQNM15E7ciWzSbAzVwzS/bJ YRVEp4iEF1Ez3mqt9YbtIA+YxhEoFihyVLeUtRLaEkdei0b/kOWq+fLkOM96K5Ne g2LG5jhCBiVsbIOUOq992DI1bvfYsQmQK7k8hqoDwsQNPJ80lGz25vtCNBfbPA+y GJH+waf5Y1QoX32rejo9oCFhObhn9nZxedwbRKCMR2Q/huShoLNFTtz7f0ItOIIk Yjcsqca/CXMr8Sf/LZ+IjKa8jTZNOv/S76ZxiR9aMy3lx1XrMOUmAIWECeUHjayL K0pFwH2G04ORKlTEa4NwrJdfvCWp9Q== =SLOE -----END PGP SIGNATURE----- --3r4tcmh4k4j2lcbt--