Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2391432rdb; Wed, 21 Feb 2024 06:24:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWfvTvQFP1+MPoC+tpM9zFupDg1R92EAnrnvMXX12+GuwTlqSSYB57RTHBMZBuNwzWWy44VvggEXP8HvuXhbLDlaMWzK/2Neiu692j0hw== X-Google-Smtp-Source: AGHT+IHjBiPlmDVCEq427MnfdQ1PK39neo/9RxUzuT/YLlGLhwhEA16G0bvzxu3sa2v58Q/GllnM X-Received: by 2002:aa7:c387:0:b0:565:1272:2936 with SMTP id k7-20020aa7c387000000b0056512722936mr575461edq.18.1708525476270; Wed, 21 Feb 2024 06:24:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708525476; cv=pass; d=google.com; s=arc-20160816; b=aUWJbzhu/Tn5nzu+uq7t3A+FgJlWETZxY6gQZ+nVFBXwcroKBvIzzyExWuCqm7cYAS 0NTPbDqeouSV+YYjXI05NJzi3qzU99XuzoUEwFHAiU5nMNTvoXZ4dsxmrBryaWndd0Ks 0DFlJTy+gWt9uQ9VttoEGfh3uXogca3fomMqUNES3d90TWBQZP+uQTnD45CwtE9ei37s bGLv8IglndDOuw+XXXXQrc2hXoXj9xgR3uBpXpGgn8ASX8Ct3LyyE4C+aRjc9YlPcTAG 8MntHldb2rZL0ZPs/PTeJrT37VrATQPunTjq9zkZ4IdmzW26+dTtlVAmgUDY6Utk06yi tZCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=WxaLr/olRy1Lrj8CgoWrKHAG8ikb6as6inMsU3UgNAo=; fh=WAQUMxCk1lb6FfCDEcUYYkt5gBjmn3d4chiXG9fDvHU=; b=zNn3uBIkPskLDDna9LEH1PhBUUlkz/98v6BAGHgAVF2gs9xnd35Nbv6jd2wycEc5J0 YC5sn3bqWMgcYFIPMmoIbE+HZdF59kzPhZGGXSgX7FwQKKn/vL1SBZ5vrCjcb8iKbzS0 wwUTyk+ttn2skWojlckpavE0K3e8fpg4XKsRLr79LXPPbThu/BzWT5x0ETBK4a1j0ixJ SZiJCD+tC0FYiRs/MqnJTxrNKstDCxiKQVn8kKzebdwS/Km3Dt+55B1oh64M/ZCW9Ha6 ytvkfBsfWJfhaNSGlAfPbCO+8mPPfquxFj/LFQLyNInJO5vyidbPQacpRjxxpsCakS05 bJKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-74885-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74885-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m20-20020a50d7d4000000b0056178b386cesi4599881edj.0.2024.02.21.06.24.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 06:24:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74885-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-74885-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74885-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0B2121F234F5 for ; Wed, 21 Feb 2024 14:24:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 922777BB03; Wed, 21 Feb 2024 14:24:31 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18B1669E00 for ; Wed, 21 Feb 2024 14:24:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708525471; cv=none; b=iAF6w7juul4+XYXZv6C1mxRpajs9LUes+paJHnGAzEw23vWSFZ/MTelMyMU0aJQn7YZwI5tt/ME0KBK2Fep4tyDM8wpGfMNiFK9fPSFwP+U8DfncX/IC258cMtzavi9J7tqgPY2PjCTJVjCJEVh3cf+s8YD+4D41BL9Qe2BkvqM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708525471; c=relaxed/simple; bh=MSnOGaCDM31EFc3ia7dnG7DavW3wwAsIGBdVyjSyggQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Gq6SylcyjpMUu0TWkNlDh53x/jwo5uErRYM801wDybvbJk2HD0sKgsmh+0ioE9/IrDVJF5eozMsOYKrdZ4r5sQ/78Pw1LtJL/leT1LcoqAFWNz5qJ5WESUb7TgdJi0nMorhjggW8dDhu3hsmUqKLNLRTfwhla8fWFgqxUehwLTs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rcnWL-0004zf-Tl; Wed, 21 Feb 2024 15:24:25 +0100 Received: from [2a0a:edc0:0:b01:1d::7b] (helo=bjornoya.blackshift.org) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcnWL-0023cE-AD; Wed, 21 Feb 2024 15:24:25 +0100 Received: from pengutronix.de (unknown [172.20.34.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) 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 EC589294BAD; Wed, 21 Feb 2024 14:24:24 +0000 (UTC) Date: Wed, 21 Feb 2024 15:24:24 +0100 From: Marc Kleine-Budde To: Oliver Hartkopp Cc: Vincent MAILHOL , Maxime Jayat , Wolfgang Grandegger , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] can: netlink: Fix TDCO calculation using the old data bittiming Message-ID: <20240221-garden-petted-789304a1b1a5-mkl@pengutronix.de> References: <40579c18-63c0-43a4-8d4c-f3a6c1c0b417@munic.io> <54afa5e8-fb5e-4d90-8897-8f3c5a684418@hartkopp.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="inlfg5asntdkuyns" Content-Disposition: inline In-Reply-To: <54afa5e8-fb5e-4d90-8897-8f3c5a684418@hartkopp.net> X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org --inlfg5asntdkuyns Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 21.02.2024 15:14:02, Oliver Hartkopp wrote: > I have an old PCAN USB adapter (Classical CAN) which uses the pcan_usb > driver and wanted to set a 50kbit/s bitrate: >=20 > ip link set can0 up txqueuelen 500 type can bitrate 50000 sjw 4 >=20 > First it complained about the SJW having a higher value than some phase-s= eg > value which was 2. >=20 > Error: sjw: 4 greater than phase-seg2: 2. >=20 > I always thought the driver automatically adapts the SJW value to the > highest possible and SJW=3D4 could always be set. Did this change at a ce= rtain > point? Yes, that changed with b5a3d0864ee7 ("can: bittiming: can_sjw_check(): check that SJW is not longer than either Phase Buffer Segment") See discussion in https://lore.kernel.org/all/20220907103845.3929288-3-mkl@= pengutronix.de/ > Anyway, then I reduced the given SJW value and the ip command did not give > any error message. >=20 > But finally there was not CAN traffic possible with my "always working > setup". >=20 > I'm running 6.8.0-rc4-00433-g92a355464776 from Linus' tree. >=20 > Reverting this patch fixed my issue. But what has the tdco calculation to do with non CAN-FD controllers? Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung N=C3=BCrnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | --inlfg5asntdkuyns Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEUEC6huC2BN0pvD5fKDiiPnotvG8FAmXWB5UACgkQKDiiPnot vG8Sogf9GDTH+r+dpvL4+IwbOEdFwI4awCIUJ/mrGD+zql/rNCPxYWz6liDuKOJk DnXqOSuPPBoDorLLWf58H/1pgwCu4Lo+TaJ9x1igrKpt0lFxBJ7a7FO0tcjFeE2N jjlSukRzehY2Iqo4oL+y3ZdwQoeqFFCj/dNVISpZWDGDA3YieAyVQ2lsbd6TJVb1 Ft5eKJzNNNfuh+8uGkPQ0j9QYu7ptyTZorAKiZy5ucJYl+sRd22vXU2crIIByBtK YuRclqXEm1aG45kQmNZB9tJsnXxFZHcFXdhnmxtrwpi23S67Fbk0DPPW0+U5mpW3 6g/I9/+HvqmGm5L1CKz+3PKQ7Wjt3g== =7CLS -----END PGP SIGNATURE----- --inlfg5asntdkuyns--