Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3786908iog; Tue, 28 Jun 2022 02:47:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tdJu/BFlPkVgtQJB2MT9+Ss3eBN/GSsrgBGLnqSKPyRpl6ry3R3ojJXr5/lsAwWNc7V2IY X-Received: by 2002:a17:90b:3e85:b0:1ed:5a12:513c with SMTP id rj5-20020a17090b3e8500b001ed5a12513cmr14294153pjb.64.1656409661049; Tue, 28 Jun 2022 02:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656409661; cv=none; d=google.com; s=arc-20160816; b=qSXrGv7kqSWy/Ttu68IhyOmN6glKXcEIAOFPgeJ9FbcyiDJktYxaGXBcvfeAcQgnpp zIfmlDEpk4QwybLlPp9VwQcVSio/l6r91P3lPVjSFm0LZSRSyygD5/ycSDe5+puGL8Fu 8K5fxOXSQEgUlTsdQ7RpbNGFreu2yUF5wLgTtNgYwZqx96N5kyiB55liFvQ219PJlYhS Swme7kVgm8Tb0ya7mpmgPF18k0OdRs57PSy0oCDb2fw9CGXXJKeSXPfTgWR8IjxxKERg LG9wIzlV4edBsnZ83ua+EadHk5smfcpbWaROJrCacTnLUcuQER9oX7VmrtlNUw51Yrds RihQ== 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=809Pitd33XKKnnifwar4WAx2DWPWNuE6Ly2jbFMeVvA=; b=Zj4t5Y4F0yfpXn5BK2BaljboqxRP8W3cI0UhUJG1p7b947XhKIuNUeaVcuK2Oo0aP4 F4BKe8gxLUhMqyBL1KnXiQXd6kGzkgDLm0UAKqZd/9G6OG3+IdOJGXDnKIDN2wiHexd3 6BapOsWKynlOY5aI28O8aW5O+VwS+zQI1NsgeMV1XTK7GUnapopT/o+YtGozjnMn9t8W c9CXEAL1RTWy0XKZi2FL0oikssrj1mCR71zMPWk95u6GTCrG7MNGGNug2F4LohdVtfO6 xDneB1vQMbBxQ6cUR6CKWe/dzE6a4JuHheubxQwocDcGRc6qKanPj7Z+sG14slqRtCfw kOkw== 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 e64-20020a636943000000b0040d1fc1bbdcsi18422218pgc.478.2022.06.28.02.47.27; Tue, 28 Jun 2022 02:47:41 -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 S1344197AbiF1J2v (ORCPT + 99 others); Tue, 28 Jun 2022 05:28:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235563AbiF1J2u (ORCPT ); Tue, 28 Jun 2022 05:28:50 -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 4F2831D0CD for ; Tue, 28 Jun 2022 02:28:49 -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 1o67WQ-0008WT-IG; Tue, 28 Jun 2022 11:28:38 +0200 Received: from pengutronix.de (unknown [IPv6:2a01:4f8:1c1c:29e9:22:41ff:fe00:1400]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) 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 28BFBA0DA1; Tue, 28 Jun 2022 09:28:34 +0000 (UTC) Date: Tue, 28 Jun 2022 11:28:33 +0200 From: Marc Kleine-Budde To: Dario Binacchi Cc: linux-kernel@vger.kernel.org, Amarula patchwork , Oliver Hartkopp , michael@amarulasolutions.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Wolfgang Grandegger , linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v4 05/12] can: slcan: use CAN network device driver API Message-ID: <20220628092833.uo66jbnwhh5af6je@pengutronix.de> References: <20220614122821.3646071-1-dario.binacchi@amarulasolutions.com> <20220614122821.3646071-6-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4o7tiudpedbts5sa" Content-Disposition: inline In-Reply-To: <20220614122821.3646071-6-dario.binacchi@amarulasolutions.com> 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 --4o7tiudpedbts5sa Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 14.06.2022 14:28:14, Dario Binacchi wrote: > As suggested by commit [1], now the driver uses the functions and the > data structures provided by the CAN network device driver interface. >=20 > Currently the driver doesn't implement a way to set bitrate for SLCAN > based devices via ip tool, so you'll have to do this by slcand or > slcan_attach invocation through the -sX parameter: >=20 > - slcan_attach -f -s6 -o /dev/ttyACM0 > - slcand -f -s8 -o /dev/ttyUSB0 >=20 > where -s6 in will set adapter's bitrate to 500 Kbit/s and -s8 to > 1Mbit/s. > See the table below for further CAN bitrates: > - s0 -> 10 Kbit/s > - s1 -> 20 Kbit/s > - s2 -> 50 Kbit/s > - s3 -> 100 Kbit/s > - s4 -> 125 Kbit/s > - s5 -> 250 Kbit/s > - s6 -> 500 Kbit/s > - s7 -> 800 Kbit/s > - s8 -> 1000 Kbit/s >=20 > In doing so, the struct can_priv::bittiming.bitrate of the driver is not > set and since the open_candev() checks that the bitrate has been set, it > must be a non-zero value, the bitrate is set to a fake value (-1U) > before it is called. >=20 > The patch also changes the slcan_devs locking from rtnl to spin_lock. The > change was tested with a kernel with the CONFIG_PROVE_LOCKING option > enabled that did not show any errors. You're not allowed to call alloc_candev() with a spin_lock held. See today's kernel test robot mail: | https://lore.kernel.org/all/YrpqO5jepAvv4zkf@xsang-OptiPlex-9020 I think it's best to keep the rtnl for now. regards, 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 | --4o7tiudpedbts5sa Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmK6ybwACgkQrX5LkNig 010qdggAtdxAjabFrihePEFNk9ZUDi7eeXLiuqtrrmU2gUg88nVIvrbice7mjMcO m7kFYlSE8iD8nE508gzdgdSDA6s8kav24uKnjjYh9DYkXoaQH5f4JaItkFoK5EDh uIru50LF4l4Pb3uqOVy5UEYFkZ21g54M7xPEJ8k0Uz8VrKT2IzLPZX3q8H/getGJ Oz+yOwtHnGJO473wXNjjaFMcYoycxTlDHVAk0SaL4Czy4p49PEAWcusXuFtgXthH GEQieOTLS4UkLVpM3a93aQUa7PNe4Awv1+SG6HfAmltIrj6/iB0vey9puFbcOi5p kIGRsHHQXrCaxK0tRC75zdxGabkf2A== =02Mr -----END PGP SIGNATURE----- --4o7tiudpedbts5sa--