linux_dsm_epyc7002/drivers/pwm
Geert Uytterhoeven d717ea73e3 pwm: Fix period and polarity in pwm_get() for non-perfect matches
If pwm_get() finds a look-up entry with a perfect match (both dev_id and
con_id match), the loop is aborted, and "p" still points to the correct
struct pwm_lookup.

If only an entry with a matching dev_id or con_id is found, the loop
terminates after traversing the whole list, and "p" now points to
arbitrary memory, not part of the pwm_lookup list.
Then pwm_set_period() and pwm_set_polarity() will set random values for
period resp. polarity.

To fix this, save period and polarity when finding a new best match,
just like is done for chip (for the provider) and index.

This fixes the LCD backlight on r8a7740/armadillo-legacy, which was fed
period 0 and polarity -1068821144 instead of 33333 resp. 1.

Fixes: 3796ce1d4d ("pwm: add period and polarity to struct pwm_lookup")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: stable@vger.kernel.org
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2014-08-18 10:58:43 +02:00
..
core.c pwm: Fix period and polarity in pwm_get() for non-perfect matches 2014-08-18 10:58:43 +02:00
Kconfig pwm: Changes for v3.17-rc1 2014-08-08 18:06:29 -07:00
Makefile pwm: sti: Add new driver for ST's PWM IP 2014-08-07 16:18:27 +02:00
pwm-ab8500.c
pwm-atmel-tcb.c
pwm-atmel.c
pwm-bcm-kona.c
pwm-bfin.c
pwm-clps711x.c
pwm-ep93xx.c
pwm-fsl-ftm.c
pwm-imx.c pwm: imx: set can_sleep flag for imx_pwm 2014-08-07 13:22:44 +02:00
pwm-jz4740.c
pwm-lp3943.c
pwm-lpc32xx.c
pwm-lpss.c pwm: lpss: remove dependency on clk framework 2014-08-07 13:18:03 +02:00
pwm-mxs.c
pwm-pca9685.c
pwm-puv3.c
pwm-pxa.c
pwm-renesas-tpu.c
pwm-rockchip.c pwm: rockchip: Added to support for RK3288 SoC 2014-08-08 13:12:47 +02:00
pwm-samsung.c
pwm-spear.c
pwm-sti.c pwm: sti: Remove PWM period table 2014-08-08 13:12:46 +02:00
pwm-tegra.c
pwm-tiecap.c
pwm-tiehrpwm.c
pwm-tipwmss.c pwm: pwm-tipwmss: remove unnecessary OOM messages 2014-08-07 13:14:33 +02:00
pwm-tipwmss.h
pwm-twl-led.c
pwm-twl.c
pwm-vt8500.c
sysfs.c