aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x/intr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/host1x/intr.c')
-rw-r--r--drivers/gpu/host1x/intr.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/gpu/host1x/intr.c b/drivers/gpu/host1x/intr.c
index 2491bf82e30c..8b4fad0ab35d 100644
--- a/drivers/gpu/host1x/intr.c
+++ b/drivers/gpu/host1x/intr.c
@@ -122,18 +122,20 @@ static void action_submit_complete(struct host1x_waitlist *waiter)
122static void action_wakeup(struct host1x_waitlist *waiter) 122static void action_wakeup(struct host1x_waitlist *waiter)
123{ 123{
124 wait_queue_head_t *wq = waiter->data; 124 wait_queue_head_t *wq = waiter->data;
125
125 wake_up(wq); 126 wake_up(wq);
126} 127}
127 128
128static void action_wakeup_interruptible(struct host1x_waitlist *waiter) 129static void action_wakeup_interruptible(struct host1x_waitlist *waiter)
129{ 130{
130 wait_queue_head_t *wq = waiter->data; 131 wait_queue_head_t *wq = waiter->data;
132
131 wake_up_interruptible(wq); 133 wake_up_interruptible(wq);
132} 134}
133 135
134typedef void (*action_handler)(struct host1x_waitlist *waiter); 136typedef void (*action_handler)(struct host1x_waitlist *waiter);
135 137
136static action_handler action_handlers[HOST1X_INTR_ACTION_COUNT] = { 138static const action_handler action_handlers[HOST1X_INTR_ACTION_COUNT] = {
137 action_submit_complete, 139 action_submit_complete,
138 action_wakeup, 140 action_wakeup,
139 action_wakeup_interruptible, 141 action_wakeup_interruptible,
@@ -209,7 +211,7 @@ static void syncpt_thresh_work(struct work_struct *work)
209 host1x_syncpt_load(host->syncpt + id)); 211 host1x_syncpt_load(host->syncpt + id));
210} 212}
211 213
212int host1x_intr_add_action(struct host1x *host, u32 id, u32 thresh, 214int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh,
213 enum host1x_intr_action action, void *data, 215 enum host1x_intr_action action, void *data,
214 struct host1x_waitlist *waiter, void **ref) 216 struct host1x_waitlist *waiter, void **ref)
215{ 217{
@@ -254,7 +256,7 @@ int host1x_intr_add_action(struct host1x *host, u32 id, u32 thresh,
254 return 0; 256 return 0;
255} 257}
256 258
257void host1x_intr_put_ref(struct host1x *host, u32 id, void *ref) 259void host1x_intr_put_ref(struct host1x *host, unsigned int id, void *ref)
258{ 260{
259 struct host1x_waitlist *waiter = ref; 261 struct host1x_waitlist *waiter = ref;
260 struct host1x_syncpt *syncpt; 262 struct host1x_syncpt *syncpt;
@@ -277,9 +279,6 @@ int host1x_intr_init(struct host1x *host, unsigned int irq_sync)
277 279
278 mutex_init(&host->intr_mutex); 280 mutex_init(&host->intr_mutex);
279 host->intr_syncpt_irq = irq_sync; 281 host->intr_syncpt_irq = irq_sync;
280 host->intr_wq = create_workqueue("host_syncpt");
281 if (!host->intr_wq)
282 return -ENOMEM;
283 282
284 for (id = 0; id < nb_pts; ++id) { 283 for (id = 0; id < nb_pts; ++id) {
285 struct host1x_syncpt *syncpt = host->syncpt + id; 284 struct host1x_syncpt *syncpt = host->syncpt + id;
@@ -288,7 +287,7 @@ int host1x_intr_init(struct host1x *host, unsigned int irq_sync)
288 INIT_LIST_HEAD(&syncpt->intr.wait_head); 287 INIT_LIST_HEAD(&syncpt->intr.wait_head);
289 snprintf(syncpt->intr.thresh_irq_name, 288 snprintf(syncpt->intr.thresh_irq_name,
290 sizeof(syncpt->intr.thresh_irq_name), 289 sizeof(syncpt->intr.thresh_irq_name),
291 "host1x_sp_%02d", id); 290 "host1x_sp_%02u", id);
292 } 291 }
293 292
294 host1x_intr_start(host); 293 host1x_intr_start(host);
@@ -299,7 +298,6 @@ int host1x_intr_init(struct host1x *host, unsigned int irq_sync)
299void host1x_intr_deinit(struct host1x *host) 298void host1x_intr_deinit(struct host1x *host)
300{ 299{
301 host1x_intr_stop(host); 300 host1x_intr_stop(host);
302 destroy_workqueue(host->intr_wq);
303} 301}
304 302
305void host1x_intr_start(struct host1x *host) 303void host1x_intr_start(struct host1x *host)
@@ -342,7 +340,7 @@ void host1x_intr_stop(struct host1x *host)
342 if (!list_empty(&syncpt[id].intr.wait_head)) { 340 if (!list_empty(&syncpt[id].intr.wait_head)) {
343 /* output diagnostics */ 341 /* output diagnostics */
344 mutex_unlock(&host->intr_mutex); 342 mutex_unlock(&host->intr_mutex);
345 pr_warn("%s cannot stop syncpt intr id=%d\n", 343 pr_warn("%s cannot stop syncpt intr id=%u\n",
346 __func__, id); 344 __func__, id);
347 return; 345 return;
348 } 346 }