remarkable-linux/drivers
Thierry Reding ef793e6e11 rtc: tegra: Implement clock handling
commit 5fa4086987 upstream.

Accessing the registers of the RTC block on Tegra requires the module
clock to be enabled. This only works because the RTC module clock will
be enabled by default during early boot. However, because the clock is
unused, the CCF will disable it at late_init time. This causes the RTC
to become unusable afterwards. This can easily be reproduced by trying
to use the RTC:

	$ hwclock --rtc /dev/rtc1

This will hang the system. I ran into this by following up on a report
by Martin Michlmayr that reboot wasn't working on Tegra210 systems. It
turns out that the rtc-tegra driver's ->shutdown() implementation will
hang the CPU, because of the disabled clock, before the system can be
rebooted.

What confused me for a while is that the same driver is used on prior
Tegra generations where the hang can not be observed. However, as Peter
De Schrijver pointed out, this is because on 32-bit Tegra chips the RTC
clock is enabled by the tegra20_timer.c clocksource driver, which uses
the RTC to provide a persistent clock. This code is never enabled on
64-bit Tegra because the persistent clock infrastructure does not exist
on 64-bit ARM.

The proper fix for this is to add proper clock handling to the RTC
driver in order to ensure that the clock is enabled when the driver
requires it. All device trees contain the clock already, therefore
no additional changes are required.

