mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jolly Shah <jolly.shah@xilinx.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	michal.simek@xilinx.com, rajan.vaja@xilinx.com,
	jolly.shah@xilinx.com, gregkh@linuxfoundation.org,
	tejas.patel@xilinx.com, manish.narani@xilinx.com,
	ravi.patel@xilinx.com
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] firmware: xilinx: Fix an error handling path in 'zynqmp_firmware_probe()'
Date: Wed, 13 May 2020 10:42:59 -0700	[thread overview]
Message-ID: <248faa4d-4f85-343b-16ab-fac3f4761dc7@xilinx.com> (raw)
In-Reply-To: <20200510130357.233364-1-christophe.jaillet@wanadoo.fr>

Reviewed-by: Jolly Shah <jolly.shah@xilinx.com>

 > ------Original Message------
 > From: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
 > Sent:  Sunday, May 10, 2020 6:03AM
 > To: Michal Simek <michal.simek@xilinx.com>, Rajan Vaja 
<rajan.vaja@xilinx.com>, Jolly Shah <jolly.shah@xilinx.com>, 'Greg Kh' 
<gregkh@linuxfoundation.org>, Tejas Patel <tejas.patel@xilinx.com>, 
Manish Narani <manish.narani@xilinx.com>, Ravi Patel <ravi.patel@xilinx.com>
 > Cc: Linux-arm-kernel@lists.infradead.org 
<linux-arm-kernel@lists.infradead.org>, Linux-kernel@vger.kernel.org 
<linux-kernel@vger.kernel.org>, Kernel-janitors 
<kernel-janitors@vger.kernel.org>, Christophe Jaillet 
<christophe.jaillet@wanadoo.fr>
 > Subject: [PATCH] firmware: xilinx: Fix an error handling path in 
'zynqmp_firmware_probe()'
 >
> If 'mfd_add_devices()' fails, we must undo 'zynqmp_pm_api_debugfs_init()'
> otherwise some debugfs directory and files will be left.
> 
> Just move the call to 'zynqmp_pm_api_debugfs_init()' a few lines below to
> fix the issue.
> 
> Fixes: e23d9c6d0d49 ("drivers: soc: xilinx: Add ZynqMP power domain driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Not related to this fix, but I think that:
>     - a call to 'of_platform_depopulate()' is missing in the remove function
>     - we shouldn't return of_platform_populate(); directly because we
>       don't have the opportunity to call 'mfd_remove_devices()' as done in
>       the remove function, and 'of_platform_depopulate()' for what have
>       been populated yet
> 
> I'm not familiar with this API, so I just point it out to get feedback.

Agree. This needs to be fixed.

Thanks,
Jolly Shah


> ---
>   drivers/firmware/xilinx/zynqmp.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
> index 8095fa84d5d7..8d1ff2454e2e 100644
> --- a/drivers/firmware/xilinx/zynqmp.c
> +++ b/drivers/firmware/xilinx/zynqmp.c
> @@ -1235,8 +1235,6 @@ static int zynqmp_firmware_probe(struct platform_device *pdev)
>   	pr_info("%s Trustzone version v%d.%d\n", __func__,
>   		pm_tz_version >> 16, pm_tz_version & 0xFFFF);
>   
> -	zynqmp_pm_api_debugfs_init();
> -
>   	ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, firmware_devs,
>   			      ARRAY_SIZE(firmware_devs), NULL, 0, NULL);
>   	if (ret) {
> @@ -1244,6 +1242,8 @@ static int zynqmp_firmware_probe(struct platform_device *pdev)
>   		return ret;
>   	}
>   
> +	zynqmp_pm_api_debugfs_init();
> +
>   	return of_platform_populate(dev->of_node, NULL, NULL, dev);
>   }
>   
> 

      reply	other threads:[~2020-05-13 17:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-10 13:03 Christophe JAILLET
2020-05-13 17:42 ` Jolly Shah [this message]

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=248faa4d-4f85-343b-16ab-fac3f4761dc7@xilinx.com \
    --to=jolly.shah@xilinx.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manish.narani@xilinx.com \
    --cc=michal.simek@xilinx.com \
    --cc=rajan.vaja@xilinx.com \
    --cc=ravi.patel@xilinx.com \
    --cc=tejas.patel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®