Lines Matching refs:notify

33 nvif_notify_put_(struct nvif_notify *notify)  in nvif_notify_put_()  argument
35 struct nvif_object *object = notify->object; in nvif_notify_put_()
41 .ntfy.index = notify->index, in nvif_notify_put_()
44 if (atomic_inc_return(&notify->putcnt) != 1) in nvif_notify_put_()
51 nvif_notify_put(struct nvif_notify *notify) in nvif_notify_put() argument
53 if (likely(notify->object) && in nvif_notify_put()
54 test_and_clear_bit(NVIF_NOTIFY_USER, &notify->flags)) { in nvif_notify_put()
55 int ret = nvif_notify_put_(notify); in nvif_notify_put()
56 if (test_bit(NVIF_NOTIFY_WORK, &notify->flags)) in nvif_notify_put()
57 flush_work(&notify->work); in nvif_notify_put()
64 nvif_notify_get_(struct nvif_notify *notify) in nvif_notify_get_() argument
66 struct nvif_object *object = notify->object; in nvif_notify_get_()
72 .ntfy.index = notify->index, in nvif_notify_get_()
75 if (atomic_dec_return(&notify->putcnt) != 0) in nvif_notify_get_()
82 nvif_notify_get(struct nvif_notify *notify) in nvif_notify_get() argument
84 if (likely(notify->object) && in nvif_notify_get()
85 !test_and_set_bit(NVIF_NOTIFY_USER, &notify->flags)) in nvif_notify_get()
86 return nvif_notify_get_(notify); in nvif_notify_get()
91 nvif_notify_func(struct nvif_notify *notify, bool keep) in nvif_notify_func() argument
93 int ret = notify->func(notify); in nvif_notify_func()
95 !test_and_clear_bit(NVIF_NOTIFY_USER, &notify->flags)) { in nvif_notify_func()
97 atomic_dec(&notify->putcnt); in nvif_notify_func()
99 nvif_notify_get_(notify); in nvif_notify_func()
107 struct nvif_notify *notify = container_of(work, typeof(*notify), work); in nvif_notify_work() local
108 nvif_notify_func(notify, true); in nvif_notify_work()
114 struct nvif_notify *notify = NULL; in nvif_notify() local
123 notify = (void *)(unsigned long)args->v0.token; in nvif_notify()
126 if (!WARN_ON(notify == NULL)) { in nvif_notify()
127 struct nvif_client *client = notify->object->client; in nvif_notify()
128 if (!WARN_ON(notify->size != size)) { in nvif_notify()
129 atomic_inc(&notify->putcnt); in nvif_notify()
130 if (test_bit(NVIF_NOTIFY_WORK, &notify->flags)) { in nvif_notify()
131 memcpy((void *)notify->data, data, size); in nvif_notify()
132 schedule_work(&notify->work); in nvif_notify()
135 notify->data = data; in nvif_notify()
136 ret = nvif_notify_func(notify, client->driver->keep); in nvif_notify()
137 notify->data = NULL; in nvif_notify()
145 nvif_notify_dtor(struct nvif_notify *notify) in nvif_notify_dtor() argument
147 struct nvif_object *object = notify->object; in nvif_notify_dtor()
153 .ntfy.index = notify->index, in nvif_notify_dtor()
155 int ret = nvif_notify_put(notify); in nvif_notify_dtor()
158 notify->object = NULL; in nvif_notify_dtor()
159 kfree((void *)notify->data); in nvif_notify_dtor()
167 void *data, u32 size, u32 reply, struct nvif_notify *notify) in nvif_notify_ctor() argument
176 notify->object = object; in nvif_notify_ctor()
177 notify->name = name ? name : "nvifNotify"; in nvif_notify_ctor()
178 notify->flags = 0; in nvif_notify_ctor()
179 atomic_set(&notify->putcnt, 1); in nvif_notify_ctor()
180 notify->func = func; in nvif_notify_ctor()
181 notify->data = NULL; in nvif_notify_ctor()
182 notify->size = reply; in nvif_notify_ctor()
184 INIT_WORK(&notify->work, nvif_notify_work); in nvif_notify_ctor()
185 set_bit(NVIF_NOTIFY_WORK, &notify->flags); in nvif_notify_ctor()
186 notify->data = kmalloc(notify->size, GFP_KERNEL); in nvif_notify_ctor()
187 if (!notify->data) in nvif_notify_ctor()
198 args->req.reply = notify->size; in nvif_notify_ctor()
200 args->req.token = (unsigned long)(void *)notify; in nvif_notify_ctor()
204 notify->index = args->ntfy.index; in nvif_notify_ctor()
208 nvif_notify_dtor(notify); in nvif_notify_ctor()