From: Mark Brown <broonie@kernel.org>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Mike Turquette <mturquette@linaro.org>,
Emilio Lopez <emilio@elopez.com.ar>,
linux-sunxi@googlegroups.com, linux-spi@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, kevin.z.m.zh@gmail.com,
sunny@allwinnertech.com, shuge@allwinnertech.com,
zhuzhenhua@allwinnertech.com
Subject: Re: [PATCH 3/4] spi: sunxi: Add Allwinner A31 SPI controller driver
Date: Fri, 17 Jan 2014 19:05:16 +0000 [thread overview]
Message-ID: <20140117190516.GJ17314@sirena.org.uk> (raw)
In-Reply-To: <20140116211201.GC3351@lukather>
[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]
On Thu, Jan 16, 2014 at 10:12:01PM +0100, Maxime Ripard wrote:
> On Thu, Jan 16, 2014 at 07:40:03PM +0000, Mark Brown wrote:
> > > + if (status & SUN6I_INT_CTL_RF_OVF) {
> > > + sun6i_spi_drain_fifo(sspi, SUN6I_FIFO_DEPTH);
> > > + sun6i_spi_write(sspi, SUN6I_INT_STA_REG, SUN6I_INT_CTL_RF_OVF);
> > > + return IRQ_HANDLED;
> > > + }
> > This looks like an overflow - a log message would be helpful for users
> > and you should possibly be flagging an error on the current transfer.
> Hmmm, that was an attempt at receiving more bytes than the FIFO can
> handle, but I guess the FIFO full interrupt would be more appropriate
> for this.
If you've got an overflow interrupt that suggests that the data is
already corrupted, assuming the interrupt isn't misnamed.
> > > + ret = clk_set_rate(sspi->mclk, 100000000);
> > > + if (ret) {
> > > + dev_err(&pdev->dev, "Couldn't change module clock rate\n");
> > > + goto err2;
> > > + }
> > Does this really need to be fatal (or done at all)? There seems to be
> > another reasonably flexible divider in the IP and it's more common to
> > either set this per transfer to something that rounds nicely or just use
> > the default and rely on the dividers.
> The default parent of the module clock runs at 24MHz, that means that
> we won't be able to reach a spi clock higher than 12MHz, which seems
> quite low. We can always change the rate in the transfer setup code
> though, if needs be.
12MHz is actually quite a common limit for SPI interfaces (half of a
24MHz master clock like the IP itself has) but yeah, you want to go
higher if you can. Doing it on transfer setup is going to mean that
you save a little power when you don't need the extra speed too.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-01-17 19:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-16 17:11 [PATCH 0/4] Add Allwinner A31 SPI controller support Maxime Ripard
2014-01-16 17:11 ` [PATCH 1/4] clk: sunxi: Add support for PLL6 on the A31 Maxime Ripard
2014-01-17 22:14 ` Mike Turquette
2014-01-27 15:02 ` Maxime Ripard
2014-01-16 17:11 ` [PATCH 2/4] ARM: sun6i: dt: Add PLL6 and SPI module clocks Maxime Ripard
2014-01-16 18:15 ` Josh Cartwright
2014-01-17 12:07 ` Maxime Ripard
2014-01-16 17:11 ` [PATCH 3/4] spi: sunxi: Add Allwinner A31 SPI controller driver Maxime Ripard
2014-01-16 19:40 ` Mark Brown
2014-01-16 21:12 ` Maxime Ripard
2014-01-17 19:05 ` Mark Brown [this message]
2014-01-16 17:11 ` [PATCH 4/4] ARM: sun6i: dt: Add SPI controllers to the A31 DTSI Maxime Ripard
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=20140117190516.GJ17314@sirena.org.uk \
--to=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=emilio@elopez.com.ar \
--cc=kevin.z.m.zh@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=maxime.ripard@free-electrons.com \
--cc=mturquette@linaro.org \
--cc=shuge@allwinnertech.com \
--cc=sunny@allwinnertech.com \
--cc=zhuzhenhua@allwinnertech.com \
/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
all inboxes | Powered by JetHome®