public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Feng Tang <feng.tang@intel.com>
Cc: John Stultz <john.stultz@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	"H. Peter Anvin" <hpa@linux.intel.com>,
	x86@kernel.org, Len Brown <lenb@kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/5] Add support for S3 non-stop TSC support.
Date: Thu, 24 Jan 2013 11:15:57 -0700	[thread overview]
Message-ID: <20130124181557.GA8630@obsidianresearch.com> (raw)
In-Reply-To: <20130124033730.GA28770@feng-snb>

On Thu, Jan 24, 2013 at 11:37:30AM +0800, Feng Tang wrote:

> > I think hard numbers would be needed to show the rtc layer is
> > causing major issues for space constrained kernels, so this
> > trade-off could be properly prioritized. Having duplicate code paths
> > in standard kernels is wasteful as well.

> Another thing is currently the CONFIG_RTC_XXX is selectable option for
> kernel, if we push the read_persistent_clock() from kernel code down to
> rtc  driver layer, then some of the CONFIG_RTC_XXX have to be always 'y' 

All my space constrained embedded kernels (ARM, PPC) already need
CONFIG_RTC.. Configurations that can still access the RTC without
CONFIG_RTC seem to be very limited, the notable one is x86 - and I
don't think 14k is going to be a problem for any modern embedded x86
systems.

CONFIG_RTC_xx doesn't have to be forced to yes, it is like any other
driver, if you don't have/load a RTC driver then you don't get a RTC,
*shrug*

> > >IIRC, some EFI backed x86 system's read_persistent_clock() is
> > >implemented by EFI's runtime gettime service.
> > Interesting, does the rtc driver not support this?
> 
> x86's read_persistent_clock() is actually implemented with 
> 	retval = x86_platform.get_wallclock()
> 
> And for x86_32 platform, the efi.c has code to set  x86_platform.get_wallclock()
> to efi_get_time() which is efi's runtime service.
> 
> I don't know the detail how it works, but I think it could co-exist with a
> rtc driver if there is.

Like the CMOS path, it completely duplicates the code in the EFI RTC
driver, so it should co-exist. The locking seems to be handled by the
EFI stuff:

unsigned long efi_get_time(void)
{
        efi_status_t status;
        efi_time_t eft;
        efi_time_cap_t cap;

        status = efi.get_time(&eft, &cap);
        if (status != EFI_SUCCESS)
                pr_err("Oops: efitime: can't read time!\n");

        return mktime(eft.year, eft.month, eft.day, eft.hour,
                      eft.minute, eft.second);
}

vs:

static int efi_read_time(struct device *dev, struct rtc_time *tm)
{
        efi_status_t status;
        efi_time_t eft;
        efi_time_cap_t cap;

        status = efi.get_time(&eft, &cap);

        if (status != EFI_SUCCESS) {
                /* should never happen */
                printk(KERN_ERR "efitime: can't read time\n");
                return -EINVAL;
        }

        convert_from_efi_time(&eft, tm);

        return rtc_valid_tm(tm);
}

Jason

  reply	other threads:[~2013-01-24 18:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-21  6:38 [RFC PATCH 0/5] Add support for S3 non-stop TSC support Feng Tang
2013-01-21  6:38 ` [RFC PATCH 1/5] x86: Add cpu capability flag X86_FEATURE_TSC_S3_NOTSTOP Feng Tang
2013-01-21  7:27   ` Chen Gong
2013-01-21  7:59     ` Feng Tang
2013-01-21 15:58       ` H. Peter Anvin
2013-01-22 14:07         ` Feng Tang
2013-01-21  6:38 ` [RFC PATCH 2/5] clocksource: Add new feature flag CLOCK_SOURCE_SUSPEND_NOTSTOP Feng Tang
2013-01-21  6:38 ` [RFC PATCH 3/5] x86: tsc: Add support for new S3_NOTSTOP feature Feng Tang
2013-01-21  6:38 ` [RFC PATCH 4/5] clocksource: Enlarge the maxim time interval when configuring the scale and shift Feng Tang
2013-01-21  7:25   ` Chen Gong
2013-01-21  6:38 ` [RFC PATCH 5/5] timekeeping: Add support for clocksource which doesn't stop during suspend Feng Tang
2013-01-21 13:55 ` [RFC PATCH 0/5] Add support for S3 non-stop TSC support Rafael J. Wysocki
2013-03-30 18:14   ` Pavel Machek
2013-04-01 17:32     ` John Stultz
2013-04-01 20:31       ` Pavel Machek
2013-04-01 20:41         ` John Stultz
2013-01-21 18:46 ` John Stultz
2013-01-22 14:55   ` Feng Tang
2013-01-22 21:56     ` John Stultz
2013-01-24  3:37       ` Feng Tang
2013-01-24 18:15         ` Jason Gunthorpe [this message]
2013-01-22 19:57   ` Jason Gunthorpe
2013-01-22 20:22     ` John Stultz
2013-01-23  0:26       ` Jason Gunthorpe
2013-01-23  0:41         ` John Stultz
2013-01-23  1:37           ` Jason Gunthorpe
2013-01-23  1:54             ` John Stultz
2013-01-23  2:35               ` Jason Gunthorpe
2013-01-23  3:07                 ` John Stultz
2013-01-23 19:23                   ` Jason Gunthorpe

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=20130124181557.GA8630@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.com \
    --cc=feng.tang@intel.com \
    --cc=hpa@linux.intel.com \
    --cc=john.stultz@linaro.org \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rafael.j.wysocki@intel.com \
    --cc=tglx@linutronix.de \
    --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