From owner-freebsd-arm@freebsd.org Thu Apr 18 14:19:48 2019 Return-Path: Delivered-To: freebsd-arm@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 8464A15728ED for ; Thu, 18 Apr 2019 14:19:48 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1AF8FD5F for ; Thu, 18 Apr 2019 14:19:48 +0000 (UTC) (envelope-from ian@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id C09FA15728E8; Thu, 18 Apr 2019 14:19:47 +0000 (UTC) Delivered-To: arm@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 9C5FA15728E7 for ; Thu, 18 Apr 2019 14:19:47 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1728F8FD5D for ; Thu, 18 Apr 2019 14:19:46 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1555597180; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=mJ/9udvWd5o2sG4pFCMfgF040CmkjK8UrZotRjnEcK8xY4r/bSZHg2yVnXkFBwTwpeHAjLFa9EOgw nbpcCCmAY01tFSWyuB3yq51Nx4yOHsQ2WllC9ri0S3lxhnTYx/Yorwi4qnpPRp/UjlE3qzic+EWejA j25PL+rQHinwaY2UJfq0vskEbFEoYYtHRP6OhHz8cguG9WcabgJK7Rx5JReOMAtsFZxytppcX9FUKw hlgUmbEPS539dQ8VlPswBVfGXZ0S6nfQZi0ACD3AATPyIBE/wzhUlBxbaaeHFb9lkjNxt+nlS2jhUU TOztc8rtM4Kam6CNz047h9p9PsRT+Gw== 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=tWcDrNpl+4qnXtrFiwO+3+Aj4gusslejnuxEOOTaDTE=; b=R6JswJfTxD38+B68gjH3AfPnOBrDi5Qd1tuG9Mled0kr58oJQrwzZUjG33/CAUEt8YbgbG2HzYGbs xMSYCbRg59lQeNAFTq2X+kpKErHo3LxqMVMoRb7COwHkPkyFna4gqK++kIDf9GwbukCc3yyqJtl/SG 0rFe/shHqB+Sc/tZ11MBnhd9hw9xl+3rzBD+b9rsNAwfKPHxmGMkaMiigAOXbCpSu62mx0nrdjlf8x zBbwoQ38m/e46HpyeiMGx2aYWdXWt2TTreYoiTMM1FM6maV+/JS4m1N8WP6gIdrppbMq9c+YEIG6t9 Z+GUvMWgVAX35LnzQ/hz9JIAQ9ZoBdw== ARC-Authentication-Results: i=1; outbound3.eu.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=tWcDrNpl+4qnXtrFiwO+3+Aj4gusslejnuxEOOTaDTE=; b=ehCaXflAjeTFEoSjYUNyLRwi1+9+hE6gV70EQT/8BQt1iU6CoLF1v+Oo3Adq7r/gli4JwWX2q2J57 df8nr93TtsaEov0AAlK5/dt57x2lpIsUhcN9wi4IPeajPnuTxg5itvvvFm2dZ/BkcM17Y34Mg4Er9j 4BD6wOLgPuIlVlrwIF6CZyOMaUaA0r5sQphdDN/cozsp3Ddy+Rjv+E71izCqXhz90sv/5KN6qA8Lq7 aRy9iSlM6hBeIPctc3NS4CyywSw9d06TzotLyBMCyCos8zs846U0aaliuaLGIhSfPffh+0KdxpWyZ3 XUSIDSlQL62mAbf4U8dGcDhW3NN21Pg== X-MHO-RoutePath: aGlwcGll X-MHO-User: fdd8796b-61e4-11e9-908b-352056dbf2de X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.eu.mailhop.org (Halon) with ESMTPSA id fdd8796b-61e4-11e9-908b-352056dbf2de; Thu, 18 Apr 2019 14:19:37 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x3IEJXGi050698; Thu, 18 Apr 2019 08:19:33 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <64b5598e2c8c7265f89a31b1f191cb1be318788a.camel@freebsd.org> Subject: Re: i2c almost working for me, was Re: i2c still not working for me From: Ian Lepore To: Daniel Braniss , Emmanuel Vadot Cc: "freebsd-arm@freebsd.org" Date: Thu, 18 Apr 2019 08:19:33 -0600 In-Reply-To: References: <12F641C3-9FAA-4A3A-BA18-A7302F3A0F5E@cs.huji.ac.il> <20190409095819.c560dbc156c46e5ca0244e3e@bidouilliste.com> <23A47048-642A-481C-B7BE-B61E55F82955@cs.huji.ac.il> <20190409171604.GA4581@bluezbox.com> <6119CE3B-6042-4DDC-82BE-B0C0C7ADA838@cs.huji.ac.il> <5D4799BC-08DF-4F3D-81A4-C2D938F4AF93@cs.huji.ac.il> <20190417222601.c037efe0cb48987c81032bac@bidouilliste.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1728F8FD5D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2019 14:19:48 -0000 On Thu, 2019-04-18 at 10:12 +0300, Daniel Braniss wrote: > > On 17 Apr 2019, at 23:26, Emmanuel Vadot > > wrote: > > > > On Tue, 16 Apr 2019 09:16:02 +0300 > > Daniel Braniss > > > wrote: > > > > > > > > > > > > On 11 Apr 2019, at 09:56, Daniel Braniss > > > > wrote: > > > > > > > > if no device is connected, I2CRDWR hangs, > > > > it also happens with i2c(8) -s, only reboot helps. > > > > > > > > ichb1: twsi_reset: Using IIC_FASTEST/UNKNOWN mode with speed > > > > param=2a > > > > iichb1: TWSI_WRITE: Writing 0 to 18 > > > > iichb1: TWSI_WRITE: Writing 2a to 14 > > > > iichb1: TWSI_WRITE: Writing 40 to c > > > > iichb1: TWSI_WRITE: Writing c4 to c > > > > iichb1: twsi_transfer: transmitting 2 messages > > > > iichb1: TWSI_READ: read f8 from 10 > > > > iichb1: twsi_transfer: status=f8 > > > > iichb1: twsi_transfer: msg[0] flags: 0 > > > > iichb1: twsi_transfer: msg[0] len: 9 > > > > iichb1: TWSI_WRITE: Writing e4 to c > > > > > > > > and now it?s hung > > > > > > [?] > > > > I don't see that on my OrangePi One or Pine64-LTS. > > well, mine is are Nanopi Neo, maybe it’s a dts issue? > I also have a orangepi-zero but it will take me some time to make > a sdcard > > > > > > > > even with a working device, this happens sometimes: > > > > > > my app gets ENXIO from the ioctl(fd, I2CRDWR, &data) and on the > > > console: > > > ? > > > gic0: Spurious interrupt detected: last irq: 38 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 38 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 38 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 29 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 29 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 38 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 29 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 38 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 29 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 38 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 38 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 38 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 38 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 38 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 38 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 38 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 38 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 29 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 29 on CPU2 > > > gic0: Spurious interrupt detected: last irq: 29 on CPU2 > > > > > > the good news: my app is killable :-) > > > > I would need more details for this. > > it was caused by i2c issues - the cable was a bit too long. > BTW, does changing the frequency work? ie dev.iicbus.0.frequency It looks like that driver does not honor the frequency sysctl/tunable. You can often compensate for a too-long cable by adding some stronger pullups. It's typical for a SOM to have pullups in the 4.7K range on i2c. You can add your own 1K pullups to see if that helps the rise times on the bus. -- Ian