ARM: xen: only set pm function ptrs for Xen guests
Subsystems (2)
PATCH 1/1 ARM: xen: only set pm function ptrs for Xen guests
From: Rob Herring <[email protected]>
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.
---
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(-)
arch/arm/xen/enlighten.c +3 -9
@@ -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 ();
Signature · 1 line
1.8.1.2
Quoted 22 lines · Rob Herring
From: Rob Herring <[email protected]>
xen_pm_initwas unconditionally settingpm_power_offandarm_pm_restartfunction pointers. This breaks multi-platform kernels. Move this initialization intoxen_guest_init, so it is conditional on running as a Xen guest.Cc Stefano Stabellini <[email protected]>Signed-off-by Rob Herring <[email protected]>---
This breaks reset and poweroff for Midway when Xen is enabled. This should go into 3.11 or stable.
Robarch/arm/xen/enlighten.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)arch/arm/xen/enlighten.c +0
-0
arch/arm/xen/enlighten.c static int __init xen_guest_init(void) · line 268
Quoted 6 lines
arch/arm/xen/enlighten.c +3
-0@@ -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.
Quoted 20 lines
arch/arm/xen/enlighten.c +0
-9gnttab_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 ();
Signature · 1 line
Julien Grall
Quoted 63 lines · Julien Grall
Quoted 22 lines · Rob Herring
From: Rob Herring <[email protected]>
xen_pm_initwas unconditionally settingpm_power_offandarm_pm_restartfunction pointers. This breaks multi-platform kernels. Move this initialization intoxen_guest_init, so it is conditional on running as a Xen guest.Cc Stefano Stabellini <[email protected]>Signed-off-by Rob Herring <[email protected]>---
This breaks reset and poweroff for Midway when Xen is enabled. This should go into 3.11 or stable.
Robarch/arm/xen/enlighten.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)arch/arm/xen/enlighten.c +0
-0arch/arm/xen/enlighten.c static int __init xen_guest_init(void) · line 268
Quoted 6 lines
arch/arm/xen/enlighten.c +3
-0@@ -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.
Quoted 10 lines
arch/arm/xen/enlighten.c +0
-2gnttab_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 ) -{arch/arm/xen/enlighten.c static int __init xen_guest_init(void) · line 279
Quoted 10 lines
arch/arm/xen/enlighten.c +0
-7- 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