<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/linux/fpga/fpga-mgr.h, branch linux-6.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.18.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.18.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-03-31T13:50:39Z</updated>
<entry>
<title>fpga: manager: add owner module and take its refcount</title>
<updated>2024-03-31T13:50:39Z</updated>
<author>
<name>Marco Pagani</name>
<email>marpagan@redhat.com</email>
</author>
<published>2024-03-05T19:29:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4d4d2d4346857bf778fafaa97d6f76bb1663e3c9'/>
<id>urn:sha1:4d4d2d4346857bf778fafaa97d6f76bb1663e3c9</id>
<content type='text'>
The current implementation of the fpga manager assumes that the low-level
module registers a driver for the parent device and uses its owner pointer
to take the module's refcount. This approach is problematic since it can
lead to a null pointer dereference while attempting to get the manager if
the parent device does not have a driver.

To address this problem, add a module owner pointer to the fpga_manager
struct and use it to take the module's refcount. Modify the functions for
registering the manager to take an additional owner module parameter and
rename them to avoid conflicts. Use the old function names for helper
macros that automatically set the module that registers the manager as the
owner. This ensures compatibility with existing low-level control modules
and reduces the chances of registering a manager without setting the owner.

Also, update the documentation to keep it consistent with the new interface
for registering an fpga manager.

Other changes: opportunistically move put_device() from __fpga_mgr_get() to
fpga_mgr_get() and of_fpga_mgr_get() to improve code clarity since the
manager device is taken in these functions.

Fixes: 654ba4cc0f3e ("fpga manager: ensure lifetime with of_fpga_mgr_get")
Suggested-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Suggested-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Marco Pagani &lt;marpagan@redhat.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20240305192926.84886-1-marpagan@redhat.com
Signed-off-by: Xu Yilun &lt;yilun.xu@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>fpga: fpga-mgr: support bitstream offset in image buffer</title>
<updated>2022-06-24T04:11:18Z</updated>
<author>
<name>Ivan Bornyakov</name>
<email>i.bornyakov@metrotek.ru</email>
</author>
<published>2022-06-23T16:32:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3cc624beba6310a8a534fb00841f22445a200d54'/>
<id>urn:sha1:3cc624beba6310a8a534fb00841f22445a200d54</id>
<content type='text'>
At the moment FPGA manager core loads to the device entire image
provided to fpga_mgr_load(). But it is not always whole FPGA image
buffer meant to be written to the device. In particular, .dat formatted
image for Microchip MPF contains meta info in the header that is not
meant to be written to the device. This is issue for those low level
drivers that loads data to the device with write() fpga_manager_ops
callback, since write() can be called in iterator over scatter-gather
table, not only linear image buffer. On the other hand, write_sg()
callback is provided with whole image in scatter-gather form and can
decide itself which part should be sent to the device.

Add header_size and data_size to the fpga_image_info struct, add
skip_header to the fpga_manager_ops struct and adjust fpga_mgr_write()
callers with respect to them.

  * info-&gt;header_size indicates part at the beginning of image buffer
    that contains some meta info. It is optional and can be 0,
    initialized with mops-&gt;initial_header_size.

  * mops-&gt;skip_header tells fpga-mgr core whether write should start
    from the beginning of image buffer or at the offset of header_size.

  * info-&gt;data_size is the size of bitstream data that is meant to be
    written to the device. It is also optional and can be 0, which
    means bitstream data is up to the end of image buffer.

Also add parse_header() callback to fpga_manager_ops, which purpose is
to set info-&gt;header_size and info-&gt;data_size. At least
initial_header_size bytes of image buffer will be passed into
parse_header() first time. If it is not enough, parse_header() should
set desired size into info-&gt;header_size and return -EAGAIN, then it will
be called again with greater part of image buffer on the input.

Suggested-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Ivan Bornyakov &lt;i.bornyakov@metrotek.ru&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20220623163248.3672-2-i.bornyakov@metrotek.ru
Signed-off-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
</content>
</entry>
<entry>
<title>fpga: mgr: Use standard dev_release for class driver</title>
<updated>2021-11-28T21:59:13Z</updated>
<author>
<name>Russ Weight</name>
<email>russell.h.weight@intel.com</email>
</author>
<published>2021-11-19T01:55:51Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4ba0b2c294fe691921271372f7b59e5cc2ce4b0f'/>
<id>urn:sha1:4ba0b2c294fe691921271372f7b59e5cc2ce4b0f</id>
<content type='text'>
The FPGA manager class driver data structure is being treated as a
managed resource instead of using the standard dev_release call-back
function to release the class data structure. This change removes
the managed resource code for the freeing of the class data structure
and combines the create() and register() functions into a single
register() or register_full() function.

The register_full() function accepts an info data structure to provide
flexibility in passing optional parameters. The register() function
supports the current parameter list for users that don't require the
use of optional parameters.

The devm_fpga_mgr_register() function is retained, and the
devm_fpga_mgr_register_full() function is added.

Signed-off-by: Russ Weight &lt;russell.h.weight@intel.com&gt;
Reviewed-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Moritz Fischer &lt;mdf@kernel.org&gt;
</content>
</entry>
<entry>
<title>fpga: fix spelling mistakes</title>
<updated>2021-07-22T02:54:21Z</updated>
<author>
<name>Tom Rix</name>
<email>trix@redhat.com</email>
</author>
<published>2021-05-19T16:30:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=580e3137318edb39d2c6efa5dad51e3fbd7e2536'/>
<id>urn:sha1:580e3137318edb39d2c6efa5dad51e3fbd7e2536</id>
<content type='text'>
Run the fpga subsystem through aspell.

