| Message ID | 20220607094752.1029295-1-dario.binacchi@amarulasolutions.com |
|---|---|
| Headers |
Return-Path: <linux-amarula+bncBCQ4XFG47UFRBWV57SKAMGQE4KX5MBQ@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 996F33F08A for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 7 Jun 2022 11:48:11 +0200 (CEST) Received: by mail-wr1-f72.google.com with SMTP id w8-20020adfde88000000b00213b7fa3a37sf2928066wrl.2 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 07 Jun 2022 02:48:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654595291; cv=pass; d=google.com; s=arc-20160816; b=WQydeajqIKtZHINyrZ3EI7NVyYOOzy+XW+mnVQ88cpTKayoJzf24/nN0fAPC2X7H2s gYoRQTUNfFJ7bhOpm/EWQrjb7QHWEYq/NCy5VJS/N4xwJ8zP41N0chwbks49zvu3Albk ozZGYRxbJH7infGEhJmqyDV9chzX4BFyh4gD+Lr1WdAHJ8OxPDNVUJKaBoUXUHEqNZRz hGXJEgOJujdqTE6jly+ki9D/AgZlnXZt+c1I5qvyDbrE1olcigSNXwU+d/l2EIwdIcrs HvnlPxLfUMvm6Ydix7wfSx9wV7wheq7VBWOjJf7o8m3TMB3x5DT6F74Lz/MI58MALn+N MLtA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=OZNOIeTq6ioSjLnWYIJht3DIqKd86hxF4te6cmHG2Z8=; b=V4uAnBj+ZENRC+/E7skcsqus6MR0+rTX5QmGE9ZqqXoaao7bdchoho6d38VolVaFp3 HB3irFV0nFkQQJM/gCXGTF+VbIfkyapzrFF4buZdm10DTrmN8KALfLc9tvXEYB1Qnk5k vIiHYCvjTWLdnLBH6MKC5X/Y+g4EL+E18u0SClqUcNEC787tN7aI3yM6HV9lJDsUkHgH i1oAsaWnW5DCZnZ47svKImZGtMlQIK2wATF19kFcWcAmXNoY4riVQWswPUj1Bwzt9bzD bfyXyQ/m9hl3UAK9H5/H4VtxYHIvlIc9rDQiH4h1IkVDhcRaU2n73AAysqR4J0t1g8jM bd5A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jDESy8of; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=OZNOIeTq6ioSjLnWYIJht3DIqKd86hxF4te6cmHG2Z8=; b=qokyduRvwkyWn3jmr6GSyLHAjX4X8+lV7a0Qzy0RuLeJexOE7W6ZX0xgc0a4lWkQZ4 qiZE5QDIYjxd0cCsebyR/oL7RmMN1vXu7uzfsKG0/C5dkKloYnR2gC2W78HV48LtYyd5 75GT9YdbLq0K07nOOyvKQgk6Z5UbZFdPwhk0Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=OZNOIeTq6ioSjLnWYIJht3DIqKd86hxF4te6cmHG2Z8=; b=TGxJwqE3sLXDRTttYzQPIsOHbDnuyw+lYaAD5f8Z6THhlBEN3NZPC8FZp/pJCcVHFJ 2ID7Xb4vMFMcIR4Trpe5kJm2F0+ihDxfx2jfjNCv3rftnPhv7L6l2i0ygioetNf5ALJv lGytnwsn196imFUVpt4QyLL2qryJ9bY1/F5B1YZhyreFnhWE/mhGFddAygjHDoYYpetH 788579yhbpziv32/irgtAjU5lZk991dqecl8ERpYWiCJtnxPv8vbRSaOqoqCkHGin0S0 tWrlGF4FLVcl4TwnpK43DiFNPVatFT1qEd6/5Em2OY5oQ/CWjSZupVYgbGWzd/Yxx02u M8rw== X-Gm-Message-State: AOAM533nqD+YuFiwUz7iH0UN+3Hhg4YwSS7d6SKm0Bk7l2MVFVGJqCb1 f3YlemHKuM9ZCfe3EcCTYpsCM+rA X-Google-Smtp-Source: ABdhPJy08elbYVDrGUpwSfVwLg5rQ6HEywRGSGzXqBxEA4bbvORoBgf/ygTmWnmzdZ024oY3kazl0w== X-Received: by 2002:a1c:29c3:0:b0:350:9797:b38f with SMTP id p186-20020a1c29c3000000b003509797b38fmr57383202wmp.22.1654595291064; Tue, 07 Jun 2022 02:48:11 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:1c8f:b0:397:380f:f614 with SMTP id k15-20020a05600c1c8f00b00397380ff614ls5111460wms.3.gmail; Tue, 07 Jun 2022 02:48:10 -0700 (PDT) X-Received: by 2002:a05:600c:2244:b0:39c:4060:1ec9 with SMTP id a4-20020a05600c224400b0039c40601ec9mr20832945wmm.147.1654595289954; Tue, 07 Jun 2022 02:48:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654595289; cv=none; d=google.com; s=arc-20160816; b=bKHPHXAFE5o3HAvF838slG6LLVso5f+qwx4If+LBGjgNAJyVK6qune7T7OP0wy8EZu NbqF/mm3TDyo0xGk8dceIJJx34ITPfaXxEXJDW2AAijm0vHGwuav09NC5qeralstqcFf Jt/gJfYKxfidE6ehsnLUtNQqk8iDin6fbazmpCoXhssTYL01c1RZDuFFNL5R4t5JINHa ezM784jMy1EYRgtBeT+PR/TmVArV7FEYS3w7/e5y5LcGNQhQmZxA8ydfjYZgqQrkT15L BJyNfH1oBVhM/kOjktVEz3rdGXg0Z0g7t8deUAKZl97rRNezhgm/GVrtVhUu5xMOsTeM uHpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=59RavXyEta5t8sr+YdZ4nWyDRUr5ofB/YBoSuRW6FK4=; b=qdVyuc63MpEDaDzULG4fjjuho4EAtkP/cK0b2JY+tJSUCYGaRwuFCb/PIRUzZ0nxQY +T4cPzN49lg4a0NtepbNyj6/7uARuWOl5pc9ydI2IKERVVqqWG1FnX4mHFOfHX+XWKKb mcHjcAgMeIdreAN6sssWAVR5dJ0H/s16jLpa6hq+5Yyh3oGBv+J7Z4sr51pLIBKKifGa GL/w7K4oT33mjblZi6c0CKbfRIITyUC91tTTN6PQPSiQ3u1M8Ywoz3pTHJ1i65zsEZXe 3i4Eiyin2F+km5a97u8GcOIUvKtkhp4DEojUWwVw/jvFreCoEx1jxhLxd5lqVTQ6fV/G oqHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jDESy8of; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id bd7-20020a05600c1f0700b0039c4a2cf724sor2126860wmb.29.2022.06.07.02.48.09 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Tue, 07 Jun 2022 02:48:09 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:600c:2d88:b0:39c:3c07:2845 with SMTP id i8-20020a05600c2d8800b0039c3c072845mr23473258wmg.116.1654595289674; Tue, 07 Jun 2022 02:48:09 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.pdxnet.pdxeng.ch (mob-5-90-137-51.net.vodafone.it. [5.90.137.51]) by smtp.gmail.com with ESMTPSA id o4-20020a05600c510400b0039748be12dbsm23200547wms.47.2022.06.07.02.48.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 02:48:09 -0700 (PDT) From: Dario Binacchi <dario.binacchi@amarulasolutions.com> To: linux-kernel@vger.kernel.org Cc: Amarula patchwork <linux-amarula@amarulasolutions.com>, michael@amarulasolutions.com, Dario Binacchi <dario.binacchi@amarulasolutions.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jakub Kicinski <kuba@kernel.org>, Jiri Slaby <jirislaby@kernel.org>, Marc Kleine-Budde <mkl@pengutronix.de>, Paolo Abeni <pabeni@redhat.com>, Sebastian Andrzej Siewior <bigeasy@linutronix.de>, Vincent Mailhol <mailhol.vincent@wanadoo.fr>, Wolfgang Grandegger <wg@grandegger.com>, linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: [RFC PATCH 00/13] can: slcan: extend supported features Date: Tue, 7 Jun 2022 11:47:39 +0200 Message-Id: <20220607094752.1029295-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jDESy8of; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
can: slcan: extend supported features
|
|
Message
Dario Binacchi
June 7, 2022, 9:47 a.m. UTC
This series originated as a result of CAN communication tests for an
application using the USBtin adapter (https://www.fischl.de/usbtin/).
The tests showed some errors but for the driver everything was ok.
Also, being the first time I used the slcan driver, I was amazed that
it was not possible to configure the bitrate via the ip tool.
For these two reasons, I started looking at the driver code and realized
that it didn't use the CAN network device driver interface.
Starting from these assumptions, I tried to:
- Use the CAN network device driver interface.
- Set the bitrate via the ip tool.
- Send the open/close command to the adapter from the driver.
- Add ethtool support to reset the adapter errors.
- Extend the protocol to forward the adapter CAN communication
errors and the CAN state changes to the netdev upper layers.
Except for the protocol extension patches (i. e. forward the adapter CAN
communication errors and the CAN state changes to the netdev upper
layers), the whole series has been tested. Testing the extension
protocol patches requires updating the adapter firmware. Before modifying
the firmware I think it makes sense to know if these extensions can be
considered useful.
Before applying the series I used these commands:
slcan_attach -f -s6 -o /dev/ttyACM0
slcand ttyACM0 can0
ip link set can0 up
After applying the series I am using these commands:
slcan_attach /dev/ttyACM0
slcand ttyACM0 can0
ip link set dev can0 down
ip link set can0 type can bitrate 500000
ethtool --set-priv-flags can0 err-rst-on-open on
ip link set dev can0 up
Now there is a clearer separation between serial line and CAN,
but above all, it is possible to use the ip and ethtool commands
as it happens for any CAN device driver. The changes are backward
compatible, you can continue to use the slcand and slcan_attach
command options.
Dario Binacchi (13):
can: slcan: use the BIT() helper
can: slcan: use netdev helpers to print out messages
can: slcan: use the alloc_can_skb() helper
can: slcan: use CAN network device driver API
can: slcan: simplify the device de-allocation
can: slcan: allow to send commands to the adapter
can: slcan: set bitrate by CAN device driver API
can: slcan: send the open command to the adapter
can: slcan: send the close command to the adapter
can: slcan: move driver into separate sub directory
can: slcan: add ethtool support to reset adapter errors
can: slcan: extend the protocol with error info
can: slcan: extend the protocol with CAN state info
drivers/net/can/Makefile | 2 +-
drivers/net/can/slcan/Makefile | 7 +
.../net/can/{slcan.c => slcan/slcan-core.c} | 464 +++++++++++++++---
drivers/net/can/slcan/slcan-ethtool.c | 65 +++
drivers/net/can/slcan/slcan.h | 18 +
5 files changed, 480 insertions(+), 76 deletions(-)
create mode 100644 drivers/net/can/slcan/Makefile
rename drivers/net/can/{slcan.c => slcan/slcan-core.c} (67%)
create mode 100644 drivers/net/can/slcan/slcan-ethtool.c
create mode 100644 drivers/net/can/slcan/slcan.h
Comments
On Tue. 7 juin 2022 at 18:47, Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote: > This series originated as a result of CAN communication tests for an > application using the USBtin adapter (https://www.fischl.de/usbtin/). > The tests showed some errors but for the driver everything was ok. > Also, being the first time I used the slcan driver, I was amazed that > it was not possible to configure the bitrate via the ip tool. > For these two reasons, I started looking at the driver code and realized > that it didn't use the CAN network device driver interface. That's funny! Yesterday, I sent this comment: https://lore.kernel.org/linux-can/CAMZ6RqKZwC_OKcgH+WPacY6kbNbj4xR2Gdg2NQtm5Ka5Hfw79A@mail.gmail.com/ And today, you send a full series to remove all the dust from the slcan driver. Do I have some kind of mystical power to summon people on the mailing list? > Starting from these assumptions, I tried to: > - Use the CAN network device driver interface. In order to use the CAN network device driver, a.k.a. can-dev module, drivers/net/can/Kbuild has to be adjusted: move slcan inside CAN_DEV scope. @Mark: because I will have to send a new version for my can-dev/Kbuild cleanup, maybe I can take that change and add it to my series? > - Set the bitrate via the ip tool. > - Send the open/close command to the adapter from the driver. > - Add ethtool support to reset the adapter errors. > - Extend the protocol to forward the adapter CAN communication > errors and the CAN state changes to the netdev upper layers. > > Except for the protocol extension patches (i. e. forward the adapter CAN > communication errors and the CAN state changes to the netdev upper > layers), the whole series has been tested. Testing the extension > protocol patches requires updating the adapter firmware. Before modifying > the firmware I think it makes sense to know if these extensions can be > considered useful. > > Before applying the series I used these commands: > > slcan_attach -f -s6 -o /dev/ttyACM0 > slcand ttyACM0 can0 > ip link set can0 up > > After applying the series I am using these commands: > > slcan_attach /dev/ttyACM0 > slcand ttyACM0 can0 > ip link set dev can0 down > ip link set can0 type can bitrate 500000 > ethtool --set-priv-flags can0 err-rst-on-open on > ip link set dev can0 up > > Now there is a clearer separation between serial line and CAN, > but above all, it is possible to use the ip and ethtool commands > as it happens for any CAN device driver. The changes are backward > compatible, you can continue to use the slcand and slcan_attach > command options. > > > > Dario Binacchi (13): > can: slcan: use the BIT() helper > can: slcan: use netdev helpers to print out messages > can: slcan: use the alloc_can_skb() helper > can: slcan: use CAN network device driver API > can: slcan: simplify the device de-allocation > can: slcan: allow to send commands to the adapter > can: slcan: set bitrate by CAN device driver API > can: slcan: send the open command to the adapter > can: slcan: send the close command to the adapter > can: slcan: move driver into separate sub directory > can: slcan: add ethtool support to reset adapter errors > can: slcan: extend the protocol with error info > can: slcan: extend the protocol with CAN state info > > drivers/net/can/Makefile | 2 +- > drivers/net/can/slcan/Makefile | 7 + > .../net/can/{slcan.c => slcan/slcan-core.c} | 464 +++++++++++++++--- > drivers/net/can/slcan/slcan-ethtool.c | 65 +++ > drivers/net/can/slcan/slcan.h | 18 + > 5 files changed, 480 insertions(+), 76 deletions(-) > create mode 100644 drivers/net/can/slcan/Makefile > rename drivers/net/can/{slcan.c => slcan/slcan-core.c} (67%) > create mode 100644 drivers/net/can/slcan/slcan-ethtool.c > create mode 100644 drivers/net/can/slcan/slcan.h
On 07.06.2022 19:27:05, Vincent MAILHOL wrote: > On Tue. 7 juin 2022 at 18:47, Dario Binacchi > <dario.binacchi@amarulasolutions.com> wrote: > > This series originated as a result of CAN communication tests for an > > application using the USBtin adapter (https://www.fischl.de/usbtin/). > > The tests showed some errors but for the driver everything was ok. > > Also, being the first time I used the slcan driver, I was amazed that > > it was not possible to configure the bitrate via the ip tool. > > For these two reasons, I started looking at the driver code and realized > > that it didn't use the CAN network device driver interface. > > That's funny! Yesterday, I sent this comment: > https://lore.kernel.org/linux-can/CAMZ6RqKZwC_OKcgH+WPacY6kbNbj4xR2Gdg2NQtm5Ka5Hfw79A@mail.gmail.com/ > > And today, you send a full series to remove all the dust from the > slcan driver. Do I have some kind of mystical power to summon people > on the mailing list? That would be very useful and awesome super power, I'm a bit jealous. :D > > Starting from these assumptions, I tried to: > > - Use the CAN network device driver interface. > > In order to use the CAN network device driver, a.k.a. can-dev module, > drivers/net/can/Kbuild has to be adjusted: move slcan inside CAN_DEV > scope. > > @Mark: because I will have to send a new version for my can-dev/Kbuild > cleanup, maybe I can take that change and add it to my series? Let's get the your Kconfig/Makefile changes into can-next/master first. Then Dario can then base this series on that branch. regards, Marc
+CC: Max Staudt <max@enpas.org> On Tue. 7 Jun. 2022 at 18:47, Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote: > This series originated as a result of CAN communication tests for an > application using the USBtin adapter (https://www.fischl.de/usbtin/). > The tests showed some errors but for the driver everything was ok. > Also, being the first time I used the slcan driver, I was amazed that > it was not possible to configure the bitrate via the ip tool. > For these two reasons, I started looking at the driver code and realized > that it didn't use the CAN network device driver interface. > > Starting from these assumptions, I tried to: > - Use the CAN network device driver interface. > - Set the bitrate via the ip tool. > - Send the open/close command to the adapter from the driver. > - Add ethtool support to reset the adapter errors. > - Extend the protocol to forward the adapter CAN communication > errors and the CAN state changes to the netdev upper layers. > > Except for the protocol extension patches (i. e. forward the adapter CAN > communication errors and the CAN state changes to the netdev upper > layers), the whole series has been tested. Testing the extension > protocol patches requires updating the adapter firmware. Before modifying > the firmware I think it makes sense to know if these extensions can be > considered useful. > > Before applying the series I used these commands: > > slcan_attach -f -s6 -o /dev/ttyACM0 > slcand ttyACM0 can0 > ip link set can0 up > > After applying the series I am using these commands: > > slcan_attach /dev/ttyACM0 > slcand ttyACM0 can0 > ip link set dev can0 down > ip link set can0 type can bitrate 500000 > ethtool --set-priv-flags can0 err-rst-on-open on > ip link set dev can0 up In his CAN327 driver, Max manages to bring the can0 device without the need of dedicated user space daemon by using line discipline (ldattach): https://lore.kernel.org/linux-can/20220602213544.68273-1-max@enpas.org/ Isn't the same feasible with slcan so that we completely remove the dependency toward slcand? Max what do you think of this? > Now there is a clearer separation between serial line and CAN, > but above all, it is possible to use the ip and ethtool commands > as it happens for any CAN device driver. The changes are backward > compatible, you can continue to use the slcand and slcan_attach > command options. Yours sincerely, Vincent Mailhol
On Tue. 7 Jun 2022 at 19:39, Marc Kleine-Budde <mkl@pengutronix.de> wrote: > On 07.06.2022 19:27:05, Vincent MAILHOL wrote: > > On Tue. 7 juin 2022 at 18:47, Dario Binacchi > > <dario.binacchi@amarulasolutions.com> wrote: > > > This series originated as a result of CAN communication tests for an > > > application using the USBtin adapter (https://www.fischl.de/usbtin/). > > > The tests showed some errors but for the driver everything was ok. > > > Also, being the first time I used the slcan driver, I was amazed that > > > it was not possible to configure the bitrate via the ip tool. > > > For these two reasons, I started looking at the driver code and realized > > > that it didn't use the CAN network device driver interface. > > > > That's funny! Yesterday, I sent this comment: > > https://lore.kernel.org/linux-can/CAMZ6RqKZwC_OKcgH+WPacY6kbNbj4xR2Gdg2NQtm5Ka5Hfw79A@mail.gmail.com/ > > > > And today, you send a full series to remove all the dust from the > > slcan driver. Do I have some kind of mystical power to summon people > > on the mailing list? > > That would be very useful and awesome super power, I'm a bit jealous. :D > > > > Starting from these assumptions, I tried to: > > > - Use the CAN network device driver interface. > > > > In order to use the CAN network device driver, a.k.a. can-dev module, > > drivers/net/can/Kbuild has to be adjusted: move slcan inside CAN_DEV > > scope. > > > > @Mark: because I will have to send a new version for my can-dev/Kbuild > > cleanup, maybe I can take that change and add it to my series? > > Let's get the your Kconfig/Makefile changes into can-next/master first. > Then Dario can then base this series on that branch. ACK. I'll keep my series as-is.
On Tue, 7 Jun 2022 21:19:54 +0900 Vincent MAILHOL <mailhol.vincent@wanadoo.fr> wrote: > In his CAN327 driver, Max manages to bring the can0 device without the > need of dedicated user space daemon by using line discipline > (ldattach): > https://lore.kernel.org/linux-can/20220602213544.68273-1-max@enpas.org/ > > Isn't the same feasible with slcan so that we completely remove the > dependency toward slcand? > Max what do you think of this? I think it is a good idea to move this into the kernel driver. I don't have a slcan device, but a quick peek at its protocol suggests that it can be done much easier and cleaner than in can327. Fun fact: The use of a userspace "ignition" tool is a possible use case baked into can327's design ;) There is only one use case I can see for it though: Probing the ELM327's baud rate, and/or setting it before attaching the ldisc. This is the single thing that the kernel driver cannot do, since it is attached to an already running TTY, with a fixed speed. Everything else is configurable via "ip link". slcand could be used to auto-probe and set the baud rate as well. Then again, these stripped-down tools could likely be implemented as shell scripts calling stty and ldattach... Max
Dario, thank you so much for working on slcan! To speed up the slcan cleanup, may I suggest looking at can327? It started as a modification of slcan, and over the past few months, it has gone through several review rounds in upstreaming. In fact, a *ton* of things pointed out during reviews would apply 1:1 to slcan. What's more, there's legacy stuff that's no longer needed. No SLCAN_MAGIC, no slcan_devs, ... it's all gone in can327. May I suggest you have a look at it and bring slcan's boilerplate in line with it? It's certainly not perfect (7 patch series and counting, and that's just the public ones), but I'm sure that looking at the two drivers side-by-side could serve as a good starting point, to avoid re-reviewing the same things all over again. The current out-of-tree version can be found here (the repo name is still the old one, elmcan), where I occasionally push changes before bundling them up into an upstreaming patch. If a specific line seems strange to you, "git blame" on this repo is likely to dig up a helpful commit message, explaining the choice: https://github.com/norly/elmcan https://git.enpas.org/?p=elmcan.git Max
On 08.06.2022 02:15:37, Max Staudt wrote: > To speed up the slcan cleanup, may I suggest looking at can327? > > It started as a modification of slcan, and over the past few months, > it has gone through several review rounds in upstreaming. In fact, a > *ton* of things pointed out during reviews would apply 1:1 to slcan. > > What's more, there's legacy stuff that's no longer needed. No > SLCAN_MAGIC, no slcan_devs, ... it's all gone in can327. May I suggest > you have a look at it and bring slcan's boilerplate in line with it? +1 Most of Dario's series looks good. I suggest that we mainline this first. If there's interest and energy the slcan driver can be reworked to re-use the more modern concepts of the can327 driver. > It's certainly not perfect (7 patch series and counting, and that's > just the public ones), but I'm sure that looking at the two drivers > side-by-side could serve as a good starting point, to avoid > re-reviewing the same things all over again. regards, Marc
On Wed, 8 Jun 2022 09:19:47 +0200 Marc Kleine-Budde <mkl@pengutronix.de> wrote: > On 08.06.2022 02:15:37, Max Staudt wrote: > > To speed up the slcan cleanup, may I suggest looking at can327? > > > > It started as a modification of slcan, and over the past few months, > > it has gone through several review rounds in upstreaming. In fact, a > > *ton* of things pointed out during reviews would apply 1:1 to slcan. > > > > What's more, there's legacy stuff that's no longer needed. No > > SLCAN_MAGIC, no slcan_devs, ... it's all gone in can327. May I > > suggest you have a look at it and bring slcan's boilerplate in line > > with it? > > +1 > > Most of Dario's series looks good. I suggest that we mainline this > first. If there's interest and energy the slcan driver can be reworked > to re-use the more modern concepts of the can327 driver. Agreed. It does look good, and I'm glad to see slcan get some love. Thanks Dario! Max