From: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
To: tomi.valkeinen@ti.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: [BISECTED] OMAP: DSS: clk rate mismatch
Date: Mon, 27 Jan 2014 19:30:40 +0200 [thread overview]
Message-ID: <52E697C0.6000202@gmail.com> (raw)
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
[ 0.624389] Modules linked in:
[ 0.624481] CPU: 0 PID: 1 Comm: swapper Tainted: G W
3.13.0-next-20140124+ #35
[ 0.624572] [<c00126dc>] (unwind_backtrace) from [<c0010c30>]
(show_stack+0x10/0x14)
[ 0.624633] [<c0010c30>] (show_stack) from [<c0032d8c>]
(warn_slowpath_common+0x64/0x84)
[ 0.624694] [<c0032d8c>] (warn_slowpath_common) from [<c0032e2c>]
(warn_slowpath_fmt+0x2c/0x3c)
[ 0.624755] [<c0032e2c>] (warn_slowpath_fmt) from [<c01edb88>]
(dss_set_fck_rate+0x68/0x8c)
[ 0.624816] [<c01edb88>] (dss_set_fck_rate) from [<c056f300>]
(omap_dsshw_probe+0x1e4/0x2f8)
[ 0.624877] [<c056f300>] (omap_dsshw_probe) from [<c023e5f8>]
(platform_drv_probe+0x18/0x48)
[ 0.624938] [<c023e5f8>] (platform_drv_probe) from [<c023d1f0>]
(driver_probe_device+0xb0/0x200)
[ 0.624999] [<c023d1f0>] (driver_probe_device) from [<c023d3a8>]
(__driver_attach+0x68/0x8c)
[ 0.625061] [<c023d3a8>] (__driver_attach) from [<c023bac0>]
(bus_for_each_dev+0x50/0x88)
[ 0.625122] [<c023bac0>] (bus_for_each_dev) from [<c023ca28>]
(bus_add_driver+0xcc/0x1c8)
[ 0.625183] [<c023ca28>] (bus_add_driver) from [<c023da24>]
(driver_register+0x9c/0xe0)
[ 0.625244] [<c023da24>] (driver_register) from [<c023e540>]
(platform_driver_probe+0x20/0xc0)
[ 0.625305] [<c023e540>] (platform_driver_probe) from [<c056f088>]
(omap_dss_init+0x1c/0xb0)
[ 0.625366] [<c056f088>] (omap_dss_init) from [<c0008758>]
(do_one_initcall+0x94/0x138)
[ 0.625427] [<c0008758>] (do_one_initcall) from [<c054db64>]
(kernel_init_freeable+0xe4/0x1ac)
[ 0.625488] [<c054db64>] (kernel_init_freeable) from [<c03a0108>]
(kernel_init+0x8/0x100)
[ 0.625549] [<c03a0108>] (kernel_init) from [<c000ded8>]
(ret_from_fork+0x14/0x3c)
[ 0.625610] ---[ end trace 9f1065fe5ada0e27 ]---
According to git bisect, this
http://permalink.gmane.org/gmane.linux.ports.arm.omap/107355 is the
commit that broke it. Unfortunately that commit cannot be reverted, so I
did a quick'n'dirty hack(just for the sake of it):
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 9a145da..10e2fab 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -482,7 +482,8 @@ bool dss_div_calc(unsigned long pck, unsigned long
fck_min,
int dss_set_fck_rate(unsigned long rate)
{
- int r;
+ int r, mul, div;
+ unsigned long prate;
DSSDBG("set fck to %lu\n", rate);
@@ -490,8 +491,22 @@ int dss_set_fck_rate(unsigned long rate)
if (r)
return r;
- dss.dss_clk_rate = clk_get_rate(dss.dss_clk);
+ prate = clk_get_rate(dss.dss_clk);
+
+ for (mul = 1; mul < 16; mul++)
+ for(div = 1; div< 16; div++)
+ if(((prate*mul)/div) == rate)
+ goto found;
+
+found:
+ if(mul != 16)
+ r = clk_set_rate(dss.dss_clk, (rate*mul)/div);
+
+ if (r)
+ return r;
+
+ dss.dss_clk_rate = clk_get_rate(dss.dss_clk);
WARN_ONCE(dss.dss_clk_rate != rate,
"clk rate mismatch: %lu != %lu", dss.dss_clk_rate,
rate);
and it solves the problem. I hope the above will give you a better idea
on what is really broken (and how to fix it :) ).
Regards,
Ivo
next reply other threads:[~2014-01-27 17:30 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-27 17:30 Ivaylo Dimitrov [this message]
2014-01-27 18:41 ` [BISECTED] OMAP: DSS: clk rate mismatch Christoph Fritz
2014-01-28 9:04 ` Tomi Valkeinen
2014-01-28 9:35 ` Christoph Fritz
2014-01-28 9:48 ` Tomi Valkeinen
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-02-01 18:55 ` Christoph Fritz
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-07 10:12 ` Christoph Fritz
2014-02-07 13:49 ` Tomi Valkeinen
2014-02-10 20:54 ` Christoph Fritz
2014-02-11 14:53 ` 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 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 8:48 ` Tomi Valkeinen
2014-01-28 18:17 ` Ivaylo Dimitrov
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:50 ` Tero Kristo
2014-01-29 11:30 ` Tomi Valkeinen
2014-01-29 18:52 ` Ivaylo Dimitrov
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=52E697C0.6000202@gmail.com \
--to=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 \
--cc=tomi.valkeinen@ti.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;
as well as URLs for NNTP newsgroup(s).