All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	linux-kernel@vger.kernel.org, pali.rohar@gmail.com, pavel@ucw.cz
Subject: Re: [BISECTED] OMAP: DSS: clk rate mismatch
Date: Tue, 28 Jan 2014 10:48:32 +0200	[thread overview]
Message-ID: <52E76EE0.2060006@ti.com> (raw)
In-Reply-To: <52E7614E.8010903@ti.com>


[-- Attachment #1.1: Type: text/plain, Size: 1372 bytes --]

On 2014-01-28 09:50, Tomi Valkeinen wrote:
> On 2014-01-27 19:30, Ivaylo Dimitrov wrote:
>> Hi Tomi,
>>
>> linux-next-20140124 DSS is broken on N900  - display stays black (there
>> is some noise though). I booted the kernel with qemu and it gives the
>> following warning:
>>
>> [    0.623779] DSS: set fck to 172800000
>> [    0.624237] ------------[ cut here ]------------
>> [    0.624298] WARNING: CPU: 0 PID: 1 at
>> drivers/video/omap2/dss/dss.c:497 dss_set_fck_rate+0x68/0x8c()
>> [    0.624359] clk rate mismatch: 288000000 != 172800000
> 
> That says that the omapdss tries to set the func clock to 172.8 MHz, but
> after setting the rate, the clock is at 288 MHz.
> 
> I just hit the same warning with beagle-xm yesterday, with v3.13-rc6 +
> DSS device tree patches, although it might be a different thing. I see
> that the actual clock is lower than what omapdss tries to set, you have
> the other way around.
> 
> The beagle-xm issue is related to a clk-divider fix I have sent some
> time ago:
> 
> http://mid.gmane.org/1383736008-22764-1-git-send-email-tomi.valkeinen@ti.com

I made a somewhat hacky quickfix for beagle. Applying that and the
clk-divider from the link above makes things work for me. However, as I
said, the issue with n900 might be different, but it'd be interesting to
hear if it has any effect.

 Tomi


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-OMAPDSS-DSS-fclk-rate-rounding-test.patch --]
[-- Type: text/x-diff; name="0001-OMAPDSS-DSS-fclk-rate-rounding-test.patch", Size: 1144 bytes --]

From f633a151a01b06a7b86107d93f9f53e05601c02c Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
Date: Tue, 28 Jan 2014 10:19:07 +0200
Subject: [PATCH] OMAPDSS: DSS: fclk rate rounding test

---
 drivers/video/omap2/dss/dss.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 9009f62defd0..de35be6d6e20 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -473,8 +473,22 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,
 	fckd_stop = max(DIV_ROUND_UP(prate * m, fck_hw_max), 1ul);
 
 	for (fckd = fckd_start; fckd >= fckd_stop; --fckd) {
+		unsigned long rfclk;
 		fck = prate / fckd * m;
 
+		/* do we get the right rate with this? */
+		rfclk = clk_round_rate(dss.dss_clk, fck);
+
+		if (rfclk != fck) {
+			/* no we don't. try rounding the other way */
+			fck += 1;
+
+			rfclk = clk_round_rate(dss.dss_clk, fck);
+
+			if (rfclk != fck)
+				DSSERR("mismatch %lu != %lu\n", rfclk, fck);
+		}
+
 		if (func(fck, data))
 			return true;
 	}
-- 
1.8.3.2


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <pali.rohar@gmail.com>,
	<pavel@ucw.cz>
Subject: Re: [BISECTED] OMAP: DSS: clk rate mismatch
Date: Tue, 28 Jan 2014 10:48:32 +0200	[thread overview]
Message-ID: <52E76EE0.2060006@ti.com> (raw)
In-Reply-To: <52E7614E.8010903@ti.com>


[-- Attachment #1.1: Type: text/plain, Size: 1372 bytes --]

On 2014-01-28 09:50, Tomi Valkeinen wrote:
> On 2014-01-27 19:30, Ivaylo Dimitrov wrote:
>> Hi Tomi,
>>
>> linux-next-20140124 DSS is broken on N900  - display stays black (there
>> is some noise though). I booted the kernel with qemu and it gives the
>> following warning:
>>
>> [    0.623779] DSS: set fck to 172800000
>> [    0.624237] ------------[ cut here ]------------
>> [    0.624298] WARNING: CPU: 0 PID: 1 at
>> drivers/video/omap2/dss/dss.c:497 dss_set_fck_rate+0x68/0x8c()
>> [    0.624359] clk rate mismatch: 288000000 != 172800000
> 
> That says that the omapdss tries to set the func clock to 172.8 MHz, but
> after setting the rate, the clock is at 288 MHz.
> 
> I just hit the same warning with beagle-xm yesterday, with v3.13-rc6 +
> DSS device tree patches, although it might be a different thing. I see
> that the actual clock is lower than what omapdss tries to set, you have
> the other way around.
> 
> The beagle-xm issue is related to a clk-divider fix I have sent some
> time ago:
> 
> http://mid.gmane.org/1383736008-22764-1-git-send-email-tomi.valkeinen@ti.com

I made a somewhat hacky quickfix for beagle. Applying that and the
clk-divider from the link above makes things work for me. However, as I
said, the issue with n900 might be different, but it'd be interesting to
hear if it has any effect.

 Tomi


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-OMAPDSS-DSS-fclk-rate-rounding-test.patch --]
[-- Type: text/x-diff; name="0001-OMAPDSS-DSS-fclk-rate-rounding-test.patch", Size: 1144 bytes --]

