linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ned Forrester <nforrester-/d+BM93fTQY@public.gmane.org>
To: Vernon Sauder <vernoninhand-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: Limitations on transfer length [was: pxa2xx_spi with SFRM]
Date: Wed, 12 Nov 2008 20:31:54 -0500	[thread overview]
Message-ID: <491B838A.5080103@whoi.edu> (raw)
In-Reply-To: <490158E8.8060502-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Sorry for the delayed response....

Vernon Sauder wrote:
> I finally had some time to test this again. For refreshing, this is
> testing an m25p80 MTD device on the PXA270 SPI bus.
> 
> Good news and Bad news. Good  news is that the error is gone with your
> patch on 2.6.24.4. Bad news is that it there are still cases where the
> kernel crashes or locks up using 2.6.27-rc8.

if you snapshotted 2.6.27-rc8, pxa2xx_spi would not have built properly.
 There was an error in a patch of mine that was fixed by a 2008-10-01
patch by Mike Rapoport, which would have been included in 2.6.27-rc9.
You probably figured that out.

> One time, this much of an error message got out before the kernel
> completely locked up:
> 
> root@inhand-ft4 [~] # cat /tmp/k > /dev/mtd_spi
> cat: Write Error: Bad address
> [  151.497694] ------------[ cut here ]------------
> [  151.503356] WARNING: at kernel/mutex.c:135
> __mutex_lock_slowpath+0x9c/0x200()
> [  151.510452] Modules linked in: spidev
> 
> And here is another dump that appeared after multiple writes: (Notice
> first the failed writes. I don't know what is causing that. The HW setup
> is slightly different.)

[snip crash dump]

I don't know if it could be related, but there is another thread "PXA270
SSP DMA Corruption" in which Scott Merritt reports trouble with the
combination of spidev and pxa2xx_spi.  He is also up-to-date with
2.6.27. He does not report kernel crashes, but simply corrupted data.

I looked at spidev today (for the first time) and noticed that it uses
the same buffer for rx and tx.  That should be alright, except that I
don't think that pxa2xx_spi handles that case correctly in DMA mode.
pxa2xx_spi will try to dma_map_single() the same buffer twice, once in
each direction.

Are you using PIO or DMA mode?  If DMA, can you try setting
struct pxa2xx_spi_master.enable_dma = 0;

If that works better, then maybe you have the same problem.

> I wanted to send this so you know. There is the possibility that the
> 2.6.27 I am using is not completely configured and/or patched. It was
> based on Linus' git tree but I have not completed testing all my board
> patches. This feature is not being requested any longer so I don't have
> a lot of pressure to fix it right now. As I get closer to finishing the
> project, I might need to resolve this.

Maybe if you have some other issues, that would explain the difference
in symptoms between your application and Merritt's.  Alternatively, it
could be different ways that messages are formatted by the chain of code
that accesses MTD.  Merritt is directly using the ioctl interface of spidev.

-- 
Ned Forrester                                       nforrester-/d+BM93fTQY@public.gmane.org
Oceanographic Systems Lab                                  508-289-2226
Applied Ocean Physics and Engineering Dept.
Woods Hole Oceanographic Institution          Woods Hole, MA 02543, USA
http://www.whoi.edu/sbl/liteSite.do?litesiteid=7212
http://www.whoi.edu/hpb/Site.do?id=1532
http://www.whoi.edu/page.do?pid=10079


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

  parent reply	other threads:[~2008-11-13  1:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08  8:02 pxa2xx_spi with SFRM nforrester-/d+BM93fTQY
     [not found] ` <1218182539.489bfd8b24a3d-2RFepEojUI3934Ez3d9NBg@public.gmane.org>
2008-08-08 10:08   ` Jonathan Cameron
     [not found]     ` <489C1B23.6040804-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
2008-08-11 22:55       ` Vernon Sauder
     [not found]         ` <48A0C35D.5010606-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-08-14 15:29           ` Ned Forrester
     [not found]             ` <48A44F77.1020908-/d+BM93fTQY@public.gmane.org>
2008-08-15  2:44               ` Vernon Sauder
     [not found]                 ` <48A4ED85.1030803-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-08-15 19:01                   ` Limitations on transfer length [was: pxa2xx_spi with SFRM] Ned Forrester
     [not found]                     ` <48A5D272.1070804-/d+BM93fTQY@public.gmane.org>
2008-09-08 22:42                       ` David Brownell
2008-10-24  5:11                       ` Vernon Sauder
     [not found]                         ` <490158E8.8060502-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-11-13  1:31                           ` Ned Forrester [this message]
2008-08-15 19:09                   ` pxa2xx_spi with SFRM Ned Forrester
     [not found]                     ` <48A5D44D.6040106-/d+BM93fTQY@public.gmane.org>
2008-08-16  2:33                       ` Vernon Sauder
     [not found]                         ` <20080815223307.02db86aa-W37fpRALFaH6NKmgiXY+hA0JkcsJGQge@public.gmane.org>
2008-08-18 18:34                           ` Ned Forrester
     [not found]                             ` <48A9C0D0.5050304-/d+BM93fTQY@public.gmane.org>
2008-08-20  0:59                               ` Ned Forrester
     [not found]                                 ` <48AB6C8F.4040408-/d+BM93fTQY@public.gmane.org>
2008-08-21 22:08                                   ` Vernon Sauder
     [not found]                                     ` <20080821180826.491ac70b-W37fpRALFaH6NKmgiXY+hA0JkcsJGQge@public.gmane.org>
2008-08-23  3:23                                       ` Ned Forrester
     [not found]                                         ` <48AF82B3.8040709-/d+BM93fTQY@public.gmane.org>
2008-08-29 19:18                                           ` Vernon Sauder
     [not found]                                             ` <20080829151839.7a85e7d6-W37fpRALFaH6NKmgiXY+hA0JkcsJGQge@public.gmane.org>
2008-08-30  3:07                                               ` Ned Forrester
2008-09-08 22:50                           ` David Brownell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=491B838A.5080103@whoi.edu \
    --to=nforrester-/d+bm93ftqy@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=vernoninhand-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).