[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z1gE2+q5Y766OHZt@yilunxu-OptiPlex-7050>
Date: Tue, 10 Dec 2024 17:07:39 +0800
From: Xu Yilun <yilun.xu@...ux.intel.com>
To: Peter Colberg <peter.colberg@...el.com>
Cc: Wu Hao <hao.wu@...el.com>, Tom Rix <trix@...hat.com>,
Moritz Fischer <mdf@...nel.org>, Xu Yilun <yilun.xu@...el.com>,
linux-fpga@...r.kernel.org, linux-kernel@...r.kernel.org,
Russ Weight <russ.weight@...ux.dev>,
Marco Pagani <marpagan@...hat.com>,
Matthew Gerlach <matthew.gerlach@...ux.intel.com>,
Basheer Ahmed Muddebihal <basheer.ahmed.muddebihal@...ux.intel.com>
Subject: Re: [PATCH v5 00/18] fpga: dfl: fix kernel warning on port
release/assign for SRIOV
On Tue, Nov 19, 2024 at 08:10:16PM -0500, Peter Colberg wrote:
> With the Intel FPGA PAC D5005, DFL ports are registered as platform
> devices in PF mode. The port device must be removed from the host when
> the user wants to configure the port as a VF for use by a user-space
> driver, e.g., for pass-through to a virtual machine. The FME device
> ioctls DFL_FPGA_FME_PORT_RELEASE/ASSIGN are assigned for this purpose.
>
> In the previous implementation, the port platform device is not
> completely destroyed on port release: it is removed from the system by
> platform_device_del(), but the platform device instance is retained.
> When DFL_FPGA_FME_PORT_ASSIGN is called, the platform device is added
> back with platform_device_add(), which conflicts with this comment of
> device_add(): "Do not call this routine more than once for any device
> structure", and would previously cause a kernel warning at runtime.
>
> This patch completely unregisters the port platform device on release
> and registers a new device on assign. But the main work is to remove
> the dependency on struct dfl_feature_platform_data for many internal DFL
> APIs. This structure holds many DFL enumeration infos for feature
> devices. Many DFL APIs are expected to work with these infos even when
> the port platform device is unregistered. But after this change, the
> platform_data will be freed on port release. Hence this patch introduces
> a new structure dfl_feature_dev_data, which acts similarly to the
> previous dfl_feature_platform_data. dfl_feature_platform_data then only
> needs a pointer to dfl_feature_dev_data to query DFL enumeration infos.
>
> Link: https://lore.kernel.org/all/DM6PR11MB3819F9CCD0A6126B55BCB47685FB9@DM6PR11MB3819.namprd11.prod.outlook.com/T/#t
> Link: https://patchwork.kernel.org/project/linux-fpga/cover/20240409233942.828440-1-peter.colberg@intel.com/
> Link: https://patchwork.kernel.org/project/linux-fpga/cover/20240919203430.1278067-1-peter.colberg@intel.com/
> Link: https://patchwork.kernel.org/project/linux-fpga/cover/20241025223714.394533-1-peter.colberg@intel.com/
Applied this series to for-next.
Thanks,
Yilun
Powered by blists - more mailing lists