On Wed, 2018-04-11 at 06:38:54 UTC, Alistair Popple wrote: > The pnv_npu2_init_context() and pnv_npu2_destroy_context() functions are > used to allocate/free contexts to allow address translation and shootdown > by the NPU on a particular GPU. Context initialisation is implicitly safe > as it is protected by the requirement mmap_sem be held in write mode, > however pnv_npu2_destroy_context() does not require mmap_sem to be held and > it is not safe to call with a concurrent initialisation for a different > GPU. > > It was assumed the driver would ensure destruction was not called > concurrently with initialisation. However the driver may be simplified by > allowing concurrent initialisation and destruction for different GPUs. As > npu context creation/destruction is not a performance critical path and the > critical section is not large a single spinlock is used for simplicity. > > Signed-off-by: Alistair Popple <alist...@popple.id.au> > Reviewed-by: Mark Hairgrove <mhairgr...@nvidia.com> > Tested-by: Mark Hairgrove <mhairgr...@nvidia.com> > Reviewed-by: Balbir Singh <bsinghar...@gmail.com>
Series applied to powerpc fixes, thanks. https://git.kernel.org/powerpc/c/28a5933e8d362766462ea9e5f135e1 cheers