struct nvhost_op_pair save;
struct nvhost_cpuinterrupt ctxsw;
u32 syncval;
+ void *ref;
syncval = nvhost_syncpt_incr_max(&ch->dev->syncpt,
NVSYNCPT_3D,
ch->cur_ctx->save_incrs);
nvhost_intr_add_action(&ch->dev->intr, NVSYNCPT_3D,
syncval,
NVHOST_INTR_ACTION_WAKEUP,
- &wq, NULL);
+ &wq, &ref);
wait_event(wq,
nvhost_syncpt_min_cmp(&ch->dev->syncpt,
NVSYNCPT_3D, syncval));
+ nvhost_intr_put_ref(&ch->dev->intr, ref);
nvhost_cdma_update(&ch->cdma);
}
mutex_unlock(&ch->submitlock);
for (id = 0, syncpt = intr->syncpt;
id < NV_HOST1X_SYNCPT_NB_PTS;
- ++id, ++syncpt)
+ ++id, ++syncpt) {
+ struct nvhost_waitlist *waiter, *next;
+ list_for_each_entry_safe(waiter, next, &syncpt->wait_head, list) {
+ if (atomic_cmpxchg(&waiter->state, WLS_CANCELLED, WLS_HANDLED)
+ == WLS_CANCELLED) {
+ list_del(&waiter->list);
+ kref_put(&waiter->refcount, waiter_release);
+ }
+ }
+
+ if(!list_empty(&syncpt->wait_head)) { // output diagnostics
+ printk("%s id=%d\n",__func__,id);
+ BUG_ON(1);
+ }
+
if (syncpt->irq_requested)
free_irq(syncpt->irq, syncpt);
+ }
if (intr->host1x_isr_started) {
free_irq(intr->host1x_irq, intr);