stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [added to the 3.18 stable tree] MIPS: Malta: Don't reinitialise RTC
@ 2015-08-27 15:37 Sasha Levin
  2015-08-27 15:37 ` [added to the 3.18 stable tree] MIPS: Fix sched_getaffinity with MT FPAFF enabled Sasha Levin
                   ` (114 more replies)
  0 siblings, 115 replies; 119+ messages in thread
From: Sasha Levin @ 2015-08-27 15:37 UTC (permalink / raw)
  To: stable, stable-commits
  Cc: James Hogan, Ralf Baechle, Maciej W. Rozycki, linux-mips,
	Sasha Levin

From: James Hogan <james.hogan@imgtec.com>

This patch has been added to the 3.18 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 106eccb4d20f35ebc58ff2286c170d9e79c5ff68 ]

On Malta, since commit a87ea88d8f6c ("MIPS: Malta: initialise the RTC at
boot"), the RTC is reinitialised and forced into binary coded decimal
(BCD) mode during init, even if the bootloader has already initialised
it, and may even have already put it into binary mode (as YAMON does).
This corrupts the current time, can result in the RTC seconds being an
invalid BCD (e.g. 0x1a..0x1f) for up to 6 seconds, as well as confusing
YAMON for a while after reset, enough for it to report timeouts when
attempting to load from TFTP (it actually uses the RTC in that code).

Therefore only initialise the RTC to the extent that is necessary so
that Linux avoids interfering with the bootloader setup, while also
allowing it to estimate the CPU frequency without hanging, without a
bootloader necessarily having done anything with the RTC (for example
when the kernel is loaded via EJTAG).

The divider control is configured for a 32KHZ reference clock if
necessary, and the SET bit of the RTC_CONTROL register is cleared if
necessary without changing any other bits (this bit will be set when
coming out of reset if the battery has been disconnected).

Fixes: a87ea88d8f6c ("MIPS: Malta: initialise the RTC at boot")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Paul Burton <paul.burton@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 3.14+
Patchwork: https://patchwork.linux-mips.org/patch/10739/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 arch/mips/mti-malta/malta-time.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/arch/mips/mti-malta/malta-time.c b/arch/mips/mti-malta/malta-time.c
index 3778a35..38748da 100644
--- a/arch/mips/mti-malta/malta-time.c
+++ b/arch/mips/mti-malta/malta-time.c
@@ -158,14 +158,17 @@ unsigned int get_c0_compare_int(void)
 
 static void __init init_rtc(void)
 {
-	/* stop the clock whilst setting it up */
-	CMOS_WRITE(RTC_SET | RTC_24H, RTC_CONTROL);
+	unsigned char freq, ctrl;
 
-	/* 32KHz time base */
-	CMOS_WRITE(RTC_REF_CLCK_32KHZ, RTC_FREQ_SELECT);
+	/* Set 32KHz time base if not already set */
+	freq = CMOS_READ(RTC_FREQ_SELECT);
+	if ((freq & RTC_DIV_CTL) != RTC_REF_CLCK_32KHZ)
+		CMOS_WRITE(RTC_REF_CLCK_32KHZ, RTC_FREQ_SELECT);
 
-	/* start the clock */
-	CMOS_WRITE(RTC_24H, RTC_CONTROL);
+	/* Ensure SET bit is clear so RTC can run */
+	ctrl = CMOS_READ(RTC_CONTROL);
+	if (ctrl & RTC_SET)
+		CMOS_WRITE(ctrl & ~RTC_SET, RTC_CONTROL);
 }
 
 void __init plat_time_init(void)
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 119+ messages in thread

end of thread, other threads:[~2015-08-27 17:25 UTC | newest]

Thread overview: 119+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-27 15:37 [added to the 3.18 stable tree] MIPS: Malta: Don't reinitialise RTC Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] MIPS: Fix sched_getaffinity with MT FPAFF enabled Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] MIPS: do_mcheck: Fix kernel code dump with EVA Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] MIPS: show_stack: Fix stack trace " Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] MIPS: Flush RPS on kernel entry " Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] MIPS: Make set_pte() SMP safe Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] fsnotify: fix oops in fsnotify_clear_marks_by_group_flags() Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] drm/i915: Replace WARN inside I915_READ64_2x32 with retry loop Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] drm/radeon/combios: add some validation of lvds values Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] drm/dp-mst: Remove debug WARN_ON Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] ipr: Fix locking for unit attention handling Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] ipr: Fix incorrect trace indexing Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] ipr: Fix invalid array indexing for HRRQ Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] xhci: fix off by one error in TRB DMA address boundary check Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] drivers/usb: Delete XHCI command timer if necessary Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] USB: sierra: add 1199:68AB device ID Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] usb: udc: core: add device_del() call to error pathway Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] phy: twl4030-usb: make runtime pm more reliable Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] md: use kzalloc() when bitmap is disabled Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] sparc64: Fix userspace FPU register corruptions Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] clk: keystone: add support for post divider register for main pll Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] ARM: dts: keystone: fix dt bindings to use post div register for mainpll Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] ASoC: pcm1681: Fix setting de-emphasis sampling rate selection Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] ASoC: dapm: Lock during userspace access Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] x86/xen: Probe target addresses in set_aliased_prot() before the hypercall Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] xen/gntdevt: Fix race condition in gntdev_release() Sasha Levin
2015-08-27 17:15   ` Marek Marczykowski-Górecki
2015-08-27 17:21     ` David Vrabel
2015-08-27 17:25       ` Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] hwrng: core - correct error check of kthread_run call Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] crypto: qat - Fix invalid synchronization between register/unregister sym algs Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] crypto: ixp4xx - Remove bogus BUG_ON on scattered dst buffer Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] rbd: fix copyup completion race Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] ARM: dts: i.MX35: Fix can support Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] ARM: OMAP2+: hwmod: Fix _wait_target_ready() for hwmods without sysc Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] ALSA: hda - fix cs4210_spdif_automute() Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] ALSA: fireworks/firewire-lib: add support for recent firmware quirk Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] hwmon: (dell-smm) Blacklist Dell Studio XPS 8100 Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] ipc: modify message queue accounting to not take kernel data structures into account Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] ocfs2: fix BUG in ocfs2_downconvert_thread_do_work() Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] nfsd: Drop BUG_ON and ignore SECLABEL on absent filesystem Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] PCI: Restore PCI_MSIX_FLAGS_BIRMASK definition Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] md/raid1: extend spinlock to protect raid1_end_read_request against inconsistencies Sasha Levin
2015-08-27 15:37 ` [added to the 3.18 stable tree] usb: gadget: f_uac2: fix calculation of uac2->p_interval Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] USB: qcserial/option: make AT URCs work for Sierra Wireless MC7305/MC7355 Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] USB: qcserial: Add support for Dell Wireless 5809e 4G Modem Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] mtd: nand: Fix NAND_USE_BOUNCE_BUFFER flag conflict Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] mm, vmscan: Do not wait for page writeback for GFP_NOFS allocations Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] signalfd: fix information leak in signalfd_copyinfo Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] signal: fix information leak in copy_siginfo_to_user Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] signal: fix information leak in copy_siginfo_from_user32 Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] kvm: x86: fix kvm_apic_has_events to check for NULL pointer Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] nfsd: refactor nfs4_preprocess_stateid_op Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] nfsd: do nfs4_check_fh in nfs4_check_file instead of nfs4_check_olstateid Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] ACPI / init: Switch over platform to the ACPI mode later Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] freeing unlinked file indefinitely delayed Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] s390/sclp: clear upper register halves in _sclp_print_early Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] genirq: Prevent resend to interrupts marked IRQ_NESTED_THREAD Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] ALSA: usb-audio: Add MIDI support for Steinberg MI2/MI4 Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] ALSA: usb-audio: add dB range mapping for some devices Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] ALSA: hda - Fix MacBook Pro 5,2 quirk Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] st: null pointer dereference panic caused by use after kref_put by st_open Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] mac80211: clear subdir_stations when removing debugfs Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] mmc: sdhci-esdhc: Make 8BIT bus work Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] md/raid1: fix test for 'was read error from last working device' Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] tile: use free_bootmem_late() for initrd Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] Input: usbtouchscreen - avoid unresponsive TSC-30 touch screen Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] blkcg: fix gendisk reference leak in blkg_conf_prep() Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] ata: pmp: add quirk for Marvell 4140 SATA PMP Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] usb-storage: ignore ZTE MF 823 card reader in mode 0x1225 Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] xhci: Calculate old endpoints correctly on device reset Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] xhci: prevent bus_suspend if SS port resuming in phase 1 Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] xhci: do not report PLC when link is in internal resume state Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] x86/efi: Use all 64 bit of efi_memmap in setup_e820() Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] rds: rds_ib_device.refcount overflow Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] vhost: actually track log eventfd file Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] avr32: handle NULL as a valid clock object Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] iscsi-target: Fix use-after-free during TPG session shutdown Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] iscsi-target: Fix iser explicit logout TX kthread leak Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] ima: add support for new "euid" policy condition Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] ima: extend "mask" policy matching support Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] iscsi-target: Fix iscsit_start_kthreads failure OOPs Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] sg_start_req(): make sure that there's not too many elements in iovec Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] md/bitmap: return an error when bitmap superblock is corrupt Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] iio: adc: twl6030-gpadc: Fix modalias Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] btrfs: incorrect handling for fiemap_fill_next_extent return Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] btrfs: cleanup orphans while looking up default subvolume Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] usb: renesas_usbhs: Fix fifo unclear in usbhsf_prepare_pop Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] usb: renesas_usbhs: Don't disable the pipe if Control write status stage Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] cpufreq: pcc: Enable autoload of pcc-cpufreq for ACPI processors Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] hpsa: fix a couple pci id table mistakes Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] HID: tivo: enable all buttons on the TiVo Slide Pro remote Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] [media] si4713: HID blacklist Si4713 USB development board Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] HID: do not bind to Microchip Pick16F1454 Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] Bluetooth: ath3k: Add a new ID 0cf3:e006 to ath3k list Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] arm64/mm: Remove hack in mmap randomize layout Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] thermal: rcar: fix ENR register value Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] iio: light: hid-sensor-als.c: Fix memory leak in probe() Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] iio: gyro: hid-sensor-gyro-3d: " Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] iio: accel: hid-sensor-accel-3d: " Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] ALSA: hda - add codec ID for Skylake display audio codec Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] ALSA: hda/hdmi - apply Haswell fix-ups to Skylake display codec Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] i2c: i801: Add DeviceIDs for SunrisePoint LP Sasha Levin
2015-08-27 15:38 ` [added to the 3.18 stable tree] kexec: allocate the kexec control page with KEXEC_CONTROL_MEMORY_GFP Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] intel_idle: support additional Broadwell model Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] hpfs: hpfs_error: Remove static buffer, use vsprintf extension %pV instead Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] Revert "libata: add ATA_HORKAGE_NOTRIM" Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] libata: Whitelist SSDs that are known to properly return zeroes after TRIM Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] libata: Update Crucial/Micron blacklist Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] libata: Blacklist queued TRIM on Samsung SSD 850 Pro Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] libata: Blacklist queued TRIM on all Samsung 800-series Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] libata: Do not blacklist Micron M500DC Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] libata: Expose TRIM capability in sysfs Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] libata: add ATA_HORKAGE_NOTRIM Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] libata: force disable trim for SuperSSpeed S238 Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] libata: Do not blacklist M510DC Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] ip_vti/ip6_vti: Do not touch skb->mark on xmit Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] xfrm: Override skb->mark with tunnel->parm.i_key in xfrm_input Sasha Levin
2015-08-27 15:39 ` [added to the 3.18 stable tree] ip_vti/ip6_vti: Preserve skb->mark after rcv_cb call Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).