From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932708AbcHJSJM (ORCPT ); Wed, 10 Aug 2016 14:09:12 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56448 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752509AbcHJSJI (ORCPT ); Wed, 10 Aug 2016 14:09:08 -0400 Date: Wed, 10 Aug 2016 11:08:17 -0700 From: tip-bot for Arnd Bergmann Message-ID: Cc: mingo@kernel.org, geert@linux-m68k.org, a.zummo@towertech.it, torvalds@linux-foundation.org, ville.syrjala@linux.intel.com, hpa@zytor.com, alexandre.belloni@free-electrons.com, jarkko.nikula@linux.intel.com, linux-kernel@vger.kernel.org, arnd@arndb.de, tglx@linutronix.de, bp@suse.de, peterz@infradead.org Reply-To: mingo@kernel.org, a.zummo@towertech.it, geert@linux-m68k.org, torvalds@linux-foundation.org, hpa@zytor.com, alexandre.belloni@free-electrons.com, ville.syrjala@linux.intel.com, jarkko.nikula@linux.intel.com, linux-kernel@vger.kernel.org, peterz@infradead.org, bp@suse.de, arnd@arndb.de, tglx@linutronix.de In-Reply-To: <20160809195528.1604312-1-arnd@arndb.de> References: <20160809195528.1604312-1-arnd@arndb.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/urgent] x86/hpet: Fix /dev/rtc breakage caused by RTC cleanup Git-Commit-ID: 22cc1ca3c5469cf17e149be232817b9223afa5e4 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 22cc1ca3c5469cf17e149be232817b9223afa5e4 Gitweb: http://git.kernel.org/tip/22cc1ca3c5469cf17e149be232817b9223afa5e4 Author: Arnd Bergmann AuthorDate: Tue, 9 Aug 2016 21:54:53 +0200 Committer: Ingo Molnar CommitDate: Wed, 10 Aug 2016 14:37:06 +0200 x86/hpet: Fix /dev/rtc breakage caused by RTC cleanup Ville Syrjälä reports "The first time I run hwclock after rebooting I get this: open("/dev/rtc", O_RDONLY) = 3 ioctl(3, PHN_SET_REGS or RTC_UIE_ON, 0) = 0 select(4, [3], NULL, NULL, {10, 0}) = 0 (Timeout) ioctl(3, PHN_NOT_OH or RTC_UIE_OFF, 0) = 0 close(3) = 0 On all subsequent runs I get this: open("/dev/rtc", O_RDONLY) = 3 ioctl(3, PHN_SET_REGS or RTC_UIE_ON, 0) = -1 EINVAL (Invalid argument) ioctl(3, RTC_RD_TIME, 0x7ffd76b3ae70) = -1 EINVAL (Invalid argument) close(3) = 0" This was caused by a stupid typo in a patch that should have been a simple rename to move around contents of a header file, but accidentally wrote zeroes into the rtc rather than reading from it: 463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h") Reported-by: Ville Syrjälä Tested-by: Jarkko Nikula Tested-by: Ville Syrjälä Signed-off-by: Arnd Bergmann Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: Borislav Petkov Cc: Geert Uytterhoeven Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: rtc-linux@googlegroups.com Fixes: 463a86304cae ("char/genrtc: x86: remove remnants of asm/rtc.h") Link: http://lkml.kernel.org/r/20160809195528.1604312-1-arnd@arndb.de Signed-off-by: Ingo Molnar --- arch/x86/kernel/hpet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index ed16e58..c6dfd80 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -1242,7 +1242,7 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id) memset(&curr_time, 0, sizeof(struct rtc_time)); if (hpet_rtc_flags & (RTC_UIE | RTC_AIE)) - mc146818_set_time(&curr_time); + mc146818_get_time(&curr_time); if (hpet_rtc_flags & RTC_UIE && curr_time.tm_sec != hpet_prev_update_sec) {