Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp550159pxb; Wed, 3 Feb 2021 11:24:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmTXNibFKHPfbqGi5z0EPY5lBX9XyOkDMq0hwf+K8HfZH/G9NbFN5p1ftlY3F5WGtD7OIZ X-Received: by 2002:a17:907:9495:: with SMTP id dm21mr4699615ejc.462.1612380251358; Wed, 03 Feb 2021 11:24:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612380251; cv=none; d=google.com; s=arc-20160816; b=g4cZXNUEuf2/C0BvFcOUUyd5GXkfWWWmvm7U3WIk2XJLoz4yGqP7VZEaJdwEqaioyi kyLNKeYi8IOJiWCw3rZaBKCVTU/YljEphFyvvWsi6ojdKGG8rfDQivGqFiOjaScD8Eyh /gA5a67nLSsJ9UzyGHKjcCj82KWUtrzw/eOypH/hjLnYwqMr8lxlw/woJcicr1sj68FD YbEJUBYT69FPxD+oZeJAEM2FGJUeX0+DSU5zXXRYKUJGvQtO2C0bzor8rZ3jorE/TkrY 4YKUMN9GAceiWEZ9gcYS37VpnruXE+qecMLTH2WqvodCXADz/ZLW3AMl3Y4cOnaA14zZ jpTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=7tEyNsDFsUOsQOKn7EWKqQpneGOuxi158iOcsw14opE=; b=FhV94cOlXdZsuUx0HIgmYCGFOLxm7vJl9sdyF5hoBpXINdNXGPd1YZPNg7/n/dOJaJ ziQmFGTd4LTUy68mi6DZ6XVW8ADJsfP39t6oM/Sulk9fqG31haqvx2Di/Ca9x+GBgp4q 7r0JwF/oxAuTJZPwvkHDr6k/iHWGI2z7VwbDYZCFYojcDuiuVwKi0ZzLqSAHFbW3efeS nAYXsCK4dOoM6fBeig9AB6N7xvKpBed0CsWokx7CEalw+x6joVNjpl+V2wiGCpWHBN7Z 00w2DsDC1hglbQzwd+2UDz11YR+8kBLjjPhvcqc0UqZpZhY3sQ3VG1bYIDbN3eC3KlYl dWBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d24si1995857edy.221.2021.02.03.11.23.45; Wed, 03 Feb 2021 11:24:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232173AbhBCTVE (ORCPT + 99 others); Wed, 3 Feb 2021 14:21:04 -0500 Received: from mga03.intel.com ([134.134.136.65]:40198 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231622AbhBCTVD (ORCPT ); Wed, 3 Feb 2021 14:21:03 -0500 IronPort-SDR: 0Jda1J2EVk3qQcF7cwmYOXhcLAn5MbXpAdYPjme6MLptyMgh+Qt5GuJyWw3KbfKYd8gXDqSPcc YYFnhHabc/6w== X-IronPort-AV: E=McAfee;i="6000,8403,9884"; a="181176650" X-IronPort-AV: E=Sophos;i="5.79,399,1602572400"; d="scan'208";a="181176650" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2021 11:20:12 -0800 IronPort-SDR: HdqJQI8Or5c7cL7CDQnRtDb/LNQsbLA1zj2KlFya/h8u9XnKoLmqKJ4amZFX3iecnT6VAp+QuN udCjEZ96qP8A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,399,1602572400"; d="scan'208";a="406756505" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmsmga004.fm.intel.com with ESMTP; 03 Feb 2021 11:20:10 -0800 From: Cezary Rojewski To: dmaengine@vger.kernel.org Cc: linux-kernel@vger.kernel.org, dan.j.williams@intel.com, andriy.shevchenko@linux.intel.com, vireshk@kernel.org, vkoul@kernel.org, Cezary Rojewski Subject: [PATCH v2] Revert "dmaengine: dw: Enable runtime PM" Date: Wed, 3 Feb 2021 20:19:24 +0100 Message-Id: <20210203191924.15706-1-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 842067940a3e3fc008a60fee388e000219b32632. For some solutions e.g. sound/soc/intel/catpt, DW DMA is part of a compound device (in that very example, domains: ADSP, SSP0, SSP1, DMA0 and DMA1 are part of a single entity) rather than being a standalone one. Driver for said device may enlist DMA to transfer data during suspend or resume sequences. Manipulating RPM explicitly in dw's DMA request and release channel functions causes suspend() to also invoke resume() for the exact same device. Similar situation occurs for resume() sequence. Effectively renders device dysfunctional after first suspend() attempt. Revert the change to address the problem. Fixes: 842067940a3e ("dmaengine: dw: Enable runtime PM") Cc: Andy Shevchenko Signed-off-by: Cezary Rojewski Acked-by: Andy Shevchenko --- Changes v2: - enriched tag area with fixes tag drivers/dma/dw/core.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index 19a23767533a..7ab83fe601ed 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c @@ -982,11 +982,8 @@ static int dwc_alloc_chan_resources(struct dma_chan *chan) dev_vdbg(chan2dev(chan), "%s\n", __func__); - pm_runtime_get_sync(dw->dma.dev); - /* ASSERT: channel is idle */ if (dma_readl(dw, CH_EN) & dwc->mask) { - pm_runtime_put_sync_suspend(dw->dma.dev); dev_dbg(chan2dev(chan), "DMA channel not idle?\n"); return -EIO; } @@ -1003,7 +1000,6 @@ static int dwc_alloc_chan_resources(struct dma_chan *chan) * We need controller-specific data to set up slave transfers. */ if (chan->private && !dw_dma_filter(chan, chan->private)) { - pm_runtime_put_sync_suspend(dw->dma.dev); dev_warn(chan2dev(chan), "Wrong controller-specific data\n"); return -EINVAL; } @@ -1047,8 +1043,6 @@ static void dwc_free_chan_resources(struct dma_chan *chan) if (!dw->in_use) do_dw_dma_off(dw); - pm_runtime_put_sync_suspend(dw->dma.dev); - dev_vdbg(chan2dev(chan), "%s: done\n", __func__); } -- 2.17.1