Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14582267rwb; Mon, 28 Nov 2022 02:50:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf61TahGNu3MJDsqz25I0Y6VkVC5CMXdYtYqYyCxFpBqRlCsQfX4ITtmjmctY017yi7iuikL X-Received: by 2002:a17:90b:804:b0:213:de70:9eb5 with SMTP id bk4-20020a17090b080400b00213de709eb5mr58763407pjb.145.1669632613687; Mon, 28 Nov 2022 02:50:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669632613; cv=none; d=google.com; s=arc-20160816; b=0IiUTe+cHKUXsHjzAvJp9L/+RSTYVVL2uRLEmF3ff86hDtr28b/yNoYfU6ovX0dsE7 1Dpbx6M0ZJclRNMpSTyyVa/SEAMUGLqPMuF0toSUy/VSRi58wSEMhKpjz+vfCPCVvV5x Te92onZyDYNHnbDkZycyiIwMlofYZA9k/EmSKxBakKXv0r8/DQ/4SXInv5c59ygIGxq+ bFGHOEBdrCh2lrkPEcxPYprATRNcQdZSSjk4lIsro9srxlCQuEtua1IHC7h61FzKGi1R /mpHFvPR4c36sVUosWl8deIJI499lG1XyMEce+jy1kGpTbMu3s4kN+FW8I+asIO+zgqU Uwaw== 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:dkim-signature; bh=JGFyuaNpearh4I2bkKpI3Yx2+bxxpkCL2JVRRmilW+M=; b=CVw9uMdD5v2j8/z1SsVVB0mzgeVqR+CGn0GwX3AOxt3mb1CXXZxP3fn2lYYyOddZ6y 88kiyswaUpkJmOXqu13SyTgKcWoDANLiHld/Kgq+NeT+Z5lMa2x4jZ9uBkq31OiXkrkW xMY1hJmQgr0HsBDdXva+aCMbXTamyg5rRsHgHNYPYRPkUDwDWaQMVL8iTgiGCPJVgqPu LQFxPVXseTWouU5TT+KuDHUG6q+fVaVBuKKDsHUIXMQj5eUa/s+vMVhQJ7j/iyeG0Rfh fCPDPQ93viorZgLwUIdpQSQ54cmA7eB6jn7Yx3l0kSGdOwrODPGeSDH9DdHeP9xHkWQy ReiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@fritzc.com header.s=dkim header.b=IEmONJxA; 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 g14-20020a056a000b8e00b0057190cfb571si10046066pfj.170.2022.11.28.02.50.03; Mon, 28 Nov 2022 02:50:13 -0800 (PST) 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=fail header.i=@fritzc.com header.s=dkim header.b=IEmONJxA; 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 S230158AbiK1KQc (ORCPT + 84 others); Mon, 28 Nov 2022 05:16:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229869AbiK1KQ2 (ORCPT ); Mon, 28 Nov 2022 05:16:28 -0500 Received: from fritzc.com (mail.fritzc.com [IPv6:2a00:17d8:100::e31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5E4A13E35; Mon, 28 Nov 2022 02:16:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fritzc.com; s=dkim; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject :Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=JGFyuaNpearh4I2bkKpI3Yx2+bxxpkCL2JVRRmilW+M=; b=IEmONJxAPPyIdo+IxEmTA2iS8t FNntZqbM6YxPJtgwAFsuhkxNjZsfCEoDiwYyXLkng/f+jLhWFk2wEUhc90F2uXeGLOOnkoFQUSrzi qunS5i5HnqySi9KjBws1E3bIY8ahh/z7UlT51WccrgBb3jYlidt8rxs+SyrFDSjZFsyY=; Received: from 127.0.0.1 by fritzc.com with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim latest) (envelope-from ) id 1ozbBH-000ZNN-IW; Mon, 28 Nov 2022 11:16:11 +0100 Date: Mon, 28 Nov 2022 11:16:05 +0100 From: Christoph Fritz To: Oliver Hartkopp Cc: Pavel Pisa , Richard Weinberger , Andreas Lauser , Wolfgang Grandegger , Marc Kleine-Budde , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH 0/2] LIN support for Linux Message-ID: References: <20221127190244.888414-1-christoph.fritz@hexdev.de> <58a773bd-0db4-bade-f8a2-46e850df9b0b@hartkopp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <58a773bd-0db4-bade-f8a2-46e850df9b0b@hartkopp.net> X-Spam_score: -1.0 X-Spam_bar: - X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_PASS,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 Hello Oliver > are you already aware of this LIN project that uses the Linux SocketCAN > infrastructure and implements the LIN protocol based on a serial tty > adaption (which the serial LIN protocol mainly is)? > > https://github.com/lin-bus Sure, that's why I initially added Pavel Pisa to the recipients of this RFC patch series. When there is an internal kernel API for LIN, his sllin (tty-line-discipline driver for LIN) could be adjusted and finally go mainline. Adding LIN only as a tty-line-discipline does not fit all the currently available hardware. Another argument against a tty-line-discipline only approach as a LIN-API is, that there is no off the shelf standard computer UART with LIN-break-detection (necessary to meet timing constraints), so it always needs specially crafted hardware like USB adapters or PCIe-cards. For the handful of specialized embedded UARTs with LIN-break-detection I guess it could make more sense to go the RS485-kind-of-path and integrate LIN support into the tty-driver while not using a tty-line-discipline there at all. > IIRC the implementation of the master/slave timings was the biggest Currently sllin only supports master mode, I guess because of the tight timing constraints. > challenge and your approach seems to offload this problem to your > USB-attached hardware right? The hexLIN USB adapter processes slave mode answer table on its own, just to meet timing constraints. For master mode, it is currently not offloaded (but could be if really necessary). The amount of offloading (if any at all) is totally up to the device and its device-driver (the entity actually processing data). So sllin does not do offloading but can only work in relaxed timing constrained environments. An UART with built in LIN-break-detection (there are a few) might be able to fully meet timing constraints without offloading (as well as e.g. a PCIe card). > Can I assume there will be a similar CAN-controlled programming interface to > create real time master/slave protocol frames like in a usual CAN/LIN > adapter (e.g. https://www.peak-system.com/PCAN-LIN.213.0.html) ?? I already did some tests letting hexLIN and PCAN talk to each other in a real time manner. Please see my preliminary PDF docu at https://hexdev.de/hexlin/ Thanks -- Christoph