Lines Matching defs:r_evt
345 * @r_evt: A reference to the associated registered event; when this is NULL
362 struct scmi_registered_event *r_evt;
368 #define IS_HNDL_PENDING(hndl) (!(hndl)->r_evt)
429 struct scmi_registered_event *r_evt;
441 r_evt = SCMI_GET_REVT_FROM_PD(pd, pd->eh->evt_id);
442 if (!r_evt)
443 r_evt = ERR_PTR(-EINVAL);
445 return r_evt;
452 * @r_evt: The registered event descriptor to use
464 struct scmi_registered_event *r_evt)
483 if (IS_ERR(r_evt)) {
490 report = REVT_FILL_REPORT(r_evt, pd->eh->evt_id, pd->eh->timestamp,
492 r_evt->report, &src_id);
540 struct scmi_registered_event *r_evt;
553 r_evt = scmi_process_event_header(eq, pd);
554 if (!r_evt)
556 pd->in_flight = r_evt;
558 r_evt = pd->in_flight;
560 } while (scmi_process_event_payload(eq, pd, r_evt));
581 struct scmi_registered_event *r_evt;
589 r_evt = SCMI_GET_REVT(ni, proto_id, evt_id);
590 if (!r_evt)
593 if (len > r_evt->evt->max_payld_sz) {
597 if (kfifo_avail(&r_evt->proto->equeue.kfifo) < sizeof(eh) + len) {
612 kfifo_in(&r_evt->proto->equeue.kfifo, &eh, sizeof(eh));
613 kfifo_in(&r_evt->proto->equeue.kfifo, buf, len);
626 queue_work(r_evt->proto->equeue.wq,
627 &r_evt->proto->equeue.notify_work);
791 struct scmi_registered_event *r_evt;
793 r_evt = devm_kzalloc(ni->handle->dev, sizeof(*r_evt),
795 if (!r_evt)
797 r_evt->proto = pd;
798 r_evt->evt = evt;
800 r_evt->sources = devm_kcalloc(ni->handle->dev, num_sources,
802 if (!r_evt->sources)
804 r_evt->num_sources = num_sources;
805 mutex_init(&r_evt->sources_mtx);
807 r_evt->report = devm_kzalloc(ni->handle->dev,
809 if (!r_evt->report)
812 pd->registered_events[i] = r_evt;
816 MAKE_ALL_SRCS_KEY(r_evt->proto->id, r_evt->evt->id));
869 * associated to this handler descriptor (hndl->r_evt == NULL), so the handler
920 struct scmi_registered_event *r_evt;
922 r_evt = SCMI_GET_REVT(ni, KEY_XTRACT_PROTO_ID(hndl->key),
924 if (!r_evt)
940 hndl->r_evt = r_evt;
942 mutex_lock(&r_evt->proto->registered_mtx);
943 hash_add(r_evt->proto->registered_events_handlers,
945 mutex_unlock(&r_evt->proto->registered_mtx);
955 * An handler is considered pending when its r_evt == NULL, because the related
1050 struct scmi_registered_event *r_evt;
1053 r_evt = SCMI_GET_REVT(ni, KEY_XTRACT_PROTO_ID(evt_key),
1058 if (r_evt) {
1059 mutex_lock(&r_evt->proto->registered_mtx);
1060 hndl = KEY_FIND(r_evt->proto->registered_events_handlers,
1064 mutex_unlock(&r_evt->proto->registered_mtx);
1117 struct scmi_registered_event *r_evt;
1120 r_evt = SCMI_GET_REVT(ni, KEY_XTRACT_PROTO_ID(evt_key),
1122 if (r_evt) {
1123 mutex_lock(&r_evt->proto->registered_mtx);
1124 hndl = KEY_FIND(r_evt->proto->registered_events_handlers,
1128 mutex_unlock(&r_evt->proto->registered_mtx);
1136 * @r_evt: The registered event to act upon
1147 static inline int __scmi_enable_evt(struct scmi_registered_event *r_evt,
1156 num_sources = r_evt->num_sources;
1157 } else if (src_id < r_evt->num_sources) {
1163 mutex_lock(&r_evt->sources_mtx);
1168 sid = &r_evt->sources[src_id];
1170 ret = REVT_NOTIFY_ENABLE(r_evt, r_evt->evt->id,
1181 sid = &r_evt->sources[src_id];
1183 REVT_NOTIFY_DISABLE(r_evt,
1184 r_evt->evt->id, src_id);
1188 mutex_unlock(&r_evt->sources_mtx);
1198 ret = __scmi_enable_evt(hndl->r_evt,
1212 ret = __scmi_enable_evt(hndl->r_evt,
1255 struct scmi_registered_event *r_evt = hndl->r_evt;
1258 if (r_evt) {
1259 protocol_id = r_evt->proto->id;
1260 mutex_lock(&r_evt->proto->registered_mtx);
1265 if (r_evt) {
1266 mutex_unlock(&r_evt->proto->registered_mtx);
1271 * (ie. including r_evt and registered_mtx)
1283 struct scmi_registered_event *r_evt = hndl->r_evt;
1284 u8 protocol_id = r_evt->proto->id;
1286 mutex_lock(&r_evt->proto->registered_mtx);
1288 mutex_unlock(&r_evt->proto->registered_mtx);