Commit 92f3b57c authored by Stéphane Eranian's avatar Stéphane Eranian Committed by David Mosberger

[PATCH] ia64: minor perfmon fixes

- remove extra include of asm/perfmon.h
- fix a bug if PFM_LOAD_CONTEXT by which it would not return an
  error if the task already had a context attached.
parent 922e56d1
......@@ -4322,6 +4322,7 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
ret = pfm_reserve_session(current, ctx->ctx_fl_system, the_cpu);
if (ret) goto error;
ret = -EBUSY;
/*
* task is necessarily stopped at this point.
*
......@@ -4331,6 +4332,10 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
*
* XXX: needs to be atomic
*/
DPRINT(("[%d] before cmpxchg() old_ctx=%p new_ctx=%p\n",
current->pid,
thread->pfm_context, ctx));
old = ia64_cmpxchg("acq", &thread->pfm_context, NULL, ctx, sizeof(pfm_context_t *));
if (old != NULL) {
DPRINT(("load_pid [%d] already has a context\n", req->load_pid));
......@@ -4344,7 +4349,7 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
/*
* link context to task
*/
ctx->ctx_task = task;
ctx->ctx_task = task;
if (ctx->ctx_fl_system) {
......
......@@ -25,7 +25,6 @@
#include <asm/delay.h>
#include <asm/elf.h>
#include <asm/perfmon.h>
#include <asm/pgalloc.h>
#include <asm/processor.h>
#include <asm/sal.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment