From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6060C433E0 for ; Wed, 24 Jun 2020 07:41:41 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 83C76206E2 for ; Wed, 24 Jun 2020 07:41:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oLejd7o4"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="VkKK6reH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83C76206E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SIfk2P4G7Ep8SGHBHNQ6Hu8hvZ0muWa/WGIccBEYrWU=; b=oLejd7o4AHwRgpwshsLDFs1xo 8fT6Q7aBmI4+muk97VIcUkxukO3vZRj3fOVDf6NRTQox6I9fjSKaKxGDDJfTQCV/R3Yp/8SKl9msl JKj37xHIIT+AdQhdN5Nhv29smReTa9Qg1veikm5jAmd93ZTTc9hAfXPGJyaR+z07tyx9XFgjqkUZm 1D7waPF7ZNTQp0pXNRZ9KBsd8A3S59ocWKdpMn3KfUEKDq9x30qmkCG6tw8+W6sidYM7d9k55+Hqi YUWW5IQRWQwkExmVek/z4SFAIei0sTWWLVD6Q2hxN8fOeAKmpxnchlUFHoBsAtZwhbhiDQ4KB4UJ5 0Bg2eyhnQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo00S-0007Tl-Bj; Wed, 24 Jun 2020 07:39:40 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo00Q-0007Sw-0V for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 07:39:38 +0000 Received: from localhost (unknown [171.61.66.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D4A2B206E2; Wed, 24 Jun 2020 07:39:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592984376; bh=8jDjWnLW/FFZI3XS5aeybGak7b73D3MKBl8isxyOXsU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VkKK6reH+MS6Axa7CgTPj8Y1fc71ufcxFrtM+XOSGNURxVsX4MN1HoqSkc84Z2jR2 P6SEz6rkALPwTsG5FzyUxErLRmAa3cyvV0Cb/Eww4Snvm+jPeXE56BzOvx0CUKflAF CWkLutlXs90qbZO+W0S8RzD+VfuWNiODyiY7jMJw= Date: Wed, 24 Jun 2020 13:09:32 +0530 From: Vinod Koul To: Navid Emamdoost Subject: Re: [PATCH] engine: stm32-dma: call pm_runtime_put if pm_runtime_get_sync fails Message-ID: <20200624073932.GO2324254@vkoul-mobl> References: <20200603183410.76764-1-navid.emamdoost@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200603183410.76764-1-navid.emamdoost@gmail.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Torgue , wu000273@umn.edu, kjlu@umn.edu, linux-kernel@vger.kernel.org, emamd001@umn.edu, Maxime Coquelin , smccaman@umn.edu, dmaengine@vger.kernel.org, Dan Williams , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 03-06-20, 13:34, Navid Emamdoost wrote: > Calling pm_runtime_get_sync increments the counter even in case of > failure, causing incorrect ref count. Call pm_runtime_put if > pm_runtime_get_sync fails. pls fix subsystem name as dmaengine: ... > > Signed-off-by: Navid Emamdoost > --- > drivers/dma/stm32-dma.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c > index 0ddbaa4b4f0b..0aab86bd97fe 100644 > --- a/drivers/dma/stm32-dma.c > +++ b/drivers/dma/stm32-dma.c > @@ -1169,8 +1169,10 @@ static int stm32_dma_alloc_chan_resources(struct dma_chan *c) > chan->config_init = false; > > ret = pm_runtime_get_sync(dmadev->ddev.dev); > - if (ret < 0) > + if (ret < 0) { > + pm_runtime_put(dmadev->ddev.dev); > return ret; > + } > > ret = stm32_dma_disable_chan(chan); > if (ret < 0) > @@ -1439,8 +1441,10 @@ static int stm32_dma_suspend(struct device *dev) > int id, ret, scr; > > ret = pm_runtime_get_sync(dev); > - if (ret < 0) > + if (ret < 0) { > + pm_runtime_put_sync(dev); why put_sync() > return ret; > + } > > for (id = 0; id < STM32_DMA_MAX_CHANNELS; id++) { > scr = stm32_dma_read(dmadev, STM32_DMA_SCR(id)); > -- > 2.17.1 -- ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel