[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190823125604.GS30120@smile.fi.intel.com>
Date: Fri, 23 Aug 2019 15:56:04 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: "Tanwar, Rahul" <rahul.tanwar@...ux.intel.com>
Cc: tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, hpa@...or.com,
tony.luck@...el.com, x86@...nel.org, a.zummo@...ertech.it,
alexandre.belloni@...tlin.com, robh+dt@...nel.org,
mark.rutland@....com, linux-rtc@...r.kernel.org,
devicetree@...r.kernel.org, alan@...ux.intel.com,
linux-kernel@...r.kernel.org, qi-ming.wu@...el.com,
cheol.yong.kim@...el.com, rahul.tanwar@...el.com
Subject: Re: [PATCH v1 1/2] x86/rtc: Add option to skip using RTC
On Fri, Aug 23, 2019 at 11:37:38AM +0800, Tanwar, Rahul wrote:
> On 22/8/2019 9:04 PM, Andy Shevchenko wrote:
> > On Thu, Aug 22, 2019 at 05:26:33PM +0800, Tanwar, Rahul wrote:
> > > On 22/8/2019 5:02 PM, Andy Shevchenko wrote:
> > > > On Thu, Aug 22, 2019 at 03:44:03PM +0800, Rahul Tanwar wrote:
> > > > > Use a newly introduced optional "status" property of "motorola,mc146818"
> > > > > compatible DT node to determine if RTC is supported. Skip read/write from
> > > > > RTC device only when this node is present and status is "disabled". In all
> > > > > other cases, proceed as before.
> > > > Can't we rather update ->get_wallclock() and ->set_wallclock() based on this?
> > >
> > > get_wallclock() and set_wallclock() are function pointers of platform_ops
> > >
> > > which are initialized to mach_get_cmos_time() and mach_set_rtc_mmss()
> > >
> > > at init time. Since adding a new platform to override these functions is
> > >
> > > discouraged, so the only way is to modify RTC get/set functions.
> > Shouldn't it be platform agnostic code?
> > So, my point is, instead of hacking two functions, perhaps better to avoid them
> > at all.
>
> Sorry, i could not understand your point. The changes are platform
>
> agnostic i.e. it doesn't break existing use cases. Are you recommending
>
> to add a new platform and make changes there ?
Nope, I propose to do something like
void __init foo()
{
if (platform has RTC)
return;
set_wallclock = noop;
get_wallclock = noop;
}
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists