linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tero Kristo <t-kristo@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>, Adam Ford <aford173@gmail.com>
Cc: "Tony Lindgren" <tony@atomide.com>,
	Linux-OMAP <linux-omap@vger.kernel.org>,
	"Adam Ford" <adam.ford@logicpd.com>,
	"Benoît Cousson" <bcousson@baylibre.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	devicetree <devicetree@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/omap: Migrate minimum FCK/PCK ratio from Kconfig to dts
Date: Mon, 30 Sep 2019 11:53:42 +0300	[thread overview]
Message-ID: <cb028b1e-05ca-9b22-be5d-c63f5fd56cc4@ti.com> (raw)
In-Reply-To: <23eba53a-9304-2ceb-d97e-01891ec0b3ed@ti.com>

[-- Attachment #1: Type: text/plain, Size: 2582 bytes --]

On 30/09/2019 09:45, Tomi Valkeinen wrote:
> Hi,
> 
> On 27/09/2019 18:47, Tomi Valkeinen wrote:
>> On 27/09/2019 18:37, Tero Kristo wrote:
>>
>>> If you can provide details about what clock framework / driver does 
>>> wrong (sample clk_set_xyz call sequence, expected results via 
>>> clk_get_xyz, and what fails), I can take a look at it. Just reporting 
>>> arbitrary display driver issues I won't be able to debug at all (I 
>>> don't have access to any of the displays, nor do I want to waste time 
>>> debugging them without absolutely no knowledge whatsoever.)
>>
>> I used your hack patches to allow changing rates via debugfs. And set 
>> dss1_alwon_fck_3430es2 to 27000000 or 27870967. The end result was 
>> that DSS gets some very high clock from dss1_alwon_fck_3430es2, as the 
>> frame rate jumps to many hundreds fps.
>>
>> So, these numbers are not real, but to give the idea what I saw. 
>> Running first with 50 MHz, I can see, say, 40 fps. Then I set the 
>> clock to 30 MHz, and fps dropped to, say, 30fps, as expected with 
>> lower clock. Then I set the clock to 27MHz (or the other one), 
>> expecting a bit lower fps, but instead I saw hundreds of fps.
>>
>> I don't know if there's any other way to observe the wrong clock rate 
>> but have the dss enabled and running kmstest or similar. I can help 
>> you set that up next week, should be trivial. You don't need a display 
>> for that.
> 
> Here's how to reproduce. I have the attached patches. Three of them are 
> the clk-debug ones, and one of mine to make it easy to test without a 
> display, and without underflow flood halting the device. There are on 
> top of v5.3. Kernel config also attached.
> 
> kmstest is from kms++ project (https://github.com/tomba/kmsxx). It 
> should be straightforward to compile, but kmstest binary is also 
> included in TI's rootfs.

Ok, I ignored all your test code and just fiddled with my trusty clk 
debugfs patches. I don't like debugging with test code I have no 
experience with. :)

Anyways, it seems the dpll4_m4_ck max divider value is wrong, it only 
accepts values upto 16 at least on my board. The setting for this in DT 
is 32, and it is most likely SoC specific what happens if you write an 
invalid value to the divider.

The best action here is probably to drop the max-div value for this 
clock to 16. Can someone check this with their display setup and see 
what happens? Attached patch should do the trick.

-Tero

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

[-- Attachment #2: 0001-ARM-dts-omap3-fix-DPLL4-M4-divider-max-value.patch --]
[-- Type: text/x-patch, Size: 1057 bytes --]

From 28bfaaa3747e9033b6d4cd7bb06eb72dc04580a5 Mon Sep 17 00:00:00 2001
From: Tero Kristo <t-kristo@ti.com>
Date: Mon, 30 Sep 2019 11:49:39 +0300
Subject: [PATCH 1/1] ARM: dts: omap3: fix DPLL4 M4 divider max value

The maximum divider value for DPLL4 M4 divider appears wrong. For most
OMAP3 family SoCs this is 16, but it is defined as 32, which is maybe
only valid for omap36xx. To avoid any overflows in trying to write this
register, set the max to 16 for all omap3 family.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/boot/dts/omap3xxx-clocks.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/omap3xxx-clocks.dtsi b/arch/arm/boot/dts/omap3xxx-clocks.dtsi
index 685c82a9d03e..0656c32439d2 100644
--- a/arch/arm/boot/dts/omap3xxx-clocks.dtsi
+++ b/arch/arm/boot/dts/omap3xxx-clocks.dtsi
@@ -416,7 +416,7 @@
 		#clock-cells = <0>;
 		compatible = "ti,divider-clock";
 		clocks = <&dpll4_ck>;
-		ti,max-div = <32>;
+		ti,max-div = <16>;
 		reg = <0x0e40>;
 		ti,index-starts-at-one;
 	};
-- 
2.17.1


  reply	other threads:[~2019-09-30  8:53 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-10 19:42 [PATCH] drm/omap: Migrate minimum FCK/PCK ratio from Kconfig to dts Adam Ford
2019-05-28 11:11 ` Tomi Valkeinen
2019-05-28 15:09   ` Adam Ford
2019-05-28 15:20     ` H. Nikolaus Schaller
2019-05-28 15:53     ` Tomi Valkeinen
2019-05-31 12:13       ` Adam Ford
2019-09-25 20:51       ` Adam Ford
2019-09-26  6:55         ` Tomi Valkeinen
2019-09-26 14:12           ` Adam Ford
2019-09-27  6:21             ` Tomi Valkeinen
2019-09-27 12:13               ` Adam Ford
2019-09-27 13:45                 ` Tomi Valkeinen
2019-09-27  7:55             ` Tomi Valkeinen
2019-09-27 12:33               ` Adam Ford
2019-09-27 13:47                 ` Tomi Valkeinen
2019-09-27 15:37                   ` Tero Kristo
2019-09-27 15:47                     ` Tomi Valkeinen
2019-09-30  6:45                       ` Tomi Valkeinen
2019-09-30  8:53                         ` Tero Kristo [this message]
2019-09-30 12:41                           ` Adam Ford
2019-09-30 12:47                             ` Tero Kristo
2019-09-30 13:17                               ` Adam Ford
2019-09-30 13:35                                 ` Tomi Valkeinen
2019-09-30 13:38                           ` H. Nikolaus Schaller
2019-09-30 13:54                             ` Adam Ford
2019-09-30 14:04                               ` Adam Ford
2019-09-30 14:12                                 ` Adam Ford
2019-09-30 14:20                                   ` Tomi Valkeinen
2019-09-30 14:27                                     ` Tomi Valkeinen
2019-09-30 14:56                                       ` H. Nikolaus Schaller
2019-09-30 15:10                                       ` Adam Ford
2019-09-30 17:48                                         ` Tero Kristo
2019-10-01  5:07                                           ` Tomi Valkeinen
2019-10-01  5:12                                             ` Tero Kristo
2019-10-01  8:12                                             ` Tero Kristo
2019-10-01  9:31                                               ` Tomi Valkeinen
2019-10-01 13:06                                                 ` Adam Ford
2019-10-01 13:14                                                   ` Tomi Valkeinen
2019-09-25 21:26   ` Andrew F. Davis
2019-06-13 20:22 ` Rob Herring

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=cb028b1e-05ca-9b22-be5d-c63f5fd56cc4@ti.com \
    --to=t-kristo@ti.com \
    --cc=adam.ford@logicpd.com \
    --cc=aford173@gmail.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    --cc=tony@atomide.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).