mbox series

[RFC,0/2] fpga: Add fpga configuration support from a pre-allocated dma-able buffer

Message ID 20231122053035.3758124-1-nava.kishore.manne@amd.com (mailing list archive)
Headers show
Series fpga: Add fpga configuration support from a pre-allocated dma-able buffer | expand

Message

Manne, Nava kishore Nov. 22, 2023, 5:30 a.m. UTC
Lots of embedded systems have memory constraints but they need to load
very large configuration files.The FPGA subsystem allows drivers to
request this configuration image be loaded from the filesystem,but this
requires that the entire configuration data be loaded into kernel memory
first before it's provided to the driver.This can lead to a situation where
we map the configuration data twice, once to load the configuration data
into kernel memory and once to copy the configuration data into the final
resting place which is nothing but a dma-able continuous buffer.

This creates needless memory pressure and delays due to multiple copies.
Let's add a dmabuf handling support to the fpga manager framework that
allows drivers to load the Configuration data directly from a pre-allocated
buffer. This skips the intermediate step of allocating a buffer in kernel
memory to hold the Configuration data.

This implementation allows the lower-level drivers to request the FPGA
Configuration image be loaded from pre-allocated dma-able continuous
buffer and also it avoid needless memory pressure and delays due to
multiple copies.

Please take a look at the changes and let us know if any improvements
are required.

Nava kishore Manne (2):
  fpga: support loading from a pre-allocated buffer
  fpga: versal: Use the scatterlist interface

 drivers/fpga/fpga-mgr.c       | 113 ++++++++++++++++++++++++++++++++++
 drivers/fpga/versal-fpga.c    |  13 ++++
 include/linux/fpga/fpga-mgr.h |  10 +++
 3 files changed, 136 insertions(+)