From owner-freebsd-arm@FreeBSD.ORG Fri May 2 01:17:05 2014 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A227DD9C for ; Fri, 2 May 2014 01:17:05 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7630814A0 for ; Fri, 2 May 2014 01:17:05 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Wg263-000Fhb-Dk; Fri, 02 May 2014 01:17:03 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s421H1Gg019409; Thu, 1 May 2014 19:17:01 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19jQ9DojeRo0QNnYqUUqJHp Subject: Re: BBB/I2C: Using ioctl(I2CRDWR) warns: interrupt storm detected on "intr70:" From: Ian Lepore To: Winston Smith In-Reply-To: References: <1398987601.22079.140.camel@revolution.hippie.lan> Content-Type: text/plain; charset="us-ascii" Date: Thu, 01 May 2014 19:17:01 -0600 Message-ID: <1398993421.22079.160.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: FreeBSD ARM X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 01:17:05 -0000 On Thu, 2014-05-01 at 20:24 -0400, Winston Smith wrote: > On Thu, May 1, 2014 at 7:40 PM, Ian Lepore wrote: > > Nope, that's not spurious, that's a real problem, usually it's a driver > > bug. > > It happens every time I run my `bbb_eeprom` utility -- how would I go > about further debugging this? Typically an interrupt storm will happen when a device driver's interrupt handler fails to clear the condition that triggers the interrupt, so it re-interrupts immediately, continuously. After spending a few minutes looking at arm/ti/ti_i2c.c, there's something that seems not-quite-right... the interrupt handler reads the I2C_STAT register and clears any interrupt bits it finds there, but: #define I2C_REG_STAT 0x88 When I look in the AM335x reference manual that's listed as "I2C interrupt status vector (legacy)." There's another register at 0x28 described as "Per-event enabled interrupt status vector." I wonder if just changing the I2C_REG_STAT 0x28 (in ti_i2c.h) would fix things? If not, I'd recommend doing a more thorough version of what I started doing... compare what you see in the manual with the code in terms of register offsets and which bits are being checked and see if there are other lurking glitches. -- Ian