* [PATCH 0/3] remoteproc: xlnx: enhancements and new features
@ 2026-03-03 23:51 Tanmay Shah
2026-03-03 23:51 ` [PATCH 1/3] remoteproc: xlnx: avoid mailbox setup Tanmay Shah
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Tanmay Shah @ 2026-03-03 23:51 UTC (permalink / raw)
To: andersson, mathieu.poirier; +Cc: linux-remoteproc, linux-kernel, Tanmay Shah
Introduce new enhancements in the remoteproc xlnx driver. Handle mailbox
optional properties gracefully. Handle buffer-less IPI without crash i.e.
no message is expected from the mailbox callback. Also gracefully free
mailbox channels during shutdown callback.
These small enhancements make driver more robust.
Ben Levinsky (1):
remoteproc: xlnx: Only access buffer information if IPI is buffered
Tanmay Shah (2):
remoteproc: xlnx: avoid mailbox setup
remoteproc: zynqmp: release mailbox channels on shutdown
drivers/remoteproc/xlnx_r5_remoteproc.c | 26 ++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
base-commit: 098493c6dced7b02545e8bd0053ef4099a2b769e
--
2.34.1
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH 1/3] remoteproc: xlnx: avoid mailbox setup 2026-03-03 23:51 [PATCH 0/3] remoteproc: xlnx: enhancements and new features Tanmay Shah @ 2026-03-03 23:51 ` 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 2 siblings, 0 replies; 11+ messages in thread From: Tanmay Shah @ 2026-03-03 23:51 UTC (permalink / raw) To: andersson, mathieu.poirier; +Cc: linux-remoteproc, linux-kernel, Tanmay Shah Mailbox properties are optional in the remoteproc xlnx bindings. If mailbox properties are not found in device-tree it's not fatal error in the driver. Driver will print warning messages and continue with normal operation. However, these warning messages can be interpreted as error. Check "mboxes" and "mbox-names" properties in the driver and setup mailbox only if they are available in the device-tree. This will avoid any unwanted warning/error messages. Signed-off-by: Tanmay Shah <tanmay.shah@amd.com> --- drivers/remoteproc/xlnx_r5_remoteproc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c index 5a468d959f1e..148d8c622566 100644 --- a/drivers/remoteproc/xlnx_r5_remoteproc.c +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c @@ -265,6 +265,10 @@ static struct mbox_info *zynqmp_r5_setup_mbox(struct device *cdev) struct mbox_client *mbox_cl; struct mbox_info *ipi; + if (!of_property_present(dev_of_node(cdev), "mboxes") || + !of_property_present(dev_of_node(cdev), "mbox-names")) + return NULL; + ipi = kzalloc_obj(*ipi); if (!ipi) return NULL; -- 2.34.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/3] remoteproc: xlnx: Only access buffer information if IPI is buffered 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 ` Tanmay Shah 2026-03-03 23:51 ` [PATCH 3/3] remoteproc: zynqmp: release mailbox channels on shutdown Tanmay Shah 2 siblings, 0 replies; 11+ messages in thread From: Tanmay Shah @ 2026-03-03 23:51 UTC (permalink / raw) To: andersson, mathieu.poirier Cc: linux-remoteproc, linux-kernel, Ben Levinsky, Tanmay Shah From: Ben Levinsky <ben.levinsky@amd.com> In the receive callback check if message is NULL to prevent possibility of crash by NULL pointer dereferencing. Signed-off-by: Ben Levinsky <ben.levinsky@amd.com> Signed-off-by: Tanmay Shah <tanmay.shah@amd.com> --- drivers/remoteproc/xlnx_r5_remoteproc.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c index 148d8c622566..5e92dc51f1c0 100644 --- a/drivers/remoteproc/xlnx_r5_remoteproc.c +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c @@ -232,17 +232,19 @@ static void zynqmp_r5_mb_rx_cb(struct mbox_client *cl, void *msg) ipi = container_of(cl, struct mbox_info, mbox_cl); - /* copy data from ipi buffer to r5_core */ + /* copy data from ipi buffer to r5_core if IPI is buffered. */ ipi_msg = (struct zynqmp_ipi_message *)msg; - buf_msg = (struct zynqmp_ipi_message *)ipi->rx_mc_buf; - len = ipi_msg->len; - if (len > IPI_BUF_LEN_MAX) { - dev_warn(cl->dev, "msg size exceeded than %d\n", - IPI_BUF_LEN_MAX); - len = IPI_BUF_LEN_MAX; + if (ipi_msg) { + buf_msg = (struct zynqmp_ipi_message *)ipi->rx_mc_buf; + len = ipi_msg->len; + if (len > IPI_BUF_LEN_MAX) { + dev_warn(cl->dev, "msg size exceeded than %d\n", + IPI_BUF_LEN_MAX); + len = IPI_BUF_LEN_MAX; + } + buf_msg->len = len; + memcpy(buf_msg->data, ipi_msg->data, len); } - buf_msg->len = len; - memcpy(buf_msg->data, ipi_msg->data, len); /* received and processed interrupt ack */ if (mbox_send_message(ipi->rx_chan, NULL) < 0) -- 2.34.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/3] remoteproc: zynqmp: release mailbox channels on shutdown 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 ` Tanmay Shah 2026-03-10 15:29 ` Mathieu Poirier 2 siblings, 1 reply; 11+ messages in thread From: Tanmay Shah @ 2026-03-03 23:51 UTC (permalink / raw) To: andersson, mathieu.poirier; +Cc: linux-remoteproc, linux-kernel, Tanmay Shah 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); } } -- 2.34.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3] remoteproc: zynqmp: release mailbox channels on shutdown 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 0 siblings, 1 reply; 11+ messages in thread From: Mathieu Poirier @ 2026-03-10 15:29 UTC (permalink / raw) To: Tanmay Shah; +Cc: andersson, linux-remoteproc, linux-kernel 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? I have applied the other two patches in this series. Thanks, Mathieu > } > } > > -- > 2.34.1 > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3] remoteproc: zynqmp: release mailbox channels on shutdown 2026-03-10 15:29 ` Mathieu Poirier @ 2026-03-10 16:04 ` Shah, Tanmay 2026-03-11 17:12 ` Mathieu Poirier 2026-03-16 15:38 ` Mathieu Poirier 0 siblings, 2 replies; 11+ messages in thread From: Shah, Tanmay @ 2026-03-10 16:04 UTC (permalink / raw) To: Mathieu Poirier, Tanmay Shah; +Cc: andersson, linux-remoteproc, linux-kernel 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. Thanks, Tanmay > I have applied the other two patches in this series. > > Thanks, > Mathieu > >> } >> } >> >> -- >> 2.34.1 >> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3] remoteproc: zynqmp: release mailbox channels on shutdown 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 1 sibling, 1 reply; 11+ messages in thread From: Mathieu Poirier @ 2026-03-11 17:12 UTC (permalink / raw) To: tanmay.shah; +Cc: andersson, linux-remoteproc, linux-kernel 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. The problem here is that zynqmp_r5_free_mbox() is called twice. At shutdown time all drivers go throuth the normal driver shutdown process where platform_driver.shutdown() is called and subsequently device management callbacks such as zynqmp_r5_cluster_exit(). The same applies to loading and unloading of drivers. Unless there is a corner case I can't see, calling zynqmp_r5_free_mbox() twice is not needed. > > Thanks, > Tanmay > > > I have applied the other two patches in this series. > > > > Thanks, > > Mathieu > > > >> } > >> } > >> > >> -- > >> 2.34.1 > >> > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3] remoteproc: zynqmp: release mailbox channels on shutdown 2026-03-11 17:12 ` Mathieu Poirier @ 2026-03-11 19:28 ` Shah, Tanmay 0 siblings, 0 replies; 11+ messages in thread From: Shah, Tanmay @ 2026-03-11 19:28 UTC (permalink / raw) To: Mathieu Poirier, tanmay.shah; +Cc: andersson, linux-remoteproc, linux-kernel On 3/11/2026 12:12 PM, 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. > > The problem here is that zynqmp_r5_free_mbox() is called twice. At shutdown > time all drivers go throuth the normal driver shutdown process where > platform_driver.shutdown() is called and subsequently device management > callbacks such as zynqmp_r5_cluster_exit(). The same applies to loading and > unloading of drivers. Unless there is a corner case I can't see, calling > zynqmp_r5_free_mbox() twice is not needed. > Hi Mathieu, I tested this patch again. On my platform I don't see zynqmp_r5_cluster_exit() being called when issuing `reboot` command. It only calls platform_driver.shutdown() callback. I think device management APIs are called only during driver remove callback, and not shutdown sequence. Thanks, Tanmay >> >> Thanks, >> Tanmay >> >>> I have applied the other two patches in this series. >>> >>> Thanks, >>> Mathieu >>> >>>> } >>>> } >>>> >>>> -- >>>> 2.34.1 >>>> >> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3] remoteproc: zynqmp: release mailbox channels on shutdown 2026-03-10 16:04 ` Shah, Tanmay 2026-03-11 17:12 ` Mathieu Poirier @ 2026-03-16 15:38 ` Mathieu Poirier 2026-03-16 16:37 ` Shah, Tanmay 1 sibling, 1 reply; 11+ messages in thread From: Mathieu Poirier @ 2026-03-16 15:38 UTC (permalink / raw) To: tanmay.shah; +Cc: andersson, linux-remoteproc, linux-kernel 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(). > > Thanks, > Tanmay > > > I have applied the other two patches in this series. > > > > Thanks, > > Mathieu > > > >> } > >> } > >> > >> -- > >> 2.34.1 > >> > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3] remoteproc: zynqmp: release mailbox channels on shutdown 2026-03-16 15:38 ` Mathieu Poirier @ 2026-03-16 16:37 ` Shah, Tanmay 2026-03-17 15:40 ` Mathieu Poirier 0 siblings, 1 reply; 11+ messages in thread From: Shah, Tanmay @ 2026-03-16 16:37 UTC (permalink / raw) To: Mathieu Poirier, tanmay.shah; +Cc: andersson, linux-remoteproc, linux-kernel 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. 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 >>>> >> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3] remoteproc: zynqmp: release mailbox channels on shutdown 2026-03-16 16:37 ` Shah, Tanmay @ 2026-03-17 15:40 ` Mathieu Poirier 0 siblings, 0 replies; 11+ messages in thread From: Mathieu Poirier @ 2026-03-17 15:40 UTC (permalink / raw) To: tanmay.shah; +Cc: andersson, linux-remoteproc, linux-kernel 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 > >>>> > >> > ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-03-17 15:40 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox