diff options
| author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-23 12:22:16 -0500 |
|---|---|---|
| committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-24 13:27:32 -0500 |
| commit | 8a327f23e23fa509e6e3c2263ae1cc0a67dec387 (patch) | |
| tree | 119abf09e1ec9babaf78e6889187f9d54864b118 /arch/powerpc/kernel/crash.c | |
| parent | 5a9a8d1a99c617df82339456fbdd30d6ed3a856b (diff) | |
| parent | d315777b32a4696feb86f2a0c9e9f39c94683649 (diff) | |
Merge remote branch 'linus/master' into drm-intel-fixes
Merge with Linus to resolve conflicting fixes for the reusing the stale
HEAD value during intel_ring_wait().
Conflicts:
drivers/gpu/drm/i915/intel_ringbuffer.c
Diffstat (limited to 'arch/powerpc/kernel/crash.c')
| -rw-r--r-- | arch/powerpc/kernel/crash.c | 72 |
1 files changed, 2 insertions, 70 deletions
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c index 832c8c4db254..3d569e2aff18 100644 --- a/arch/powerpc/kernel/crash.c +++ b/arch/powerpc/kernel/crash.c | |||
| @@ -48,7 +48,7 @@ int crashing_cpu = -1; | |||
| 48 | static cpumask_t cpus_in_crash = CPU_MASK_NONE; | 48 | static cpumask_t cpus_in_crash = CPU_MASK_NONE; |
| 49 | cpumask_t cpus_in_sr = CPU_MASK_NONE; | 49 | cpumask_t cpus_in_sr = CPU_MASK_NONE; |
| 50 | 50 | ||
| 51 | #define CRASH_HANDLER_MAX 2 | 51 | #define CRASH_HANDLER_MAX 3 |
| 52 | /* NULL terminated list of shutdown handles */ | 52 | /* NULL terminated list of shutdown handles */ |
| 53 | static crash_shutdown_t crash_shutdown_handles[CRASH_HANDLER_MAX+1]; | 53 | static crash_shutdown_t crash_shutdown_handles[CRASH_HANDLER_MAX+1]; |
| 54 | static DEFINE_SPINLOCK(crash_handlers_lock); | 54 | static DEFINE_SPINLOCK(crash_handlers_lock); |
| @@ -125,7 +125,7 @@ static void crash_kexec_prepare_cpus(int cpu) | |||
| 125 | smp_wmb(); | 125 | smp_wmb(); |
| 126 | 126 | ||
| 127 | /* | 127 | /* |
| 128 | * FIXME: Until we will have the way to stop other CPUSs reliabally, | 128 | * FIXME: Until we will have the way to stop other CPUs reliably, |
| 129 | * the crash CPU will send an IPI and wait for other CPUs to | 129 | * the crash CPU will send an IPI and wait for other CPUs to |
| 130 | * respond. | 130 | * respond. |
| 131 | * Delay of at least 10 seconds. | 131 | * Delay of at least 10 seconds. |
| @@ -254,72 +254,6 @@ void crash_kexec_secondary(struct pt_regs *regs) | |||
| 254 | cpus_in_sr = CPU_MASK_NONE; | 254 | cpus_in_sr = CPU_MASK_NONE; |
| 255 | } | 255 | } |
| 256 | #endif | 256 | #endif |
| 257 | #ifdef CONFIG_SPU_BASE | ||
| 258 | |||
| 259 | #include <asm/spu.h> | ||
| 260 | #include <asm/spu_priv1.h> | ||
| 261 | |||
| 262 | struct crash_spu_info { | ||
| 263 | struct spu *spu; | ||
| 264 | u32 saved_spu_runcntl_RW; | ||
| 265 | u32 saved_spu_status_R; | ||
| 266 | u32 saved_spu_npc_RW; | ||
| 267 | u64 saved_mfc_sr1_RW; | ||
| 268 | u64 saved_mfc_dar; | ||
| 269 | u64 saved_mfc_dsisr; | ||
| 270 | }; | ||
| 271 | |||
| 272 | #define CRASH_NUM_SPUS 16 /* Enough for current hardware */ | ||
| 273 | static struct crash_spu_info crash_spu_info[CRASH_NUM_SPUS]; | ||
| 274 | |||
| 275 | static void crash_kexec_stop_spus(void) | ||
| 276 | { | ||
| 277 | struct spu *spu; | ||
| 278 | int i; | ||
| 279 | u64 tmp; | ||
| 280 | |||
| 281 | for (i = 0; i < CRASH_NUM_SPUS; i++) { | ||
| 282 | if (!crash_spu_info[i].spu) | ||
| 283 | continue; | ||
| 284 | |||
| 285 | spu = crash_spu_info[i].spu; | ||
| 286 | |||
| 287 | crash_spu_info[i].saved_spu_runcntl_RW = | ||
| 288 | in_be32(&spu->problem->spu_runcntl_RW); | ||
| 289 | crash_spu_info[i].saved_spu_status_R = | ||
| 290 | in_be32(&spu->problem->spu_status_R); | ||
| 291 | crash_spu_info[i].saved_spu_npc_RW = | ||
| 292 | in_be32(&spu->problem->spu_npc_RW); | ||
| 293 | |||
| 294 | crash_spu_info[i].saved_mfc_dar = spu_mfc_dar_get(spu); | ||
| 295 | crash_spu_info[i].saved_mfc_dsisr = spu_mfc_dsisr_get(spu); | ||
| 296 | tmp = spu_mfc_sr1_get(spu); | ||
| 297 | crash_spu_info[i].saved_mfc_sr1_RW = tmp; | ||
| 298 | |||
| 299 | tmp &= ~MFC_STATE1_MASTER_RUN_CONTROL_MASK; | ||
| 300 | spu_mfc_sr1_set(spu, tmp); | ||
| 301 | |||
| 302 | __delay(200); | ||
| 303 | } | ||
| 304 | } | ||
| 305 | |||
| 306 | void crash_register_spus(struct list_head *list) | ||
| 307 | { | ||
| 308 | struct spu *spu; | ||
| 309 | |||
| 310 | list_for_each_entry(spu, list, full_list) { | ||
| 311 | if (WARN_ON(spu->number >= CRASH_NUM_SPUS)) | ||
| 312 | continue; | ||
| 313 | |||
| 314 | crash_spu_info[spu->number].spu = spu; | ||
| 315 | } | ||
| 316 | } | ||
| 317 | |||
| 318 | #else | ||
| 319 | static inline void crash_kexec_stop_spus(void) | ||
| 320 | { | ||
| 321 | } | ||
| 322 | #endif /* CONFIG_SPU_BASE */ | ||
| 323 | 257 | ||
| 324 | /* | 258 | /* |
| 325 | * Register a function to be called on shutdown. Only use this if you | 259 | * Register a function to be called on shutdown. Only use this if you |
| @@ -439,8 +373,6 @@ void default_machine_crash_shutdown(struct pt_regs *regs) | |||
| 439 | crash_shutdown_cpu = -1; | 373 | crash_shutdown_cpu = -1; |
| 440 | __debugger_fault_handler = old_handler; | 374 | __debugger_fault_handler = old_handler; |
| 441 | 375 | ||
| 442 | crash_kexec_stop_spus(); | ||
| 443 | |||
| 444 | if (ppc_md.kexec_cpu_down) | 376 | if (ppc_md.kexec_cpu_down) |
| 445 | ppc_md.kexec_cpu_down(1, 0); | 377 | ppc_md.kexec_cpu_down(1, 0); |
| 446 | } | 378 | } |
