From: "Michael Walle" <mwalle@kernel.org>
To: "Dan Carpenter" <dan.carpenter@linaro.org>,
<khairul.anuar.romli@altera.com>
Cc: "Mark Brown" <broonie@kernel.org>,
"open list:SPI SUBSYSTEM" <linux-spi@vger.kernel.org>,
"open list" <linux-kernel@vger.kernel.org>,
"Matthew Gerlach" <matthew.gerlach@altera.com>,
"Khairul Anuar Romli" <khairulanuar.romli@altera.com>
Subject: Re: [PATCH v3 1/1] spi: spi-cadence-quadspi: Fix pm runtime unbalance
Date: Fri, 04 Jul 2025 10:58:30 +0200 [thread overview]
Message-ID: <DB35AME44OW7.8Q673KOM4PD2@kernel.org> (raw)
In-Reply-To: <62b9964d-0f2c-4d26-9b35-bb7af3aa5c4f@suswa.mountain>
[-- Attachment #1: Type: text/plain, Size: 1037 bytes --]
Hi,
> > > - ret = devm_pm_runtime_enable(dev);
> > > - if (ret) {
> > > - if (cqspi->rx_chan)
> > > - dma_release_channel(cqspi->rx_chan);
> > > + pm_runtime_enable(dev);
> > > +
> > > + if (cqspi->rx_chan) {
> > > + dma_release_channel(cqspi->rx_chan);
> > > goto probe_setup_failed;
> > > }
> >
> > This will totally break the driver. It was supposed to be
Yeah. I've just stumbled on that.
> >
> > if (ret) {
> > if (cqspi->rx_chan)
> > dma_release_channel(cqspi->rx_chan);
> > goto probe_setup_failed;
> > }
> >
> > In other words, if we failed there was some slightly complicated
> > cleanup to do. But now it will do the cleanup and free things on the
> > success path if we're in cqspi->use_direct_mode.
> >
>
> I suck at email. What I meant was delete the if block:
>
> - if (cqspi->rx_chan) {
> - dma_release_channel(cqspi->rx_chan);
> - goto probe_setup_failed;
> - }
> -
Shouldn't the DMA channel be freed if spi_register_controller()
fails?
-michael
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]
prev parent reply other threads:[~2025-07-04 8:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1749601877.git.khairul.anuar.romli@altera.com>
2025-06-16 1:13 ` [PATCH v3 1/1] spi: spi-cadence-quadspi: Fix pm runtime unbalance khairul.anuar.romli
2025-06-24 18:39 ` Mark Brown
2025-06-27 4:37 ` Dan Carpenter
2025-06-27 4:39 ` Dan Carpenter
2025-06-27 10:05 ` Mark Brown
2025-06-30 9:08 ` Romli, Khairul Anuar
2025-07-04 8:58 ` Michael Walle [this message]
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=DB35AME44OW7.8Q673KOM4PD2@kernel.org \
--to=mwalle@kernel.org \
--cc=broonie@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=khairul.anuar.romli@altera.com \
--cc=khairulanuar.romli@altera.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=matthew.gerlach@altera.com \
/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;
as well as URLs for NNTP newsgroup(s).