All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: tanmay.shah@xilinx.com
Cc: ben.levinsky@xilinx.com, bjorn.andersson@linaro.org,
	devicetree@vger.kernel.org, krzk+dt@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org,
	mathieu.poirier@linaro.org, michal.simek@xilinx.com,
	openamp-system-reference@lists.openampproject.org,
	robh+dt@kernel.org
Subject: Re: [PATCH v8 6/6] drivers: remoteproc: Add Xilinx r5 remoteproc driver
Date: Thu, 2 Jun 2022 23:07:01 +0200	[thread overview]
Message-ID: <82e9f075-0526-ac34-fa92-14a7402825fd@wanadoo.fr> (raw)
In-Reply-To: <20220602203834.3675160-7-tanmay.shah@xilinx.com>

Hi,

should there be a v9, a nitpick below.

Le 02/06/2022 à 22:38, Tanmay Shah a écrit :
> This driver enables r5f dual core Real time Processing Unit subsystem
> available on Xilinx Zynq Ultrascale MPSoC Platform. RPU subsystem
> (cluster) can be configured in different modes e.g. split mode in which
> two r5f cores work independent of each other and lock-step mode in which
> both r5f cores execute same code clock-for-clock and notify if the
> result is different.
> 
> The Xilinx r5 Remoteproc Driver boots the RPU cores via calls to the Xilinx
> Platform Management Unit that handles the R5 configuration, memory access
> and R5 lifecycle management. The interface to this manager is done in this
> driver via zynqmp_pm_* function calls.
> 
> Signed-off-by: Ben Levinsky <ben.levinsky-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Tanmay Shah <tanmay.shah-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
> ---
> 

[...]

> +static void zynqmp_r5_cluster_exit(void *data)
> +{
> +	struct platform_device *pdev = (struct platform_device *)data;
> +	struct zynqmp_r5_cluster *cluster;
> +	int i;
> +
> +	cluster = (struct zynqmp_r5_cluster *)platform_get_drvdata(pdev);
> +	if (!cluster)
> +		return;
> +
> +	for (i = 0; i < cluster->core_count; i++) {
> +		zynqmp_r5_core_exit(cluster->r5_cores[i]);
> +		cluster->r5_cores[i] = NULL;
> +	}
> +
> +	kfree(cluster->r5_cores);
> +	kfree(cluster);

why not remove this kfree(cluster) here...

> +	platform_set_drvdata(pdev, NULL);
> +}
> +
> +/*
> + * zynqmp_r5_remoteproc_probe()
> + *
> + * @pdev: domain platform device for R5 cluster
> + *
> + * called when driver is probed, for each R5 core specified in DT,
> + * setup as needed to do remoteproc-related operations
> + *
> + * Return: 0 for success, negative value for failure.
> + */
> +static int zynqmp_r5_remoteproc_probe(struct platform_device *pdev)
> +{
> +	int ret;
> +	struct zynqmp_r5_cluster *cluster;
> +	struct device *dev = &pdev->dev;
> +
> +	cluster = kzalloc(sizeof(*cluster), GFP_KERNEL);

... devm_kzalloc() here...

> +	if (!cluster)
> +		return -ENOMEM;
> +
> +	cluster->dev = dev;
> +
> +	ret = devm_of_platform_populate(dev);
> +	if (ret) {
> +		dev_err_probe(dev, ret, "failed to populate platform dev\n");
> +		kfree(cluster);
> +		return ret;

and return dev_err_probe() here (without the kfree)?
Would'nt it be cleaner?

just my 2c

CJ

> +	}
> +
> +	/* wire in so each core can be cleaned up at driver remove */
> +	platform_set_drvdata(pdev, cluster);
> +
> +	ret = zynqmp_r5_cluster_init(cluster);
> +	if (ret) {
> +		zynqmp_r5_cluster_exit(pdev);
> +		dev_err_probe(dev, ret, "Invalid r5f subsystem device tree\n");
> +		return ret;
> +	}
> +
> +	ret = devm_add_action_or_reset(dev, zynqmp_r5_cluster_exit, pdev);
> +	if (ret)
> +		return ret;
> +
> +	return 0;
> +}
> +

[...]

WARNING: multiple messages have this Message-ID (diff)
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: tanmay.shah@xilinx.com
Cc: ben.levinsky@xilinx.com, bjorn.andersson@linaro.org,
	devicetree@vger.kernel.org, krzk+dt@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org,
	mathieu.poirier@linaro.org, michal.simek@xilinx.com,
	openamp-system-reference@lists.openampproject.org,
	robh+dt@kernel.org
Subject: Re: [PATCH v8 6/6] drivers: remoteproc: Add Xilinx r5 remoteproc driver
Date: Thu, 2 Jun 2022 23:07:01 +0200	[thread overview]
Message-ID: <82e9f075-0526-ac34-fa92-14a7402825fd@wanadoo.fr> (raw)
In-Reply-To: <20220602203834.3675160-7-tanmay.shah@xilinx.com>

Hi,

should there be a v9, a nitpick below.

Le 02/06/2022 à 22:38, Tanmay Shah a écrit :
> This driver enables r5f dual core Real time Processing Unit subsystem
> available on Xilinx Zynq Ultrascale MPSoC Platform. RPU subsystem
> (cluster) can be configured in different modes e.g. split mode in which
> two r5f cores work independent of each other and lock-step mode in which
> both r5f cores execute same code clock-for-clock and notify if the
> result is different.
> 
> The Xilinx r5 Remoteproc Driver boots the RPU cores via calls to the Xilinx
> Platform Management Unit that handles the R5 configuration, memory access
> and R5 lifecycle management. The interface to this manager is done in this
> driver via zynqmp_pm_* function calls.
> 
> Signed-off-by: Ben Levinsky <ben.levinsky-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Tanmay Shah <tanmay.shah-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
> ---
> 

[...]

> +static void zynqmp_r5_cluster_exit(void *data)
> +{
> +	struct platform_device *pdev = (struct platform_device *)data;
> +	struct zynqmp_r5_cluster *cluster;
> +	int i;
> +
> +	cluster = (struct zynqmp_r5_cluster *)platform_get_drvdata(pdev);
> +	if (!cluster)
> +		return;
> +
> +	for (i = 0; i < cluster->core_count; i++) {
> +		zynqmp_r5_core_exit(cluster->r5_cores[i]);
> +		cluster->r5_cores[i] = NULL;
> +	}
> +
> +	kfree(cluster->r5_cores);
> +	kfree(cluster);

why not remove this kfree(cluster) here...

> +	platform_set_drvdata(pdev, NULL);
> +}
> +
> +/*
> + * zynqmp_r5_remoteproc_probe()
> + *
> + * @pdev: domain platform device for R5 cluster
> + *
> + * called when driver is probed, for each R5 core specified in DT,
> + * setup as needed to do remoteproc-related operations
> + *
> + * Return: 0 for success, negative value for failure.
> + */
> +static int zynqmp_r5_remoteproc_probe(struct platform_device *pdev)
> +{
> +	int ret;
> +	struct zynqmp_r5_cluster *cluster;
> +	struct device *dev = &pdev->dev;
> +
> +	cluster = kzalloc(sizeof(*cluster), GFP_KERNEL);

... devm_kzalloc() here...

> +	if (!cluster)
> +		return -ENOMEM;
> +
> +	cluster->dev = dev;
> +
> +	ret = devm_of_platform_populate(dev);
> +	if (ret) {
> +		dev_err_probe(dev, ret, "failed to populate platform dev\n");
> +		kfree(cluster);
> +		return ret;

and return dev_err_probe() here (without the kfree)?
Would'nt it be cleaner?

just my 2c

CJ

> +	}
> +
> +	/* wire in so each core can be cleaned up at driver remove */
> +	platform_set_drvdata(pdev, cluster);
> +
> +	ret = zynqmp_r5_cluster_init(cluster);
> +	if (ret) {
> +		zynqmp_r5_cluster_exit(pdev);
> +		dev_err_probe(dev, ret, "Invalid r5f subsystem device tree\n");
> +		return ret;
> +	}
> +
> +	ret = devm_add_action_or_reset(dev, zynqmp_r5_cluster_exit, pdev);
> +	if (ret)
> +		return ret;
> +
> +	return 0;
> +}
> +