Signed-off-by: Tom Rix &lt;trix@redhat.com&gt;
Reviewed-by: Fernando Pacheco &lt;fpacheco@redhat.com&gt;
Signed-off-by: Moritz Fischer &lt;mdf@kernel.org&gt;
</content>
</entry>
<entry>
<title>fpga-mgr: change FPGA indirect article to an</title>
<updated>2021-06-09T12:51:25Z</updated>
<author>
<name>Tom Rix</name>
<email>trix@redhat.com</email>
</author>
<published>2021-06-08T21:23:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=895ec9c09aa77e9f0129576995cb21191d3958f1'/>
<id>urn:sha1:895ec9c09aa77e9f0129576995cb21191d3958f1</id>
<content type='text'>
Change use of 'a fpga' to 'an fpga'

Signed-off-by: Tom Rix &lt;trix@redhat.com&gt;
Link: https://lore.kernel.org/r/20210608212350.3029742-9-trix@redhat.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fpga: fpga-mgr: Add devm_fpga_mgr_register() API</title>
<updated>2020-12-01T17:49:32Z</updated>
<author>
<name>Moritz Fischer</name>
<email>mdf@kernel.org</email>
</author>
<published>2020-11-15T19:51:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=57d9352b6c651b090179f8b223b6681275c64a4f'/>
<id>urn:sha1:57d9352b6c651b090179f8b223b6681275c64a4f</id>
<content type='text'>
Add a devm_fpga_mgr_register() API that can be used to register a FPGA
Manager that was created using devm_fpga_mgr_create().

Introduce a struct fpga_mgr_devres that makes the devres
allocation a little bit more readable and gets reused for
devm_fpga_mgr_create() devm_fpga_mgr_register().

Reviewed-by: Tom Rix &lt;trix@redhat.com&gt;
Signed-off-by: Moritz Fischer &lt;mdf@kernel.org&gt;
Link: https://lore.kernel.org/r/20201115195127.284487-2-mdf@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fpga: mgr: add devm_fpga_mgr_create</title>
<updated>2018-10-16T09:13:50Z</updated>
<author>
<name>Alan Tull</name>
<email>atull@kernel.org</email>
</author>
<published>2018-10-15T22:20:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=084181fe8cc7472695b907f0018f4cd00934cb12'/>
<id>urn:sha1:084181fe8cc7472695b907f0018f4cd00934cb12</id>
<content type='text'>
Add devm_fpga_mgr_create() which is the managed
version of fpga_mgr_create().

Change current FPGA manager drivers to use
devm_fpga_mgr_create()

Signed-off-by: Alan Tull &lt;atull@kernel.org&gt;
Suggested-by: Federico Vaga &lt;federico.vaga@cern.ch&gt;
Acked-by: Moritz Fischer &lt;mdf@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>docs: fpga: document fpga manager flags</title>
<updated>2018-09-30T15:49:55Z</updated>
<author>
<name>Alan Tull</name>
<email>atull@kernel.org</email>
</author>
<published>2018-09-12T14:43:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=492ecf6d6598e7c3b0b1372653ed21da50ddfb09'/>
<id>urn:sha1:492ecf6d6598e7c3b0b1372653ed21da50ddfb09</id>
<content type='text'>
Add flags #defines to kerneldoc documentation in a
useful place.

Signed-off-by: Alan Tull &lt;atull@kernel.org&gt;
Acked-by: Moritz Fischer &lt;mdf@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fpga: mgr: add compat_id support</title>
<updated>2018-07-15T11:55:44Z</updated>
<author>
<name>Wu Hao</name>
<email>hao.wu@intel.com</email>
</author>
<published>2018-06-30T00:53:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=99a560bde313892f87ca81db568a829d3d205882'/>
<id>urn:sha1:99a560bde313892f87ca81db568a829d3d205882</id>
<content type='text'>
This patch introduces compat_id support to fpga manager, it adds
a fpga_compat_id pointer to fpga manager data structure to allow
fpga manager drivers to save the compatibility id. This compat_id
could be used for compatibility checking before doing partial
reconfiguration to associated fpga regions.

Signed-off-by: Wu Hao &lt;hao.wu@intel.com&gt;
Acked-by: Alan Tull &lt;atull@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fpga: mgr: add status for fpga-manager</title>
<updated>2018-07-15T11:55:44Z</updated>
<author>
<name>Wu Hao</name>
<email>hao.wu@intel.com</email>
</author>
<published>2018-06-30T00:53:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ecb5fbe299dfaad778033259f35bc696fa1fb743'/>
<id>urn:sha1:ecb5fbe299dfaad778033259f35bc696fa1fb743</id>
<content type='text'>
This patch adds status sysfs interface for fpga manager, it's a
read only interface which allows user to get fpga manager status,
including full/partial reconfiguration error and other status
information. It adds a status callback to fpga_manager_ops too,
allows each fpga_manager driver to define its own method to
collect latest status from hardware.

The following sysfs file is created:
* /sys/class/fpga_manager/&lt;fpga&gt;/status
  Return status of fpga manager, including reconfiguration errors.

Signed-off-by: Wu Hao &lt;hao.wu@intel.com&gt;
Acked-by: Alan Tull &lt;atull@kernel.org&gt;
Acked-by: Moritz Fischer &lt;mdf@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
