From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johan Hovold Subject: Re: [PATCH] dma: cpp41: Fix handling of error path Date: Mon, 14 Nov 2016 15:59:00 +0100 Message-ID: <20161114145900.GT14744@localhost> References: <20161111192852.25399-1-tony@atomide.com> <20161114143454.GQ14744@localhost> <20161114144731.GQ7138@atomide.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20161114144731.GQ7138-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Tony Lindgren Cc: Johan Hovold , Dan Williams , Vinod Koul , Bin Liu , Daniel Mack , Felipe Balbi , George Cherian , Peter Ujfalusi , Sebastian Andrzej Siewior , dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-omap@vger.kernel.org On Mon, Nov 14, 2016 at 06:47:31AM -0800, Tony Lindgren wrote: > Hi, > > * Johan Hovold [161114 06:35]: > > On Fri, Nov 11, 2016 at 11:28:52AM -0800, Tony Lindgren wrote: > > > If we return early on pm_runtime_get() error, we need to also call > > > pm_runtime_put_noidle() as pointed out in a musb related thread > > > by Johan Hovold . This is to keep the PM runtime > > > use counts happy. > > > > > > Fixes: fdea2d09b997 ("dmaengine: cppi41: Add basic PM runtime support") > > > Cc: Johan Hovold > > > Signed-off-by: Tony Lindgren > > > --- > > > drivers/dma/cppi41.c | 11 +++++++++-- > > > 1 file changed, 9 insertions(+), 2 deletions(-) > > > > > @@ -466,6 +472,7 @@ static void cppi41_dma_issue_pending(struct dma_chan *chan) > > > > > > error = pm_runtime_get(cdd->ddev.dev); > > > if ((error != -EINPROGRESS) && error < 0) { > > > + pm_runtime_put_noidle(cdd->ddev.dev); > > > dev_err(cdd->ddev.dev, "Failed to pm_runtime_get: %i\n", > > > error); > > > > Will this chunk not introduce rather than fix an imbalance, though? An > > error is never returned above, and the corresponding put is done > > unconditionally as far as I can tell. > > There is already an early return in cppi41_dma_issue_pending() on > error. Indeed, but before "dma: cppi41: Fix unpaired pm runtime when only a USB hub is connected" from last week, the corresponding put in cppi41_irq() was done unconditionally and would have required an unconditional get here. Thanks, Johan -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html