return nvhost_dev_is_virtual(host->dev);
}
-static inline void nvhost_intr_syncpt_lock(struct nvhost_intr_syncpt *sp)
-__acquires(&sp->lock.m)
-__acquires(&sp->lock.s)
-{
- if (nvhost_intr_is_virtual_dev(sp))
- mutex_lock(&sp->lock.m);
- else
- spin_lock(&sp->lock.s);
-}
-
-static inline void nvhost_intr_syncpt_unlock(struct nvhost_intr_syncpt *sp)
-__releases(&sp->lock.m)
-__releases(&sp->lock.s)
-{
- if (nvhost_intr_is_virtual_dev(sp))
- mutex_unlock(&sp->lock.m);
- else
- spin_unlock(&sp->lock.s);
-}
-
static void waiter_release(struct kref *kref)
{
kfree(container_of(kref, struct nvhost_waitlist, refcount));
for (i = 0; i < NVHOST_INTR_ACTION_COUNT; ++i)
INIT_LIST_HEAD(completed + i);
- nvhost_intr_syncpt_lock(syncpt);
+ /* take lock on waiter list */
+ mutex_lock(&syncpt->lock);
remove_completed_waiters(&syncpt->wait_head, threshold,
syncpt->isr_recv, completed);
reset_threshold_interrupt(intr, &syncpt->wait_head,
syncpt->id);
- nvhost_intr_syncpt_unlock(syncpt);
+ mutex_unlock(&syncpt->lock);
run_handlers(completed);
bool res = false;
syncpt = intr->syncpt + id;
- nvhost_intr_syncpt_lock(syncpt);
+ mutex_lock(&syncpt->lock);
list_for_each_entry(waiter, &syncpt->wait_head, list)
if (((waiter->action ==
NVHOST_INTR_ACTION_SUBMIT_COMPLETE) &&
break;
}
- nvhost_intr_syncpt_unlock(syncpt);
+ mutex_unlock(&syncpt->lock);
return res;
}
syncpt = intr->syncpt + id;
- nvhost_intr_syncpt_lock(syncpt);
+ mutex_lock(&syncpt->lock);
queue_was_empty = list_empty(&syncpt->wait_head);
intr_op().enable_syncpt_intr(intr, id);
}
- nvhost_intr_syncpt_unlock(syncpt);
+ mutex_unlock(&syncpt->lock);
if (ref)
*ref = waiter;
++id, ++syncpt) {
syncpt->intr = &host->intr;
syncpt->id = id;
- mutex_init(&syncpt->lock.m);
- spin_lock_init(&syncpt->lock.s);
+ mutex_init(&syncpt->lock);
INIT_LIST_HEAD(&syncpt->wait_head);
snprintf(syncpt->thresh_irq_name,
sizeof(syncpt->thresh_irq_name),
*
* Tegra Graphics Host Interrupt Management
*
- * Copyright (c) 2010-2014, NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2010-2015, NVIDIA Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
struct nvhost_intr_syncpt {
struct nvhost_intr *intr;
u8 id;
- struct {
- spinlock_t s;
- struct mutex m;
- } lock;
+ struct mutex lock;
struct list_head wait_head;
char thresh_irq_name[12];
struct work_struct work;