diff options
author | Conor Dooley <conor.dooley@microchip.com> | 2025-01-22 17:42:56 +0300 |
---|---|---|
committer | Uwe Kleine-König <ukleinek@kernel.org> | 2025-01-23 18:14:09 +0300 |
commit | 752b6e3af374460a2de18f0c10bfa06bf844dbe8 (patch) | |
tree | 6fe80df3644ae996641cdc92c94a6d196cfe652f /tools/perf/scripts/python/export-to-sqlite.py | |
parent | e8c59791ebb60790c74b2c3ab520f04a8a57219a (diff) | |
download | linux-752b6e3af374460a2de18f0c10bfa06bf844dbe8.tar.xz |
pwm: microchip-core: fix incorrect comparison with max period
In mchp_core_pwm_apply_locked(), if hw_period_steps is equal to its max,
an error is reported and .apply fails. The max value is actually a
permitted value however, and so this check can fail where multiple
channels are enabled.
For example, the first channel to be configured requests a period that
sets hw_period_steps to the maximum value, and when a second channel
is enabled the driver reads hw_period_steps back from the hardware and
finds it to be the maximum possible value, triggering the warning on a
permitted value. The value to be avoided is 255 (PERIOD_STEPS_MAX + 1),
as that will produce undesired behaviour, so test for greater than,
rather than equal to.
Fixes: 2bf7ecf7b4ff ("pwm: add microchip soft ip corePWM driver")
Cc: stable@vger.kernel.org
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20250122-pastor-fancied-0b993da2d2d2@spud
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions