mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Jassi Brar <jassisinghbrar@gmail.com>
Cc: linux-renesas-soc@vger.kernel.org, roman.gushchin@linux.dev,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Marek Vasut <marek.vasut@mailbox.org>,
	linux-kernel@vger.kernel.org,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Magnus Damm <magnus.damm@gmail.com>
Subject: Re: Sashiko review (Re: [PATCH v4 2/3] soc: renesas: Add Renesas R-Car MFIS driver)
Date: Mon, 13 Apr 2026 08:51:08 +0200	[thread overview]
Message-ID: <adySXGzjq7VFvIxX@shikoro> (raw)
In-Reply-To: <CABb+yY0bpu8rTiQKQu17ZNKkEK=y1_jNYk8fPbnpSxpcivfgog@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1973 bytes --]

Hi Jassi,

> > > What happens if request_irq() fails in mfis_mb_startup()?
> > > If request_irq() returns an error, the mailbox framework handles the startup
> > > failure by calling the shutdown() callback.
> > > Since chan_priv->irq is populated earlier during of_xlate(), it will be
> > > non-zero here. Will this cause free_irq() to be called on an IRQ that was
> > > never successfully allocated, triggering a warning?
> >
> > Uuuhh, yes! But this is not a problem of this driver but more of the
> > subsystem. It is definitely not intuitive that shutdown() is called when
> > startup() failed. There are more mailbox drivers which fell into this
> > trap, mostly by freeing an irq they never got. I will have a look at
> > this, but as said, I think it should be solved on subsystem level.
> >
> Honestly, I'd treat this as a cosmetic issue. If we fail to get the
> IRQ, the channel is already dead in the water. Seeing a warning during
> the subsequent cleanup is just a symptom of missing that critical
> resource.
> How often does your client acquire/release the channel and how
> probable is request_irq() to fail in your platform?

I agree that this is unlikely to happen in practice. I still think this
is more than just a cosmetic issue, however. Because the above code path
breaks an expectation a programmer likely has. If probe() fails,
remove() is not called. If request_irq() fails, free_irq() is not
called. So, the expectation is that if startup() fails, shutdown() is
not called. I surely was surprised about this behaviour. And surprise is
not good, boring is good, I'd say. The free_irq() splat which this
currently causes is just one appearance of the problem. It can be seen
as "not so bad" because it is the follow-up of a previous problem. I am
afraid, though, that more subtle issues might show up in the future
because of this broken expectation. It is easy to fix, so I'd still vote
to go for some fix.

Thanks and happy hacking,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-04-13  6:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02 11:27 [PATCH v4 0/3] soc: renesas: add MFIS driver Wolfram Sang
2026-04-02 11:27 ` [PATCH v4 1/3] dt-bindings: soc: renesas: Document MFIS IP core Wolfram Sang
2026-04-29  7:00   ` Geert Uytterhoeven
2026-04-02 11:27 ` [PATCH v4 2/3] soc: renesas: Add Renesas R-Car MFIS driver Wolfram Sang
2026-04-02 15:08   ` Sashiko review (Re: [PATCH v4 2/3] soc: renesas: Add Renesas R-Car MFIS driver) Wolfram Sang
2026-04-13  0:54     ` Jassi Brar
2026-04-13  6:51       ` Wolfram Sang [this message]
2026-04-16 12:46         ` Geert Uytterhoeven
2026-04-29  7:01   ` [PATCH v4 2/3] soc: renesas: Add Renesas R-Car MFIS driver Geert Uytterhoeven
2026-04-02 11:27 ` [PATCH v4 3/3] soc: renesas: add X5H PRR support Wolfram Sang
2026-04-29  7:02   ` Geert Uytterhoeven

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=adySXGzjq7VFvIxX@shikoro \
    --to=wsa+renesas@sang-engineering.com \
    --cc=geert+renesas@glider.be \
    --cc=jassisinghbrar@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=marek.vasut@mailbox.org \
    --cc=roman.gushchin@linux.dev \
    /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®