static int nvhost_channelrelease(struct inode *inode, struct file *filp)
{
struct nvhost_channel_userctx *priv = filp->private_data;
- struct nvhost_cdma *cdma = &priv->ch->cdma;
mutex_lock(&channel_lock);
if (!priv->ch || !priv->ch->dev) {
}
trace_nvhost_channel_release(dev_name(&priv->ch->dev->dev));
- /* reduce timeout of the remaining jobs */
- nvhost_cdma_update_client_timeout(cdma, priv->clientid, 500);
-
filp->private_data = NULL;
nvhost_module_remove_client(priv->ch->dev, priv);
mutex_unlock(&channel_lock);
nvhost_putchannel(priv->ch);
kfree(priv);
-
return 0;
}
}
}
-/*
- * nvhost_cdma_update_timeout(cdma, clientid, timeout) - Update timeout of
- * the given client. The caller must not hold cdma lock
- */
-void nvhost_cdma_update_client_timeout(struct nvhost_cdma *cdma, int clientid,
- int timeout)
-{
- struct nvhost_job *job;
-
- mutex_lock(&cdma->lock);
-
- list_for_each_entry(job, &cdma->sync_queue, list)
- if (job->clientid == cdma->timeout.clientid)
- job->timeout = timeout;
-
- /* if the first job in the queue is from this client, restart
- * the timer */
- job = list_first_entry(&cdma->sync_queue, struct nvhost_job, list);
- if (job->clientid == clientid) {
- stop_cdma_timer_locked(cdma);
- cdma_start_timer_locked(cdma, job);
- }
-
- mutex_unlock(&cdma->lock);
-}
static void nvhost_cdma_finalize_job_incrs(struct nvhost_syncpt *syncpt,
struct nvhost_job_syncpt *sp)
enum cdma_event event);
void nvhost_cdma_update_sync_queue(struct nvhost_cdma *cdma,
struct nvhost_syncpt *syncpt, struct platform_device *dev);
-void nvhost_cdma_update_client_timeout(struct nvhost_cdma *cdma, int clientid,
- int timeout);
#endif