Re: [PATCH v3 1/1] spi: spi-cadence-quadspi: Fix pm runtime unbalance
From: Michael Walle
Date: Fri Jul 04 2025 - 05:07:30 EST
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:
signature.asc
Description: PGP signature