From: "Kári Davíðsson" <kari.davidsson@marel.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH v4] powerpc/5200: Add mpc5200-spi (non-PSC) device driver
Date: Tue, 23 Jun 2009 16:31:13 +0000 [thread overview]
Message-ID: <4A410351.4050508@marel.com> (raw)
In-Reply-To: <fa686aa40906230853t5db35b11wae09cf46634d4758@mail.gmail.com>
Lowered my SPI clock down to 1MHz (from 50MHz (in steps of 10MHz).
At 1Mhz the driver stops starving the rest of the kernel.
What is interesting is that due to the low duty cycle of the SPI port
the transfer rate at 1MHz and 50Mhz is almost the same.
I suggest that the driver simply limits max frequency to 1Mhz.
This (very limited) SPI pherperial does not handle any more anyways.
rg
kd
Grant Likely wrote:
> On Tue, Jun 23, 2009 at 8:40 AM, K=E1ri Dav=ED=F0sson<kari.davidsson@mare=
l.com> wrote:
>> Hi,
>>
>> I have been testing this driver a little bit (on 2.6.29.3)
>>
>> What happens for me is that the driver starves the system while sending
>> data over the SPI interface.
>>
>> I think the problem is in the function (interrupt handler)
>> mpc52xx_spi_irq() that calls the function mpc52xx_spi_fsm_process()
>> which again is an loop that iterates over the whole data to be sent.
>=20
> Hmmm, the state machine is supposed to yield after each byte sent, but
> on fast transfers I could see it becoming ready to run again
> immediately.
>=20
> Unfortunately it is not an easy problem. The SPI device can only
> handle 1 byte at a time. Maybe it would be better for CPU fairness if
> all the work was done in a thread. I didn't originally because I
> didn't want to introduce a huge amount of scheduling overhead every
> time a byte was transfered, and I wanted to keep transfers fast. I
> need to think about this some more.
>=20
> g.
>=20
next prev parent reply other threads:[~2009-06-23 16:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-18 2:55 [PATCH v4] powerpc/5200: Add mpc5200-spi (non-PSC) device driver Grant Likely
2009-06-18 6:58 ` [spi-devel-general] " Wolfram Sang
2009-06-18 13:35 ` Grant Likely
2009-06-18 14:26 ` Wolfram Sang
2009-07-03 7:01 ` Grant Likely
2009-06-23 14:40 ` Kári Davíðsson
2009-06-23 15:53 ` Grant Likely
2009-06-23 16:31 ` Kári Davíðsson [this message]
2009-06-23 16:41 ` Grant Likely
2009-10-21 13:17 ` Wolfram Sang
2009-10-21 14:45 ` Grant Likely
2009-10-21 17:06 ` Wolfram Sang
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=4A410351.4050508@marel.com \
--to=kari.davidsson@marel.com \
--cc=grant.likely@secretlab.ca \
--cc=linuxppc-dev@ozlabs.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).