linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BISECTED] OMAP: DSS: clk rate mismatch
@ 2014-01-27 17:30 Ivaylo Dimitrov
  2014-01-27 18:41 ` Christoph Fritz
  2014-01-28  7:50 ` [BISECTED] OMAP: DSS: clk rate mismatch Tomi Valkeinen
  0 siblings, 2 replies; 33+ messages in thread
From: Ivaylo Dimitrov @ 2014-01-27 17:30 UTC (permalink / raw)
  To: tomi.valkeinen; +Cc: linux-omap, linux-kernel, pali.rohar, pavel

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

^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2014-02-14  2:18 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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: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

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).