From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751752AbbIQMbm (ORCPT ); Thu, 17 Sep 2015 08:31:42 -0400 Received: from down.free-electrons.com ([37.187.137.238]:59478 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751026AbbIQMbl (ORCPT ); Thu, 17 Sep 2015 08:31:41 -0400 Date: Thu, 17 Sep 2015 14:31:38 +0200 From: Alexandre Belloni To: Heiko =?iso-8859-1?Q?St=FCbner?= Cc: Xing Zheng , a.zummo@towertech.it, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 9/9] rtc: hym8563: make sure hym8563 can be normal work Message-ID: <20150917123138.GG4287@piout.net> References: <1442478540-15068-1-git-send-email-zhengxing@rock-chips.com> <1442486368-1912-1-git-send-email-zhengxing@rock-chips.com> <3439697.Ymf0XB1EzX@diego> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3439697.Ymf0XB1EzX@diego> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 17/09/2015 at 14:07:47 +0200, Heiko Stübner wrote : > Am Donnerstag, 17. September 2015, 18:39:28 schrieb Xing Zheng: > > The rtc hym8563 maybe failed to register if first startup or rtc > > powerdown: > > [ 0.988540 ] rtc-hym8563 1-0051: no valid clock/calendar values available > > [ 0.995642 ] rtc-hym8563 1-0051: rtc core: registered hym8563 as rtc0 [ > > 1.078985 ] rtc-hym8563 1-0051: no valid clock/calendar values available [ > > 1.085698 ] rtc-hym8563 1-0051: hctosys: unable to read the hardware > > clock > > > > We can set initial time for rtc and register it: > > [ 0.995678 ] rtc-hym8563 1-0051: rtc core: registered hym8563 as rtc0 > > [ 1.080313 ] rtc-hym8563 1-0051: setting system clock to 2000-01-01 > > 00:02:00 UTC (946684920) > > hmm, not setting a false date was actually intentional when I did the driver. > > In my mind it is better to shout and keep programs from using wrong values > than to set some arbitary date and let programs silently use this wrong value. > Indeed, I find it worse to set a wrong value instead of returning an error. Userspace has to define its policy when reading the time fails. -- Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com