Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Aug 2020 18:40:54 -0600
From:      Ian Lepore <ian@freebsd.org>
To:        John-Mark Gurney <jmg@funkthat.com>
Cc:        Alexander Mishin <mishin@mh.net.ru>, freebsd-arm@freebsd.org
Subject:   Re: Kmod driver at iicbus. attach() and config_intrhook(9)
Message-ID:  <f7c93c8ca44a8af4e51bae70cb7b8492d33977c9.camel@freebsd.org>
In-Reply-To: <20200820235301.GE4213@funkthat.com>
References:  <7fabb65d99aaa74775c1daa91bffb873@mh.net.ru> <3249fa7e-554a-83ef-57b2-7c38aa0b4591@FreeBSD.org> <20200819072409.GA59949@bluezbox.com> <05145b71692af74b103bb226a2e93a15e1e851cb.camel@freebsd.org> <d603cf3b852d5e18fa5faa9066f643a3@mh.net.ru> <20200820223918.GC4213@funkthat.com> <d709ba1d3473f5d4353dc1109c198f8acb8ffa28.camel@freebsd.org> <20200820235301.GE4213@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2020-08-20 at 16:53 -0700, John-Mark Gurney wrote:
> > Hmm, yeah, it looks like more has been done along these lines than I
> > remembered.  In fact, the work may be done.
> > 
> > Some i2c controllers have to work properly before interrupts are
> > available, to control things like PMIC chips that are required very
> > early in device configuration.  Typically they have some sort of
> 
> Ahh, yeah, forgot about PMICs...
> 
> > polling mechanism that's used early, and revert to using interrupts
> > once they're available.  The allwinner and rockchip drivers work that
> > way.
> 
> So, sounds like any controller that is found to not be doing this, needs
> to be fixed to use the above function, and then the remaining ones that
> either poll, or use the hybrid approach can keep using
> bus_generic_attach...
> 
> Back to original question, no, that additional logic should not be
> needed, and any controller that requires it needs to be fixed
> instead...

Yeah, it was always my plan that after all controller drivers were
updated, the intrhook stuff could be removed from slave drivers that
still have it.

I'd like to see the controllers that can do xfers without interrupts
have a comment that says so.  Something like

  /* no need for bus_delayed_attach(), we xfer without interrupts */

Then you can grep -l for add_child.*iicbus and grep for
bus_delayed_attach and compare the two file lists to find drivers that
may not be doing the right thing.  Using that technique now shows that
we may still have a dozen or so controller drivers to fix (or at least
examine for correctness).

BTW, all of this tends to apply to SPI controller and slave drivers
too, but the problem is likely smaller there because we have fewer SPI
controller drivers.

-- Ian





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