From f633a151a01b06a7b86107d93f9f53e05601c02c Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
Date: Tue, 28 Jan 2014 10:19:07 +0200
Subject: [PATCH] OMAPDSS: DSS: fclk rate rounding test

---
 drivers/video/omap2/dss/dss.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 9009f62defd0..de35be6d6e20 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -473,8 +473,22 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,
 	fckd_stop = max(DIV_ROUND_UP(prate * m, fck_hw_max), 1ul);
 
 	for (fckd = fckd_start; fckd >= fckd_stop; --fckd) {
+		unsigned long rfclk;
 		fck = prate / fckd * m;
 
+		/* do we get the right rate with this? */
+		rfclk = clk_round_rate(dss.dss_clk, fck);
+
+		if (rfclk != fck) {
+			/* no we don't. try rounding the other way */
+			fck += 1;
+
+			rfclk = clk_round_rate(dss.dss_clk, fck);
+
+			if (rfclk != fck)
+				DSSERR("mismatch %lu != %lu\n", rfclk, fck);
+		}
+
 		if (func(fck, data))
 			return true;
 	}
-- 
1.8.3.2


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

  reply	other threads:[~2014-01-28  8:48 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-27 17:30 [BISECTED] OMAP: DSS: clk rate mismatch Ivaylo Dimitrov
2014-01-27 18:41 ` Christoph Fritz
2014-01-28  9:04   ` Tomi Valkeinen
2014-01-28  9:04     ` Tomi Valkeinen
2014-01-28  9:35     ` Christoph Fritz
2014-01-28  9:48       ` Tomi Valkeinen
2014-01-28  9:48         ` Tomi Valkeinen
2014-01-28 13:40         ` Tero Kristo
2014-01-28 13:40           ` Tero Kristo
2014-01-28 17:02           ` Christoph Fritz
2014-01-29 11:21             ` OMAP: clock DT conversion issues with omap36xx Christoph Fritz
2014-01-29 14:57               ` Tero Kristo
2014-01-29 14:57                 ` Tero Kristo
2014-02-01 18:55                 ` Christoph Fritz
2014-01-29 19:03               ` Nishanth Menon
2014-01-29 19:03                 ` Nishanth Menon
2014-02-01 18:52                 ` Christoph Fritz
2014-02-02 20:09                   ` Christoph Fritz
2014-02-04 15:50               ` Tero Kristo
2014-02-04 15:50                 ` Tero Kristo
2014-02-07 10:12                 ` Christoph Fritz
2014-02-07 13:49                   ` Tomi Valkeinen
2014-02-07 13:49                     ` Tomi Valkeinen
2014-02-10 20:54                     ` Christoph Fritz
2014-02-11 14:53                       ` Tomi Valkeinen
2014-02-11 14:53                         ` Tomi Valkeinen
2014-02-12 13:18                   ` Tomi Valkeinen
2014-02-12 13:18                     ` Tomi Valkeinen
2014-02-12 22:30                     ` Belisko Marek
2014-02-13  9:03                     ` Tomi Valkeinen
2014-02-13  9:03                       ` Tomi Valkeinen
2014-02-13 10:05                       ` Tomi Valkeinen
2014-02-13 10:05                         ` Tomi Valkeinen
2014-02-14  2:18                         ` Christoph Fritz
2014-01-28  7:50 ` [BISECTED] OMAP: DSS: clk rate mismatch Tomi Valkeinen
2014-01-28  7:50   ` Tomi Valkeinen
2014-01-28  8:48   ` Tomi Valkeinen [this message]
2014-01-28  8:48     ` Tomi Valkeinen
2014-01-28 18:17     ` Ivaylo Dimitrov
2014-01-29  9:10       ` Tero Kristo
2014-01-29  9:10         ` Tero Kristo
2014-01-29  9:29         ` Ivaylo Dimitrov
2014-01-29  9:38           ` Tomi Valkeinen
2014-01-29  9:38             ` Tomi Valkeinen
2014-01-29  9:50             ` Tero Kristo
2014-01-29  9:50               ` Tero Kristo
2014-01-29 11:30       ` Tomi Valkeinen
2014-01-29 11:30         ` Tomi Valkeinen
2014-01-29 18:52         ` Ivaylo Dimitrov
2014-01-30  6:04           ` Tomi Valkeinen
2014-01-30  6:04             ` Tomi Valkeinen

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=52E76EE0.2060006@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=pali.rohar@gmail.com \
    --cc=pavel@ucw.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.