From: Ned Forrester <nforrester-/d+BM93fTQY@public.gmane.org>
To: Vernon Sauder
<vernoninhand-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Limitations on transfer length [was: pxa2xx_spi with SFRM]
Date: Fri, 15 Aug 2008 15:01:06 -0400 [thread overview]
Message-ID: <48A5D272.1070804@whoi.edu> (raw)
In-Reply-To: <48A4ED85.1030803-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Vernon Sauder wrote:
> Ned Forrester wrote:
> On a side note, there is an MTD error when using the SPI Flash with the
> pxa2xx_spi driver.
>
> root@inhand-ft4 [~] # flash_erase /dev/mtd_spi
> Erase Total 1 Units
> Performing Flash Erase of length 65536 at offset 0x0 done # <- why *64K* ??
> root@inhand-ft4 [~] # echo -n hithere123 > /dev/mtd_spi
> root@inhand-ft4 [~] # hexdump -C -n512 /dev/mtdblock_spi
> 00000000 68 69 74 68 65 72 65 31 32 33 ff ff ff ff ff ff
> |hithere123......|
> 00000010 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> |................|
> *
> 00000200
> root@inhand-ft4 [~] # echo -n hithere444xxx > /dev/mtdblock_spi
> [ 231.370000] pxa2xx-spi pxa2xx-spi.1: pump_transfers: transfer length
> greater than 8191
This message is issued by pxa2xx_spi.c in pump_transfers() if the
transfer length is illegal. You may have uncovered a bug here. I think
the 8191 limitation on transfer length only applies to DMA, as that is
the length of the DMA counter. The test for this should probably be
performed only if DMA is in use. I don't think Stephen or I ever
expected any transfer to approach that length, in either PIO or DMA
mode. Is this really a legitimate transfer request? Something that can
only work in PIO mode and not in DMA mode? That seems improper to me.
> # maybe 64K??
> [ 231.380000] end_request: I/O error, dev mtdblock_spi, sector 0
> [ 231.380000] Buffer I/O error on device mtdblock_spi, logical block 0
> [ 231.380000] lost page write due to I/O error on mtdblock_spi
> root@inhand-ft4 [~] # hexdump -C -n512 /dev/mtdblock_spi
> 00000000 68 69 74 68 65 72 65 31 32 33 ff ff ff ff ff ff
> |hithere123......|
> 00000010 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> |................|
> *
> 00000200
>
> I have not done a great deal of testing with MTD yet but I can read and
> write a small test file. I was hoping to use the mtdblock interface for
> this application. I will take a little time and see if I can figure out
> what part is wrong here.
>
>
> Thanks again for your help.
> Vern
David,
Is there supposed to be any practical limit to the length of a transfer?
It seems that the /dev/mtdblock_spi driver has requested a transfer in
excess of 8191 bytes (though I don't know how long a transfer it
requested).
In this case, I think pxa2xx_spi.c could handle long transfers in PIO
mode, but not if DMA has been requested. It looks like we may have put
a bug in pxa2xx_spi by performing the length test even when DMA is not
requested.
Is it proper to require that PIO mode be used if long transfers will be
requested?
I see several possibilities (and there are probably more):
1. Make long transfers illegal (probably both undesirable and
unenforceable).
2. Require PIO mode to be used by protocol drivers for long transfers
(but how would they know how long is too long?).
3. Simply reject the call to transfer() if too long a transfer is
requested with DMA.
4. Silently, or with warning, revert to PIO mode if a long transfer is
requested with DMA.
5. Require that pxa2xx_spi break long DMA transfers into the required
number of pieces to be performed in separate DMAs, silently giving back
the message after it has completed all of it (this requires a lot of
extra book-keeping in pxa2xx_spi).
--
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=/
next prev parent reply other threads:[~2008-08-15 19:01 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 ` Ned Forrester [this message]
[not found] ` <48A5D272.1070804-/d+BM93fTQY@public.gmane.org>
2008-09-08 22:42 ` Limitations on transfer length [was: pxa2xx_spi with SFRM] David Brownell
2008-10-24 5:11 ` Vernon Sauder
[not found] ` <490158E8.8060502-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-11-13 1:31 ` Ned Forrester
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=48A5D272.1070804@whoi.edu \
--to=nforrester-/d+bm93ftqy@public.gmane.org \
--cc=david-b-yBeKhBN/0LDR7s880joybQ@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.