[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4a52e857-e6b2-4526-952c-0de6679a48e3@ti.com>
Date: Mon, 19 Jan 2026 12:18:26 +0530
From: Gokul Praveen <g-praveen@...com>
To: "Rafael V. Volkmer" <rafael.v.volkmer@...il.com>, <ukleinek@...nel.org>
CC: <j-keerthy@...com>, <linux-kernel@...r.kernel.org>,
<linux-pwm@...r.kernel.org>, <n-francis@...com>, <u-kumar1@...com>, "Gokul
Praveen" <g-praveen@...com>
Subject: Re: [PATCH v2] pwm: tiehrpwm: Enable EHRPWM controller before setting
configuration
Hi Rafael.
On 19/01/26 08:25, Rafael V. Volkmer wrote:
> Hello Uwe, Gokul,
>
> Sorry for the late response, I was on vacation and away from my setup.
>
> On Fri, 9 Jan 2026 23:53:22 +0100, Uwe Kleine-König wrote:
>> That makes me think the problem isn't understood well yet and needs more
>> research. @Rafael, does the problem reproduce for you with Gokul's
>> recipe? (Or did you try that already? I understood your reply as "I
>> didn't encounter the issue but also didn't test specifically for that.")
>
> Right, my previous reply meant I hadn't explicitly targeted this issue yet.
> I have now re-tested using Gokul's sysfs configuration sequence, but I still
> cannot reproduce it on my setup.
>
>> As I cannot reproduce the issue, can you please check if adding
>>
>> pm_runtime_get_sync(pwmchip_parent(chip));
>>
>> to the probe function makes the problem disappear? Also please boot with
>>
>> trace_event=pwm
>>
>> on the command line and provide the content of
>> /sys/kernel/debug/tracing/trace after reproducing the problem.
>
> Since I cannot reproduce the issue here, I can't validate whether adding
> pm_runtime_get_sync() changes the behavior, and I don't have a failing
> trace to share.
>
> For reference, I ran the tests on an AM62P EVM using TI's default SDK
> userspace, with a custom kernel on top, and U-Boot from the SDK. The
> board was booted from SD card.
>
> I used pwm1 instead of pwm0, since the PWM pin routed to the EVM 40-pin
> header is ball B21 (SPI0_CLK / EHRPWM1_A). The signal was verified with a
> logic analyzer at 24 MHz sampling rate.
>
> This makes me suspect the behavior Gokul observed might depend on another
> configuration interacting in parallel.
>
> If possible, could Gokul try the same recipe on an AM62 EVM using TI's
> default images and confirm whether the issue reproduces there? That is the
> platform I am currently working with. This should either match the AM62P
> results or help identify a relevant configuration difference.
>
Can you test the same on TI J784S4 EVM as I reproduced the issue on this
board.
I believe dumping the registers and capturing the signals using logic
analyzer is the best way to reproduce this issue.
The easiest way I tried to reproduce this issue is by enabling debug
prints. I have attached the patch for the
same(0001-Debug-prints-to-check-if-period-and-duty-cycle-is-re.patch).
This patch basically reads the registers and prints its value.
So, after applying the attached patch and running the following
commands, I got the following output.
Commands:
============
>>>>> cd /sys/class/pwm/pwmchip0
>>>>> /sys/class/pwm/pwmchip0# echo 1 > export
>>>>> /sys/class/pwm/pwmchip0# cd pwm1/
>>>>> /sys/class/pwm/pwmchip0/pwm1# echo 10000000 > period
>>>>> /sys/class/pwm/pwmchip0/pwm1# echo 3000000 > duty_cycle
>>>>> /sys/class/pwm/pwmchip0/pwm1# echo "normal" > polarity
>>>>> /sys/class/pwm/pwmchip0/pwm1# echo 1 > enable
========================================================
Output:
===========
Before put sync: Period:65103, Duty cycle:19531
EHRPWM enable function: Period:0, Duty cycle:0
===================================================
This indicates that the duty cycle and period is not reflected.
It would be really helpful, if you can try the same procedure on J784S4
EVM, Rafael. I have also attached a patch(0001-Enable-EHRPWM-1_B-using
AC33-pin.patch) which includes the device tree changes for enabling
EHRPWM1_B. The testpoint used for signal capture is TP126.
Additionally, it would be great if you can also share the output after
applying the attached
patch((0001-Debug-prints-to-check-if-period-and-duty-cycle-is-re.patch)
on both AM62 EVM and J784S4 EVM.
The issue is that I do not have an AM62 EVM with me, actually. Apologies
for that, Rafael.
Thanks in advance for your help, Rafael.
Best Regards
Gokul Praveen
> Best regards,
> Rafael V. Volkmer
View attachment "0001-Debug-prints-to-check-if-period-and-duty-cycle-is-re.patch" of type "text/x-patch" (2137 bytes)
View attachment "0001-Enable-EHRPWM-1_B-using-AC33-pin.patch" of type "text/x-patch" (3396 bytes)
Powered by blists - more mailing lists