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: 135741 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1986945lji; Mon, 14 May 2018 09:21:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpL+SVHq5jpvyCjxzZHS8QdNochWXntrVfCFbPuxXLUI25tLQ/o+hSpc1kqDTpQLAuuKw9o X-Received: by 2002:a17:902:9349:: with SMTP id g9-v6mr10337125plp.375.1526314869894; Mon, 14 May 2018 09:21:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526314869; cv=none; d=google.com; s=arc-20160816; b=oswFkfH+AqUUz+hVwpOTawAyMd6L36o/5WfbyFjxNWbpZMwPDiu6D8WqxsRP/0jTHI sPQPLWZdQx+wJSTB7Z+A1PJFEVOKQ188crC8uBdlpfngSzJzN15EsxO7xSq8nh1GONU9 rTXXAvGkBmlQPwQwIapuqDrQ/uLSJT0qMYkT22nztjGKGbP7c04ggywlNdf/zIp+Y4tI DbwqTDT3A6mavnJ6zmxAp6lPfQYAKDdaCymFn/V3Df4xwEfQtXWQbwuyaNzwJis+uDSO 4SgXD2+Fz+3Q/eLVbu0atp0ITf/uiOKk9rTjF3O05Pvtrl3pI2Vna06uqKiiGAMmbRdi phig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=YXQxSkq4VxPN8xd48JJjkNFWvrP3jl7yjYc0HnnBGhw=; b=eLaOBl2MHPPSrKz+8yTOF/wsLE7ND+hB1caIfHPX6hxKTy0WHmAyOGXO/n9fMFUNEu e7n1y67WLVx+WMxrZ/6LQVcElRD9Ba3Z8RbrZVQFtKTRi3I/uHquDNruHDZalws2+NL8 eYYvMHPK+rwGuvs29cvHchWZtwtbS2rJ/u7YdVyeovhBXt6W69sfYLS7JQ6NWF0GVQ2W hnfPJE8zdpOqTH+tF66km8enpiGrTw8mjh7OiBITIlypF15zinhSD7wt2qrpUou5YyS1 hxpJKjYwPyYRTlQbPisa4/uPmYT2XHy6R8SWzo2r5wgTKu+Xgu7MVN5DmfWedcBhJmgJ 5Heg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CUHuv6I/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8-v6si9963113plm.134.2018.05.14.09.21.09; Mon, 14 May 2018 09:21:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CUHuv6I/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755009AbeENQVF (ORCPT + 29 others); Mon, 14 May 2018 12:21:05 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:51227 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754988AbeENQVB (ORCPT ); Mon, 14 May 2018 12:21:01 -0400 Received: by mail-wm0-f68.google.com with SMTP id j4-v6so14597274wme.1 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=rh+7UgomCkO2+CIalNA2kzjV22J1LoaFvw+vzr2bzjB7l4NUB0p+hZVIdoTr1VHfV/ BKtlu9+OpS7tTyXuLhgzLMmicbPd1vG2mubE4OgBNsDm1/B8L0WPwSyZ5pfWeZtAYTwp sqm1xiNExJNB6Sh8ij2/16Bw8mrghjzMa+el0ZV0yjG8XjO45yjuIp6jTgobrnLn8unu dU/p9yc3PbwfVRYskuEbNeJAdo4i/0piarlYIl2POHOgeO3FfEVppW++sZqgTrTrdcrh GF8wWMl/SyEwH6aDbvgTkOqZJ8Kz1eRlFKOfUGGvox1clgcTVSTkQgG/EMlLVj6TQQgf r7uw== X-Gm-Message-State: ALKqPwcaW0RoVbFmymYyXyFNZsVI4TnmBbLWqX9CmcenSXv8sh9mB5nv gOadwbhW3kZs4OCRiiEImOYyPQ== 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 Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Srinivas Kandagatla 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.16.2 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)) {