[...]

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

  reply	other threads:[~2022-06-02 21:07 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02 20:38 [PATCH v8 0/6] Add Xilinx RPU subsystem support Tanmay Shah
2022-06-02 20:38 ` Tanmay Shah
2022-06-02 20:38 ` [PATCH v8 1/6] dt-bindings: remoteproc: Add Xilinx RPU subsystem bindings Tanmay Shah
2022-06-02 20:38   ` Tanmay Shah
2022-06-03  6:33   ` Peter Korsgaard
2022-06-03  6:33     ` Peter Korsgaard
2022-06-09 17:41     ` Rob Herring
2022-06-09 17:41       ` Rob Herring
2022-06-10 16:17       ` Tanmay Shah
2022-06-10 16:17         ` Tanmay Shah
2022-06-07 17:32   ` Tanmay Shah
2022-06-07 17:32     ` Tanmay Shah
2022-06-09 17:33     ` Rob Herring
2022-06-09 17:33       ` Rob Herring
2022-06-10 16:18       ` Tanmay Shah
2022-06-10 16:18         ` Tanmay Shah
2022-06-02 20:38 ` [PATCH v8 2/6] arm64: dts: xilinx: zynqmp: Add RPU subsystem device node Tanmay Shah
2022-06-02 20:38   ` Tanmay Shah
2022-06-02 20:38 ` [PATCH v8 3/6] firmware: xilinx: Add ZynqMP firmware ioctl enums for RPU configuration Tanmay Shah
2022-06-02 20:38   ` Tanmay Shah
2022-06-02 20:38 ` [PATCH v8 4/6] firmware: xilinx: Add shutdown/wakeup APIs Tanmay Shah
2022-06-02 20:38   ` Tanmay Shah
2022-06-02 20:38 ` [PATCH v8 5/6] firmware: xilinx: Add RPU configuration APIs Tanmay Shah
2022-06-02 20:38   ` Tanmay Shah
2022-06-02 20:38 ` [PATCH v8 6/6] drivers: remoteproc: Add Xilinx r5 remoteproc driver Tanmay Shah
2022-06-02 20:38   ` Tanmay Shah
2022-06-02 21:07   ` Christophe JAILLET [this message]
2022-06-02 21:07     ` Christophe JAILLET
2022-06-07 13:03   ` Peter Korsgaard
2022-06-07 13:03     ` Peter Korsgaard
2022-06-07 16:52   ` Mathieu Poirier
2022-06-07 16:52     ` Mathieu Poirier
2022-06-13 20:59     ` Tanmay Shah
2022-06-13 20:59       ` Tanmay Shah
     [not found]     ` <2d905471-34f0-60d9-90f8-17ea34683836@amd.com>
2022-06-21 19:25       ` Mathieu Poirier
2022-06-21 19:25         ` Mathieu Poirier
2022-06-08 17:37   ` Mathieu Poirier
2022-06-08 17:37     ` Mathieu Poirier
2022-06-13 21:36     ` Tanmay Shah
2022-06-13 21:36       ` Tanmay Shah

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=82e9f075-0526-ac34-fa92-14a7402825fd@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=ben.levinsky@xilinx.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=michal.simek@xilinx.com \
    --cc=openamp-system-reference@lists.openampproject.org \
    --cc=robh+dt@kernel.org \
    --cc=tanmay.shah@xilinx.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.