FAILED: patch "[PATCH] pwm: tiehrpwm: Clear period on disable to allow reconfiguration" failed to apply to 6.1-stable tree
Subsystems (2)
Sasha Levin
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x e74b9a7ee50071aad25d3989bf985292f90b0c6e
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From e74b9a7ee50071aad25d3989bf985292f90b0c6e Mon Sep 17 00:00:00 2001
From: Alexander Sverdlin <[email protected]>
Date: Tue, 29 Sep 2026 14:08:02 +0200
Subject: [PATCH] pwm: tiehrpwm: Clear period on disable to allow
reconfiguration
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Both channels share one period register, so ehrpwm_pwm_config() rejects a period differing from the sibling's period_cycles[]. That value was cleared only in .free(), not in .disable(), so a stopped channel kept blocking the sibling from switching to a new frequency. Clear it in .disable() too.
Testcase:
cd /sys/class/pwm/pwmchip0; echo 0 > export; echo 1 > export for p in pwm0 pwm1; do
echo 1000000 > $p/period; echo 500000 > $p/duty_cycle
echo 1 > $p/enable; echo 0 > $p/enable; echo 2000000 > $p/period done
echo 1 > pwm0/enable # before: -EINVAL, after: succeeds
--- drivers/pwm/pwm-tiehrpwm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/pwm/pwm-tiehrpwm.c +3 -0
@@ -358,6 +358,9 @@ static void ehrpwm_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)/* Disable clock on PWM disable */ pm_runtime_put_sync (pwmchip_parent (chip)); + +/* A disabled channel must not constrain the sibling's period */ + pc->period_cycles[pwm->hwpwm] =0 ; }static void ehrpwm_pwm_free (struct pwm_chip *chip,struct pwm_device *pwm)
Signature · 1 line
2.53.0