* [PATCH] ARM: xen: only set pm function ptrs for Xen guests
@ 2013-08-28 16:19 ` Rob Herring
0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2013-08-28 16:19 UTC (permalink / raw)
To: xen-devel, linux-arm-kernel, linux-kernel; +Cc: Rob Herring, Stefano Stabellini
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;
+
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();
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] ARM: xen: only set pm function ptrs for Xen guests
@ 2013-08-28 16:19 ` Rob Herring
0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2013-08-28 16:19 UTC (permalink / raw)
To: linux-arm-kernel
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;
+
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();
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Xen-devel] [PATCH] ARM: xen: only set pm function ptrs for Xen guests
2013-08-28 16:19 ` Rob Herring
@ 2013-08-28 16:32 ` Julien Grall
-1 siblings, 0 replies; 7+ messages in thread
From: Julien Grall @ 2013-08-28 16:32 UTC (permalink / raw)
To: Rob Herring
Cc: xen-devel, linux-arm-kernel, linux-kernel, Rob Herring,
Stefano Stabellini
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Xen-devel] [PATCH] ARM: xen: only set pm function ptrs for Xen guests
@ 2013-08-28 16:32 ` Julien Grall
0 siblings, 0 replies; 7+ messages in thread
From: Julien Grall @ 2013-08-28 16:32 UTC (permalink / raw)
To: linux-arm-kernel
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xen-devel] [PATCH] ARM: xen: only set pm function ptrs for Xen guests
2013-08-28 16:32 ` Julien Grall
(?)
@ 2013-08-28 18:03 ` Rob Herring
-1 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2013-08-28 18:03 UTC (permalink / raw)
To: Julien Grall
Cc: xen-devel, linux-arm-kernel, linux-kernel, Rob Herring,
Stefano Stabellini
On Wed, Aug 28, 2013 at 11:32 AM, Julien Grall <julien.grall@linaro.org> wrote:
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Xen-devel] [PATCH] ARM: xen: only set pm function ptrs for Xen guests
@ 2013-08-28 18:03 ` Rob Herring
0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2013-08-28 18:03 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Aug 28, 2013 at 11:32 AM, Julien Grall <julien.grall@linaro.org> wrote:
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xen-devel] [PATCH] ARM: xen: only set pm function ptrs for Xen guests
@ 2013-08-28 18:03 ` Rob Herring
0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2013-08-28 18:03 UTC (permalink / raw)
To: Julien Grall
Cc: xen-devel, linux-arm-kernel, linux-kernel, Rob Herring,
Stefano Stabellini
On Wed, Aug 28, 2013 at 11:32 AM, Julien Grall <julien.grall@linaro.org> wrote:
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-08-28 18:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-28 16:19 [PATCH] ARM: xen: only set pm function ptrs for Xen guests Rob Herring
2013-08-28 16:19 ` Rob Herring
2013-08-28 16:32 ` [Xen-devel] " Julien Grall
2013-08-28 16:32 ` Julien Grall
2013-08-28 18:03 ` Rob Herring
2013-08-28 18:03 ` Rob Herring
2013-08-28 18:03 ` Rob Herring
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.