mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
To: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Cc: Manivannan Sadhasivam <mani@kernel.org>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Huang Yiwei <quic_hyiwei@quicinc.com>,
	Sudeep Holla <sudeep.holla@kernel.org>,
	Jassi Brar <jaswinder.singh@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] mailbox: arm_mhu_db: Remove redundant mbox_controller_unregister() on probe failure
Date: Tue, 6 Oct 2026 17:03:07 +0530	[thread overview]
Message-ID: <4fb39acb-51c8-4abe-ad5f-bb5aeb180c55@oss.qualcomm.com> (raw)
In-Reply-To: <20261006093014.mak7ctqf37c22l4o@hu-mojha-hyd.qualcomm.com>


On 10/6/2026 3:00 PM, Mukesh Ojha wrote:
> On Tue, Oct 06, 2026 at 02:44:15PM +0530, Anup Vishwakarma wrote:
>> mhu_db_probe() registers the mailbox controller via
>> devm_mbox_controller_register(), which automatically calls
>> mbox_controller_unregister() through devres when the device is removed
>> or probe fails. If devm_request_threaded_irq() subsequently fails in
>> the channel setup loop, the error path also manually calls
>> mbox_controller_unregister(), resulting in a double call that corrupts
>> the global mailbox controller list and causes a kernel panic.
>>
>> Remove the redundant manual call and rely on devres for cleanup.
>>
>> Fixes: 7002ca237b21 ("mailbox: arm_mhu: Add ARM MHU doorbell driver")
>> Signed-off-by: Anup Vishwakarma <anup.vishwakarma@oss.qualcomm.com>
>> ---
>>   drivers/mailbox/arm_mhu_db.c | 8 +++-----
>>   1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/mailbox/arm_mhu_db.c b/drivers/mailbox/arm_mhu_db.c
>> index a39239e38a47..9668dfdedc78 100644
>> --- a/drivers/mailbox/arm_mhu_db.c
>> +++ b/drivers/mailbox/arm_mhu_db.c
>> @@ -315,12 +315,10 @@ static int mhu_db_probe(struct amba_device *adev, const struct amba_id *id)
>>   		mhu->mlink[i].tx_reg = mhu->mlink[i].rx_reg + TX_REG_OFFSET;
>>   
>>   		err = devm_request_threaded_irq(dev, irq, NULL,
>> -						mhu_db_mbox_rx_handler,
>> -						IRQF_ONESHOT, "mhu_db_link", mhu);
>> -		if (err) {
>> -			mbox_controller_unregister(&mhu->mbox);
>> +					mhu_db_mbox_rx_handler,
>> +					IRQF_ONESHOT, "mhu_db_link", mhu);
> It looks like alignment/indentation is unnecessary changing.
>
>> +		if (err)
>>   			return err;
>> -		}
>>   	}
> with the above fix.
>
> Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>

Thanks for the review, Mukesh. Addressed both comments in v2: - Removed 
the now-empty err_req_irq: label in qcom-ipcc.c - Restored original 
alignment of devm_request_threaded_irq() arguments in arm_mhu_db.c

Best Regards, Anup Vishwakarma


  reply	other threads:[~2026-10-06 11:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06  9:14 [PATCH 0/2] mailbox: " Anup Vishwakarma
2026-10-06  9:14 ` [PATCH 1/2] mailbox: qcom-ipcc: " Anup Vishwakarma
2026-10-06  9:35   ` Mukesh Ojha
2026-10-06  9:14 ` [PATCH 2/2] mailbox: arm_mhu_db: " Anup Vishwakarma
2026-10-06  9:30   ` Mukesh Ojha
2026-10-06 11:33     ` Anup Vishwakarma [this message]
2026-10-06  9:31 ` [PATCH 0/2] mailbox: " Mukesh Ojha

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=4fb39acb-51c8-4abe-ad5f-bb5aeb180c55@oss.qualcomm.com \
    --to=anup.vishwakarma@oss.qualcomm.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=mukesh.ojha@oss.qualcomm.com \
    --cc=quic_hyiwei@quicinc.com \
    --cc=sudeep.holla@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®