From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753385AbdKHFfl (ORCPT ); Wed, 8 Nov 2017 00:35:41 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:33683 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753001AbdKHFfk (ORCPT ); Wed, 8 Nov 2017 00:35:40 -0500 Date: Wed, 8 Nov 2017 06:35:22 +0100 From: Alexandre Belloni To: Baolin Wang Cc: Baolin Wang , Alessandro Zummo , Rob Herring , Mark Rutland , devicetree@vger.kernel.org, LKML , linux-rtc@vger.kernel.org, Mark Brown Subject: Re: [PATCH 2/2] rtc: sprd: Add Spreadtrum RTC driver Message-ID: <20171108053522.qhoagssswonevae4@piout.net> References: <7037c5053a533505f38fc036290a398989cfdafc.1510051749.git.baolin.wang@spreadtrum.com> <20171108034409.cm65hvuhz67hmz3b@piout.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/11/2017 at 13:29:21 +0800, Baolin Wang wrote: > > Don't do that. This is a valuable information. If you know the time is > > invalid, return -EINVAL in read_time(). What your are doing here is > > confusing the system by making it believe your fake date is the correct > > time. > > Usually for mobile device, we should give one reasonable start time if > the RTC powered down. Anyway I can remove this feature now. > Very appreciated for your helpful comments. Then userspace will have -EINVAL when reading the RTC and will be able to set the RTC to whatever value it wants. Don't encode that policy in the kernel. -- Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com