From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: tanmay.shah@amd.com
Cc: andersson@kernel.org, linux-remoteproc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] remoteproc: zynqmp: release mailbox channels on shutdown
Date: Tue, 17 Mar 2026 09:40:33 -0600 [thread overview]
Message-ID: <abl18XFwhKJ9bVRE@p14s> (raw)
In-Reply-To: <6e18177d-d2be-4d42-807f-2238436bd4a2@amd.com>
On Mon, Mar 16, 2026 at 11:37:05AM -0500, Shah, Tanmay wrote:
>
>
> On 3/16/2026 10:38 AM, Mathieu Poirier wrote:
> > On Tue, Mar 10, 2026 at 11:04:54AM -0500, Shah, Tanmay wrote:
> >>
> >>
> >> On 3/10/2026 10:29 AM, Mathieu Poirier wrote:
> >>> On Tue, Mar 03, 2026 at 03:51:28PM -0800, Tanmay Shah wrote:
> >>>> mailbox driver can't introduce shutdown callback, as it might endup
> >>>> closing mbox channels prematurely. By allowing the client driver to
> >>>> manage the shutdown process, it's ensured that mailbox channels are
> >>>> closed only when they are no longer needed.
> >>>>
> >>>> Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
> >>>> ---
> >>>> drivers/remoteproc/xlnx_r5_remoteproc.c | 2 ++
> >>>> 1 file changed, 2 insertions(+)
> >>>>
> >>>> diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c
> >>>> index 5e92dc51f1c0..50a9974f3202 100644
> >>>> --- a/drivers/remoteproc/xlnx_r5_remoteproc.c
> >>>> +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c
> >>>> @@ -1490,6 +1490,8 @@ static void zynqmp_r5_remoteproc_shutdown(struct platform_device *pdev)
> >>>> dev_err(cluster->dev, "failed to %s rproc %d\n",
> >>>> rproc_state_str, rproc->index);
> >>>> }
> >>>> +
> >>>> + zynqmp_r5_free_mbox(r5_core->ipi);
> >>>
> >>> This is already called in zynqmp_r5_cluster_exit(), why doing it here again?
> >>>
> >>
> >> Hi,
> >>
> >> Thanks for reviews.
> >> I think cluster_exit() call is called only during driver unload. Where
> >> as shutdown callback is called during power-off commands of linux like
> >> reboot or shutdown.
> >>
> >> That is why I am calling it separately during shutdown() callback.
> >
> > Then call zynqmp_r5_free_mbox() from zynqmp_r5_remoteproc_shutdown() rather than
> > zynqmp_r5_cluster_exit().
> >
>
> I have to call zynqmp_r5_free_mbox() from both handlers i.e.
> platform_driver.remove() and platform_driver.shutdown(). I can't skip
> either of them.
>
> Because during driver unload (rmmod), shutdown() handler won't be
> called. And during power-off commands (reboot, shutdown) remove()
> handler won't be called.
I was under the impression that during system shutdown, ->remove() and
->shutdown() were called sequentially. I looked into the platform_driver
structure documentation and nothing of that nature is described, leading me to
beleive your assessment is correct.
I'll apply your patch.
>
> Let me know if I am still missing something.
>
> Thanks,
> Tanmay
>
> >>
> >> Thanks,
> >> Tanmay
> >>
> >>> I have applied the other two patches in this series.
> >>>
> >>> Thanks,
> >>> Mathieu
> >>>
> >>>> }
> >>>> }
> >>>>
> >>>> --
> >>>> 2.34.1
> >>>>
> >>
>
prev parent reply other threads:[~2026-03-17 15:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-03 23:51 [PATCH 0/3] remoteproc: xlnx: enhancements and new features Tanmay Shah
2026-03-03 23:51 ` [PATCH 1/3] remoteproc: xlnx: avoid mailbox setup Tanmay Shah
2026-03-03 23:51 ` [PATCH 2/3] remoteproc: xlnx: Only access buffer information if IPI is buffered Tanmay Shah
2026-03-03 23:51 ` [PATCH 3/3] remoteproc: zynqmp: release mailbox channels on shutdown Tanmay Shah
2026-03-10 15:29 ` Mathieu Poirier
2026-03-10 16:04 ` Shah, Tanmay
2026-03-11 17:12 ` Mathieu Poirier
2026-03-11 19:28 ` Shah, Tanmay
2026-03-16 15:38 ` Mathieu Poirier
2026-03-16 16:37 ` Shah, Tanmay
2026-03-17 15:40 ` Mathieu Poirier [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=abl18XFwhKJ9bVRE@p14s \
--to=mathieu.poirier@linaro.org \
--cc=andersson@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=tanmay.shah@amd.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