From patchwork Mon Jan 27 17:30:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Dimitrov X-Patchwork-Id: 3543351 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4A6B0C02DC for ; Mon, 27 Jan 2014 17:31:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2E07920123 for ; Mon, 27 Jan 2014 17:31:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 66DA020131 for ; Mon, 27 Jan 2014 17:31:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753882AbaA0Rat (ORCPT ); Mon, 27 Jan 2014 12:30:49 -0500 Received: from mail-ea0-f182.google.com ([209.85.215.182]:55853 "EHLO mail-ea0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753842AbaA0Rap (ORCPT ); Mon, 27 Jan 2014 12:30:45 -0500 Received: by mail-ea0-f182.google.com with SMTP id r15so2474418ead.13 for ; Mon, 27 Jan 2014 09:30:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=Di2yEnXpd/4ulwu+bJS7W0jE931yUwLFuDqh1m15ZRQ=; b=vfjObNIac7JEBsURGjd6zQscHBKsJmcKHs2vTdRQ2GFY5+FhQM57uKaWIy5GJ6KoTc sNyF5q+1OxkJSz0P4VbpFRvTTKIQtH76cx8fKtmyYrvCQucT8iIhZSPLP0gelYQjJxgN fpnHoAic51doPp6+wq6WGWDL3fdnZu9gIHzfKSZgc/hWekDXhDItw8QQAA0++1NbSR+b siw1tfJ9ZZSme1ZZ3IVFe7+PjWWSC+hSvuE+kveHZLg3s+1VWwBQAa0SyJ/qGUEWUA1G dXCV7KVNNigtVZRwMzO3wWISKoDeFOdN7oI4HoMePrksdwaGk2Lzn2eRFTWX37f+v9u4 EWsg== X-Received: by 10.14.173.129 with SMTP id v1mr22441938eel.60.1390843844166; Mon, 27 Jan 2014 09:30:44 -0800 (PST) Received: from [192.168.1.10] ([46.249.74.23]) by mx.google.com with ESMTPSA id z46sm44815057een.1.2014.01.27.09.30.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Jan 2014 09:30:43 -0800 (PST) Message-ID: <52E697C0.6000202@gmail.com> Date: Mon, 27 Jan 2014 19:30:40 +0200 From: Ivaylo Dimitrov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: tomi.valkeinen@ti.com CC: "linux-omap@vger.kernel.org" , linux-kernel@vger.kernel.org, pali.rohar@gmail.com, pavel@ucw.cz Subject: [BISECTED] OMAP: DSS: clk rate mismatch Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 0.624633] [] (show_stack) from [] (warn_slowpath_common+0x64/0x84) [ 0.624694] [] (warn_slowpath_common) from [] (warn_slowpath_fmt+0x2c/0x3c) [ 0.624755] [] (warn_slowpath_fmt) from [] (dss_set_fck_rate+0x68/0x8c) [ 0.624816] [] (dss_set_fck_rate) from [] (omap_dsshw_probe+0x1e4/0x2f8) [ 0.624877] [] (omap_dsshw_probe) from [] (platform_drv_probe+0x18/0x48) [ 0.624938] [] (platform_drv_probe) from [] (driver_probe_device+0xb0/0x200) [ 0.624999] [] (driver_probe_device) from [] (__driver_attach+0x68/0x8c) [ 0.625061] [] (__driver_attach) from [] (bus_for_each_dev+0x50/0x88) [ 0.625122] [] (bus_for_each_dev) from [] (bus_add_driver+0xcc/0x1c8) [ 0.625183] [] (bus_add_driver) from [] (driver_register+0x9c/0xe0) [ 0.625244] [] (driver_register) from [] (platform_driver_probe+0x20/0xc0) [ 0.625305] [] (platform_driver_probe) from [] (omap_dss_init+0x1c/0xb0) [ 0.625366] [] (omap_dss_init) from [] (do_one_initcall+0x94/0x138) [ 0.625427] [] (do_one_initcall) from [] (kernel_init_freeable+0xe4/0x1ac) [ 0.625488] [] (kernel_init_freeable) from [] (kernel_init+0x8/0x100) [ 0.625549] [] (kernel_init) from [] (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): @@ -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 --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);