Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Apr 2019 07:38:27 -0600
From:      Ian Lepore <ian@freebsd.org>
To:        Per Hedeland <per@hedeland.org>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: I2c producing crazy console messages [[Re: insanely-high interrupt rates -- PARTIAL resolution (Pi2)]]
Message-ID:  <584546affdae591dbd204dc7e7385db628ba7b3e.camel@freebsd.org>
In-Reply-To: <c745bfea-4dce-1212-62c1-6410f2eef87b@hedeland.org>
References:  <004ddba628b94b80845d8e509ddcb648d21fd6c9.camel@freebsd.org> <669892ac3fc37b0843a156c0ab102316829103fd.camel@freebsd.org> <663f2566-b035-7011-70eb-4163b41e6e55@denninger.net> <20190325164827.GL57400@cicely7.cicely.de> <3db9cf8a-68ee-e339-67bf-760ee51464fd@denninger.net> <fc17ac0f77832e840b9fffa9b1074561f1e766d8.camel@freebsd.org> <d96c7f42-f01b-8990-a558-ee92d631b51d@denninger.net> <dc56a8964cae942354cbe2b5b0620f2eebb569bb.camel@freebsd.org> <874l7fyrpr.fsf@news-spur.riddles.org.uk> <701e011f-3088-8ed4-4fbb-6fa93ac698f5@denninger.net> <aefa1d778e7684f71ffed49ce32ee80e2273d033.camel@freebsd.org> <67133e19-2be5-ccd1-2ded-008b36a866ec@denninger.net> <6f6f8471-8624-c5e2-547c-42b712254126@denninger.net> <ec6a5200c9c0b255094f6a46a1d2f95cd9334ea6.camel@freebsd.org> <8bcdb1e1-e561-6255-848d-e532ad4d5918@denninger.net> <499b53d5-23ed-c33b-3715-018720c536a3@hedeland.org> <bdf9fb604e7b4a54d3f0085bd7223c9d6b1679c4.camel@freebsd.org> <c745bfea-4dce-1212-62c1-6410f2eef87b@hedeland.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 2019-04-20 at 12:39 +0200, Per Hedeland wrote:
> On 2019-04-19 18:04, Ian Lepore wrote:
> > On Fri, 2019-04-19 at 13:32 +0200, Per Hedeland wrote:
> > > But anyway I would be *extremely* surprised if I saw them, since
> > > AFAIU
> > > the i2c bus per se has no concept of interrupts - you need to
> > > connect
> > > some other wire from the device to e.g. a gpio pin (with
> > > appropriate
> > > config) in order to generate interrupts - and I haven't done
> > > that.
> > > (The
> > > ads1015 does have an ALERT/RDY pin that could potentially be used
> > > for
> > > it, but since FreeBSD AFAIK doesn't have a way to deliver the
> > > interrupts to userland code, I had no interest in it.)
> > 
> > You're thinking about this all wrong.  The interrupts have nothing
> > to
> > do with the i2c bus, but the i2c controller still uses interrupts
> > to
> > signal things like "trasnfer done" or "fifo empty".
> 
> OK...
> 
> > If there's nothing
> > on the bus, you don't end up doing any transfers, so you don't get
> > any
> > spurious interrupts.
> 
> That much is clear even to me, but I'm doing 128 transfers/second
> without seeing any spurious interrupts. But I guess my observation
> matches the second alternative in one of your earlier messages (where
> the first alternative, as far as I understood, was about interrupts
> from the i2c device itself...) - i.e. interrupts being dispatched to
> multiple cores. This obviously can't happen on the RPi 0/1 that I've
> tried, since they're single-core.
> 
> 

Exactly so.  I did all my recent rpi i2c driver work using an old rpi1
so I never saw the problem.  Now I've got an rpi2, and oddly enough,
last night I finally saw a few spurious interrupts while writing to an
RTC chip (but never while reading from one).  I also now have an
ADS1015 in hand (gotta love amazon free same-day delivery).  So
hopefully today I can track this down, although without something like
jtag debugging, the only way to know if it's the "multiple cores
signalled at once" situation is to eliminate all other possibilities.

-- Ian




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?584546affdae591dbd204dc7e7385db628ba7b3e.camel>