From owner-freebsd-hackers@freebsd.org Tue May 18 15:27: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 B694B64FDC5 for ; Tue, 18 May 2021 15:27:33 +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 4Fl0HT4PKkz4mk2 for ; Tue, 18 May 2021 15:27:33 +0000 (UTC) (envelope-from ian@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 94E8E64FDC4; Tue, 18 May 2021 15:27: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 94AC564F9D7 for ; Tue, 18 May 2021 15:27:33 +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 4Fl0HT0rWrz4mdf for ; Tue, 18 May 2021 15:27:32 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1621351651; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=MnJgdWrd+ePWpc0mzx/IYK9qAqo2679id6rSBQXUg+5to7YsxJuX6zps73mD+Vj1iRse61yzw4VOw +RTcVFxtGNkl/KTD7ogJgc0RIhs4kY2Aw8OIyJGFxvK9Fd1c/R9cBN9AJUhPRUEDJ0zFIXERSH76/l 5yat0stgaXGpr+XD58mISP+oxA63hrY9IwsrBZPVjpF8Ls413Pp6O7OfReabIqXKPZeHMewQb6fxrC ZL57pevt5VkYgT45C9fmNGGa7Pv51qZ7aJMIHJK3AA/29QXBKK8W4/Zroxb4xt1D1wrxIIfXRilq/h RuVYo62hlbxs5bxGYranv+O2sHnvc4w== 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:cc:to:from:subject:message-id:dkim-signature:from; bh=OClMS4BCPkcdY//KU719KiSVwZXFfMdo6TwXmqNnsoo=; b=NQPkvQ/12wAT5jCXZRzUzc3TxhFy4n1SvV3dGnV1SsMFyplbP+wrxDqdaY5yAvdqdo6Z+dyXJKTvg eTkeRy7HRiGBFJHqWyCOW3rU76q+M/am/iyi916SbFh4vmD5K9Y+yNgZYG0NjKwmhFbJEe31XFrZ3k lRBEHg2furf+KlR4GCq9JPKBeVjpkxLXVuSVaHSHiVdp8/D1mWCIlPwvEwQhNGNuaDKviuOH4JnU6G i6H4rnGptXZFauSaqJjxc3wUkfeYyAdLfulzp8MLA6S9ERQf+8up8CpiMbAy4Du9+FLV42TleF8K2p qZPL8MaSEesyj7pRWaOSQFYNZbUjS1A== 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:cc:to:from:subject:message-id:from; bh=OClMS4BCPkcdY//KU719KiSVwZXFfMdo6TwXmqNnsoo=; b=NqRNQOcQ3FsyoXC84nkMfpofNd0wif7KX8KOIufECYF1RpGE43t/FFNoFyekj4dJuFoR9RNdpFeWJ hP7fUkpd6T6LnHnGvaPIknlAvbxBoIF+lzQq7pr7lpg87QPwyQrYY5MabSeb8VVEkla0O9AcMTm/8h I35TtYwj7gPx9J7YDzgK5pe/bkV0rJsNGw1JkHPgka0iN59cKE4Bnc96fOAHThRy2xlXkce6NLP/ad qZPL9ssnb0XDOiTOTd5Uzh6qSPoqkIbJjnl4C32aVwcuc7vH9R8vpX30jngu2LO7EHbCRGNS+nv6mi ozzj67zXdY9RPztoWGqV9idIQ1aXnsA== X-Originating-IP: 67.177.211.60 X-MHO-RoutePath: aGlwcGll X-MHO-User: 8dc8f982-b7ed-11eb-8483-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 8dc8f982-b7ed-11eb-8483-bf9d68d023b6; Tue, 18 May 2021 15:27:30 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 14IFRRSw072302; Tue, 18 May 2021 09:27:27 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: patch: make i2c(8) usable for scripting From: Ian Lepore To: Poul-Henning Kamp Cc: hackers@freebsd.org Date: Tue, 18 May 2021 09:27:27 -0600 In-Reply-To: <13972.1621147890@critter.freebsd.dk> References: <12056.1621109641@critter.freebsd.dk> <8d232feb354bf404426c51efe4953551ae2476c9.camel@freebsd.org> <13972.1621147890@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: 4Fl0HT0rWrz4mdf X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:16509, ipnet:54.244.128.0/17, country:US] 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: Tue, 18 May 2021 15:27:33 -0000 On Sun, 2021-05-16 at 06:51 +0000, Poul-Henning Kamp wrote: > -------- > 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 commands ? > > Related to that: Should i2c(8)'s -m default be changed to 'tr' ? > I just realized I didn't reply to the second question... Yes, I think -m tr should be the default. It should work on all hardware. The only real reason I can think of to support discrete start and stop commands in i2c(8) is for testing drivers. -- Ian