Linux clock framework development
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Fabio Estevam <fabio.estevam@nxp.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Stefan Wahren <stefan.wahren@i2se.com>,
	kernel@pengutronix.de
Cc: linux-clk@vger.kernel.org
Subject: Re: [PATCH] clk: mxs: ensure that i.MX28's ref_io clks are not operated too fast
Date: Thu, 2 May 2019 14:37:10 +0200	[thread overview]
Message-ID: <20190502123710.2l6bahxslsb5usvv@pengutronix.de> (raw)
In-Reply-To: <20190322215132.hz5ioo46zfl3tdab@pengutronix.de>

Hello,

On Fri, Mar 22, 2019 at 10:51:32PM +0100, Uwe Kleine-König wrote:
> On Wed, May 03, 2017 at 08:56:25PM +0200, Uwe Kleine-König wrote:
> > Since commits 7d81397cd93d ("clk: mxs: add clock support for imx28") and
> > 64e2bc413047 ("clk: mxs: imx28: decrease the frequency of ref_io1 for
> > SSP2 and SSP3") the frequencies for ref_io0 and ref_io1 are initialized
> > to 288 MHz because the initial frequency "seems too high to be ssp clock
> > source directly". However this isn't enough to ensure that the frequency
> > isn't increased later again. In fact this happens on my machine as the
> > mxs-spi driver calls clk_set_rate(ssp->clk, 160000000) with ssp being
> > ssp2 which is resolved to
> > 
> > 	ref_io1.rate = 320 MHz
> > 	ssp2_sel.parent = ref_io1
> > 	ssp2_div.divider = 2
> > 
> > . The observed effect is that reading MISO reliably fails: Instead of
> > the least significant bit the second least significant bit is reported
> > twice. This is probably related to the reports
> > 
> > 	https://community.nxp.com/thread/290209
> > 	https://community.nxp.com/thread/310434
> > 	https://community.nxp.com/thread/385546
> > 
> > So additionally to initializing ref_io0 and ref_io1 to 288 MHz ensure
> > that their frequency is never set to something bigger later on. This is
> > done by adding a parameter min_frac to clk-ref and use that instead of
> > the hard coded 18 to limit the valid values for FRAC. For all ref clocks
> > but ref_io0 and ref_io1 18 is used and so there is no functional change
> > for those.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
> > Hello,
> > 
> > I'd expect this to go in as a fix as it repairs reading from an EEPROM which
> > should be a fairly common task.
> > 
> > It would be nice to get confirmation from NXP that this is a right fix and
> > that spi transfers are supposed to be reliable with ref_ioX <= 288 MHz.
> 
> I spend some time on this problem once more. I examined a machine that
> showed no issues with CLKCTRL_FRAC0.IO1FRAC >= 19, but reliably reported
> more than 32000 read errors with CLKCTRL_FRAC0.IO1FRAC == 18 when
> dumping an EEPROM that contains 32768 bytes that can show the error.
> 
> The boring to find insights are, that the error is independent of the
> other dividers in the clock tree that affect the spi clk frequency and
> hbus.
> 
> A more interesting insight is that applying coolant spray nearly
> halves the read rate (as reported by dd) but also the error rate drops
> to 0. After some time the machine reheats again and the error rate
> raises to nearly 100% as before.
> 
> I just shared that information with NXP's tech support and will keep you
> updated on their reactions.

The gist of their response is that this CPU is too old and so they don't
have much resources to spend time debugging things there any more. The
supporter suggested to upgrade to i.MX6 or i.MX7 instead ...

So we're living with the work around suggested in this thread and pray
it will continue to work for us even tough it doesn't seem to be robust
enough to fix the same problem for Stefan.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

      reply	other threads:[~2019-05-02 12:37 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03 18:56 [PATCH] clk: mxs: ensure that i.MX28's ref_io clks are not operated too fast Uwe Kleine-König
2017-05-03 19:53 ` Fabio Estevam
2017-05-04 12:25   ` Stefan Wahren
2017-05-05  7:25     ` Uwe Kleine-König
2017-05-05  7:49       ` Stefan Wahren
2017-05-05 15:49         ` Stefan Wahren
2017-05-05 20:10           ` Uwe Kleine-König
2017-05-07 11:51             ` Stefan Wahren
2017-05-08  8:24               ` Uwe Kleine-König
2017-05-10 13:39                 ` Stefan Wahren
2017-05-10 14:13                   ` Uwe Kleine-König
2017-05-10 20:26                 ` Uwe Kleine-König
2017-05-08  9:53             ` AW: " Krummsdorf Michael
2017-05-08 10:14               ` Uwe Kleine-König
2017-05-10 18:05             ` Uwe Kleine-König
2017-05-26 12:06   ` Uwe Kleine-König
2017-05-29 21:06     ` Stefan Wahren
2017-05-29 21:21 ` Fabio Estevam
2017-05-30  6:54   ` Uwe Kleine-König
2017-05-30  8:04     ` Stefan Wahren
2017-05-30 11:13     ` Fabio Estevam
2018-07-26 14:32 ` Uwe Kleine-König
2018-07-26 14:50   ` Stefan Wahren
2018-07-26 15:02     ` Fabio Estevam
2018-08-01  9:31       ` Uwe Kleine-König
2018-08-02  8:33         ` Uwe Kleine-König
2018-08-03  9:09           ` Uwe Kleine-König
2018-08-08  8:23         ` Stefan Wahren
2018-08-08  9:09           ` Uwe Kleine-König
2018-07-26 15:04   ` Fabio Estevam
2018-07-26 15:18     ` Fabio Estevam
2019-03-22 21:51 ` Uwe Kleine-König
2019-05-02 12:37   ` Uwe Kleine-König [this message]

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=20190502123710.2l6bahxslsb5usvv@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=fabio.estevam@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-clk@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@codeaurora.org \
    --cc=shawnguo@kernel.org \
    --cc=stefan.wahren@i2se.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