public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: I/O issues with writing to mtdblock devices on kirkwood
Date: Tue, 12 Jan 2016 22:49:57 +0100	[thread overview]
Message-ID: <4468027.N4Q71mzei0@wuerfel> (raw)
In-Reply-To: <20160112180223.GA6588@sirena.org.uk>

On Tuesday 12 January 2016 18:02:23 Mark Brown wrote:
> On Tue, Jan 12, 2016 at 05:29:40PM +0100, Arnd Bergmann wrote:
> > On Tuesday 12 January 2016 02:19:04 Andrew Lunn wrote:
> 
> > > When i played with this, i added a reschedule point at the end of the
> > > drivers transfer_one_message() function, to see if that would help. It
> > > did not, which is why i made a guess it has something to do with a
> > > lock.
> 
> > Can you try using usleep_range() instead of udelay()? It might also
> 
> Oh, indeed - should've thought of that!
> 
> > be worth trying what the actual delay is for each byte to see if a
> > longer sleep time would help, but I guess that time is highly
> > device specific.
> 
> I expect that the delay will depend on the clock speed of the SPI bus
> which is system dependant.  Might actually be worth checking if the bus
> is clocked excessively slowly.

Definitely worth checking, bug if we are transferring large enough amounts
of data, we will always incur a long delay even if the SPI bus is
clocked relatively fast. Doing a usleep_range() will likely make the
throughput much lower, as we will have longer times during which we
are not transferring any data here.

I see in the Armada 370 datasheet that the controller actually supports an
interrupt driven mode, which should be much better in principle than blocking
the CPU during the entire transfer. There may of course be a good reason
why the driver has never used interrupts, but it was originally introduced
in Orion5x, so maybe there was a bug that has been fixed in the meantime.

	Arnd

  reply	other threads:[~2016-01-12 21:49 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21 12:24 I/O issues with writing to mtdblock devices on kirkwood Ian Campbell
2015-08-21 13:07 ` Andrew Lunn
2015-08-21 20:23   ` Ian Campbell
2015-09-05 21:08 ` Andrew Lunn
2015-09-06 12:11   ` Ian Campbell
2015-10-11 14:37   ` JM
2015-10-11 15:35     ` Andrew Lunn
2015-10-12 14:29       ` JM
2015-10-12 16:05         ` Rob J. Epping
2015-10-12 16:21           ` Andrew Lunn
2015-10-13  7:51             ` Ian Campbell
     [not found]               ` <5626B4DC.8000407@mcfarlanes.me>
     [not found]                 ` <5627F4E8.3030907@mcfarlanes.me>
2015-10-21 21:11                   ` Ian Campbell
2015-10-21 21:22                     ` Iain McFarlane
2015-10-21 21:28                       ` JM
2015-10-21 21:31                         ` Iain McFarlane
2015-10-22  0:38                       ` Andrew Lunn
2015-10-22  6:40                       ` Ian Campbell
2015-10-22  6:40                       ` Ian Campbell
2016-01-11 23:00       ` Martin Michlmayr
2016-01-11 23:22         ` Mark Brown
2016-01-11 23:43           ` Andrew Lunn
2016-01-12  1:21             ` Mark Brown
2016-01-12  0:07           ` Martin Michlmayr
2016-01-12  0:47             ` Mark Brown
2016-01-12  1:19               ` Andrew Lunn
2016-01-12  1:31                 ` Mark Brown
2016-01-12 16:29                 ` Arnd Bergmann
2016-01-12 18:02                   ` Mark Brown
2016-01-12 21:49                     ` Arnd Bergmann [this message]
2016-01-12 22:00                       ` Mark Brown
2016-01-12 22:41                         ` Arnd Bergmann
2016-01-13 11:42                           ` Mark Brown

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=4468027.N4Q71mzei0@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.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