From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-renesas-soc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Jassi Brar <jassisinghbrar@gmail.com>,
Mark Brown <broonie@linaro.org>
Subject: Re: [RFC PATCH] mailbox: don't free the channel if the startup callback failed
Date: Tue, 7 Apr 2026 12:23:44 +0200 [thread overview]
Message-ID: <adTbMCsgwpqVYADU@ninjato> (raw)
In-Reply-To: <20260407101714.39990-2-wsa+renesas@sang-engineering.com>
[-- Attachment #1: Type: text/plain, Size: 797 bytes --]
> A second thing is that module_put is called. This should also not be
> done when startup() fails. It breaks the expected symmetry that
> request_channel() gets the module and only free_channel() puts it again.
This part is bogus...
> This patch is RFC because I am still somewhat new to the mailbox
> subsystem and might miss something.
... which proves this point ;) ...
> dev_err(dev, "Unable to startup the chan (%d)\n", ret);
> - mbox_free_channel(chan);
> + scoped_guard(spinlock_irqsave, &chan->lock) {
> + chan->cl = NULL;
> + if (chan->txdone_method == TXDONE_BY_ACK)
> + chan->txdone_method = TXDONE_BY_POLL;
> + }
... module_put needs to be here.
Still, not calling shutdown() still seems essential to me, so I'd
appreciate comments about the patch still.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2026-04-07 10:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-07 10:13 [RFC PATCH] mailbox: don't free the channel if the startup callback failed Wolfram Sang
2026-04-07 10:23 ` Wolfram Sang [this message]
2026-04-07 10:36 ` Wolfram Sang
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=adTbMCsgwpqVYADU@ninjato \
--to=wsa+renesas@sang-engineering.com \
--cc=broonie@linaro.org \
--cc=jassisinghbrar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.