Hi Christophe, Few review comments:
Christophe Lombard <clomb...@linux.vnet.ibm.com> writes: > + > +int cxl_context_thread_tidr(struct cxl_context *ctx, int assign) > +{ > + int rc = 0; > + > + /* Clear any TIDR value assigned to the current thread */ > + if (!assign) { > + clear_thread_tidr(current); > + ctx->tid = 0; > + } else { > + /* Assign a unique TIDR (thread id) for the current thread */ > + rc = set_thread_tidr(current); > + if (!rc) > + ctx->tid = current->thread.tidr; set_thread_tidr can also return non-zero error values and will never return '0'. So this condition should be 'if(rc > 0)' instead of 'if (!rc)' > +#define CXL_IOCTL_GET_AFU_ID _IOR(CXL_MAGIC, 0x02, struct cxl_afu_id) > +#define CXL_IOCTL_THREAD_TIDR _IOR(CXL_MAGIC, 0x03, > int) Instead of adding a new syscall I think assiging a thread-id can be better done by adding a new flag to the cxl_ioctl_start_work.flag field and using one of the reserved fields to return the allocated tid back to the user. -- Vaibhav Jain <vaib...@linux.vnet.ibm.com> Linux Technology Center, IBM India Pvt. Ltd.