All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Nava kishore Manne <nava.kishore.manne@amd.com>
Cc: git@xilinx.com, michal.simek@xilinx.com, mdf@kernel.org,
	hao.wu@intel.com, yilun.xu@intel.com, trix@redhat.com,
	ronak.jain@xilinx.com, rajan.vaja@xilinx.com,
	abhyuday.godhasara@xilinx.com, harsha.harsha@xilinx.com,
	lakshmi.sai.krishna.potthuri@xilinx.com, tanmay.shah@xilinx.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org
Subject: Re: [PATCH v3 2/2] fpga: zynqmp-fpga: Adds status interface
Date: Thu, 13 Oct 2022 11:21:19 +0200	[thread overview]
Message-ID: <Y0fYjyXrMEo6M76k@kroah.com> (raw)
In-Reply-To: <20221013090556.741357-3-nava.kishore.manne@amd.com>

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@amd.com>
> ---
> 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

WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <gregkh@linuxfoundation.org>
To: Nava kishore Manne <nava.kishore.manne@amd.com>
Cc: git@xilinx.com, michal.simek@xilinx.com, mdf@kernel.org,
	hao.wu@intel.com, yilun.xu@intel.com, trix@redhat.com,
	ronak.jain@xilinx.com, rajan.vaja@xilinx.com,
	abhyuday.godhasara@xilinx.com, harsha.harsha@xilinx.com,
	lakshmi.sai.krishna.potthuri@xilinx.com, tanmay.shah@xilinx.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org
Subject: Re: [PATCH v3 2/2] fpga: zynqmp-fpga: Adds status interface
Date: Thu, 13 Oct 2022 11:21:19 +0200	[thread overview]
Message-ID: <Y0fYjyXrMEo6M76k@kroah.com> (raw)
In-Reply-To: <20221013090556.741357-3-nava.kishore.manne@amd.com>

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@amd.com>
> ---
> 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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-10-13  9:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13  9:05 [PATCH v3 0/2] Adds status interface for zynqmp-fpga Nava kishore Manne
2022-10-13  9:05 ` Nava kishore Manne
2022-10-13  9:05 ` [PATCH v3 1/2] firmware: xilinx: Add pm api function for PL config reg readback Nava kishore Manne
2022-10-13  9:05   ` Nava kishore Manne
2022-10-13 13:48   ` kernel test robot
2022-10-13 13:48   ` kernel test robot
2022-10-13 13:48   ` kernel test robot
2022-10-13 14:59   ` kernel test robot
2022-10-13 16:51   ` kernel test robot
2022-10-14 15:33   ` Xu Yilun
2022-10-14 15:33     ` Xu Yilun
2022-10-13  9:05 ` [PATCH v3 2/2] fpga: zynqmp-fpga: Adds status interface Nava kishore Manne
2022-10-13  9:05   ` Nava kishore Manne
2022-10-13  9:21   ` Greg KH [this message]
2022-10-13  9:21     ` Greg KH
2022-10-14 16:02   ` Xu Yilun
2022-10-14 16:02     ` Xu Yilun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y0fYjyXrMEo6M76k@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=abhyuday.godhasara@xilinx.com \
    --cc=git@xilinx.com \
    --cc=hao.wu@intel.com \
    --cc=harsha.harsha@xilinx.com \
    --cc=lakshmi.sai.krishna.potthuri@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdf@kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=nava.kishore.manne@amd.com \
    --cc=rajan.vaja@xilinx.com \
    --cc=ronak.jain@xilinx.com \
    --cc=tanmay.shah@xilinx.com \
    --cc=trix@redhat.com \
    --cc=yilun.xu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.