Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3806738pxp; Tue, 15 Mar 2022 06:43:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEII3m3f/rWVDma1iIOVzgTEK0k+9Zm0ehc5nl2RPBBwoSWsWyjM4vc9JvLqhovlhzQ4vN X-Received: by 2002:a65:6a13:0:b0:373:14f6:5d33 with SMTP id m19-20020a656a13000000b0037314f65d33mr24678301pgu.62.1647351805592; Tue, 15 Mar 2022 06:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647351805; cv=none; d=google.com; s=arc-20160816; b=AtK84RQ7j2MZnqqxVOeuN/l2SHgvbzh+eWX9DCuZsuZh8kYd+HL+TXL285WgPY/Xhu D5nYCN0/Ru3JCWIV/gpk37oI+ta5h/hCvc+F2jvGfWZ1sganPG6wHseYh7y+yURwKC24 FoFa43q1NBYt3p5w+IrOzyhUqprwTV1OSjuoN6cdAGVUbCyidN0PXUp7oP73oIgTfwCe mJ0GjKkThZD8am29lhmiIfAt7FPmGAhEi9TxF+gREa8FdqFB1eMKDUkc9GwkAePOk+dW P+E9HKylgW6wnJdkGi9A/SgZ+k0aveQ4RLGgf+Ysb6/4NCwGFg+yhc0MjGq8wY9pDXh8 1O+Q== 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=spmRdHUs/pB+y5Y1hl6lbfNnuUSziqnhnnmRyJSdPoI=; b=M+aAi5KyeL5LX4V4DEotRw1s7CvvTWGM5/lva3nKIBfYVTnBIOBp2b6lSNAQyMi9JW xk54yqhHbkvgEucfKVOidtVS3Gfhu+9/uVunDnWfmkPCpS2YiI3rNmhnkembNZ1R70Us EQvwzAa800/widD5V6OLCqWAQox3EzEOGZ7X9KD1ZQ8hd2cUK75gNlhijcVDSn7JDHcU oI3T0tB4NmPLiKpd4NfIQNzqRTkfaYMNqZZu5fKrGXe0sodbdVQ4xtGgkgPayy8OssM4 Gb/tVjlUvNTELDanRYxnBHMa3ZJGRCv0LxPDe+u/IfhNQGMxKT5eln9iANK2QSI6rUYx EVUg== 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 g9-20020a63be49000000b00378c63b4e2fsi17746443pgo.769.2022.03.15.06.43.12; Tue, 15 Mar 2022 06:43:25 -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 S243032AbiCNWFY (ORCPT + 99 others); Mon, 14 Mar 2022 18:05:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237105AbiCNWFX (ORCPT ); Mon, 14 Mar 2022 18:05:23 -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 7A11F3D1E4 for ; Mon, 14 Mar 2022 15:04:13 -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 1nTsnR-0003Aq-9a; Mon, 14 Mar 2022 23:04:09 +0100 Received: from pengutronix.de (2a03-f580-87bc-d400-6399-440a-c2a2-bdf7.ip6.dokom21.de [IPv6:2a03:f580:87bc:d400:6399:440a:c2a2:bdf7]) (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 631184B40D; Mon, 14 Mar 2022 22:04:08 +0000 (UTC) Date: Mon, 14 Mar 2022 23:04:08 +0100 From: Marc Kleine-Budde To: Vincent Mailhol Cc: Max Staudt , Wolfgang Grandegger , linux-can@vger.kernel.org, Oliver Neukum , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby Subject: Re: [PATCH v3] can, tty: elmcan CAN/ldisc driver for ELM327 based OBD-II adapters Message-ID: <20220314220408.hn4vdohtjdbfoaqo@pengutronix.de> References: <20220307214303.1822590-1-max@enpas.org> <20220309135414.34f77251.max@enpas.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jairfwongtmk2mz3" Content-Disposition: inline In-Reply-To: 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 --jairfwongtmk2mz3 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 09.03.2022 22:49:49, Vincent Mailhol wrote: > > But rx_offload needs the mailbox_read function, even if it's a dummy, > > because can_rx_offload_add_fifo() checks: > > > > if (!offload->mailbox_read) > > return -EINVAL; >=20 > I think that there should not be a dummy functions like this one. >=20 > Either we agree that using can_rx_offload without implementing > the mailbox_read() is OK and in that case, the can_rx_offload > framework should be modified to allow mailbox_read() to be a NULL > pointer. >=20 > Either it is not the case and you use the more classic > netif_rx(). >=20 > And I do not have the answer. I haven't studied can_rx_offload > enough to be a judge here. Sorry. >=20 > @Marc, any thoughts? Use can_rx_offload_add_manual() instead. > > > > +/* Send a can_frame to a TTY. */ > > > > +static netdev_tx_t elmcan_netdev_start_xmit(struct sk_buff *skb, > > > > + struct net_device *dev) > > > > +{ > > > > + struct elmcan *elm =3D netdev_priv(dev); > > > > + struct can_frame *frame =3D (struct can_frame *)skb->data; > > > > + > > > > + if (skb->len !=3D sizeof(struct can_frame)) > > > > + goto out; > > > > > > Isn=E2=80=99t this aleardy guaranteed by the upper layers? > > > > Copy-pasta from slcan.c - will look into it. >=20 > Also give a look at can_dropped_invalid_skb(). ACK 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 | --jairfwongtmk2mz3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmIvu9UACgkQrX5LkNig 010z+wf8COaZnIFyF/cDQMT+ve8a0iwBPignONvdZYfNxHc+rLtj3801S/p2AaDj oI8HTmCwRyl2HBIXPCyBIiy3YgqiY0kb54FDZqZ9JuvNxTgAj0HtWqS6EW32DYdB cs7da4RXLR2xyQMr4YizVUePiETHQwu4y4wof3rg2ghdfIBcfZJwqpnm6LfNG9Jn n2IEY3ntpULQrA08ittg0kvPQAVehJZ0h/1OARpsxyK7P1yrEgdOxgEG1KsIfrfu RcjRqLhX/h9iu619oTuofcCSzvZgieyXawWgBbP13bgue8fHjKbibKr93Hnv8orp Bd5CPt6oULFdq775Wu36VSvqJjyMmg== =KNPb -----END PGP SIGNATURE----- --jairfwongtmk2mz3--