|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [XEN][PATCH v9 13/19] asm/smp.h: Fix circular dependency for device_tree.h and rwlock.h
Dynamic programming ops will modify the dt_host and there might be other
function which are browsing the dt_host at the same time. To avoid the race
conditions, we will need to add a rwlock to protect access to the dt_host.
However, adding rwlock in device_tree.h causes following circular dependency:
device_tree.h->rwlock.h->smp.h->asm/smp.h->device_tree.h
To fix this, removed the "#include <xen/device_tree.h> and forward declared
"struct dt_device_node".
Signed-off-by: Vikram Garhwal <vikram.garhwal@xxxxxxx>
Reviewed-by: Henry Wang <Henry.Wang@xxxxxxx>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
---
Changes from v7:
Move struct dt_device_node declaration just above arch_cpu_init().
---
---
xen/arch/arm/include/asm/smp.h | 4 +++-
xen/arch/arm/smpboot.c | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/xen/arch/arm/include/asm/smp.h b/xen/arch/arm/include/asm/smp.h
index a37ca55bff..4fabdf5310 100644
--- a/xen/arch/arm/include/asm/smp.h
+++ b/xen/arch/arm/include/asm/smp.h
@@ -3,7 +3,6 @@
#ifndef __ASSEMBLY__
#include <xen/cpumask.h>
-#include <xen/device_tree.h>
#include <asm/current.h>
#endif
@@ -23,6 +22,9 @@ DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
extern void noreturn stop_cpu(void);
extern int arch_smp_init(void);
+
+struct dt_device_node;
+
extern int arch_cpu_init(int cpu, struct dt_device_node *dn);
extern int arch_cpu_up(int cpu);
extern void arch_cpu_up_finish(void);
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index e107b86b7b..eeb76cd551 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -10,6 +10,7 @@
#include <xen/cpu.h>
#include <xen/cpumask.h>
#include <xen/delay.h>
+#include <xen/device_tree.h>
#include <xen/domain_page.h>
#include <xen/errno.h>
#include <xen/init.h>
--
2.17.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |