<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/fpga/dfl.c, branch v6.18.22</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.22</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.22'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-03-04T12:20:54+00:00</updated>
<entry>
<title>fpga: dfl: use subsys_initcall to allow built-in drivers to be added</title>
<updated>2026-03-04T12:20:54+00:00</updated>
<author>
<name>Thadeu Lima de Souza Cascardo</name>
<email>cascardo@igalia.com</email>
</author>
<published>2025-12-15T19:05:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bfcee87fd1756d5eecfba51b451a8866d6d7d7a2'/>
<id>urn:sha1:bfcee87fd1756d5eecfba51b451a8866d6d7d7a2</id>
<content type='text'>
[ Upstream commit 267f53140c9d0bf270bbe0148082e9b8e5011273 ]

The dfl code adds a bus. If it is built-in and there is a built-in driver
as well, the dfl module_init may be called after the driver module_init,
leading to a failure to register the driver as the bus has not been added
yet.

Use subsys_initcall, which guarantees it will be called before the drivers
init code.

Without the fix, we see failures like this:

[    0.479475] Driver 'intel-m10-bmc' was unable to register with bus_type 'dfl' because the bus was not initialized.

Cc: stable@vger.kernel.org
Fixes: 9ba3a0aa09fe ("fpga: dfl: create a dfl bus type to support DFL devices")
Signed-off-by: Thadeu Lima de Souza Cascardo &lt;cascardo@igalia.com&gt;
Link: https://lore.kernel.org/r/20251215-dfl_subsys-v1-1-21807bad6b10@igalia.com
Reviewed-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
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: destroy/recreate feature platform device on port release/assign</title>
<updated>2024-12-18T14:28:48+00:00</updated>
<author>
<name>Xu Yilun</name>
<email>yilun.xu@intel.com</email>
</author>
<published>2024-11-20T01:10:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=46b155acbf4ee4ebf6bd7d5661b08762220ab894'/>
<id>urn:sha1:46b155acbf4ee4ebf6bd7d5661b08762220ab894</id>
<content type='text'>
Now that the internal DFL APIs have been converted to consume DFL
enumeration info from a separate structure, dfl_feature_dev_data, which
lifetime is independent of the feature device, proceed to completely
destroy and recreate the feature platform device on port release and
assign, respectively. This resolves a longstanding issue in the use of
platform_device_add(), which states to "not call this routine more than
once for any device structure" and which used to print a kernel warning.

The function feature_dev_unregister() resets the device pointer in the
feature data to NULL to signal that the feature platform device has been
destroyed. This substitutes the previous device_is_registered() checks.

Signed-off-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Signed-off-by: Russ Weight &lt;russell.h.weight@intel.com&gt;
Signed-off-by: Peter Colberg &lt;peter.colberg@intel.com&gt;
Reviewed-by: Matthew Gerlach &lt;matthew.gerlach@linux.intel.com&gt;
Reviewed-by: Basheer Ahmed Muddebihal &lt;basheer.ahmed.muddebihal@linux.intel.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20241120011035.230574-19-peter.colberg@intel.com
Signed-off-by: Xu Yilun &lt;yilun.xu@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: drop unneeded get_device() and put_device() of feature device</title>
<updated>2024-12-18T14:28:48+00:00</updated>
<author>
<name>Peter Colberg</name>
<email>peter.colberg@intel.com</email>
</author>
<published>2024-11-20T01:10:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ff1f06b60ab041b3ff69c7b3e23d5d5d5ae2f97e'/>
<id>urn:sha1:ff1f06b60ab041b3ff69c7b3e23d5d5d5ae2f97e</id>
<content type='text'>
The feature device data was originally stored as platform data, hence
the memory allocation was tied to the lifetime of the feature device.
Now that the feature device data is tied to the lifetime of the DFL PCIe
FPGA device instead, get_device() and put_device() are no longer needed.

Signed-off-by: Peter Colberg &lt;peter.colberg@intel.com&gt;
Reviewed-by: Matthew Gerlach &lt;matthew.gerlach@linux.intel.com&gt;
Reviewed-by: Basheer Ahmed Muddebihal &lt;basheer.ahmed.muddebihal@linux.intel.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20241120011035.230574-18-peter.colberg@intel.com
Signed-off-by: Xu Yilun &lt;yilun.xu@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: remove unneeded function build_info_create_dev()</title>
<updated>2024-12-18T14:28:48+00:00</updated>
<author>
<name>Peter Colberg</name>
<email>peter.colberg@intel.com</email>
</author>
<published>2024-11-20T01:10:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=57146d9454882c4539f0f239505958ad8e0ddfd8'/>
<id>urn:sha1:57146d9454882c4539f0f239505958ad8e0ddfd8</id>
<content type='text'>
Remove the function build_info_create_dev(), which no longer serves its
original purpose now that the allocation of the platform device has been
moved to feature_dev_register().

Signed-off-by: Peter Colberg &lt;peter.colberg@intel.com&gt;
Reviewed-by: Matthew Gerlach &lt;matthew.gerlach@linux.intel.com&gt;
Reviewed-by: Basheer Ahmed Muddebihal &lt;basheer.ahmed.muddebihal@linux.intel.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20241120011035.230574-17-peter.colberg@intel.com
Signed-off-by: Xu Yilun &lt;yilun.xu@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: allocate platform device after feature device data</title>
<updated>2024-12-18T14:28:48+00:00</updated>
<author>
<name>Peter Colberg</name>
<email>peter.colberg@intel.com</email>
</author>
<published>2024-11-20T01:10:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fa74e62d6af08fe7a8b69683953a2dab40e9ae2f'/>
<id>urn:sha1:fa74e62d6af08fe7a8b69683953a2dab40e9ae2f</id>
<content type='text'>
Delay calling platform_device_alloc() from build_info_create_dev() to
feature_dev_register(), now that the feature device data contains all
necessary data to create the feature device. This completes the new
function feature_dev_register(), which will be reused in a subsequent
commit to fully recreate the feature device when assigning a port.

In the function feature_dev_unregister(), reset the device pointer in
the feature data to NULL to signal that the platform device has been
destroyed. This will substitute device_is_registered() in a subsequent
commit. Reset the device pointer of each sub feature for consistency.

Convert is_feature_dev_detected() to check whether binfo-&gt;type is not
DFL_ID_MAX for deciding whether a feature device was detected during
feature parsing, instead of checking binfo-&gt;feature_dev for non-NULL.

Signed-off-by: Peter Colberg &lt;peter.colberg@intel.com&gt;
Reviewed-by: Matthew Gerlach &lt;matthew.gerlach@linux.intel.com&gt;
Reviewed-by: Basheer Ahmed Muddebihal &lt;basheer.ahmed.muddebihal@linux.intel.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20241120011035.230574-16-peter.colberg@intel.com
Signed-off-by: Xu Yilun &lt;yilun.xu@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: store platform device id in feature device data</title>
<updated>2024-12-18T14:28:48+00:00</updated>
<author>
<name>Peter Colberg</name>
<email>peter.colberg@intel.com</email>
</author>
<published>2024-11-20T01:10:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=59c265babab697aaa80814fe808cbb8942a14b9d'/>
<id>urn:sha1:59c265babab697aaa80814fe808cbb8942a14b9d</id>
<content type='text'>
Delay the feature device id allocation from build_info_create_dev() to
binfo_create_feature_dev_data() and store the id in the feature device
data before copying it to the device. This will allow reusing the same
id in a subsequent commit which completely destroys and recreates the
feature device when releasing and reassigning the corresponding port.

Instead of manually freeing the id when no longer needed, use a
device-managed resource with a custom action to automatically free
the id right before the feature device data is freed. The id registry
is guaranteed to be allocated when dfl_id_free_action() is invoked,
since the DFL PCIe device and its device-managed resources will be
destroyed before dfl_ids_destroy() is called in dfl_fpga_exit().

Signed-off-by: Peter Colberg &lt;peter.colberg@intel.com&gt;
Reviewed-by: Matthew Gerlach &lt;matthew.gerlach@linux.intel.com&gt;
Reviewed-by: Basheer Ahmed Muddebihal &lt;basheer.ahmed.muddebihal@linux.intel.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20241120011035.230574-15-peter.colberg@intel.com
Signed-off-by: Xu Yilun &lt;yilun.xu@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: store platform device name in feature device data</title>
<updated>2024-12-18T14:28:48+00:00</updated>
<author>
<name>Peter Colberg</name>
<email>peter.colberg@intel.com</email>
</author>
<published>2024-11-20T01:10:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3ddcf99119603b102e19e5f44338c1524cc549b7'/>
<id>urn:sha1:3ddcf99119603b102e19e5f44338c1524cc549b7</id>
<content type='text'>
Add a new member, pdev_name, to the structure dfl_feature_dev_data that
holds the platform device name for convenience. A subsequent commit will
completely destroy the platform device during port release, after which
fdata-&gt;dev is unavailable, while fdata itself remains available.

