From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756000AbbLEByn (ORCPT ); Fri, 4 Dec 2015 20:54:43 -0500 Received: from mail-vk0-f54.google.com ([209.85.213.54]:35717 "EHLO mail-vk0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751936AbbLEBym (ORCPT ); Fri, 4 Dec 2015 20:54:42 -0500 MIME-Version: 1.0 In-Reply-To: References: <1449107584-3192-1-git-send-email-jwerner@chromium.org> Date: Fri, 4 Dec 2015 17:54:40 -0800 X-Google-Sender-Auth: 6ixyeVNWGRsKOfCWkrJ_-TRkCi0 Message-ID: Subject: Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st From: Julius Werner To: Doug Anderson Cc: Julius Werner , Andrew Morton , Alessandro Zummo , Sonny Rao , Chris Zhong , Heiko Stuebner , "linux-kernel@vger.kernel.org" , rtc-linux@googlegroups.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > How would such a hook work? If userspace sees the system suspend on > Nov 30th and sees the system wake up on Dec 1st, how does it know > whether it should adjust? If it's truly Dec 1st then the kernel will > have adjusted the date from Nov 31st to Dec 1st. If it's truly Dec > 2nd then the kernel will not have adjusted the date and the RTC will > have ticked past Nov 31 and onto Dec 1st. Userspace can't tell. > Userspace could try to parse "dmesg" and look to see if the kernel > adjusted, but that's ugly. Good point, I didn't think that through far enough. I guess parsing dmesg would be an option, but a pretty ugly one and it wouldn't be guaranteed to work if you got an early boot kernel crash after the correction. So, really, it seems like there's no reliable way to fix this for S5 (unless we start doing crazy things like writing to disk from kernel code). From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk0-x229.google.com (mail-vk0-x229.google.com. [2607:f8b0:400c:c05::229]) by gmr-mx.google.com with ESMTPS id g91si842136vki.3.2015.12.04.17.54.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Dec 2015 17:54:41 -0800 (PST) Received: by mail-vk0-x229.google.com with SMTP id a188so76726687vkc.0 for ; Fri, 04 Dec 2015 17:54:41 -0800 (PST) MIME-Version: 1.0 Sender: rtc-linux@googlegroups.com In-Reply-To: References: <1449107584-3192-1-git-send-email-jwerner@chromium.org> Date: Fri, 4 Dec 2015 17:54:40 -0800 Message-ID: Subject: [rtc-linux] Re: [PATCH] RTC: RK808: Work around hardware bug on November 31st From: Julius Werner To: Doug Anderson Cc: Julius Werner , Andrew Morton , Alessandro Zummo , Sonny Rao , Chris Zhong , Heiko Stuebner , "linux-kernel@vger.kernel.org" , rtc-linux@googlegroups.com Content-Type: text/plain; charset=UTF-8 Reply-To: rtc-linux@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , > How would such a hook work? If userspace sees the system suspend on > Nov 30th and sees the system wake up on Dec 1st, how does it know > whether it should adjust? If it's truly Dec 1st then the kernel will > have adjusted the date from Nov 31st to Dec 1st. If it's truly Dec > 2nd then the kernel will not have adjusted the date and the RTC will > have ticked past Nov 31 and onto Dec 1st. Userspace can't tell. > Userspace could try to parse "dmesg" and look to see if the kernel > adjusted, but that's ugly. Good point, I didn't think that through far enough. I guess parsing dmesg would be an option, but a pretty ugly one and it wouldn't be guaranteed to work if you got an early boot kernel crash after the correction. So, really, it seems like there's no reliable way to fix this for S5 (unless we start doing crazy things like writing to disk from kernel code). -- -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.