fpga: dfl: support multiple opens on feature device node.
authorXu Yilun <yilun.xu@intel.com>
Mon, 18 Nov 2019 05:20:41 +0000 (13:20 +0800)
committerMoritz Fischer <mdf@kernel.org>
Thu, 30 Apr 2020 03:37:07 +0000 (20:37 -0700)
commitb6862193ca12e4bce6a18f31bb36eaa6d801b377
tree6ecae23ae25f89edce3ec7b6d620e7027635f67c
parent8f3d9f354286745c751374f5f1fcafee6b3f3136
fpga: dfl: support multiple opens on feature device node.

Each DFL functional block, e.g. AFU (Accelerated Function Unit) and FME
(FPGA Management Engine), could implement more than one function within
its region, but current driver only allows one user application to access
it by exclusive open on device node. So this is not convenient and
flexible for userspace applications, as they have to combine lots of
different functions into one single application.

This patch removes the limitation here to allow multiple opens to each
feature device node for AFU and FME from userspace applications. If user
still needs exclusive access to these device node, O_EXCL flag must be
issued together with open.

Signed-off-by: Wu Hao <hao.wu@intel.com>
Signed-off-by: Xu Yilun <yilun.xu@intel.com>
Signed-off-by: Moritz Fischer <mdf@kernel.org>
drivers/fpga/dfl-afu-main.c
drivers/fpga/dfl-fme-main.c
drivers/fpga/dfl.c
drivers/fpga/dfl.h