Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp488034imn; Wed, 27 Jul 2022 11:35:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uwHKX/4CKP4cH1u5dQkLJioVq923Kswi0DSDE1d8AskQWyArodvp/f9Z0BRxzyov261js6 X-Received: by 2002:a17:907:7286:b0:72e:f9c1:8068 with SMTP id dt6-20020a170907728600b0072ef9c18068mr19055810ejc.39.1658946910643; Wed, 27 Jul 2022 11:35:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658946910; cv=none; d=google.com; s=arc-20160816; b=JJzogbIaWywOlNfc6c8kbIghUCxQc9fLX82BY4rtOpdELDzbdDE8/Nu1gjiqvluD2j QUFE15lyhSJUGwPM0HYnTCOONv8AvvA/uL7sfBcsC8mQ1+9g5z/rwcC81sjNKf9pIwV1 yIzPZIlAcQGjhEsMoSQA4EGm0P+jTO0Emw+YW8cx5XN1TO/fI38iA68C5MWAFhGbHwKw k7B8llaLbeDvNci5gdpiT5B9uJQotFKwxWsyQQnC9XSM2dhFqHibofLIPSKO/BTtcrO1 TD2gYwto1Gru5BoA+yI6AQNcBgdtigFfgQP5CKM2XQF2zMZPr4VFmVqGOhh1YhWOSwoS TK1Q== 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:subject:cc:to:from:date; bh=gyBAfyfFWdWba4ML1mkE5qLrimYun07jYDv3vITt/Hk=; b=TkojRW5qsGpRB/nYZHxwXbmVmjApEMSZ8KUOoDUq56nrz8Kk/0C0USzec5C4ROqUFq YJnPUuZmdGAPua05DviwuKI9l9RnzXnOvdnX7+MXbWTYRz8Lne2lw3eXKscfIG9j18zB 02oNmSk3EYF43C4mK3bp8N3QieZuVWn8icnMJo7XoD5gIbmnzFXQABSzAIwiTA4vzFsA GU7jmcJlgIRcBP1avWeDYdW2decdsXCw28LXVDNeaxccxLcsVa7lQrBNs14KKYhBl57r NoVEDJBbOTLxUgga54VY2zDv641MHHYeUS+kHyYjGvWEuGphBYQW0qTRsB4Ty2b6oo0I +PuA== ARC-Authentication-Results: i=1; mx.google.com; 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 i16-20020a1709064fd000b0072b4ad153dasi17819779ejw.635.2022.07.27.11.34.45; Wed, 27 Jul 2022 11:35:10 -0700 (PDT) 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; 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 S241039AbiG0Saz (ORCPT + 99 others); Wed, 27 Jul 2022 14:30:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239763AbiG0Sai (ORCPT ); Wed, 27 Jul 2022 14:30:38 -0400 X-Greylist: delayed 1154 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 27 Jul 2022 10:28:47 PDT Received: from mail.enpas.org (zhong.enpas.org [IPv6:2a03:4000:2:537::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BA0CC107291; Wed, 27 Jul 2022 10:28:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail.enpas.org (Postfix) with ESMTPSA id 6E70CFFCE8; Wed, 27 Jul 2022 17:28:46 +0000 (UTC) Date: Wed, 27 Jul 2022 19:28:39 +0200 From: Max Staudt To: Marc Kleine-Budde , Dario Binacchi Cc: linux-kernel@vger.kernel.org, linux-can@vger.kernel.org, Oliver Hartkopp , michael@amarulasolutions.com, Amarula patchwork , Jeroen Hofstee , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Wolfgang Grandegger , netdev@vger.kernel.org Subject: Re: [RFC PATCH v3 8/9] can: slcan: add support to set bit time register (btr) Message-ID: <20220727192839.707a3453.max@enpas.org> In-Reply-To: <20220727113054.ffcckzlcipcxer2c@pengutronix.de> References: <20220726210217.3368497-1-dario.binacchi@amarulasolutions.com> <20220726210217.3368497-9-dario.binacchi@amarulasolutions.com> <20220727113054.ffcckzlcipcxer2c@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 On Wed, 27 Jul 2022 13:30:54 +0200 Marc Kleine-Budde wrote: > As far as I understand, setting the btr is an alternative way to set the > bitrate, right? I don't like the idea of poking arbitrary values into a > hardware from user space. I agree with Marc here. This is a modification across the whole stack, specific to a single device, when there are ways around. If I understand correctly, the CAN232 "S" command sets one of the fixed bitrates, whereas "s" sets the two BTR registers. Now the question is, what do BTR0/BTR1 mean, and what are they? If they are merely a divider in a CAN controller's master clock, like in ELM327, then you could a) Calculate the BTR values from the bitrate userspace requests, or b) pre-calculate a huge table of possible bitrates and present them all to userspace. Sounds horrible, but that's what I did in can327, haha. Maybe I should have reigned them in a little, to the most useful values. c) just limit the bitrates to whatever seems most useful (like the "S" command's table), and let users complain if they really need something else. In the meantime, they are still free to slcand or minicom to their heart's content before attaching slcan, thanks to your backwards compatibility efforts. In short, to me, this isn't a deal breaker for your patch series. Max