From patchwork Mon May 14 16:18:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10398885 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 974576038F for ; Mon, 14 May 2018 16:33:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81F602823E for ; Mon, 14 May 2018 16:33:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 767A628399; Mon, 14 May 2018 16:33:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0914D2823E for ; Mon, 14 May 2018 16:32:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=YTTLmQIEMz/BE7fIU/8hUhLcA6PjfPkuXOUryNWbGRY=; b=etQ 2Yt186QHBXIEBCag7cPkXixF5ZHlbqdyOENVYzTnHgBS2bIxd98JmicRe8UUBL6Q9iIEmhefpnHHU n/SDS59j4wMGNghtwWeOYL41tbVVQ2f2Afr0VvPKu2iUoXPsY+JHOIhMMymYUbkGirxud5wOsoCNH tB4xm4MQALPyT3f1WHVKHKjyR22gKtjePeTZZEd7DXDxGtz0pYNPcZEWPm8WV+rnnCgMgeX4YycUv +vZNrTOU2tPA7PWPNIG7xuAbdNneeHIxaH2QqUBR4sNQivn84CHRqOWfZ5QG0CDdzm+iPJJdc284j s4mYFmv5OFiG14mPlTRRW48E09Kc1Kg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIGP6-0005FB-Bg; Mon, 14 May 2018 16:32:52 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIGDp-0003nw-0H for linux-arm-kernel@lists.infradead.org; Mon, 14 May 2018 16:21:27 +0000 Received: by mail-wm0-x244.google.com with SMTP id f6-v6so14564374wmc.4 for ; Mon, 14 May 2018 09:21:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=YXQxSkq4VxPN8xd48JJjkNFWvrP3jl7yjYc0HnnBGhw=; b=CUHuv6I/5e+oDbsAwvs8nrETojjkGlb2Cj6pLBS0+ybL0uHPn3Mxd58S2lJ1VPLcYU j7//M6Lh1MITFvHgdQQI/1+J+S7N413i37lZCNiTq0xcDFwIJ2OT0haFk01tmqt/zpv3 pmJZIA0CIl5x0ImBQHpk2tOXgiFScKobmjJ1U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YXQxSkq4VxPN8xd48JJjkNFWvrP3jl7yjYc0HnnBGhw=; b=ntZfEevkEAbsEbe6pE6DLa3YFlgNnjL4nr3jq89jukSk97jZuL/oR8MRgv3vONCR2l wbMIIjBCFSrdB2X83PTcbz2W84r0ZOhRJghHDRgazoVXIIoyBfD2h0grutlPAQStLYHw 8pTbCVGGKWhXBhX1U62ccdM4/c8Q3zHfGLVukRyQVJ0O7qD1zOLH/S88PXh3RmUVn+TP UOcrf76nnMKxkCmQdyri/xLL/QPv9SzR9RS3x0jYua0WbbLqJv0bZ/NbWOVSZBSTxHOz yyJHJpLOY4eUrDJYnNbOyNU1TIkbV3mKFzQwZ2fsbt5nyW1wUooR8mPrKd45C7lAoFWd 6uqg== X-Gm-Message-State: ALKqPwcCH+q1KgIFqHpaexBst1HUS5w7ssxD3BdqshzsT/aAro4X1CTU c6FETL2uiVnXgSmCZ6LK0DPRmA== X-Google-Smtp-Source: AB8JxZp9y9Z+GpuYMRBPgfy5XRzy6UlDKh0t7qqBXAM7Hr+8+mpVseKnOwMZXUgB2LKMntqfxGFclw== X-Received: by 2002:a1c:af8a:: with SMTP id y132-v6mr5827941wme.107.1526314859424; Mon, 14 May 2018 09:20:59 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id p7-v6sm11231468wrj.85.2018.05.14.09.20.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 May 2018 09:20:58 -0700 (PDT) From: Srinivas Kandagatla To: agross@codeaurora.org, vkoul@kernel.org, dmaengine@vger.kernel.org Subject: [PATCH] dmaengine: qcom: bam_dma: check if the runtime pm enabled Date: Mon, 14 May 2018 17:18:52 +0100 Message-Id: <20180514161852.9620-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180514_092113_088697_2BFD19EF X-CRM114-Status: GOOD ( 12.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, Srinivas Kandagatla , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Disabling pm runtime at probe is not sufficient to get BAM working on remotely controller instances. pm_runtime_get_sync() would return -EACCES in such cases. So check if runtime pm is enabled before returning error from bam functions. Fixes: 5b4a68952a89 ("dmaengine: qcom: bam_dma: disable runtime pm on remote controlled") Signed-off-by: Srinivas Kandagatla --- drivers/dma/qcom/bam_dma.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index d29275b97e84..5f4babebc508 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -540,7 +540,7 @@ static void bam_free_chan(struct dma_chan *chan) int ret; ret = pm_runtime_get_sync(bdev->dev); - if (ret < 0) + if (pm_runtime_enabled(bdev->dev) && ret < 0) return; vchan_free_chan_resources(to_virt_chan(chan)); @@ -721,7 +721,7 @@ static int bam_pause(struct dma_chan *chan) int ret; ret = pm_runtime_get_sync(bdev->dev); - if (ret < 0) + if (pm_runtime_enabled(bdev->dev) && ret < 0) return ret; spin_lock_irqsave(&bchan->vc.lock, flag); @@ -747,7 +747,7 @@ static int bam_resume(struct dma_chan *chan) int ret; ret = pm_runtime_get_sync(bdev->dev); - if (ret < 0) + if (pm_runtime_enabled(bdev->dev) && ret < 0) return ret; spin_lock_irqsave(&bchan->vc.lock, flag); @@ -853,7 +853,7 @@ static irqreturn_t bam_dma_irq(int irq, void *data) tasklet_schedule(&bdev->task); ret = pm_runtime_get_sync(bdev->dev); - if (ret < 0) + if (pm_runtime_enabled(bdev->dev) && ret < 0) return ret; if (srcs & BAM_IRQ) { @@ -970,7 +970,7 @@ static void bam_start_dma(struct bam_chan *bchan) return; ret = pm_runtime_get_sync(bdev->dev); - if (ret < 0) + if (pm_runtime_enabled(bdev->dev) && ret < 0) return; while (vd && !IS_BUSY(bchan)) {