<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/fpga, branch v6.1.124</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.124</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.124'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-12-14T18:53:12+00:00</updated>
<entry>
<title>fpga: manager: add owner module and take its refcount</title>
<updated>2024-12-14T18:53:12+00:00</updated>
<author>
<name>Marco Pagani</name>
<email>marpagan@redhat.com</email>
</author>
<published>2024-11-25T05:38:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=304f8032d601d4f9322ca841cd0b573bd1beb158'/>
<id>urn:sha1:304f8032d601d4f9322ca841cd0b573bd1beb158</id>
<content type='text'>
[ Upstream commit 4d4d2d4346857bf778fafaa97d6f76bb1663e3c9 ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Xiangyu Chen &lt;xiangyu.chen@windriver.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fpga: bridge: add owner module and take its refcount</title>
<updated>2024-12-14T18:53:12+00:00</updated>
<author>
<name>Marco Pagani</name>
<email>marpagan@redhat.com</email>
</author>
<published>2024-11-25T05:38:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=18dc8366abb6cadcb77668b1a16434654e355d49'/>
<id>urn:sha1:18dc8366abb6cadcb77668b1a16434654e355d49</id>
<content type='text'>
[ Upstream commit 1da11f822042eb6ef4b6064dc048f157a7852529 ]

The current implementation of the fpga bridge 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 bridge if
the parent device does not have a driver.

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

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

Other changes: opportunistically move put_device() from __fpga_bridge_get()
to fpga_bridge_get() and of_fpga_bridge_get() to improve code clarity since
the bridge device is taken in these functions.

Fixes: 21aeda950c5f ("fpga: add fpga bridge framework")
Suggested-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Suggested-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Reviewed-by: Russ Weight &lt;russ.weight@linux.dev&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/20240322171839.233864-1-marpagan@redhat.com
Signed-off-by: Xu Yilun &lt;yilun.xu@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Xiangyu Chen &lt;xiangyu.chen@windriver.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fpga: region: add owner module and take its refcount</title>
<updated>2024-06-12T09:03:39+00:00</updated>
<author>
<name>Marco Pagani</name>
<email>marpagan@redhat.com</email>
</author>
<published>2024-04-19T08:35:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=75a001914a8d2ccdcbe4b8cc7e94ac71d0e66093'/>
<id>urn:sha1:75a001914a8d2ccdcbe4b8cc7e94ac71d0e66093</id>
<content type='text'>
[ Upstream commit b7c0e1ecee403a43abc89eb3e75672b01ff2ece9 ]

The current implementation of the fpga region 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 region
during programming if the parent device does not have a driver.

To address this problem, add a module owner pointer to the fpga_region
struct and use it to take the module's refcount. Modify the functions for
registering a region 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 region as the
owner. This ensures compatibility with existing low-level control modules
and reduces the chances of registering a region without setting the owner.

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

Fixes: 0fa20cdfcc1f ("fpga: fpga-region: device tree control for FPGA")
Suggested-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Suggested-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Reviewed-by: Russ Weight &lt;russ.weight@linux.dev&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/20240419083601.77403-1-marpagan@redhat.com
Signed-off-by: Xu Yilun &lt;yilun.xu@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fpga: dfl-pci: add PCI subdevice ID for Intel D5005 card</title>
<updated>2024-06-12T09:03:01+00:00</updated>
<author>
<name>Peter Colberg</name>
<email>peter.colberg@intel.com</email>
</author>
<published>2024-04-22T23:02:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1572a4a3b8c0b2e9a0493d23501a7c271009bc39'/>
<id>urn:sha1:1572a4a3b8c0b2e9a0493d23501a7c271009bc39</id>
<content type='text'>
[ Upstream commit bb1dbeceb1c20cfd81271e1bd69892ebd1ee38e0 ]

Add PCI subdevice ID for the Intel D5005 Stratix 10 FPGA card as
used with the Open FPGA Stack (OFS) FPGA Interface Manager (FIM).

Unlike the Intel D5005 PAC FIM which exposed a separate PCI device ID,
the OFS FIM reuses the same device ID for all DFL-based FPGA cards
and differentiates on the subdevice ID. The subdevice ID values were
chosen as the numeric part of the FPGA card names in hexadecimal.

Signed-off-by: Peter Colberg &lt;peter.colberg@intel.com&gt;
Reviewed-by: Matthew Gerlach &lt;matthew.gerlach@linux.intel.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20240422230257.1959-1-peter.colberg@intel.com
Signed-off-by: Xu Yilun &lt;yilun.xu@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fpga: bridge: fix kernel-doc parameter description</title>
<updated>2023-05-11T14:03:27+00:00</updated>
<author>
<name>Marco Pagani</name>
<email>marpagan@redhat.com</email>
</author>
<published>2023-03-01T14:03:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=53cdfec25135dbe8b4dd8cfabd8835f18941b68e'/>
<id>urn:sha1:53cdfec25135dbe8b4dd8cfabd8835f18941b68e</id>
<content type='text'>
[ Upstream commit 7ef1a2c1c9dffa177ecc3ea50b7f5ee63a621137 ]

Fix the kernel-doc description for the "struct fpga_image_info *info"
parameter of the fpga_bridge_get() function.

Fixes: 060ac5c8fa7b ("fpga: bridge: kernel-doc fixes")
Signed-off-by: Marco Pagani &lt;marpagan@redhat.com&gt;
Reviewed-by: Tom Rix &lt;trix@redhat.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20230301140309.512578-1-marpagan@redhat.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fpga: bridge: properly initialize bridge device before populating children</title>
<updated>2023-04-26T12:28:43+00:00</updated>
<author>
<name>Alexis Lothoré</name>
<email>alexis.lothore@bootlin.com</email>
</author>
<published>2023-04-04T13:31:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=71b6df69f17e5dc31aa25a8d292980aabc8a703c'/>
<id>urn:sha1:71b6df69f17e5dc31aa25a8d292980aabc8a703c</id>
<content type='text'>
commit dc70eb868b9cd2ca01313e5a394e6ea001d513e9 upstream.

The current code path can lead to warnings because of uninitialized device,
which contains, as a consequence, uninitialized kobject. The uninitialized
device is passed to of_platform_populate, which will at some point, while
creating child device, try to get a reference on uninitialized parent,
resulting in the following warning:

kobject: '(null)' ((ptrval)): is not initialized, yet kobject_get() is
being called.

The warning is observed after migrating a kernel 5.10.x to 6.1.x.
Reverting commit 0d70af3c2530 ("fpga: bridge: Use standard dev_release for
class driver") seems to remove the warning.
This commit aggregates device_initialize() and device_add() into
device_register() but this new call is done AFTER of_platform_populate

Fixes: 0d70af3c2530 ("fpga: bridge: Use standard dev_release for class driver")
Signed-off-by: Alexis Lothoré &lt;alexis.lothore@bootlin.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20230404133102.2837535-2-alexis.lothore@bootlin.com
Signed-off-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fpga: microchip-spi: rewrite status polling in a time measurable way</title>
<updated>2023-03-10T08:33:34+00:00</updated>
<author>
<name>Ivan Bornyakov</name>
<email>i.bornyakov@metrotek.ru</email>
</author>
<published>2022-12-30T09:29:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c169890b5f7b2e47a472d30ba7004168c187bb71'/>
<id>urn:sha1:c169890b5f7b2e47a472d30ba7004168c187bb71</id>
<content type='text'>
[ Upstream commit 88e705697e801299a13ecaf2ba54599964fe711c ]

Original busy loop with retries count in mpf_poll_status() is not too
reliable, as it takes different times on different systems. Replace it
with read_poll_timeout() macro.

While at it, fix polling stop condition to met function's original
intention declared in the comment. The issue with original polling stop
condition is that it stops if any of mask bits is set, while intention
was to stop if all mask bits is set. This was not noticible because only
MPF_STATUS_READY is passed as mask argument and it is BIT(1).

Fixes: 5f8d4a900830 ("fpga: microchip-spi: add Microchip MPF FPGA manager")
Signed-off-by: Ivan Bornyakov &lt;i.bornyakov@metrotek.ru&gt;
Reviewed-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Acked-by: Conor Dooley &lt;conor.dooley@microchip.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20221230092922.18822-3-i.bornyakov@metrotek.ru
Signed-off-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fpga: microchip-spi: move SPI I/O buffers out of stack</title>
<updated>2023-03-10T08:33:34+00:00</updated>
<author>
<name>Ivan Bornyakov</name>
<email>i.bornyakov@metrotek.ru</email>
</author>
<published>2022-12-30T09:29:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e9ed12b8c7f7a9c587a0243a29d89d2674e85e0e'/>
<id>urn:sha1:e9ed12b8c7f7a9c587a0243a29d89d2674e85e0e</id>
<content type='text'>
[ Upstream commit 1da53d23a41c5f77963984d8da5623ed56918ada ]

As spi-summary doc says:
 &gt; I/O buffers use the usual Linux rules, and must be DMA-safe.
 &gt; You'd normally allocate them from the heap or free page pool.
 &gt; Don't use the stack, or anything that's declared "static".

Replace spi_write() with spi_write_then_read(), which is dma-safe for
on-stack buffers. Use cacheline aligned buffers for transfers used in
spi_sync_transfer().

Although everything works OK with stack-located I/O buffers, better
follow the doc to be safe.

Fixes: 5f8d4a900830 ("fpga: microchip-spi: add Microchip MPF FPGA manager")
Signed-off-by: Ivan Bornyakov &lt;i.bornyakov@metrotek.ru&gt;
Acked-by: Conor Dooley &lt;conor.dooley@microchip.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20221230092922.18822-2-i.bornyakov@metrotek.ru
Signed-off-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>fpga: stratix10-soc: Fix return value check in s10_ops_write_init()</title>
<updated>2023-02-09T10:28:22+00:00</updated>
<author>
<name>Zheng Yongjun</name>
<email>zhengyongjun3@huawei.com</email>
</author>
<published>2022-11-26T07:14:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b10990bee73cba064def8f7e180e1888b02688e6'/>
<id>urn:sha1:b10990bee73cba064def8f7e180e1888b02688e6</id>
<content type='text'>
commit 65ea840afd508194b0ee903256162aa87e46ec30 upstream.

In case of error, the function stratix10_svc_allocate_memory()
returns ERR_PTR() and never returns NULL. The NULL test in the
return value check should be replaced with IS_ERR().

Fixes: e7eef1d7633a ("fpga: add intel stratix10 soc fpga manager driver")
Signed-off-by: Zheng Yongjun &lt;zhengyongjun3@huawei.com&gt;
Reviewed-by: Russ Weight &lt;russell.h.weight@intel.com&gt;
Cc: stable@vger.kernel.org
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20221126071430.19540-1-zhengyongjun3@huawei.com
Signed-off-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fpga: m10bmc-sec: Fix probe rollback</title>
<updated>2023-02-09T10:28:22+00:00</updated>
<author>
<name>Ilpo Järvinen</name>
<email>ilpo.jarvinen@linux.intel.com</email>
</author>
<published>2022-12-14T14:49:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=74cff472d3d66db13b5ef64f40dfa42383f71ff7'/>
<id>urn:sha1:74cff472d3d66db13b5ef64f40dfa42383f71ff7</id>
<content type='text'>
commit 60ce26d10e5850f33cc76fce52f5377045e75a15 upstream.

Handle probe error rollbacks properly to avoid leaks.

Fixes: 5cd339b370e2 ("fpga: m10bmc-sec: add max10 secure update functions")
Reviewed-by: Matthew Gerlach &lt;matthew.gerlach@linux.intel.com&gt;
Reviewed-by: Russ Weight &lt;russell.h.weight@intel.com&gt;
Reviewed-by: Marco Pagani &lt;marpagan@redhat.com&gt;
Signed-off-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Cc: stable@vger.kernel.org
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20221214144952.8392-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
