From owner-freebsd-hackers@freebsd.org Sun May 16 06:51:33 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C843163792A for ; Sun, 16 May 2021 06:51:33 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4FjXx14RFgz4YBC for ; Sun, 16 May 2021 06:51:33 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: by mailman.nyi.freebsd.org (Postfix) id 9836963763B; Sun, 16 May 2021 06:51:33 +0000 (UTC) Delivered-To: hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 97F82637929 for ; Sun, 16 May 2021 06:51:33 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FjXx1349Hz4Y5Z; Sun, 16 May 2021 06:51:32 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (v-critter.freebsd.dk [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by phk.freebsd.dk (Postfix) with ESMTPS id CAF6D89290; Sun, 16 May 2021 06:51:30 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.16.1/8.16.1) with ESMTPS id 14G6pUtT013974 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 16 May 2021 06:51:30 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.16.1/8.16.1/Submit) id 14G6pUS5013973; Sun, 16 May 2021 06:51:30 GMT (envelope-from phk) To: Ian Lepore cc: hackers@freebsd.org Subject: Re: patch: make i2c(8) usable for scripting In-reply-to: <8d232feb354bf404426c51efe4953551ae2476c9.camel@freebsd.org> From: "Poul-Henning Kamp" References: <12056.1621109641@critter.freebsd.dk> <8d232feb354bf404426c51efe4953551ae2476c9.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13971.1621147890.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Sun, 16 May 2021 06:51:30 +0000 Message-ID: <13972.1621147890@critter.freebsd.dk> X-Rspamd-Queue-Id: 4FjXx1349Hz4Y5Z X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 May 2021 06:51:33 -0000 -------- Ian Lepore writes: > On Sat, 2021-05-15 at 20:14 +0000, Poul-Henning Kamp wrote: > > The /dev/iic%d filedescriptor is opened and closed for every single > > command, in the hope that it will aid multiple separate programs > > sharing I2C busses. I have not actually tried that yet, so it may > > need more work (exclusive opens etc.). > > There should be no need to do that. The i2c bus is arbitrated in > iicbus/iiconf.c and most all the in-tree drivers now use either > explicit iicbus_request_bus() calls, or use iicbus_transfer_excl(). = > Certainly users of iic(4) don't need to be protected from each other; > everything in the driver that uses the bus does so inside of > request_bus / release_bus calls. How does that work when i2c(8) (by default) issues discrete start/stop com= mands ? Related to that: Should i2c(8)'s -m default be changed to 'tr' ? -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= .