From: stephane.eranian@hp.com Date: Thu, 28 Jul 2005 12:18:00 +0000 (-0700) Subject: [IA64] fix perfmon context load X-Git-Tag: v2.6.13-rc7~64^2~7^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=6bf11e8c708f0e512ed733fc65a50770c5bc7b54;p=linux-2.6-omap-h63xx.git [IA64] fix perfmon context load The PFM_LOAD_CONTEXT may fail silently and cause a session to remain reserved even though it should not. This can happen when the commands succeeds in reserving the session but fails when it actually tries to attach to the load_pid. In that case, the command has failed but will return 0. More importantly, the session will remain reserved. This patch fixes the problem. Signed-off-by: Signed-off-by: Tony Luck --- diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index b8ebb8e427e..f1201ac8a11 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c @@ -4312,6 +4312,7 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) DPRINT(("before cmpxchg() old_ctx=%p new_ctx=%p\n", thread->pfm_context, ctx)); + ret = -EBUSY; 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));