From nobody Thu May 26 05:51:25 2022 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 31A231B551B0 for ; Thu, 26 May 2022 05:51:28 +0000 (UTC) (envelope-from mychaela.falconia@gmail.com) Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L7xrZ5cGhz3wNw; Thu, 26 May 2022 05:51:26 +0000 (UTC) (envelope-from mychaela.falconia@gmail.com) Received: by mail-yb1-xb2b.google.com with SMTP id v26so1309141ybd.2; Wed, 25 May 2022 22:51:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8mCfEcn3zSiPr96EbWBG8xiSp4jgF7ESwSmlWmlpOcY=; b=ovDx36Rk4xk5+uD0+KFszguIq9nTTUfDmoa3/coQIyfnQjgITkm3fnkcGasgjdv/HX ObPEZw97xDwGlmVQh94yq333VYriCGi9xnytlo962ZWys7ljVYnKeBGX4FrUqO/EDdan gFPtNX9xNQca+zfj1IpcdJKqk6mNYDsM5gqtwef2K23ytjY34pdSc2fQdGZK70w1nwxW oZdF4wKtffzhxch//edMsySyTTnPdE0IHsJAGUH41auy+Li74ncJ0oTjWIDc0tBs4HRe bTiFulP92OgdXpspcZo+npEX6KNdFEWohpHdJAMFfuy9PVUmDYciuC/hDdn3byDZhahz n/nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8mCfEcn3zSiPr96EbWBG8xiSp4jgF7ESwSmlWmlpOcY=; b=l5GsiekNst1YQDFsRXCpdpREUZmBt+pXrvYBxOK1FduD1v3rFbWu6SZc9jHF7OwqGB 6NXd7QdEl1Y8WGwKwKJh9Mi0VFyC4NwN2skuxwbKe7NzFe7UGp4K/jGcMkqEnzwnScoq 8CuyPB/jHmGoX4qvGrGcGqoxpqUmorbVWbdcHqvzv8ANgSEhNJfVSWea5afY7pkUWkfb oYzvETkeQscMyobRtRoCxsxRskdXXN/5zxaJj8GwAAYJaHMvzHYTtqDRO3yHb+mMVVey pMTFyNR4rM9uitLZpB9PLy8/Qb8g+RgujILSdP3FlWrcgVseuwhwa4RTom2SUK6EjwEn Tn2Q== X-Gm-Message-State: AOAM530lp5+E7Wgk4V9jxsmhORrmQmqQdyMkujAoryXw/MYlQ0UWeGVZ ztQZNpiUowlfHL79kPZeUQI+9/4OkOmqvD0e4UhoI0k6 X-Google-Smtp-Source: ABdhPJw5kMKIRVxy9VzsYtSeVNPlRP5WmkH88uJXougU0ABJ/tVYQcz04x2kKKeVNS1y7dZ/bwAXdsZ3PIYRu8PIZQ8= X-Received: by 2002:a25:d953:0:b0:655:4d0c:f12b with SMTP id q80-20020a25d953000000b006554d0cf12bmr9482976ybg.441.1653544286253; Wed, 25 May 2022 22:51:26 -0700 (PDT) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Received: by 2002:a05:7000:668c:0:0:0:0 with HTTP; Wed, 25 May 2022 22:51:25 -0700 (PDT) In-Reply-To: References: <55AF97D3-5212-4A58-9942-3207A176C179@nimnet.asn.au> From: Mychaela Falconia Date: Wed, 25 May 2022 21:51:25 -0800 Message-ID: Subject: Re: Unwanted auto-assertion of DTR & RTS on serial port open To: Warner Losh Cc: FreeBSD questions , Kyle Evans Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4L7xrZ5cGhz3wNw X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=ovDx36Rk; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mychaelafalconia@gmail.com designates 2607:f8b0:4864:20::b2b as permitted sender) smtp.mailfrom=mychaelafalconia@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_SPAM_SHORT(1.00)[0.999]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b2b:from]; MLMMJ_DEST(0.00)[freebsd-questions]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N Hello everyone, I got a happy conclusion to this thread: I just did a test install of FreeBSD 13.1-RELEASE on a spare laptop, and I tested the CNO_RTSDTR feature of interest to me. I used this FT2232D breakout board for my test: https://pldkit.com/index.php?_route_=other/ft2232d-module I connected a USB cable between the FreeBSD machine and the test board - yup, FreeBSD recognized the FT2232D USB device and created /dev/cuaU[01] and /dev/ttyU[01], as well as .init and .lock devices. I then connected my oscilloscope probe to FT2232D ADBUS4 output (Channel A DTR) and set the scope to trigger on this line going low, as in below 2.0 V. Then I did this test command sequence: stty -f /dev/cuaU0.init -rtsdtr cat /dev/null > /dev/cuaU0 And the scope never triggered, i.e., DTR output never went low! In contrast, if I omit the .init device stty -rtsdtr step, then DTR does go low (remember, it's LVCMOS, not RS-232 here) when the regular device is opened. So the CNO_RTSDTR feature in FreeBSD really does fully solve the problem of unwanted DTR & RTS assertion - but it works thusly only because FreeBSD has those .init devices, hence a mindless port of the CNO_RTSDTR termios flag to Linux, as one Linux maintainer was proposing, would NOT work in a satisfactory manner - because Linux lacks ttyXX.init and ttyXX.lock devices. FreeBSD is now the first - and so far only - Unix-style OS that makes it possible to operate on serial ports without auto-asserting DTR and RTS, fixing the design flaw that goes back to 1970s UNIX. I shall now take this data point and go back to Linux kernel maintainers, and start mounting the pressure on them to accept one of the numerous already existing patch proposals that would enable the same capability in Linux. M~