Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1097767imw; Tue, 5 Jul 2022 03:51:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1upPybAATc6ZMeP1bN1cV6e3SA9z43BzVDCGrJFwyXjsVUv9AfZMT91catKzdmVnIZmXONO X-Received: by 2002:a17:90b:3e86:b0:1ec:fc46:9e1b with SMTP id rj6-20020a17090b3e8600b001ecfc469e1bmr43140178pjb.155.1657018267474; Tue, 05 Jul 2022 03:51:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657018267; cv=none; d=google.com; s=arc-20160816; b=HTsiA5nSoVdmeHQpoCgfbHSG8HIRBbrOD83WxNZSyQABklwWQTrBv+UupSWzx6B2kf s2qTlndW0gnO1oKoLz9HyNjOdJdyMjhTUmDxD31S8yGuc4b57aDb4ObvSdytwop2afXL u0yL5fzqlvrOc+173xL6m9T6sxOtByRuZhDCHpe2LnBthN9FMnWp7aQuKHqc1JmNqeT7 jpNxsg0WQQgCwruji1yajsOKLzx6PI/KVIZcJGu4i+nF1JZuuwiqAEl/d/yujNI1WZye MdZ/pQ9299+bsDqJS0ryWMd3BLmbwrjGyPy+e+lCTNpUXBoJpYtT9ByoLDVgOEZ/YSYa C3rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=BXFmf6ZRIpCq2lj1p6bdlKcWtd0FwxZu34Oaqz1usXk=; b=PFGOuOfKvqUgQ+9mA22eG52npvoMNLgcGGixOeWz0Qrfs/0mise/3iTaCwutPaTeOZ TWMYV7o7QfCt/Vq35TKWpFW5GAowq+tN3abdxd4+AJIGzxukeIC/dXqvtOo2n4D6Ohmv Mj3N7fgo2uGeMXBJa9wPFuJwpfSY4igX7PqrzKMmcuWPnaegiAEbgGHJyKxX/rfOgYYy KeeWi6GOkq263rm7yGoe9U80hsv9aNCCA+ux7K7d6iMetj5CxKM50nKy6607sd4D33eg zASKkJz+1yRkS2j7I9gV1YxBd1nmeRL1Y8Q5eUpy7GHThsaSFP+JI70NdXiY0pIrZaek W0vw== 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 i129-20020a636d87000000b003fe428b329dsi22208228pgc.839.2022.07.05.03.50.54; Tue, 05 Jul 2022 03:51:07 -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 S232342AbiGEKjT (ORCPT + 99 others); Tue, 5 Jul 2022 06:39:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230499AbiGEKjS (ORCPT ); Tue, 5 Jul 2022 06:39:18 -0400 Received: from mail.enpas.org (zhong.enpas.org [IPv6:2a03:4000:2:537::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 949EFC24; Tue, 5 Jul 2022 03:39:17 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail.enpas.org (Postfix) with ESMTPSA id 836A1FF9BF; Tue, 5 Jul 2022 10:39:16 +0000 (UTC) Date: Tue, 5 Jul 2022 12:39:12 +0200 From: Max Staudt To: Geert Uytterhoeven Cc: Marc Kleine-Budde , Wolfgang Grandegger , linux-can@vger.kernel.org, Vincent Mailhol , Oliver Neukum , Linux Kernel Mailing List , Vincent Mailhol , Greg Kroah-Hartman , Oliver Hartkopp Subject: Re: [PATCH v9] can, tty: can327 CAN/ldisc driver for ELM327 based OBD-II adapters Message-ID: <20220705123912.1dfc6242.max@enpas.org> In-Reply-To: References: <20220618195031.10975-1-max@enpas.org> <20220627150557.qluqtejrddj5nfif@pengutronix.de> <20220627190126.4eb57a2b.max@enpas.org> <20220705094927.vgtxcjh4klw6dcg3@pengutronix.de> <20220705115613.69d32b22.max@enpas.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Tue, 5 Jul 2022 12:16:08 +0200 Geert Uytterhoeven wrote: > > > > I had a quick glance through the various revisions posted, and > > > > it doesn't seem like anyone mentioned the serial bus. Would > > > > there be any advantage in migrating to the serial bus? > > > > > > Does serial bus work with hot plug devices like USB Serial > > > Adapters and/or devices that are not described in the device > > > tree? > > Probably it cannot work with hot-plug devices yet. > And devices must be described in some way (DT, ACPI), it does not > support auto-detect. Correct! > So far I've seen serial bus used with e.g. bluetooth and DT. > I'm wondering if/how people use it with bluetooth connected to a > hot-pluggable device like usb-serial. They don't :) serdev is (currently, still, AFAIK) only for devices permanently attached to a platform - hence they can be reliably described as part of the platform itself, be it via DT or ACPI or whatever. So the fact, say, that the "Nokia N900" has a BT module permanently soldered to "UART 2", that's something you can encode in its DT, because it applies to this device, and this device only. The ELM327 and clones are merely naked USB/BT-UART bridges with default VID/PID to the computer, and some variants are classic RS232 devices. No way to identify them, as they can appear/disappear on any UART, anywhere. So you need to attach them manually - and to my knowledge, such a manual mechanism is still missing from serdev. So we have to use a line discipline, as that has an API to attach from userspace. This also explains how to use Bluetooth via USB: Either it's a VID/PID known to some driver speaking native USB, or... well, for UARTs there's btattach and hciattach (both part of BlueZ), and both use the N_HCI line discipline. No serdev involved. I don't know if any USB-UART-BT device with a unique VID/PID exists, and I don't know whether serdev could be attached kernel-side in this case. Max