Commit e3c14a19 authored by Tony Luck's avatar Tony Luck

Merge agluck-lia64.sc.intel.com:/data/home/aegl/BK/work/eranian

into agluck-lia64.sc.intel.com:/data/home/aegl/BK/linux-ia64-release-2.6.9
parents 8abe655c 23c25b0d
......@@ -479,7 +479,7 @@ static const char *proc_features[]={
"Enable CMCI promotion",
"Enable MCA to BINIT promotion",
"Enable MCA promotion",
"Enable BEER promotion"
"Enable BERR promotion"
};
......
......@@ -3985,7 +3985,10 @@ pfm_stop(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
state = ctx->ctx_state;
is_system = ctx->ctx_fl_system;
if (state != PFM_CTX_LOADED && state != PFM_CTX_MASKED) return -EINVAL;
/*
* context must be attached to issue the stop command (includes LOADED,MASKED,ZOMBIE)
*/
if (state == PFM_CTX_UNLOADED) return -EINVAL;
/*
* In system wide and when the context is loaded, access can only happen
......@@ -6312,15 +6315,15 @@ pfm_flush_pmds(struct task_struct *task, pfm_context_t *ctx)
*/
is_self = ctx->ctx_task == task ? 1 : 0;
#ifdef CONFIG_SMP
if (task == current) {
#else
/*
* in UP, the state can still be in the registers
* can access PMU is task is the owner of the PMU state on the current CPU
* or if we are running on the CPU bound to the context in system-wide mode
* (that is not necessarily the task the context is attached to in this mode).
* In system-wide we always have can_access_pmu true because a task running on an
* invalid processor is flagged earlier in the call stack (see pfm_stop).
*/
if (task == current || GET_PMU_OWNER() == task) {
#endif
can_access_pmu = 1;
can_access_pmu = (GET_PMU_OWNER() == task) || (ctx->ctx_fl_system && ctx->ctx_cpu == smp_processor_id());
if (can_access_pmu) {
/*
* Mark the PMU as not owned
* This will cause the interrupt handler to do nothing in case an overflow
......@@ -6330,6 +6333,7 @@ pfm_flush_pmds(struct task_struct *task, pfm_context_t *ctx)
* on.
*/
SET_PMU_OWNER(NULL, NULL);
DPRINT(("releasing ownership\n"));
/*
* read current overflow status:
......
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