Lines Matching defs:r_evt
342 * @r_evt: A reference to the associated registered event; when this is NULL
359 struct scmi_registered_event *r_evt;
365 #define IS_HNDL_PENDING(hndl) (!(hndl)->r_evt)
426 struct scmi_registered_event *r_evt;
438 r_evt = SCMI_GET_REVT_FROM_PD(pd, pd->eh->evt_id);
439 if (!r_evt)
440 r_evt = ERR_PTR(-EINVAL);
442 return r_evt;
449 * @r_evt: The registered event descriptor to use
461 struct scmi_registered_event *r_evt)
480 if (IS_ERR(r_evt)) {
487 report = REVT_FILL_REPORT(r_evt, pd->eh->evt_id, pd->eh->timestamp,
489 r_evt->report, &src_id);
537 struct scmi_registered_event *r_evt;
550 r_evt = scmi_process_event_header(eq, pd);
551 if (!r_evt)
553 pd->in_flight = r_evt;
555 r_evt = pd->in_flight;
557 } while (scmi_process_event_payload(eq, pd, r_evt));
578 struct scmi_registered_event *r_evt;
588 r_evt = SCMI_GET_REVT(ni, proto_id, evt_id);
589 if (!r_evt)
592 if (len > r_evt->evt->max_payld_sz) {
596 if (kfifo_avail(&r_evt->proto->equeue.kfifo) < sizeof(eh) + len) {
611 kfifo_in(&r_evt->proto->equeue.kfifo, &eh, sizeof(eh));
612 kfifo_in(&r_evt->proto->equeue.kfifo, buf, len);
625 queue_work(r_evt->proto->equeue.wq,
626 &r_evt->proto->equeue.notify_work);
785 struct scmi_registered_event *r_evt;
787 r_evt = devm_kzalloc(ni->handle->dev, sizeof(*r_evt),
789 if (!r_evt)
791 r_evt->proto = pd;
792 r_evt->evt = evt;
794 r_evt->sources = devm_kcalloc(ni->handle->dev, num_sources,
796 if (!r_evt->sources)
798 r_evt->num_sources = num_sources;
799 mutex_init(&r_evt->sources_mtx);
801 r_evt->report = devm_kzalloc(ni->handle->dev,
803 if (!r_evt->report)
806 pd->registered_events[i] = r_evt;
810 MAKE_ALL_SRCS_KEY(r_evt->proto->id, r_evt->evt->id));
845 * associated to this handler descriptor (hndl->r_evt == NULL), so the handler
896 struct scmi_registered_event *r_evt;
898 r_evt = SCMI_GET_REVT(ni, KEY_XTRACT_PROTO_ID(hndl->key),
900 if (!r_evt)
905 hndl->r_evt = r_evt;
906 mutex_lock(&r_evt->proto->registered_mtx);
907 hash_add(r_evt->proto->registered_events_handlers,
909 mutex_unlock(&r_evt->proto->registered_mtx);
919 * An handler is considered pending when its r_evt == NULL, because the related
1014 struct scmi_registered_event *r_evt;
1017 r_evt = SCMI_GET_REVT(ni, KEY_XTRACT_PROTO_ID(evt_key),
1022 if (r_evt) {
1023 mutex_lock(&r_evt->proto->registered_mtx);
1024 hndl = KEY_FIND(r_evt->proto->registered_events_handlers,
1028 mutex_unlock(&r_evt->proto->registered_mtx);
1081 struct scmi_registered_event *r_evt;
1084 r_evt = SCMI_GET_REVT(ni, KEY_XTRACT_PROTO_ID(evt_key),
1086 if (r_evt) {
1087 mutex_lock(&r_evt->proto->registered_mtx);
1088 hndl = KEY_FIND(r_evt->proto->registered_events_handlers,
1092 mutex_unlock(&r_evt->proto->registered_mtx);
1100 * @r_evt: The registered event to act upon
1111 static inline int __scmi_enable_evt(struct scmi_registered_event *r_evt,
1120 num_sources = r_evt->num_sources;
1121 } else if (src_id < r_evt->num_sources) {
1127 mutex_lock(&r_evt->sources_mtx);
1132 sid = &r_evt->sources[src_id];
1134 ret = REVT_NOTIFY_ENABLE(r_evt, r_evt->evt->id,
1145 sid = &r_evt->sources[src_id];
1147 REVT_NOTIFY_DISABLE(r_evt,
1148 r_evt->evt->id, src_id);
1152 mutex_unlock(&r_evt->sources_mtx);
1162 ret = __scmi_enable_evt(hndl->r_evt,
1176 ret = __scmi_enable_evt(hndl->r_evt,
1210 struct scmi_registered_event *r_evt = hndl->r_evt;
1213 if (r_evt)
1214 mutex_lock(&r_evt->proto->registered_mtx);
1218 if (r_evt)
1219 mutex_unlock(&r_evt->proto->registered_mtx);
1226 struct scmi_registered_event *r_evt = hndl->r_evt;
1228 mutex_lock(&r_evt->proto->registered_mtx);
1230 mutex_unlock(&r_evt->proto->registered_mtx);