core: direct-controls: Fix clearing of special wakeup
'special_wakeup_count' is incremented on successfully asserting
special wakeup. So we will never clear the special wakeup if we
check 'special_wakeup_count' to be zero. Fix this issue by checking
the 'special_wakeup_count' to 1 in dctl_clear_special_wakeup().
@@ -247,10 +247,13 @@ static int dctl_clear_special_wakeup(struct cpu_thread *t)
return OPAL_UNSUPPORTED;
lock(&c->dctl_lock);
- if (c->special_wakeup_count == 0)
+ if (!c->special_wakeup_count)
+ goto out;
+ if (c->special_wakeup_count == 1)
rc = p9_core_clear_special_wakeup(c);
if (!rc)
c->special_wakeup_count--;
+out:
unlock(&c->dctl_lock);
return rc;
