Thread (9 messages) 9 messages, 4 authors, 2016-06-16

Re: [v5, 1/2] cxl: Add mechanism for delivering AFU driver specific events

From: Matthew R. Ochs <hidden>
Date: 2016-05-24 14:44:23

On May 24, 2016, at 1:59 AM, Vaibhav Jain [off-list ref] =
wrote:
=20
Hi Philippe,
=20
Few comments,
=20
Philippe Bergheaud [off-list ref] writes:
=20
quoted
diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
index 4fe5078..b0027e6 100644
--- a/drivers/misc/cxl/cxl.h
+++ b/drivers/misc/cxl/cxl.h
@@ -24,6 +24,7 @@
#include <asm/reg.h>
#include <misc/cxl-base.h>
=20
+#include <misc/cxl.h>
#include <uapi/misc/cxl.h>
=20
extern uint cxl_verbose;
@@ -34,7 +35,7 @@ extern uint cxl_verbose;
 * Bump version each time a user API change is made, whether it is
 * backwards compatible ot not.
 */
-#define CXL_API_VERSION 2
+#define CXL_API_VERSION 3
#define CXL_API_VERSION_COMPATIBLE 1
=20
/*
@@ -522,6 +523,10 @@ struct cxl_context {
	bool pending_fault;
	bool pending_afu_err;
=20
+	/* Used by AFU drivers for driver specific event delivery */
+	struct cxl_afu_driver_ops *afu_driver_ops;
+	atomic_t afu_driver_events;
If the afu_driver_ops.deliver_event is idempotent then instead of =
using
a refcount we can simply call afu_driver_ops.deliver_event to see if
there are any driver events queued. Since callback deliver_event is
called in context of a spinlock and cannot sleep hence requirement of
idempotency seems reasonable.
The purpose for the count is so the AFU driver is only called when it
has something to send. Otherwise we don't want to be called.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help