linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: julien.grall@linaro.org (Julien Grall)
To: linux-arm-kernel@lists.infradead.org
Subject: [Xen-devel] [PATCH] ARM: xen: only set pm function ptrs for Xen guests
Date: Wed, 28 Aug 2013 17:32:53 +0100	[thread overview]
Message-ID: <521E2635.4070800@linaro.org> (raw)
In-Reply-To: <1377706794-8481-1-git-send-email-robherring2@gmail.com>

On 08/28/2013 05:19 PM, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> xen_pm_init was unconditionally setting pm_power_off and arm_pm_restart
> function pointers. This breaks multi-platform kernels. Move this
> initialization into xen_guest_init, so it is conditional on running as a
> Xen guest.
> 
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> ---
> This breaks reset and poweroff for Midway when Xen is enabled. This 
> should go into 3.11 or stable.
> Rob
> 
>  arch/arm/xen/enlighten.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> index 8a6295c..fa86452 100644
> --- a/arch/arm/xen/enlighten.c
> +++ b/arch/arm/xen/enlighten.c
> @@ -263,6 +263,9 @@ static int __init xen_guest_init(void)
>  	if (xen_vcpu_info == NULL)
>  		return -ENOMEM;
>  
> +	pm_power_off = xen_power_off;
> +	arm_pm_restart = xen_restart;
> +

I think it's too early to set pm callbacks. If Linux is running as dom0,
xen needs to overwrite the power management callback. Otherwise, dom0
could shutdown/restart the whole platform, that is annoying.
For instance, on the versatile express, the power management callback
are set very late (ie during driver initialization).

pm callbacks should be updated by a late initcall and check if xen is
enabled.

>  	gnttab_init();
>  	if (!xen_initial_domain())
>  		xenbus_probe(NULL);
> @@ -271,15 +274,6 @@ static int __init xen_guest_init(void)
>  }
>  core_initcall(xen_guest_init);
>  
> -static int __init xen_pm_init(void)
> -{
> -	pm_power_off = xen_power_off;
> -	arm_pm_restart = xen_restart;
> -
> -	return 0;
> -}
> -subsys_initcall(xen_pm_init);
> -
>  static irqreturn_t xen_arm_callback(int irq, void *arg)
>  {
>  	xen_hvm_evtchn_do_upcall();
> 


-- 
Julien Grall

  reply	other threads:[~2013-08-28 16:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28 16:19 [PATCH] ARM: xen: only set pm function ptrs for Xen guests Rob Herring
2013-08-28 16:32 ` Julien Grall [this message]
2013-08-28 18:03   ` [Xen-devel] " Rob Herring

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=521E2635.4070800@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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).