diff --git a/drivers/misc/cxl/file.c b/drivers/misc/cxl/file.c
+static inline bool ctx_event_pending(struct cxl_context *ctx)
+{
+ if (ctx->pending_irq || ctx->pending_fault || ctx->pending_afu_err)
+ return true;
+
+ if (ctx->afu_driver_ops)
+ return ctx->afu_driver_ops->event_pending(ctx);
+
+ return false;
+}
+
+
+ if (ctx->afu_driver_ops && ctx->afu_driver_ops->event_pending(ctx)) {
+ pr_devel("afu_read delivering AFU driver specific event\n");
+ event.header.type = CXL_EVENT_AFU_DRIVER;
+ ctx->afu_driver_ops->deliver_event(ctx, &event, sizeof(event));
+ WARN_ON(event.header.size > sizeof(event));
+
+ } else if (ctx->pending_irq) {