> On May 24, 2016, at 1:59 AM, Vaibhav Jain <vaib...@linux.vnet.ibm.com> wrote: > > Hi Philippe, > > Few comments, > > Philippe Bergheaud <fe...@linux.vnet.ibm.com> writes: > >> 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> >> >> +#include <misc/cxl.h> >> #include <uapi/misc/cxl.h> >> >> 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 >> >> /* >> @@ -522,6 +523,10 @@ struct cxl_context { >> bool pending_fault; >> bool pending_afu_err; >> >> + /* 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. _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev