Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 May 2016 23:35:17 -0700
From:      Adrian Chadd <adrian@freebsd.org>
To:        Patrick Kelsey <pkelsey@freebsd.org>,  "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org>,  "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>, Ruslan Bukin <br@freebsd.org>
Subject:   Re: svn commit: r298274 - head/sys/dev/spibus
Message-ID:  <CAJ-Vmokwd2wYDMrHQYGBbfvDZ6=32EatZp3k-j1cwUYDMFf%2BTg@mail.gmail.com>
In-Reply-To: <CAD44qMWbOUaveDtq%2BHn_cYAiU_VGwFEgYJ1vSFYv=4G9XSzzbQ@mail.gmail.com>
References:  <201604191539.u3JFdkHx048678@repo.freebsd.org> <CAJ-VmonyZR-CiPxceAvVzxDjL7WXDAix-Pmj2RRqp%2B9gj3u0hA@mail.gmail.com> <20160419171243.GA30453@bsdpad.com> <CACVs6=_pN9VAz1kkQQAL-ftKof%2Bkkn5MgxDP1kWj9kM-x=AzbQ@mail.gmail.com> <1461097280.1232.34.camel@freebsd.org> <CAD44qMV1bRA9USafKLSdKv8CcES34G8Kbt54OspaAA_Xdb07xg@mail.gmail.com> <CAJ-Vmo=GiP_NXfBz5ZsJkBm8Ypm-t0udZRqX9BkTa0KuC1bvrw@mail.gmail.com> <CAD44qMWJeTNuXS%2BB1ecJUFN63dweYZRKKG4Ek7kxMk-Mme7=%2BQ@mail.gmail.com> <CAD44qMWbOUaveDtq%2BHn_cYAiU_VGwFEgYJ1vSFYv=4G9XSzzbQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I've reviewed the patches from luiz, and these look fine. but indeed,
this patchset does set/release the bus each transaction so we can do
multiple transactions whilst holding the bus.

Which is fine, but it means I have to undo ruslan's removal in the below commit.

I'm happy to run through and do each of the spi bus drivers (as there
are more now than the two you patched) but it's a bit close to the
11.0-release cycle to go and churn the spibus code.

But, if people think it's worth doing it so we can try to get mmcspi
into the tree before 11.0-rel is cut, I'm happy to run through and do
it. I actually have some AR9331 stuff now that could use mmcspi. :)

What do people think?


-adrian


On 19 April 2016 at 14:19, Patrick Kelsey <pkelsey@freebsd.org> wrote:
>
>
> On Tue, Apr 19, 2016 at 4:41 PM, Patrick Kelsey <pkelsey@freebsd.org> wrote:
>>
>>
>>
>>
>> On Tue, Apr 19, 2016 at 4:38 PM, Adrian Chadd <adrian.chadd@gmail.com>
>> wrote:
>>>
>>> On 19 April 2016 at 13:37, Patrick Kelsey <pkelsey@freebsd.org> wrote:
>>> >
>>> >
>>> > On Tue, Apr 19, 2016 at 4:21 PM, Ian Lepore <ian@freebsd.org> wrote:
>>> >>
>>> >> On Tue, 2016-04-19 at 13:17 -0700, Juli Mallett wrote:
>>> >> > Patrick Kelsey offered an mmcspi driver for FreeBSD, but nobody
>>> >> > seemed
>>> >> > interested.  I know of one proprietary branch of FreeBSD using it.
>>> >> > You might poke him if you want to know how he dealt with this, and
>>> >> > if
>>> >> > you want to commit his driver.
>>> >> >
>>> >>
>>> >> Patrick is a committer, maybe he should just commit it. :)
>>> >
>>> >
>>> > What I believe originally held up that driver being committed (by
>>> > others -
>>> > this was before my commit bit) was that I relied on some out-of-tree
>>> > spibus
>>> > changes Luiz had made (as I recall, mainly being able to reserve the
>>> > SPI bus
>>> > for multiple transactions), and getting those into the tree would have
>>> > required updating/testing other existing SPI drivers, based on feedback
>>> > I
>>> > received at the time.  All I had was the RB450G that I developed and
>>> > tested
>>> > the driver with, so I really couldn't address that issue, and then work
>>> > took
>>> > me in some other direction entirely.  Some or all of these spibus
>>> > changes
>>> > that I relied on might now be in the tree, I'm not sure offhand.  I am
>>> > sure
>>> > though that a huge stack of other things I need to get through has
>>> > chronically kept me from updating that driver to current and retesting.
>>> >
>>> > When I wrote that driver, I put a lot of effort into testing it against
>>> > as
>>> > many different cards as I could obtain at the time - I believe 30 or so
>>> > in
>>> > total, all the details are in the code that was posted to the list back
>>> > then.  I encountered a number of strange/unexpected behaviors in that
>>> > set of
>>> > cards, and all of that hard-won knowledge is in that driver, including
>>> > a
>>> > much less complex fix for a shifted-response-data issue than you will
>>> > see if
>>> > you look at the Linux mmcpsi driver (as I recall, the Linux driver has
>>> > code
>>> > to arbitrarily bit-shift card response data, and to detect when that
>>> > should
>>> > be done, but it turns out that can be avoided entirely by inserting
>>> > idle
>>> > cycles in the right place when sending the command).
>>>
>>> Well, we should add the SPI bus reservation code and churn stuff as
>>> needed. I think that'd be a great addition.
>>>
>>> Do you have a patchset somewhere?
>>>
>>
>>
>> Just going from memory here - there is what I posted to the list, then at
>> some point Luiz took a stab at updating it to then-current (I should have a
>> copy of those somewhere - not sure where else they went, if anywhere), and
>> beyond that, I think there's a harmless but unnecessary conditional in the
>> original code that could be removed.
>>
>>
>
> For reference, my original patchset and the work-in-progress update Luiz
> sent me a few months later are now available at
> https://people.freebsd.org/~pkelsey/mmcspi/
>
> -Patrick
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmokwd2wYDMrHQYGBbfvDZ6=32EatZp3k-j1cwUYDMFf%2BTg>