Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp573875imn; Tue, 26 Jul 2022 04:01:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s6biKAZfRooBWYTEDXSCbEqLxe384AUh1GU34verXMnmb7TRLcfQuR+TA9t3YRuRHzxmAe X-Received: by 2002:a17:907:6d8f:b0:72b:6b87:81f1 with SMTP id sb15-20020a1709076d8f00b0072b6b8781f1mr13724012ejc.674.1658833266913; Tue, 26 Jul 2022 04:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658833266; cv=none; d=google.com; s=arc-20160816; b=wBHAbFOhGkf4jvc89cWYhXITWsSDCd4t+x1PjuFGPgTnO+JG+YyH83BNUPBYiJr8z0 QmvOTe73Lei6oUQj/vONihN7njJckMhHb1JtRXKdSny8+AHFziJI4bN0C76KPFhKski+ 2wwk3Sfw8JrJRFwryHwwc2vtwgcaamnAE387iIjow+oCkp11HrL39M8/htiGSaDbXDUi r+lEkwbaFc+Xl47MU8TgZJTIuHrq4Dq0qL/AuWz0IoWSuDquoBMzX57IszoHfIyEYbUj RT7CUI1z0yZXlTnA/bPeeSJV2/3ucW8sr27HHkrC+B4P3gMKEpNhz9VI4EtKsehOWvNo d7hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=m0G1ouauyWlsMi4tX3T8kDD9m/uUFaFanRq+c7+5U7s=; b=pgsRGBj9+PV/2rejySn4+eJ7w0eolG09v8coIzAML8/0LOANMlELtLh3DzWNOK+ubS 7dp48S7k5WrEpESSZdhoufJCCEQcEZZZD+eZD2dUpZ7PSiOHce+/3bZ9RrNle5JKcI6C JyShay7rVcwmREPgvXW5TzC8yIjtYolOrKHTdPtAWfS5qhDcRO5XhC00alhiNwS+m/fp z64tsEB6s000xfpTJHIStPXNk/LgVj08Uz4pX69xxAi8opCDR2lXwCubE4JMin590yex 0TUgoJNOCvdnjrzJHG86wSAIJW5A58Est5geeUQM7nafco8O30q51HD9hzd+2J0E2APY EeZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PVvx51OO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id me22-20020a170906aed600b0072b3bc2edb1si13220198ejb.364.2022.07.26.04.00.42; Tue, 26 Jul 2022 04:01:06 -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; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PVvx51OO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238195AbiGZKLt (ORCPT + 99 others); Tue, 26 Jul 2022 06:11:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233069AbiGZKLs (ORCPT ); Tue, 26 Jul 2022 06:11:48 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB6751ADAD for ; Tue, 26 Jul 2022 03:11:46 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id b16so9423113lfb.7 for ; Tue, 26 Jul 2022 03:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=m0G1ouauyWlsMi4tX3T8kDD9m/uUFaFanRq+c7+5U7s=; b=PVvx51OOtlmDQcp+hJ9/QKAgDbD27XSXYiNOQxzShhI3JbRiAGv3AGUfQNpKEX85Ju Y3q+EL6ksrC/5vI4VjNPjznfY5b4hFs+VPQSz22sekFKjTQj3CfuTln588rafXxviWoJ TRamENOpI2kB4vy+4bsL/VIyN8iaKsi+zVLh4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=m0G1ouauyWlsMi4tX3T8kDD9m/uUFaFanRq+c7+5U7s=; b=35IrsUwOJgef1lU3HuGsqKKepGWnm41CZL8B5kb70a9/+Jc1hcFQrXRotNYG8GgXU9 4yAn8j24R00ikc7uNZiUmRAUERPXCHKWpqw7bx44UheTvQXkj+3GXhf4beIiOTU3ZHDL dbl4prYIA8mLM+MoA7/UKSeG2LzqKx9uMo2AtqZOqdq1arlbiGbEk1FocCcqqdaEUTU/ N0AEtKAb6yMVdb7a4qh7+dZRqHD5MCf3hhcjcQm6unMvcfeqrLCjFZc/AqfAVn2joYGr iVLtHAhAwwUlfS2Ssg8A0pUzmmPiRDVz/NMFAoZ3P54w7rYlO8gEBoiqAFt8NyqeLTtY UNSA== X-Gm-Message-State: AJIora+/WfBcbZXr3H6a2aSljb4xhBHQxj9ynSOhRjqVCe/9Td2g6A50 H1nWHnYoW2dauwVk6SV/AaPZf7M2jQzNnSyHWvJvtQ== X-Received: by 2002:a05:6512:1389:b0:489:d0bb:241e with SMTP id p9-20020a056512138900b00489d0bb241emr6755687lfa.536.1658830305163; Tue, 26 Jul 2022 03:11:45 -0700 (PDT) MIME-Version: 1.0 References: <20220725065419.3005015-1-dario.binacchi@amarulasolutions.com> <20220725065419.3005015-3-dario.binacchi@amarulasolutions.com> <20220725123804.ofqpq4j467qkbtzn@pengutronix.de> In-Reply-To: <20220725123804.ofqpq4j467qkbtzn@pengutronix.de> From: Dario Binacchi Date: Tue, 26 Jul 2022 12:11:33 +0200 Message-ID: Subject: Re: [PATCH v2 2/6] can: slcan: remove legacy infrastructure To: Marc Kleine-Budde Cc: linux-kernel@vger.kernel.org, michael@amarulasolutions.com, Amarula patchwork , Jeroen Hofstee , Oliver Hartkopp , Max Staudt , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Wolfgang Grandegger , linux-can@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Hello Marc, On Mon, Jul 25, 2022 at 2:38 PM Marc Kleine-Budde wrote: > > On 25.07.2022 08:54:15, Dario Binacchi wrote: > > Taking inspiration from the drivers/net/can/can327.c driver and at the > > suggestion of its author Max Staudt, I removed legacy stuff like > > `SLCAN_MAGIC' and `slcan_devs' resulting in simplification of the code > > and its maintainability. > > > > The use of slcan_devs is derived from a very old kernel, since slip.c > > is about 30 years old, so today's kernel allows us to remove it. > > > > The .hangup() ldisc function, which only called the ldisc .close(), has > > been removed since the ldisc layer calls .close() in a good place > > anyway. > > > > The old slcanX name has been dropped in order to use the standard canX > > interface naming. It has been assumed that this change does not break > > the user space as the slcan driver provides an ioctl to resolve from tty > > fd to netdev name. > > Is there a man page that documents this iotcl? Please add it and/or the > IOCTL name. I have not found documentation of the SIOCGIFNAME ioctl for the line discipline, but only for netdev (i. e. https://man7.org/linux/man-pages/man7/netdevice.7.html), Thanks and regards, Dario > > > The `maxdev' module parameter has also been removed. > > > > CC: Max Staudt > > Signed-off-by: Dario Binacchi > > > > --- > > > > Changes in v2: > > Nitpick: > Changes since RFC: https://lore.kernel.org/all/20220716170007.2020037-1-dario.binacchi@amarulasolutions.com > > > - Update the commit description. > > - Drop the old "slcan" name to use the standard canX interface naming. > > > > drivers/net/can/slcan/slcan-core.c | 318 ++++++----------------------- > > 1 file changed, 63 insertions(+), 255 deletions(-) > > > > diff --git a/drivers/net/can/slcan/slcan-core.c b/drivers/net/can/slcan/slcan-core.c > > index c3dd7468a066..2c546f4a7981 100644 > > --- a/drivers/net/can/slcan/slcan-core.c > > +++ b/drivers/net/can/slcan/slcan-core.c > > [...] > > > @@ -898,72 +799,49 @@ static int slcan_open(struct tty_struct *tty) > > if (!tty->ops->write) > > return -EOPNOTSUPP; > > > > - /* RTnetlink lock is misused here to serialize concurrent > > - * opens of slcan channels. There are better ways, but it is > > - * the simplest one. > > - */ > > - rtnl_lock(); > > + dev = alloc_candev(sizeof(*sl), 1); > > + if (!dev) > > + return -ENFILE; > > > > - /* Collect hanged up channels. */ > > - slc_sync(); > > + sl = netdev_priv(dev); > > > > - sl = tty->disc_data; > > + /* Configure TTY interface */ > > + tty->receive_room = 65536; /* We don't flow control */ > > + sl->rcount = 0; > > + sl->xleft = 0; > > Nitpick: Please use 1 space in front of the =. > > regards, > Marc > > -- > 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 | -- Dario Binacchi Embedded Linux Developer dario.binacchi@amarulasolutions.com __________________________________ Amarula Solutions SRL Via Le Canevare 30, 31100 Treviso, Veneto, IT T. +39 042 243 5310 info@amarulasolutions.com www.amarulasolutions.com