From owner-freebsd-current@freebsd.org Mon Jul 1 16:16:42 2019 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72B0415DEDAA for ; Mon, 1 Jul 2019 16:16:42 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 5B9D086064; Mon, 1 Jul 2019 16:16:41 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (v-critter.freebsd.dk [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id B190A2025622; Mon, 1 Jul 2019 16:16:33 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id x61GGX1m092908 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 1 Jul 2019 16:16:33 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id x61GGXis092907; Mon, 1 Jul 2019 16:16:33 GMT (envelope-from phk) To: Andriy Gapon cc: FreeBSD Current Subject: Re: i2c bit banging timeout for SCL In-reply-to: From: "Poul-Henning Kamp" References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <92905.1561997793.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Mon, 01 Jul 2019 16:16:33 +0000 Message-ID: <92906.1561997793@critter.freebsd.dk> X-Rspamd-Queue-Id: 5B9D086064 X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [4.08 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.95)[0.950,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.dk]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.91)[0.911,0]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(0.06)[ip: (0.11), ipnet: 130.225.0.0/16(0.05), asn: 1835(0.15), country: EU(-0.00)]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[phk.freebsd.dk]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_SPAM_LONG(0.87)[0.866,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; RCVD_NO_TLS_LAST(0.10)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU]; FROM_NEQ_ENVFROM(0.00)[phk@phk.freebsd.dk,phk@critter.freebsd.dk] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jul 2019 16:16:42 -0000 -------- In message , Andriy Gapo= n writes: >iicbb driver has a hardcoded timeout that defines how long the driver wai= ts for > SCL line to go high after the driver releases it to float. Sometimes sl= aves >hold the line low until they are ready to continue with the communication= . >As a side note, the timeout means that the driver just goes on as if the = line >became high. Maybe it should produce an error instead. > >Anyway, I would like to increase the current timeout of 100 x 10us to 100= 0 x >10us. The rationale is that there are many slave devices, like sensors, = that >take about 10 ms to return a result. So, I think that it makes sense to = play >nice with such devices by default. > >Probably I'll add a sysctl for that parameter while I'll be there. sysctl or ioctl ? -- = 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= .