Reported-by: Martin Michlmayr <tbm@cyrius.com>
Acked-By Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
[bwh: Backported to 4.9: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-21 09:31:24 +02:00
..
accessibility
acpi ACPI / EC: Use busy polling mode when GPE is not enabled 2017-04-21 09:31:24 +02:00
amba
android ANDROID: binder: Clear binder and cookie when setting handle in flat binder struct 2016-10-24 19:37:48 +02:00
ata sata: ahci-da850: implement a workaround for the softreset quirk 2017-04-12 12:41:20 +02:00
atm atm: fix improper return value 2016-12-05 14:53:46 -05:00
auxdisplay auxdisplay: img-ascii-lcd: add missing sentinel entry in img_ascii_lcd_matches 2017-03-30 09:41:27 +02:00
base base/memory, hotplug: fix a kernel oops in show_valid_zones() 2017-02-09 08:08:28 +01:00
bcma bcma: use (get|put)_device when probing/removing device driver 2017-03-12 06:41:52 +01:00
block nbd: fix 64-bit division 2017-04-21 09:31:23 +02:00
bluetooth Bluetooth: Add another AR3012 04ca:3018 device 2017-03-15 10:02:40 +08:00
bus bus: vexpress-config: fix device reference leak 2017-01-19 20:18:07 +01:00
cdrom
char char: lack of bool string made CONFIG_DEVPORT always on 2017-04-21 09:31:22 +02:00
clk clk: lpc32xx: add a quirk for PWM and MS clock dividers 2017-04-12 12:41:15 +02:00
clocksource clocksource/drivers/arm_arch_timer: Don't assume clock runs in suspend 2017-04-12 12:41:16 +02:00
connector
cpufreq cpufreq: Bring CPUs up even if cpufreq_online() failed 2017-04-21 09:31:22 +02:00
cpuidle Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2016-10-15 09:26:12 -07:00
crypto crypto: caam - fix invalid dereference in caam_rsa_init_tfm() 2017-04-18 07:11:49 +02:00
dax device-dax: fix pmd/pte fault fallback handling 2017-03-30 09:41:27 +02:00
dca
devfreq PM / devfreq: Fix wrong trans_stat of passive devfreq device 2017-03-12 06:41:44 +01:00
dio
dma dmaengine: iota: ioat_alloc_chan_resources should not perform sleeping allocations. 2017-03-22 12:43:35 +01:00
dma-buf dma-buf: add support for compat ioctl 2017-04-18 07:11:50 +02:00
edac
eisa
extcon extcon: return error code on failure 2017-01-19 20:18:03 +01:00
firewire firewire: net: fix fragmented datagram_size off-by-one 2016-11-03 14:46:39 +01:00
firmware efi/libstub: Skip GOP with PIXEL_BLT_ONLY format 2017-04-21 09:31:20 +02:00
fmc
fpga
gpio ACPI / gpio: do not fall back to parsing _CRS when we get a deferral 2017-04-12 12:41:12 +02:00
gpu drm/nouveau/disp/mcp7x: disable dptmds workaround 2017-04-21 09:31:23 +02:00
hid HID: wacom: don't apply generic settings to old devices 2017-04-12 12:41:21 +02:00
hsi
hv Drivers: hv: vmbus: Don't leak memory when a channel is rescinded 2017-03-30 09:41:27 +02:00
hwmon hwmon: (it87) Ensure that pwm control cache is current before updating values 2017-03-12 06:41:42 +01:00
hwspinlock
hwtracing intel_th: Don't leak module refcount on failure to activate 2017-03-30 09:41:27 +02:00
i2c i2c: bcm2835: Fix hang for writing messages larger than 16 bytes 2017-04-18 07:11:47 +02:00
ide
idle x86/intel_idle: Add CPU model 0x4a (Atom Z34xx series) 2017-04-12 12:41:17 +02:00
iio iio: bmg160: reset chip when probing 2017-04-12 12:41:11 +02:00
infiniband IB/mlx5: Verify that Q counters are supported 2017-03-18 19:14:35 +08:00
input Input: xpad - add support for Razer Wildcat gamepad 2017-04-21 09:31:19 +02:00
iommu iommu/vt-d: Fix NULL pointer dereference in device_to_iommu 2017-03-30 09:41:26 +02:00
ipack ipack: print a hex number after a 0x prefix 2016-10-27 18:43:43 -07:00
irqchip irqchip/irq-imx-gpcv2: Fix spinlock initialization 2017-04-21 09:31:22 +02:00
isdn isdn/gigaset: fix NULL-deref at probe 2017-03-26 13:05:58 +02:00
leds
lguest
lightnvm
macintosh
mailbox mailbox: PCC: Fix lockdep warning when request PCC channel 2016-11-14 22:07:38 +01:00
mcb
md dm raid: fix NULL pointer dereference for raid1 without bitmap 2017-04-12 12:41:13 +02:00
media dvb-usb-v2: avoid use-after-free 2017-04-21 09:31:23 +02:00
memory memory/atmel-ebi: Fix ns <-> cycles conversions 2017-03-15 10:02:45 +08:00
memstick memstick: rtsx_usb_ms: Manage runtime PM when accessing the device 2016-10-17 15:43:05 +02:00
message
mfd mfd: tps65217: Fix page fault on unloading modules 2017-01-12 11:39:23 +01:00
misc cxl: fix nested locking hang during EEH hotplug 2017-03-15 10:02:42 +08:00
mmc mmc: sdhci-of-esdhc: remove default broken-cd for ARM 2017-04-12 12:41:22 +02:00
mtd mtd: bcm47xxpart: fix parsing first block after aligned TRX 2017-04-18 07:11:47 +02:00
net ath9k: fix NULL pointer dereference 2017-04-21 09:31:23 +02:00
nfc mei: bus: fix received data size check in NFC fixup 2016-10-31 10:25:22 -06:00
ntb ntb_transport: Pick an unused queue 2017-02-23 17:44:36 +01:00
nubus
nvdimm libnvdimm: fix reconfig_mutex, mmap_sem, and jbd2_handle lockdep splat 2017-04-21 09:31:21 +02:00
nvme nvme: simplify stripe quirk 2017-04-12 12:41:18 +02:00
nvmem
of of, numa: Return NUMA_NO_NODE from disable of_node_to_nid() if nid not possible. 2017-01-09 08:32:25 +01:00
oprofile
parisc
parport parport: fix attempt to write duplicate procfiles 2017-03-30 09:41:25 +02:00
pci PCI: Add ACS quirk for Qualcomm QDF2400 and QDF2432 2017-04-12 12:41:22 +02:00
pcmcia pcmcia: fix return value of soc_pcmcia_regulator_set 2016-11-11 08:45:08 -08:00
perf perf: xgene: Remove bogus IS_ERR() check 2016-10-17 15:50:07 +01:00
phy phy: twl4030-usb: Fix for musb session bit based PM 2016-11-17 16:25:40 +01:00
pinctrl pinctrl: qcom: Don't clear status bit on irq_unmask 2017-03-31 10:31:45 +02:00
platform platform/x86: acer-wmi: setup accelerometer when machine has appropriate notify event 2017-04-21 09:31:24 +02:00
pnp
power power: reset: at91-poweroff: timely shutdown LPDDR memories 2017-03-12 06:41:45 +01:00
powercap powercap/intel_rapl: fix and tidy up error handling 2017-01-19 20:18:07 +01:00
pps
ps3
ptp drivers/ptp: Fix kernel memory disclosure 2016-10-13 10:20:06 -04:00
pwm pwm: rockchip: State of PWM clock should synchronize with PWM enabled state 2017-04-21 09:31:22 +02:00
rapidio mm: replace get_user_pages() write/force parameters with gup_flags 2016-10-19 08:11:43 -07:00
ras
regulator regulator: Fix regulator_summary for deviceless consumers 2017-03-12 06:41:43 +01:00
remoteproc remoteproc: qcom: mdt_loader: Don't overwrite firmware object 2017-03-12 06:41:50 +01:00
reset reset: uniphier: rename MIO reset to SD reset for Pro5, PXs2, LD20 SoCs 2016-10-22 18:31:42 +09:00
rpmsg rpmsg: virtio_rpmsg_bus: fix channel creation 2017-01-26 08:24:44 +01:00
rtc rtc: tegra: Implement clock handling 2017-04-21 09:31:24 +02:00
s390 s390/zcrypt: Introduce CEX6 toleration 2017-03-22 12:43:38 +01:00
sbus
scsi scsi: sd: Fix capacity calculation with 32-bit sector_t 2017-04-21 09:31:21 +02:00
sfi
sh
sn
soc soc: ti: wkup_m3_ipc: Fix error return code in wkup_m3_ipc_probe() 2017-01-26 08:24:45 +01:00
spi spi: s3c64xx: fix inconsistency between binding and driver 2017-03-12 06:41:41 +01:00
spmi
ssb ssb: Fix error routine when fallback SPROM fails 2017-01-09 08:32:16 +01:00
staging staging: android: ashmem: lseek failed due to no FMODE_LSEEK. 2017-04-12 12:41:11 +02:00
target target: Avoid mappedlun symlink creation during lun shutdown 2017-04-21 09:31:21 +02:00
tc
thermal thermal: hwmon: Properly report critical temperature in sysfs 2017-01-09 08:32:18 +01:00
thunderbolt
tty serial: 8250_omap: Add OMAP_DMA_TX_KICK quirk for AM437x 2017-04-12 12:41:19 +02:00
uio
usb usb: hub: Wait for connection to be reestablished after port reset 2017-04-18 07:11:50 +02:00
uwb uwb: hwa-rc: fix NULL-deref at probe 2017-03-30 09:41:24 +02:00
vfio vfio/spapr: Postpone default window creation 2017-03-22 12:43:38 +01:00
vhost vhost: fix initialization for vq->is_le 2017-02-09 08:08:28 +01:00
video xen, fbfront: fix connecting to backend 2017-04-21 09:31:21 +02:00
virt mm: replace get_user_pages() write/force parameters with gup_flags 2016-10-19 08:11:43 -07:00
virtio virtio_balloon: init 1st buffer in stats vq 2017-03-31 10:31:45 +02:00
vlynq
vme VME: restore bus_remove function causing incomplete module unload 2017-03-12 06:41:50 +01:00
w1 w1: ds2490: USB transfer buffers need to be DMAable 2017-03-12 06:41:48 +01:00
watchdog watchdog: s3c2410: Fix infinite interrupt in soft mode 2017-04-12 12:41:22 +02:00
xen xen/acpi: upload PM state from init-domain to Xen 2017-03-30 09:41:26 +02:00
zorro
Kconfig
Makefile A small bug fix and a new driver for acting as an IPMI device. 2016-10-23 15:56:23 -07:00