linux-stable/drivers
Phong Hoang be83c3b6e7 clocksource/drivers/sh_cmt: Fix wrong setting if don't request IRQ for clock source channel
If CMT instance has at least two channels, one channel will be used
as a clock source and another one used as a clock event device.
In that case, IRQ is not requested for clock source channel so
sh_cmt_clock_event_program_verify() might work incorrectly.
Besides, when a channel is only used for clock source, don't need to
re-set the next match_value since it should be maximum timeout as
it still is.

On the other hand, due to no IRQ, total_cycles is not counted up
when reaches compare match time (timer counter resets to zero),
so sh_cmt_clocksource_read() returns unexpected value.
Therefore, use 64-bit clocksoure's mask for 32-bit or 16-bit variants
will also lead to wrong delta calculation. Hence, this mask should
correspond to timer counter width, and above function just returns
the raw value of timer counter register.

Fixes: bfa76bb12f ("clocksource: sh_cmt: Request IRQ for clock event device only")
Fixes: 37e7742c55 ("clocksource/drivers/sh_cmt: Fix clocksource width for 32-bit machines")
Signed-off-by: Phong Hoang <phong.hoang.wz@renesas.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210422123443.73334-1-niklas.soderlund+renesas@ragnatech.se
2021-08-13 20:26:29 +02:00
..
accessibility
acpi Revert "ACPICA: Fix memory leak caused by _CID repair function" 2021-08-03 18:14:44 +02:00
amba
android
ata libata-5.14-2021-07-30 2021-07-30 10:56:47 -07:00
atm
auxdisplay
base firmware_loader: fix use-after-free in firmware_fallback_sysfs 2021-07-29 17:22:15 +02:00
bcma
block block-5.14-2021-08-07 2021-08-07 10:26:21 -07:00
bluetooth
bus ARM: SoC fixes for v5.14, part 2 2021-08-06 11:41:12 -07:00
cdrom
char
clk A collection of clk driver fixes and one core clk API fix 2021-08-03 09:26:09 -07:00
clocksource clocksource/drivers/sh_cmt: Fix wrong setting if don't request IRQ for clock source channel 2021-08-13 20:26:29 +02:00
comedi
connector
counter
cpufreq
cpuidle cpuidle: teo: Rename two local variables in teo_select() 2021-08-03 15:18:57 +02:00
crypto
cxl
dax
dca
devfreq
dio
dma dmaengine fixes for v5.14 2021-08-06 11:08:24 -07:00
dma-buf
edac
eisa
extcon
firewire
firmware tee: Improve support for kexec and kdump 2021-08-02 14:35:18 +02:00
fpga fpga: dfl: fme: Fix cpu hotplug issue in performance reporting 2021-07-27 11:05:16 -07:00
fsi
gnss
gpio gpio: tqmx86: really make IRQ optional 2021-08-02 17:17:27 +02:00
gpu Merge tag 'amd-drm-fixes-5.14-2021-08-05' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes 2021-08-06 11:22:09 +10:00
greybus
hid HID: ft260: fix device removal due to USB disconnect 2021-07-29 12:38:32 +02:00
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
idle
iio
infiniband RDMA/iw_cxgb4: Fix refcount underflow while destroying cqs. 2021-08-05 22:33:00 -03:00
input
interconnect interconnect: Fix undersized devress_alloc allocation 2021-08-02 12:25:00 +03:00
iommu
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md block-5.14-2021-08-07 2021-08-07 10:26:21 -07:00
media media fixes for v5.14-rc5 2021-08-03 09:33:05 -07:00
memory
memstick
message
mfd
misc
mmc
most
mtd
mux
net net: vxge: fix use-after-free in vxge_device_unregister 2021-08-05 07:29:50 -07:00
nfc nfc: nfcsim: fix use after free during module unload 2021-07-28 10:20:16 +01:00
ntb
nubus
nvdimm
nvme
nvmem
of
opp
parisc
parport
pci
pcmcia
perf
phy
pinctrl
platform platform/x86: gigabyte-wmi: add support for B550 Aorus Elite V2 2021-07-28 12:05:33 +02:00
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 block-5.14-2021-08-07 2021-08-07 10:26:21 -07:00
sbus
scsi SCSI fixes on 20210804 2021-08-04 12:41:30 -07:00
sh
siox
slimbus
soc soc: ixp4xx/qmgr: fix invalid __iomem access 2021-08-03 10:16:34 +02:00
soundwire
spi spi: Fixes for v5.14 2021-08-06 11:15:02 -07:00
spmi
ssb
staging
target
tc
tee
thermal
thunderbolt
tty serial: 8250_pci: Avoid irq sharing for MSI(-X) interrupts. 2021-07-30 13:06:19 +02:00
uio
usb usb: typec: tcpm: Keep other events when receiving FRS and Sourcing_vbus events 2021-08-05 12:27:43 +02:00
vdpa
vfio
vhost
video
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile