Re: [PATCH v2] pwm: tegra: Optimize period calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Svyatoslav,

On Wed, Sep 21, 2022 at 12:33:48PM +0300, Svyatoslav Ryhel wrote:
> Asus Transformers are based on T20 and T30 SoC.
> 
> Thanks for your patience, I am enclosing the pwm trace you requested. It is
> taken from Asus Transformer TF700T owned by Maxim Schwalm (he is included
> into this mailing list but was not able to send trace).
> 
> Best regards. Svyatoslav R.

Yeah, it seems several devices are affected. The one with a tegra124 was
a Nyan one.

> cat /sys/kernel/debug/tracing/trace
> # tracer: nop
> #
> # entries-in-buffer/entries-written: 26/26   #P:4
> #
> #                                _-----=> irqs-off/BH-disabled
> #                               / _----=> need-resched
> #                              | / _---=> hardirq/softirq
> #                              || / _--=> preempt-depth
> #                              ||| / _-=> migrate-disable
> #                              |||| /     delay
> #           TASK-PID     CPU#  |||||  TIMESTAMP  FUNCTION
> #              | |         |   |||||     |         |
>  gsd-backlight-h-2626    [001] .n...   161.995352: pwm_apply: 94faa5b6: period=4000000 duty_cycle=439215 polarity=0 enabled=1
>  gsd-backlight-h-2631    [001] .....   162.148999: pwm_apply: 94faa5b6: period=4000000 duty_cycle=486274 polarity=0 enabled=1
>  gsd-backlight-h-2635    [001] .....   162.315167: pwm_apply: 94faa5b6: period=4000000 duty_cycle=674509 polarity=0 enabled=1
>  gsd-backlight-h-2639    [001] .....   162.472855: pwm_apply: 94faa5b6: period=4000000 duty_cycle=1113725 polarity=0 enabled=1
>  gsd-backlight-h-2643    [000] .....   162.672130: pwm_apply: 94faa5b6: period=4000000 duty_cycle=1584313 polarity=0 enabled=1
>  gsd-backlight-h-2647    [000] .....   162.897159: pwm_apply: 94faa5b6: period=4000000 duty_cycle=2101960 polarity=0 enabled=1
>  gsd-backlight-h-2653    [000] .....   163.094710: pwm_apply: 94faa5b6: period=4000000 duty_cycle=2462745 polarity=0 enabled=1
>  gsd-backlight-h-2657    [000] .....   163.290172: pwm_apply: 94faa5b6: period=4000000 duty_cycle=1505882 polarity=0 enabled=1
>  gsd-backlight-h-2661    [001] .....   163.491553: pwm_apply: 94faa5b6: period=4000000 duty_cycle=831372 polarity=0 enabled=1
>  gsd-backlight-h-2665    [001] .....   163.749862: pwm_apply: 94faa5b6: period=4000000 duty_cycle=439215 polarity=0 enabled=1
>  gsd-backlight-h-2669    [001] .....   163.922487: pwm_apply: 94faa5b6: period=4000000 duty_cycle=47058 polarity=0 enabled=1
>  gsd-backlight-h-2809    [002] .....   313.762043: pwm_apply: 94faa5b6: period=4000000 duty_cycle=94117 polarity=0 enabled=1
>  gsd-backlight-h-2814    [003] .....   313.901480: pwm_apply: 94faa5b6: period=4000000 duty_cycle=643137 polarity=0 enabled=1
>  gsd-backlight-h-2821    [003] .....   314.033686: pwm_apply: 94faa5b6: period=4000000 duty_cycle=1427450 polarity=0 enabled=1
>  gsd-backlight-h-2825    [003] .....   314.168334: pwm_apply: 94faa5b6: period=4000000 duty_cycle=2101960 polarity=0 enabled=1
>  gsd-backlight-h-2829    [002] .....   314.294098: pwm_apply: 94faa5b6: period=4000000 duty_cycle=2729411 polarity=0 enabled=1
>  gsd-backlight-h-2833    [002] .....   314.424415: pwm_apply: 94faa5b6: period=4000000 duty_cycle=3560784 polarity=0 enabled=1
>  gsd-backlight-h-2837    [002] .....   314.530186: pwm_apply: 94faa5b6: period=4000000 duty_cycle=3843137 polarity=0 enabled=1
>  gsd-backlight-h-2855    [003] .....   315.054516: pwm_apply: 94faa5b6: period=4000000 duty_cycle=4000000 polarity=0 enabled=1
>  gsd-backlight-h-2865    [003] .....   322.214140: pwm_apply: 94faa5b6: period=4000000 duty_cycle=3717647 polarity=0 enabled=1
>  gsd-backlight-h-2874    [002] .....   322.446465: pwm_apply: 94faa5b6: period=4000000 duty_cycle=1976470 polarity=0 enabled=1
>  gsd-backlight-h-2878    [002] .....   322.583918: pwm_apply: 94faa5b6: period=4000000 duty_cycle=721568 polarity=0 enabled=1
>  gsd-backlight-h-2882    [001] .....   322.682135: pwm_apply: 94faa5b6: period=4000000 duty_cycle=282352 polarity=0 enabled=1
>  gsd-backlight-h-2914    [001] .....   324.240133: pwm_apply: 94faa5b6: period=4000000 duty_cycle=407843 polarity=0 enabled=1
>  gsd-backlight-h-2918    [003] .....   324.376497: pwm_apply: 94faa5b6: period=4000000 duty_cycle=250980 polarity=0 enabled=1
>  gsd-backlight-h-2922    [001] .....   324.479360: pwm_apply: 94faa5b6: period=4000000 duty_cycle=47058 polarity=0 enabled=1

Assuming the parent clk rate of the PWM clock is running at 32768 Hz,
too, the problem is the same.

Maybe

diff --git a/arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi b/arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi
index c27e70d8bf2b..8e8cf0abd680 100644
--- a/arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi
+++ b/arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi
@@ -1115,6 +1115,10 @@ bluetooth {
 
 	pwm@7000a000 {
 		status = "okay";
+
+		/* To ensure a faster clock than TEGRA30_CLK_CLK_32K */
+		assigned-clocks = <&tegra_car TEGRA30_CLK_PWM>;
+		assigned-clock-parents = <&tegra_car TEGRA30_CLK_PLL_P>;
 	};
 
 	lcd_ddc: i2c@7000c000 {

helps?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux