public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Nick Thompson <nick.thompson@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Davinci: SPI performance enhancements
Date: Tue, 22 Jun 2010 09:29:40 +0100	[thread overview]
Message-ID: <4C207474.5090904@ge.com> (raw)
In-Reply-To: <DA214C1C-1C6A-4654-8778-DF6959AEE699@audioscience.com>

On 21/06/10 19:38, Delio Brignoli wrote:
> Hello Nick,
> 
> On 21/06/2010, at 11:27, Nick Thompson wrote:
>> The following restructuring and optimisations increase the SPI
>> read performance from 1.3MiB/s (on da850) to 2.87MiB/s (on da830):
> 
> Using this patch I get 2.21MiB/s on my L138 EVM (da850), quite 
> an improvement! I would like to see how much my original patch can
> be improved using some of your changes without splitting the code
> to handle the three cases. I will try later this week.

Not testing the txp and rxp pointers in the loop was a significant
gain for me and pipe-lining the TX and RX operations is going to be
a little trickier, but give it a go by all means.

> 
> [...]
>> +	if (!dout)
>> +		return davinci_spi_read(slave, len, din, flags);
>> +	else if (!din)
>> +		return davinci_spi_write(slave, len, dout, flags);
>> +#ifndef CONFIG_SPI_HALF_DUPLEX
>> +	else
>> +		return davinci_spi_read_write(slave, len, din, dout, flags);
>> +#endif
> 
> I think there should always be an else branch at the end even if 
> CONFIG_SPI_HALF_DUPLEX is not defined. Something like:
> 
> #else
> 	flags |= SPI_XFER_END;
> #endif

Hmmm, yes, you are correct. That must be added, else in the unexpected
case, the transaction will be opened and left open. I'll fix that.

> 
> to terminate the transfer instead of failing silently.
> In fact it should signal the error condition somehow, but 
> I do not know enough about u-boot to provide an advice on this.

I think maybe a printk(KERN_ERR ...) will do it. I'll add that too.

> 
> Thanks
> --
> Delio

Thanks for the review.

Nick.

  reply	other threads:[~2010-06-22  8:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-21  9:27 [U-Boot] [PATCH] Davinci: SPI performance enhancements Nick Thompson
2010-06-21 14:41 ` Paulraj, Sandeep
2010-06-21 14:57   ` Nick Thompson
2010-06-21 15:21   ` Nick Thompson
2010-06-21 18:38 ` Delio Brignoli
2010-06-22  8:29   ` Nick Thompson [this message]
2010-06-22  9:57     ` Delio Brignoli
2010-06-22 14:27       ` Paulraj, Sandeep
2010-06-22 14:40         ` Delio Brignoli
2010-06-22 15:27 ` Paulraj, Sandeep
2010-06-23  8:14   ` Nick Thompson

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=4C207474.5090904@ge.com \
    --to=nick.thompson@ge.com \
    --cc=u-boot@lists.denx.de \
    /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