* RE: [PATCH 0/3] davinci: spi: replace existing SPI driver
[not found] ` <004201cb0878$eaff2ac0$c0fd8040$@raj@ti.com>
@ 2010-06-14 19:13 ` Brian Niebuhr
[not found] ` <BA34378D1528D04CB3C865B8BAB2472B024CC7-mqUZVEcnZosHtCCSzi1I5PfQPhDVBs+grNQQ6b5fDX0@public.gmane.org>
[not found] ` <012801cb0c7a$4e1f5210$ea5df630$@raj@ti.com>
0 siblings, 2 replies; 13+ messages in thread
From: Brian Niebuhr @ 2010-06-14 19:13 UTC (permalink / raw)
To: Sudhakar Rajashekhara,
davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
> > I have compiled with the davinci_all_defconfig, but I don't
> have EVMs
> > for the other davinci platforms to test with.
> >
>
> I was testing this series on OMAP-L137, OMAP-L138 and DM365 EVMs and I
> found that on all these EVMS, Interrupt mode has problems.
> Driver works
> fine in DMA and POLL modes. Some problems which I had
> observed with the
> old driver are gone now.
Do you have any idea what errors you're seeing in interrupt mode? I
went and retested interrupt mode with several devices on my custom board
and it still appeared to be working fine. It may be an interaction with
code outside the driver because I'm running the identical driver code
but I'm not running the latest kernel from the davinci git repository.
I'm trying to figure out if I can get my DA850 EVM back into a state
where I can debug this. Thanks for any hints you can give!
^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <1275923348-8533-2-git-send-email-bniebuhr@efjohnson.com>]
[parent not found: <B85A65D85D7EB246BE421B3FB0FBB59301E744A8C4@dbde02.ent.ti.com>]
* RE: [PATCH 0/3] davinci: spi: replace existing SPI driver
[not found] ` <B85A65D85D7EB246BE421B3FB0FBB59301E744A8C4@dbde02.ent.ti.com>
@ 2010-06-14 19:15 ` Brian Niebuhr
[not found] ` <BA34378D1528D04CB3C865B8BAB2472B024CCA-mqUZVEcnZosHtCCSzi1I5PfQPhDVBs+grNQQ6b5fDX0@public.gmane.org>
0 siblings, 1 reply; 13+ messages in thread
From: Brian Niebuhr @ 2010-06-14 19:15 UTC (permalink / raw)
To: Nori, Sekhar, Brian Niebuhr
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/
> Can you please post this series to SPI development list
> (spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org) CCing the maintainers
> David Brownell and Grant Likely?
Done
> > INTRODUCTION
> >
> > I have been working on a custom OMAP-L138 board that has
> multiple spi
> > devices (seven) on one controller. These devices have a
> wide range of
> > transfer parameters (speed, phase, polarity, internal and gpio chip
> > selects). During my testing I found multiple errors in the
> davinci spi
> > driver as a result of this complex setup. The primary issues were:
> >
> > 1. There is a race condition due to the SPIBUF read
> busy-waits for slow
> > devices
> > 2. I found some DMA transfer length errors under some conditions
> > 3. The chip select code caused extra byte transfers (with no chip
> > select active) due to writes to SPIDAT1
> > 4. Several issues prevented using multiple SPI devices, especially
> > the DMA code, as disucussed previously on the davinci list.
>
> This should be replicated in patch description for patch 1/3
> as a record
> of why the original driver was removed.
Will do.
> > The fixes to these problems were not simple. I ended up
> making fairly
> > large changes to the driver, and those changes are
> contained in these
> > patches. The full list of changes follows.
> >
> > CHANGE LIST
> >
> > 1. davinci_spi_chipelect() now performs both activation and
> deactivation
> > of chip selects. This lets spi_bitbang fully control chip
> > select activation, as intended by the SPI API.
> > 2. Chip select activation does not cause extra writes to the SPI bus
> > 3. Chip select activation does not use SPIDEF for control.
> This change
> > will also allow for implementation of inverted (active high)
> > chip selects in the future.
> > 4. Added back gpio chip select capability from the old driver
> > 5. Fixed prescale calculation for non-integer fractions of spi clock
> > 6. Allow specification of SPI transfer parameters on a per-device
> > (instead of per-controller) basis
> > 7. Allow specification of polled, interrupt-based, or DMA
> operation on
> > a per-device basis
> > 8. Allow DMA with when more than one device is connected
> > 9. Combined pio and dma txrx_bufs functions into one since
> they share
> > large parts of their functionality, and to simplify
> item (8).
> > 10. Use only SPIFMT0 to allow more than 4 devices
> >
> > TESTING
> >
> > I have tested the driver using a custom SPI stress test on my
> > OMAP-L138-based board with three devices connected. I have tested
> > configurations with all three devices polled, all three
> interrupt-based,
> > all three DMA, and a mixture.
>
> This should be replicated in patch description for patch 2/3
> as a record
> of what the new driver provides.
Will do.
> > I have compiled with the davinci_all_defconfig, but I don't
> have EVMs
> > for the other davinci platforms to test with.
>
> DM6467, DM365 and OMAP-L137 EVMs have SPI devices as well. We can help
> test on at least some of those. No need to wait for test
> results before
> posting to SPI list though, it can happen in parallel to the review.
Ok, thanks.
> > SUMMARY
> >
> > This patch solves a lot of issues that should save a lot of
> people time
> > down the road. Since I posted the original patch I have
> had at least 5
> > people contact me personally to get help applying the patch
> because SPI
> > was broken on their boards. I have heard back from at
> least 2 that the
> > original patch worked for them.
>
> You can include an Acked-by: from those developers. This will
> help build
> the case for the new driver.
I'll see if I still have the emails.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 0/3] davinci: spi: replace existing SPI driver
@ 2010-06-14 15:54 Brian Niebuhr
2010-06-27 6:03 ` [spi-devel-general] " Grant Likely
0 siblings, 1 reply; 13+ messages in thread
From: Brian Niebuhr @ 2010-06-14 15:54 UTC (permalink / raw)
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
NOTE
This patch requires the EDMA patch at:
http://linux.davincidsp.com/pipermail/davinci-linux-open-source/2010-March/018022.html
which has since been reverted out of the davinci kernel.
INTRODUCTION
I have been working on a custom OMAP-L138 board that has multiple spi
devices (seven) on one controller. These devices have a wide range of
transfer parameters (speed, phase, polarity, internal and gpio chip
selects). During my testing I found multiple errors in the davinci spi
driver as a result of this complex setup. The primary issues were:
1. There is a race condition due to the SPIBUF read busy-waits for slow
devices
2. I found some DMA transfer length errors under some conditions
3. The chip select code caused extra byte transfers (with no chip
select active) due to writes to SPIDAT1
4. Several issues prevented using multiple SPI devices, especially
the DMA code, as disucussed previously on the davinci list.
The fixes to these problems were not simple. I ended up making fairly
large changes to the driver, and those changes are contained in these
patches. The full list of changes follows.
CHANGE LIST
1. davinci_spi_chipelect() now performs both activation and deactivation
of chip selects. This lets spi_bitbang fully control chip
select activation, as intended by the SPI API.
2. Chip select activation does not cause extra writes to the SPI bus
3. Chip select activation does not use SPIDEF for control. This change
will also allow for implementation of inverted (active high)
chip selects in the future.
4. Added back gpio chip select capability from the old driver
5. Fixed prescale calculation for non-integer fractions of spi clock
6. Allow specification of SPI transfer parameters on a per-device
(instead of per-controller) basis
7. Allow specification of polled, interrupt-based, or DMA operation on
a per-device basis
8. Allow DMA with when more than one device is connected
9. Combined pio and dma txrx_bufs functions into one since they share
large parts of their functionality, and to simplify item (8).
10. Use only SPIFMT0 to allow more than 4 devices
TESTING
I have tested the driver using a custom SPI stress test on my
OMAP-L138-based board with three devices connected. I have tested
configurations with all three devices polled, all three interrupt-based,
all three DMA, and a mixture.
I have compiled with the davinci_all_defconfig, but I don't have EVMs
for the other davinci platforms to test with.
SUMMARY
This patch solves a lot of issues that should save a lot of people time
down the road. Since I posted the original patch I have had at least 5
people contact me personally to get help applying the patch because SPI
was broken on their boards. I have heard back from at least 2 that the
original patch worked for them.
I appreciate any testing and feedback that others can provide.
Brian Niebuhr (3):
davinci: spi: remove old Davinci SPI driver
davinci: spi: add replacement SPI driver
davinci: spi: modify platform data for updated SPI driver
arch/arm/mach-davinci/board-dm355-evm.c | 10 +
arch/arm/mach-davinci/board-dm355-leopard.c | 10 +
arch/arm/mach-davinci/board-dm365-evm.c | 10 +
arch/arm/mach-davinci/dm355.c | 6 -
arch/arm/mach-davinci/dm365.c | 6 -
arch/arm/mach-davinci/include/mach/spi.h | 41 +-
drivers/spi/davinci_spi.c | 1196 ++++++++++-----------------
drivers/spi/davinci_spi.h | 186 +++++
8 files changed, 681 insertions(+), 784 deletions(-)
create mode 100644 drivers/spi/davinci_spi.h
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [spi-devel-general] [PATCH 0/3] davinci: spi: replace existing SPI driver
@ 2010-06-27 6:03 ` Grant Likely
[not found] ` <AANLkTilTTgTchq_w0CktXokOxGX32lmRyPqrTyFI9LCF-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-28 17:57 ` [spi-devel-general] " Nori, Sekhar
0 siblings, 2 replies; 13+ messages in thread
From: Grant Likely @ 2010-06-27 6:03 UTC (permalink / raw)
To: Brian Niebuhr
Cc: Tejun Heo, spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/
Any users of the current davinci_spi driver care to comment on this
series? I'm hesitant to apply a complete replacement to a driver that
was only added in December without having a lot more information.
Tejun or Sandeep, any comments?
Thanks,
g.
On Mon, Jun 14, 2010 at 9:54 AM, Brian Niebuhr <bniebuhr3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> NOTE
>
> This patch requires the EDMA patch at:
>
> http://linux.davincidsp.com/pipermail/davinci-linux-open-source/2010-March/018022.html
>
> which has since been reverted out of the davinci kernel.
>
>
> INTRODUCTION
>
> I have been working on a custom OMAP-L138 board that has multiple spi
> devices (seven) on one controller. These devices have a wide range of
> transfer parameters (speed, phase, polarity, internal and gpio chip
> selects). During my testing I found multiple errors in the davinci spi
> driver as a result of this complex setup. The primary issues were:
>
> 1. There is a race condition due to the SPIBUF read busy-waits for slow
> devices
> 2. I found some DMA transfer length errors under some conditions
> 3. The chip select code caused extra byte transfers (with no chip
> select active) due to writes to SPIDAT1
> 4. Several issues prevented using multiple SPI devices, especially
> the DMA code, as disucussed previously on the davinci list.
>
> The fixes to these problems were not simple. I ended up making fairly
> large changes to the driver, and those changes are contained in these
> patches. The full list of changes follows.
>
> CHANGE LIST
>
> 1. davinci_spi_chipelect() now performs both activation and deactivation
> of chip selects. This lets spi_bitbang fully control chip
> select activation, as intended by the SPI API.
> 2. Chip select activation does not cause extra writes to the SPI bus
> 3. Chip select activation does not use SPIDEF for control. This change
> will also allow for implementation of inverted (active high)
> chip selects in the future.
> 4. Added back gpio chip select capability from the old driver
> 5. Fixed prescale calculation for non-integer fractions of spi clock
> 6. Allow specification of SPI transfer parameters on a per-device
> (instead of per-controller) basis
> 7. Allow specification of polled, interrupt-based, or DMA operation on
> a per-device basis
> 8. Allow DMA with when more than one device is connected
> 9. Combined pio and dma txrx_bufs functions into one since they share
> large parts of their functionality, and to simplify item (8).
> 10. Use only SPIFMT0 to allow more than 4 devices
>
> TESTING
>
> I have tested the driver using a custom SPI stress test on my
> OMAP-L138-based board with three devices connected. I have tested
> configurations with all three devices polled, all three interrupt-based,
> all three DMA, and a mixture.
>
> I have compiled with the davinci_all_defconfig, but I don't have EVMs
> for the other davinci platforms to test with.
>
> SUMMARY
>
> This patch solves a lot of issues that should save a lot of people time
> down the road. Since I posted the original patch I have had at least 5
> people contact me personally to get help applying the patch because SPI
> was broken on their boards. I have heard back from at least 2 that the
> original patch worked for them.
>
> I appreciate any testing and feedback that others can provide.
>
> Brian Niebuhr (3):
> davinci: spi: remove old Davinci SPI driver
> davinci: spi: add replacement SPI driver
> davinci: spi: modify platform data for updated SPI driver
>
> arch/arm/mach-davinci/board-dm355-evm.c | 10 +
> arch/arm/mach-davinci/board-dm355-leopard.c | 10 +
> arch/arm/mach-davinci/board-dm365-evm.c | 10 +
> arch/arm/mach-davinci/dm355.c | 6 -
> arch/arm/mach-davinci/dm365.c | 6 -
> arch/arm/mach-davinci/include/mach/spi.h | 41 +-
> drivers/spi/davinci_spi.c | 1196 ++++++++++-----------------
> drivers/spi/davinci_spi.h | 186 +++++
> 8 files changed, 681 insertions(+), 784 deletions(-)
> create mode 100644 drivers/spi/davinci_spi.h
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> spi-devel-general mailing list
> spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/spi-devel-general
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <AANLkTilTTgTchq_w0CktXokOxGX32lmRyPqrTyFI9LCF-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 0/3] davinci: spi: replace existing SPI driver
[not found] ` <AANLkTilTTgTchq_w0CktXokOxGX32lmRyPqrTyFI9LCF-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-06-27 8:25 ` Tejun Heo
0 siblings, 0 replies; 13+ messages in thread
From: Tejun Heo @ 2010-06-27 8:25 UTC (permalink / raw)
To: Grant Likely
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
Thomas Koeller, Brian Niebuhr, Sandeep Paulraj
Hello,
On 06/27/2010 08:03 AM, Grant Likely wrote:
> Any users of the current davinci_spi driver care to comment on this
> series? I'm hesitant to apply a complete replacement to a driver that
> was only added in December without having a lot more information.
>
> Tejun or Sandeep, any comments?
Eh, I don't really have any idea about the code. My only commit there
is slab.h inclusion cleanup which doesn't require any specific
knowledge of the code, so... no useful comment from me.
Thanks.
--
tejun
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [spi-devel-general] [PATCH 0/3] davinci: spi: replace existing SPI driver
[not found] ` <AANLkTilTTgTchq_w0CktXokOxGX32lmRyPqrTyFI9LCF-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-27 8:25 ` Tejun Heo
@ 2010-06-28 17:57 ` Nori, Sekhar
[not found] ` <B85A65D85D7EB246BE421B3FB0FBB59301E77EDA9C-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
0 siblings, 1 reply; 13+ messages in thread
From: Nori, Sekhar @ 2010-06-28 17:57 UTC (permalink / raw)
To: Grant Likely, Brian Niebuhr
Cc: Tejun Heo, spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/
Hi Grant,
On Sun, Jun 27, 2010 at 11:33:13, Grant Likely wrote:
> Any users of the current davinci_spi driver care to comment on this
> series? I'm hesitant to apply a complete replacement to a driver that
> was only added in December without having a lot more information.
Inside TI, we tested the new driver using SPI flash in DMA, interrupt and
polled modes and found it to be working fine. Please see:
http://www.mail-archive.com/davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org/msg18139.html
and
http://www.mail-archive.com/davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org/msg18198.html
Other folks have tested it too and are happy with the fixes it bring in:
http://www.mail-archive.com/davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org/msg18184.html
http://www.mail-archive.com/davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org/msg18195.html
Thanks,
Sekhar
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2010-06-29 21:49 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1275923348-8533-1-git-send-email-bniebuhr@efjohnson.com>
[not found] ` <004201cb0878$eaff2ac0$c0fd8040$@raj@ti.com>
2010-06-14 19:13 ` [PATCH 0/3] davinci: spi: replace existing SPI driver Brian Niebuhr
[not found] ` <BA34378D1528D04CB3C865B8BAB2472B024CC7-mqUZVEcnZosHtCCSzi1I5PfQPhDVBs+grNQQ6b5fDX0@public.gmane.org>
2010-06-15 11:02 ` Sudhakar Rajashekhara
2010-06-15 11:02 ` Sudhakar Rajashekhara
[not found] ` <012801cb0c7a$4e1f5210$ea5df630$@raj@ti.com>
2010-06-16 15:57 ` [spi-devel-general] [PATCH 0/3] davinci: spi: replace existingSPI driver Brian Niebuhr
[not found] ` <1275923348-8533-2-git-send-email-bniebuhr@efjohnson.com>
[not found] ` <1275923348-8533-3-git-send-email-bniebuhr@efjohnson.com>
[not found] ` <004601cb0879$c25b75f0$471261d0$@raj@ti.com>
2010-06-14 19:13 ` [PATCH 2/3] davinci: spi: add replacement SPI driver Brian Niebuhr
[not found] ` <1275923348-8533-4-git-send-email-bniebuhr@efjohnson.com>
[not found] ` <004701cb087a$6cb51470$461f3d50$@raj@ti.com>
2010-06-14 19:13 ` [PATCH 3/3] davinci: spi: modify platform data for updated SPIdriver Brian Niebuhr
[not found] ` <B85A65D85D7EB246BE421B3FB0FBB59301E744A8C4@dbde02.ent.ti.com>
2010-06-14 19:15 ` [PATCH 0/3] davinci: spi: replace existing SPI driver Brian Niebuhr
[not found] ` <BA34378D1528D04CB3C865B8BAB2472B024CCA-mqUZVEcnZosHtCCSzi1I5PfQPhDVBs+grNQQ6b5fDX0@public.gmane.org>
2010-06-16 19:34 ` Grant Likely
2010-06-14 15:54 Brian Niebuhr
2010-06-27 6:03 ` [spi-devel-general] " Grant Likely
[not found] ` <AANLkTilTTgTchq_w0CktXokOxGX32lmRyPqrTyFI9LCF-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-27 8:25 ` Tejun Heo
2010-06-28 17:57 ` [spi-devel-general] " Nori, Sekhar
[not found] ` <B85A65D85D7EB246BE421B3FB0FBB59301E77EDA9C-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2010-06-28 18:27 ` Grant Likely
[not found] ` <AANLkTikSU105SxoX6m0u0DhDoGQ0047eSGurpivfn74s-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-29 8:01 ` Grant Likely
[not found] ` <AANLkTilT2mZsbgt3fyjEpFheI6U2qNpyW-2ruC7tcvkH-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-29 21:49 ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).