linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: "Tanwar, Rahul" <rahul.tanwar@linux.intel.com>
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	hpa@zytor.com, tony.luck@intel.com, x86@kernel.org,
	a.zummo@towertech.it, alexandre.belloni@bootlin.com,
	robh+dt@kernel.org, mark.rutland@arm.com,
	linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
	alan@linux.intel.com, linux-kernel@vger.kernel.org,
	qi-ming.wu@intel.com, cheol.yong.kim@intel.com,
	rahul.tanwar@intel.com
Subject: Re: [PATCH v1 1/2] x86/rtc: Add option to skip using RTC
Date: Fri, 23 Aug 2019 15:56:04 +0300	[thread overview]
Message-ID: <20190823125604.GS30120@smile.fi.intel.com> (raw)
In-Reply-To: <a6717e97-01cf-771c-8467-be5946528dd0@linux.intel.com>

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



  reply	other threads:[~2019-08-23 12:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22  7:44 [PATCH v1 0/2] x86/rtc: Add option to skip using RTC Rahul Tanwar
     [not found] ` <cover.1566458029.git.rahul.tanwar@linux.intel.com>
2019-08-22  7:44   ` [PATCH v1 1/2] " Rahul Tanwar
2019-08-22  9:02     ` Andy Shevchenko
2019-08-22  9:26       ` Tanwar, Rahul
2019-08-22 13:04         ` Andy Shevchenko
2019-08-23  3:37           ` Tanwar, Rahul
2019-08-23 12:56             ` Andy Shevchenko [this message]
2019-08-26  9:01               ` Tanwar, Rahul
2019-08-22  7:44   ` [PATCH v1 2/2] dt-bindings: rtc: Add optional status property Rahul Tanwar
2019-08-22  8:56     ` Andy Shevchenko
2019-08-22  9:09       ` Alexandre Belloni
2019-08-22  9:38         ` Tanwar, Rahul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190823125604.GS30120@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=a.zummo@towertech.it \
    --cc=alan@linux.intel.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bp@alien8.de \
    --cc=cheol.yong.kim@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=qi-ming.wu@intel.com \
    --cc=rahul.tanwar@intel.com \
    --cc=rahul.tanwar@linux.intel.com \
    --cc=robh+dt@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).