Re: [PATCH] mailbox: arm_mhuv2: time out if the receiver never comes up
From: Jassi Brar
Date: Sun Oct 11 2026 - 21:36:43 EST
On Wed, Sep 2, 2026 at 4:25 AM Linkai Gong <gonglinkai@xxxxxxxxxx> wrote:
>
> mhuv2_tx_init() waits forever for access_ready. Fail probe
> after 1s instead of hanging boot.
>
> Fixes: 5a6338cce9f4 ("mailbox: arm_mhuv2: Add driver")
> Signed-off-by: Linkai Gong <gonglinkai@xxxxxxxxxx>
> ---
> drivers/mailbox/arm_mhuv2.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mailbox/arm_mhuv2.c b/drivers/mailbox/arm_mhuv2.c
> index f035284944c0..1cf4282e1583 100644
> --- a/drivers/mailbox/arm_mhuv2.c
> +++ b/drivers/mailbox/arm_mhuv2.c
> @@ -27,6 +27,7 @@
>
> #include <linux/amba/bus.h>
> #include <linux/interrupt.h>
> +#include <linux/iopoll.h>
> #include <linux/mailbox_controller.h>
> #include <linux/mailbox/arm_mhuv2_message.h>
> #include <linux/module.h>
> @@ -968,6 +969,7 @@ static int mhuv2_tx_init(struct amba_device *adev, struct mhuv2 *mhu,
> {
> struct device *dev = mhu->mbox.dev;
> int ret, i;
> + u32 val;
>
> mhu->frame = SENDER_FRAME;
> mhu->mbox.ops = &mhuv2_sender_ops;
> @@ -1011,8 +1013,11 @@ static int mhuv2_tx_init(struct amba_device *adev, struct mhuv2 *mhu,
> out:
> /* Wait for receiver to be ready */
> writel_relaxed(0x1, &mhu->send->access_request);
> - while (!readl_relaxed(&mhu->send->access_ready))
> - continue;
> + if (readl_relaxed_poll_timeout(&mhu->send->access_ready, val, val,
> + 100, 1000000)) {
> + dev_err(dev, "receiver not ready\n");
> + return -ETIMEDOUT;
> + }
>
> return 0;
> }
> --
> 2.25.1
>
Applied to mailbox/for-next
Thanks
Jassi