Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2020 13:18:31 -0700
From:      John-Mark Gurney <jmg@funkthat.com>
To:        Ian Lepore <ian@freebsd.org>
Cc:        Alexander Mishin <mishin@mh.net.ru>, freebsd-arm@freebsd.org
Subject:   Re: Kmod driver at iicbus. attach() and config_intrhook(9)
Message-ID:  <20200824201830.GF4213@funkthat.com>
In-Reply-To: <f7c93c8ca44a8af4e51bae70cb7b8492d33977c9.camel@freebsd.org>
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> <f7c93c8ca44a8af4e51bae70cb7b8492d33977c9.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Ian Lepore wrote this message on Thu, Aug 20, 2020 at 18:40 -0600:
> 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).

Just realized we should probably document this somewhere... iicbus(4)
isn't the best place, but it's a place that exists...

It's also woefully out of data, listing only a few device drivers,
and 4 interfaces...

Anyone want to submit a patch for this?

> 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.

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



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