spigen problem
Adrian Chadd
adrian.chadd at gmail.com
Mon May 20 16:32:20 UTC 2019
On Mon, 20 May 2019 at 07:43, Ian Lepore <ian at freebsd.org> wrote:
>
> On Sun, 2019-05-19 at 23:36 -0700, Adrian Chadd wrote:
> > On Sun, 19 May 2019 at 09:41, Ian Lepore <ian at freebsd.org> wrote:
> > >
> > > On Sun, 2019-05-19 at 09:03 -0700, Adrian Chadd wrote:
> > > > hi!
> > > >
> > > > this looks ok to me. I'll go commit this tonight.
> > > >
> > > >
> > > > -a
> > > >
> > >
> > > I actually think it's horrible and we should fix the real problem
> > > of
> > > supporting hardware that can only do unidirectional
> > > transfers. But,
> > > doing so is a pretty big job. I've got some ideas on it, but it's
> > > not
> > > something that's going to get finished in a week or two.
> >
> > Do you mind if I commit this for now anyway? That at least unblocks
> > Mori to do other interesting hacks.
> >
> > What are your ideas?
> >
> >
>
> Sorry, I should have been more specific that my whining didn't amount
> to a blocking request, because I just don't have the spare time right
> now to even try to address the underlying problem.
>
> There probably should have been a rule for spi from day one that the
> controller driver has to supply a dummy buffer if the caller doesn't
> supply a buffer for one of the directions and the controller must do
> bidirectional transfers (like if dma is involved). Instead we went the
> other way and said callers always must supply bidirectional buffers
> even though the case of using both input and output data in one
> transfer is exceedingly rare.
>
> I think a minimal-changes idea that may work is to say that the callers
> must supply a buffer for both directions like they do now, but they are
> allowed to set either the tx or the rx length to zero to provide a clue
> to the controller driver that a transfer in that direction isn't needed
> if the hardware can't do it (or if not doing it speeds things up or
> makes things easier). We still have to examine and change every
> existing controller driver, but the changes would be minimal.
Hi!
Ok. That makes sense. I can make the AR71xx SPI controller do this
with little effort. I don't think we have a lot of SPI drivers in the
tree though, so yeah, hopefully it shouldn't be too bad.
I think establishing that moving forward as an SPI driver requirement
would be great. That way we don't accumulate extra debt.
-adrian
More information about the freebsd-mips
mailing list