mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@oss.nxp.com>
To: Frank Li <Frank.li@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>, Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Dong Aisheng <aisheng.dong@nxp.com>,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/8] firmware: imx: scu-irq: Free mailbox client on failure
Date: Thu, 16 Oct 2025 10:14:59 +0800	[thread overview]
Message-ID: <20251016021459.GA3592@nxa18884-linux.ap.freescale.net> (raw)
In-Reply-To: <aO+wg4I1IFxQQ7rf@lizhi-Precision-Tower-5810>

On Wed, Oct 15, 2025 at 10:32:35AM -0400, Frank Li wrote:
>On Wed, Oct 15, 2025 at 09:55:03PM +0800, Peng Fan wrote:
>> On Tue, Oct 14, 2025 at 11:54:36AM -0400, Frank Li wrote:
>> >On Tue, Oct 14, 2025 at 12:54:39PM +0800, Peng Fan wrote:
>> >> With mailbox channel freed, it is pointless to keep mailbox client.
>> >> So free the mailbox client in err path.
>> >>
>> >> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>> >> ---
>> >>  drivers/firmware/imx/imx-scu-irq.c | 1 +
>> >>  1 file changed, 1 insertion(+)
>> >>
>> >> diff --git a/drivers/firmware/imx/imx-scu-irq.c b/drivers/firmware/imx/imx-scu-irq.c
>> >> index f2b902e95b738fae90af9cbe54da4f488219906f..1fbe4c3de5c1592bfcf2334a83776c25d5ca7a3f 100644
>> >> --- a/drivers/firmware/imx/imx-scu-irq.c
>> >> +++ b/drivers/firmware/imx/imx-scu-irq.c
>> >> @@ -255,6 +255,7 @@ int imx_scu_enable_general_irq_channel(struct device *dev)
>> >>
>> >>  free_ch:
>> >>  	mbox_free_channel(ch);
>> >> +	devm_kfree(dev, cl);
>> >
>> >
>> >you use devm_kmalloc(), when return failure, framework will auto free cl.
>> >
>> >Avoid mixing manual free and management free code.
>> >
>> >So I think this patch is not neccesary.
>>
>> Actually in imx-scu.c, there is only a warning message if this API call returns
>> error. So need to free here.
>
>what's warning?

When imx_scu_enable_general_irq_channel() fails, there is only a warning
printed out as below, the probe continues.

        ret = imx_scu_enable_general_irq_channel(dev);
        if (ret)
                dev_warn(dev,
                        "failed to enable general irq channel: %d\n", ret);

        dev_info(dev, "NXP i.MX SCU Initialized\n");

        return devm_of_platform_populate(dev);

Thanks,
Peng

>
>Frank
>>
>> Thanks
>> Peng
>>
>> >
>> >Frank
>> >>
>> >>  	return ret;
>> >>  }
>> >>
>> >> --
>> >> 2.37.1
>> >>

  reply	other threads:[~2025-10-16  1:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14  4:54 [PATCH 0/8] firmware: imx: scu: Misc update Peng Fan
2025-10-14  4:54 ` [PATCH 1/8] firmware: imx: scu-irq: fix OF node leak in Peng Fan
2025-10-14 15:48   ` Frank Li
2025-10-14  4:54 ` [PATCH 2/8] firmware: imx: scu-irq: Free mailbox client on failure Peng Fan
2025-10-14 15:54   ` Frank Li
2025-10-15 13:55     ` Peng Fan
2025-10-15 14:32       ` Frank Li
2025-10-16  2:14         ` Peng Fan [this message]
2025-10-16 15:33           ` Frank Li
2025-10-14  4:54 ` [PATCH 3/8] firmware: imx: scu-irq: Init workqueue before request mbox channel Peng Fan
2025-10-14 15:55   ` Frank Li
2025-10-14  4:54 ` [PATCH 4/8] firmware: imx: scu-irq: Set mu_resource_id before get handle Peng Fan
2025-10-14 15:57   ` Frank Li
2025-10-14  4:54 ` [PATCH 5/8] firmware: imx: scu-irq: Remove unused export of imx_scu_enable_general_irq_channel Peng Fan
2025-10-14 15:59   ` Frank Li
2025-10-14  4:54 ` [PATCH 6/8] firmware: imx: scu: Update error code Peng Fan
2025-10-14 16:00   ` Frank Li
2025-10-14  4:54 ` [PATCH 7/8] firmware: imx: scu: Suppress bind attrs Peng Fan
2025-10-14 16:01   ` Frank Li
2025-10-14  4:54 ` [PATCH 8/8] firmware: imx: scu: Use devm_mutex_init Peng Fan
2025-10-14 16:02   ` Frank Li

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=20251016021459.GA3592@nxa18884-linux.ap.freescale.net \
    --to=peng.fan@oss.nxp.com \
    --cc=Frank.li@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /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®