Re: [PATCH v3 2/2] fpga: zynqmp-fpga: Adds status interface

From: Greg KH
Date: Thu Oct 13 2022 - 05:20:44 EST


On Thu, Oct 13, 2022 at 02:35:56PM +0530, Nava kishore Manne wrote:
> Adds status interface for zynqmp-fpga, It's a read only interface
> which allows the user to get the Programmable Logic(PL) configuration
> status.
>
> Usage:
> To read the Programmable Logic(PL) configuration status
> cat /sys/class/fpga_manager/<fpga>/device/status
>
> Signed-off-by: Nava kishore Manne <nava.kishore.manne@xxxxxxx>
> ---
> Changes for v2:
> - Updated status messages handling logic as suggested by Xu Yilun.
>
> Changes for v3:
> - Updated status interface handling logic (Restrict the status
> interface to the device-specific instead of handled by the core)
> as suggested by Xu Yilun.
>
> drivers/fpga/zynqmp-fpga.c | 87 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 87 insertions(+)

You add sysfs files without a Documentation/ABI/ update as well, which
is not allowed. Please fix that up for your next submission.

> @@ -95,6 +175,13 @@ static int zynqmp_fpga_probe(struct platform_device *pdev)
>
> priv->dev = dev;
>
> + /* Add the device attributes */
> + ret = sysfs_create_group(&dev->kobj, &zynqmp_fpga_attr_group);
> + if (ret) {
> + dev_err(dev, "Error creating sysfs files\n");
> + return ret;
> + }

You just raced with userspace and lost. Do not do this, set the default
groups attribute in your platform driver and the driver core will handle
this all for you automatically.

thanks,

greg k-h