Signed-off-by: Peter Colberg &lt;peter.colberg@intel.com&gt;
Reviewed-by: Matthew Gerlach &lt;matthew.gerlach@linux.intel.com&gt;
Reviewed-by: Basheer Ahmed Muddebihal &lt;basheer.ahmed.muddebihal@linux.intel.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20241120011035.230574-14-peter.colberg@intel.com
Signed-off-by: Xu Yilun &lt;yilun.xu@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: store MMIO resources in feature device data</title>
<updated>2024-12-18T14:28:48+00:00</updated>
<author>
<name>Peter Colberg</name>
<email>peter.colberg@intel.com</email>
</author>
<published>2024-11-20T01:10:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7b15c41110382ccc208a046932c762bcca16b5b1'/>
<id>urn:sha1:7b15c41110382ccc208a046932c762bcca16b5b1</id>
<content type='text'>
Instead of directly copying the MMIO resource of each feature to the
feature device resources, add a new member to the feature device data
to store the resources and copy them to the feature device using
platform_device_add_resources(). This prepares a subsequent commit
which completely destroys and recreates the feature device when
releasing and reassigning the corresponding port, respectively.

Signed-off-by: Peter Colberg &lt;peter.colberg@intel.com&gt;
Reviewed-by: Matthew Gerlach &lt;matthew.gerlach@linux.intel.com&gt;
Reviewed-by: Basheer Ahmed Muddebihal &lt;basheer.ahmed.muddebihal@linux.intel.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20241120011035.230574-13-peter.colberg@intel.com
Signed-off-by: Xu Yilun &lt;yilun.xu@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: convert features from flexible array member to separate array</title>
<updated>2024-12-18T14:28:48+00:00</updated>
<author>
<name>Peter Colberg</name>
<email>peter.colberg@intel.com</email>
</author>
<published>2024-11-20T01:10:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b3245f700ae2e9f0ecbcf36b8908f6460db91202'/>
<id>urn:sha1:b3245f700ae2e9f0ecbcf36b8908f6460db91202</id>
<content type='text'>
Use a separate array allocation for features and substitute a pointer
for the flexible array member in the feature device data. A subsequent
commit will add another array for resources. The current commit converts
the flexible array member to a separate allocation for consistency.

Signed-off-by: Peter Colberg &lt;peter.colberg@intel.com&gt;
Reviewed-by: Matthew Gerlach &lt;matthew.gerlach@linux.intel.com&gt;
Reviewed-by: Basheer Ahmed Muddebihal &lt;basheer.ahmed.muddebihal@linux.intel.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20241120011035.230574-12-peter.colberg@intel.com
Signed-off-by: Xu Yilun &lt;yilun.xu@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>fpga: dfl: factor out feature device data from platform device data</title>
<updated>2024-12-18T14:28:48+00:00</updated>
<author>
<name>Peter Colberg</name>
<email>peter.colberg@intel.com</email>
</author>
<published>2024-11-20T01:10:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=39ea74e33edc034831ed19902bfc17354c8fc8db'/>
<id>urn:sha1:39ea74e33edc034831ed19902bfc17354c8fc8db</id>
<content type='text'>
Add a structure dfl_feature_dev_data to hold the DFL enumeration
info previously held in dfl_feature_platform_data. Allocate the new
structure using device-managed memory whose lifetime is bound to the
lifetime of the physical DFL, e.g., PCIe FPGA device. In a subsequent
commit, this will allow the feature platform device to be completely
destroyed and recreated on port release and assign, respectively, while
retaining the feature data in the new dfl_feature_dev_data structure.

Signed-off-by: Peter Colberg &lt;peter.colberg@intel.com&gt;
Reviewed-by: Matthew Gerlach &lt;matthew.gerlach@linux.intel.com&gt;
Reviewed-by: Basheer Ahmed Muddebihal &lt;basheer.ahmed.muddebihal@linux.intel.com&gt;
Acked-by: Xu Yilun &lt;yilun.xu@intel.com&gt;
Link: https://lore.kernel.org/r/20241120011035.230574-11-peter.colberg@intel.com
Signed-off-by: Xu Yilun &lt;yilun.xu@linux.intel.com&gt;
</content>
</entry>
</feed>
