linux-stable/drivers
Hans de Goede a05af71f0d pwm: crc: Fix off-by-one error in the clock-divider calculations
The CRC PWM controller has a clock-divider which divides the clock with
a value between 1-128. But as can seen from the PWM_DIV_CLK_xxx
defines, this range maps to a register value of 0-127.

So after calculating the clock-divider we must subtract 1 to get the
register value, unless the requested frequency was so high that the
calculation has already resulted in a (rounded) divider value of 0.

Note that before this fix, setting a period of PWM_MAX_PERIOD_NS which
corresponds to the max. divider value of 128 could have resulted in a
bug where the code would use 128 as divider-register value which would
have resulted in an actual divider value of 0 (and the enable bit being
set). A rounding error stopped this bug from actually happen. This
same rounding error means that after the subtraction of 1 it is impossible
to set the divider to 128. Also bump PWM_MAX_PERIOD_NS by 1 ns to allow
setting a divider of 128 (register-value 127).

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200903112337.4113-10-hdegoede@redhat.com
2020-09-06 15:38:02 +02:00
..
accessibility
acpi ACPI / LPSS: Save Cherry Trail PWM ctx registers only once (at activation) 2020-09-06 15:37:58 +02:00
amba
android binder: Don't use mmput() from shrinker function. 2020-07-23 09:47:12 +02:00
ata
atm atm: fix atm_dev refcnt leaks in atmtcp_remove_persistent 2020-07-30 17:35:53 -07:00
auxdisplay
base device property: Avoid NULL pointer dereference in device_get_next_child_node() 2020-07-23 17:04:28 +02:00
bcma
block Char/Misc fixes for 5.8-rc6 2020-07-16 11:26:40 -07:00
bluetooth
bus Fix a suspend/resume regression (crash) on TI AM3/AM4 SoC's. 2020-07-25 13:27:12 -07:00
cdrom
char Linux 5.8 2020-08-11 11:58:31 +10:00
clk A couple build fixes for issues exposed this merge window and a fix for 2020-07-15 19:00:12 -07:00
clocksource Fix a suspend/resume regression (crash) on TI AM3/AM4 SoC's. 2020-07-25 13:27:12 -07:00
connector
counter
cpufreq cpufreq: intel_pstate: Fix active mode setting from command line 2020-07-13 17:55:57 +02:00
cpuidle
crypto crypto/chtls: correct net_device reference count 2020-07-20 18:28:04 -07:00
dax
dca
devfreq
dio
dma Linux 5.8-rc6 2020-07-24 08:48:05 +10:00
dma-buf Linux 5.8-rc6 2020-07-24 08:48:05 +10:00
edac
eisa
extcon
firewire
firmware firmware: Fix a reference count leak. 2020-07-29 13:13:50 -04:00
fpga fpga: dfl: fix bug in port reset handshake 2020-07-13 22:11:17 -07:00
fsi
gnss
gpio
gpu drm/i915: remove the extra modeset init layer 2020-09-04 13:41:43 +03:00
greybus
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid into master 2020-07-17 09:43:13 -07:00
hsi
hv
hwmon hwmon: (drivetemp) Avoid SCT usage on Toshiba DT01ACA family drives 2020-07-18 08:11:44 -07:00
hwspinlock
hwtracing intel_th: Fix a NULL dereference when hub driver is not loaded 2020-07-10 15:12:48 +02:00
i2c i2c: slave: add sanity check when unregistering 2020-07-28 18:37:17 +02:00
i3c
ide
idle
iio First set of IIO and counter fixes in the 5.8 cycle. 2020-07-08 09:20:50 +02:00
infiniband RDMA/core: Free DIM memory in error unwind 2020-07-30 11:03:33 -03:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2020-07-13 18:31:15 -07:00
interconnect interconnect: msm8916: Fix buswidth of pcnoc_s nodes 2020-07-23 10:45:24 +02:00
iommu iommu/qcom: Use domain rather than dev as tlb cookie 2020-07-22 17:29:28 +02:00
ipack
irqchip Bugfixes and a one-liner patch to silence sparse. 2020-07-06 12:48:04 -07:00
isdn
leds
lightnvm
macintosh
mailbox
mcb
md dm integrity: fix integrity recalculation that is improperly skipped 2020-07-23 14:39:37 -04:00
media
memory
memstick
message
mfd irqdomain/treewide: Keep firmware node unconditionally allocated 2020-07-14 17:44:42 +02:00
misc habanalabs: prevent possible out-of-bounds array access 2020-07-19 08:15:36 +03:00
mmc mmc: sdhci-of-aspeed: Fix clock divider calculation 2020-07-13 12:17:34 +02:00
most
mtd mtd: rawnand: xway: Fix build issue 2020-07-07 21:04:38 +02:00
mux
net vxlan: fix memleak of fdb 2020-08-01 11:49:18 -07:00
nfc nfc: s3fwrn5: add missing release on skb in s3fwrn5_recv_frame 2020-07-20 18:31:33 -07:00
ntb
nubus
nvdimm libnvdimm/security: Fix key lookup permissions 2020-07-08 17:08:01 -07:00
nvme nvme: add a Identify Namespace Identification Descriptor list quirk 2020-07-29 08:05:44 +02:00
nvmem
of Linux 5.8-rc6 2020-07-24 08:48:05 +10:00
opp opp: Increase parsed_static_opps in _of_add_opp_table_v1() 2020-07-16 08:50:54 +05:30
oprofile
parisc
parport
pci pci-v5.8-fixes-3 2020-07-30 12:01:42 -07:00
pcmcia
perf drivers/perf: Prevent forced unbinding of PMU drivers 2020-07-17 10:51:44 +01:00
phy phy: fixes for 5.8 2020-07-08 18:00:07 +02:00
pinctrl A single patch to the Qualcomm driver fixing missing dual 2020-08-01 10:11:42 -07:00
platform platform/x86: asus-wmi: allow BAT1 battery name 2020-07-15 12:47:04 +03:00
pnp
power
powercap
pps
ps3
ptp
pwm pwm: crc: Fix off-by-one error in the clock-divider calculations 2020-09-06 15:38:02 +02:00
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi scsi: core: Run queue in case of I/O resource contention failure 2020-07-20 21:38:20 -04:00
sfi
sh
siox
slimbus
soc i.MX fixes for 5.8, round 2: 2020-07-16 22:08:07 +02:00
soundwire
spi spi: Fixes for v5.8 2020-07-17 10:24:09 -07:00
spmi
ssb
staging Staging driver fixes for 5.8-rc7 2020-07-26 09:14:59 -07:00
target
tc
tee
thermal - Fix invalid index array access on int340x_thermal leading to a 2020-07-16 11:08:54 -07:00
thunderbolt
tty serial: exar: Fix GPIO configuration for Sealevel cards based on XR17V35X 2020-07-24 10:58:14 +02:00
uio
usb usb: tegra: Fix allocation for the FPCI context 2020-07-23 13:21:01 +02:00
vdpa
vfio vfio/pci: fix racy on error and request eventfd ctx 2020-07-17 08:28:40 -06:00
vhost vhost/scsi: fix up req type endian-ness 2020-07-29 13:24:30 -04:00
video Linux 5.8 2020-08-11 11:58:31 +10:00
virt virt: vbox: Fix guest capabilities mask check 2020-07-10 13:40:19 +02:00
virtio virtio-mem: Fix build error due to improper use 'select' 2020-07-30 11:28:17 -04:00
visorbus
vlynq
vme
w1
watchdog
xen xen: branch for v5.8-rc5 2020-07-11 11:16:46 -07:00
zorro
Kconfig
Makefile