mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: "Myaskouvskey, Artiom" <artiom.myaskouvskey@intel.com>
Cc: <davej@codemonkey.org.uk>, <hpa@zytor.com>,
	<linux-kernel@vger.kernel.org>,
	"Satt, Shai" <shai.satt@intel.com>
Subject: Re: [PATCH 2.6.19-rc5-git2] EFI: calling efi_get_time during suspend
Date: Sun, 10 Dec 2006 20:20:00 -0800	[thread overview]
Message-ID: <20061210202000.674d5b34.randy.dunlap@oracle.com> (raw)
In-Reply-To: <C1467C8B168BCF40ACEC2324C1A2B07401704459@hasmsx411.ger.corp.intel.com>

On Mon, 13 Nov 2006 11:43:45 +0200 Myaskouvskey, Artiom wrote:

> From: Artiom Myaskouvskey <artiom.myaskouvskey@intel.com>
> 
> Function efi_get_time called not only during init kernel phase but also
> during suspend (from get_cmos_time). 
> When it is called from get_cmos_time the corresponding runtime service
> should be called in virtual and not in physical mode.
> 
> Signed-off-by: Artiom Myaskouvskey <artiom.myaskouvskey@intel.com>
> ---
> 
> diff -uprN linux-2.6.19-rc5-git2.orig/include/linux/efi.h
> linux-2.6.19-rc5-git2/include/linux/efi.h
> --- linux-2.6.19-rc5-git2.orig/include/linux/efi.h	2006-11-13
> 11:15:19.000000000 +0200
> +++ linux-2.6.19-rc5-git2/include/linux/efi.h	2006-11-13
> 11:15:38.000000000 +0200
> @@ -300,7 +300,7 @@ extern int efi_mem_attribute_range (unsi
>  extern int __init efi_uart_console_only (void);
>  extern void efi_initialize_iomem_resources(struct resource
> *code_resource,
>  					struct resource *data_resource);
> -extern unsigned long __init efi_get_time(void);
> +extern unsigned long efi_get_time(void);
>  extern int __init efi_set_rtc_mmss(unsigned long nowtime);

Hi--

Shouldn't the /__init/ on efi_set_rtc_mmss() also be dropped?

>  extern struct efi_memory_map memmap;
>  
> diff -uprN linux-2.6.19-rc5-git2.orig/arch/i386/kernel/efi.c
> linux-2.6.19-rc5-git2/arch/i386/kernel/efi.c
> --- linux-2.6.19-rc5-git2.orig/arch/i386/kernel/efi.c	2006-11-13
> 11:15:17.000000000 +0200
> +++ linux-2.6.19-rc5-git2/arch/i386/kernel/efi.c	2006-11-13
> 11:15:38.000000000 +0200
> @@ -194,17 +194,25 @@ inline int efi_set_rtc_mmss(unsigned lon
>  	return 0;
>  }
>  /*
> - * This should only be used during kernel init and before runtime
> - * services have been remapped, therefore, we'll need to call in
> physical
> - * mode.  Note, this call isn't used later, so mark it __init.
> + * This is used during kernel init before runtime
> + * services have been remapped and also during suspend, therefore, 
> + * we'll need to call both in physical and virtual modes. 
>   */
> -inline unsigned long __init efi_get_time(void)
> +inline unsigned long efi_get_time(void)
>  {
>  	efi_status_t status;
>  	efi_time_t eft;
>  	efi_time_cap_t cap;
>  
> -	status = phys_efi_get_time(&eft, &cap);
> +	if (efi.get_time) {
> +		/* if we are in virtual mode use remapped function */ 
> + 		status = efi.get_time(&eft, &cap);
> +        }
> +        else {
> +	    /* we are in physical mode */
> +            status = phys_efi_get_time(&eft, &cap);
> +        }
> +
>  	if (status != EFI_SUCCESS)
>  		printk("Oops: efitime: can't read time status:
> 0x%lx\n",status);

---
~Randy

  parent reply	other threads:[~2006-12-11  4:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-13  9:43 Myaskouvskey, Artiom
2006-11-13  9:51 ` Arjan van de Ven
2006-12-11  4:20 ` Randy Dunlap [this message]
2006-11-13 11:07 Myaskouvskey, Artiom

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=20061210202000.674d5b34.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=artiom.myaskouvskey@intel.com \
    --cc=davej@codemonkey.org.uk \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shai.satt@intel.com \
    /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

all inboxes | Powered by JetHome®