From owner-freebsd-hackers@freebsd.org Sun May 16 04:05:40 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 93591633BF6 for ; Sun, 16 May 2021 04:05:40 +0000 (UTC) (envelope-from ian@freebsd.org) 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 4FjTFc0zy0z3krm for ; Sun, 16 May 2021 04:05:40 +0000 (UTC) (envelope-from ian@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 21B16633C1F; Sun, 16 May 2021 04:05:40 +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 217A5633971 for ; Sun, 16 May 2021 04:05:40 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5c.ore.mailhop.org (outbound5c.ore.mailhop.org [54.244.192.240]) (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 4FjTFb4W1wz3kmn for ; Sun, 16 May 2021 04:05:39 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1621137938; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=v67KOuqowaliV+ckFsNHI/cQl/aNIlnV2P5sQjou0VkQ5JNEQFS0cHruknqC2Mwjg9Qd6Gi3Zwxol d/NBAhR6kysqPNVkF/1RpaCstRmfLR5NOKQhSCbYt9ZeGLyry1Wb9bxoQhTbT8cOJxDgjtKlTeeWBK FdSfUUOTf6w3eIx+oMeeqXup37wBOl9bqwwGB0N/NL78OlfHs7lxI6DLOTpCocsfIzKPOf9rLWAp1C MX7ruQ/TNQHwlt4w1tbipmDDVkZSZqh4rO081GQfG4OdV8TMx6j/jWJRVVokxV3ZXDY9HCM4UayF0H 94WwCaqeUXouv8yAC4SM+umq2b6s0Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=BWeNhiyABlPUCwvxeK007QNbyBrqkKPKy5RNkZ1x2Us=; b=MYojLej14oiwkZWZw+KhPMioluzgBBhQEGs5ZT78Er5WQ0WhjdhcSFcSY2ntjXGnwDrD44gy38AmU lUEAxKQka2ZRzC3TN0XXeLnUUR3ZBlM4Jpi/LXJN0M8Oy+qXnOF+9g5Gpzemt8NlF9HgRxrjD1VWKL 3q+zhjrKF26Cp+LIWh406pAG1YWRs+uUlGpeBdWu8trKOXwAfEK89pcS+Aa7sOMRMi9jPTyrRg5umI tHqoUhDK3dMZ5aB+Kw56CBFY3IJZvFp5vYV7DXyhD2kR393E2X59Px3brOQnfk3k67au05FiWqWLO0 JVnv8FZjm04nVvU8e1e/F2jFVfvz7Wg== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=BWeNhiyABlPUCwvxeK007QNbyBrqkKPKy5RNkZ1x2Us=; b=JcUDGVvOVkBM1TNiy6HhWuiyTUwTP1Ksnc8GHvOtCKmxMM5MoPFrfSWHmzKP2HbLh1vIx6fqnGa3E u23IBn0OTNtOxAzLg9/8aomr3WtzKIYK35ZW2iA2JpwkhqUvvLPBPxfPyynbRjwmRpl//ZVlP/pbsr boYUbwf7a0oeVH9V7L+NBpBRFFczJDo9f36g4rbHp/YH9Aq0oQ+v07QTuEdVU+NRRbE6F4FDNf+M6c h01y3tpwFODwQ+34lJI6Ato4jUqKPBxKTG2XjycViJ2AkdiaaPIcXVSfGUCuKLrcsKkNh5IXpC2sUN eOY3zJW79JIGw6PbvTOQ11p7aQf+xxw== X-Originating-IP: 67.177.211.60 X-MHO-RoutePath: aGlwcGll X-MHO-User: f6aa57f0-b5fb-11eb-8406-bf9d68d023b6 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id f6aa57f0-b5fb-11eb-8406-bf9d68d023b6; Sun, 16 May 2021 04:05:37 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 14G45Xup062390; Sat, 15 May 2021 22:05:34 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <8d232feb354bf404426c51efe4953551ae2476c9.camel@freebsd.org> Subject: Re: patch: make i2c(8) usable for scripting From: Ian Lepore To: Poul-Henning Kamp , hackers@freebsd.org Date: Sat, 15 May 2021 22:05:33 -0600 In-Reply-To: <12056.1621109641@critter.freebsd.dk> References: <12056.1621109641@critter.freebsd.dk> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FjTFb4W1wz3kmn 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 04:05:40 -0000 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. -- Ian