From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757956AbcLAAwC (ORCPT ); Wed, 30 Nov 2016 19:52:02 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:46087 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757868AbcLAAwA (ORCPT ); Wed, 30 Nov 2016 19:52:00 -0500 Date: Thu, 1 Dec 2016 01:51:59 +0100 From: Alexandre Belloni To: Mark Rutland Cc: Neil Armstrong , khilman@baylibre.com, carlo@caione.org, a.zummo@towertech.it, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, rtc-linux@googlegroups.com Subject: Re: [rtc-linux] Re: [RFC PATCH 2/3] rtc: Add Amlogic Virtual Wake RTC Message-ID: <20161201005159.l54yo4kspgrb75ev@piout.net> References: <1478183365-23708-1-git-send-email-narmstrong@baylibre.com> <1478183365-23708-3-git-send-email-narmstrong@baylibre.com> <20161103153647.GD25852@remoulade> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161103153647.GD25852@remoulade> User-Agent: NeoMutt/20161104 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/11/2016 at 15:36:48 +0000, Mark Rutland wrote : > > In order to be able to reuse the RTC wakealarm feature, this > > driver implements a fake RTC device which uses the system time > > to deduce a suspend delay. > > This sounds like an always-on oneshot timer device, not an RTC. > > > +static int meson_vrtc_read_time(struct device *dev, struct rtc_time *tm) > > +{ > > + unsigned long local_time; > > + struct timeval time; > > + > > + do_gettimeofday(&time); > > + local_time = time.tv_sec - (sys_tz.tz_minuteswest * 60); > > + rtc_time_to_tm(local_time, tm); > > + > > + return 0; > > +} > > ... if this were a timer, you wouldn't need this hack. > The main issue I think is that the clockevents are not able to wakeup a platform so it doesn't really fit as a timer inside the kernel. I think it may be fine to handle that in the RTC subsystem for now. The same issue can be seen with the flextimer on LS1021A: http://lists.infradead.org/pipermail/linux-arm-kernel/2015-August/365597.html -- Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com