From patchwork Tue May 18 07:43:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 12264021 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=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 C0337C433ED for ; Tue, 18 May 2021 07:45:34 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 88BF7611BF for ; Tue, 18 May 2021 07:45:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 88BF7611BF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=atomide.com 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc: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=D7YHv9EaaDepxgvqvkLQEx73b9HLOmnRSZtxlvv8fbg=; b=KE7Fl1vu4PJooIXBRfnp3NvJV3 aOm5wGl1iy9ngi5heHxy3yrir5TiDaOcNA3Q6VlWVTO9m7CrDDnl6Hzwo5bZC4K07FuQDx027BxQq XwpkcPgf6SC1jppYMxC3lYYNMndh0b463QFLN6VRPXzkNmVIWRJ8+RXp0BYHBOJ/WiZviyrYXXs7u sHUvGQhTdfEfqHu95+bBssMpiId89sfv06vQURjBfAyMiMvPHYD8z0WmkBEbIJkK4GrCooiLAxSXc 88qBBJYXD05K++7mpGLcP2ACw598E5FXRKyGirmQosHn56jcg0m4jA1zlxctC37uwmZgGHqBI3nmn yge6Y4aw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liuOa-00HQK9-6M; Tue, 18 May 2021 07:44:04 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liuOW-00HQJw-T2 for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 07:44:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=pV+N5JtJiZdR5bZMOcnn5pG2xZKAxXGKkee7DOMvYTg=; b=Tdcx9tN9BWYiaA9JZuSrxgtttl P8C/y1YVLOSXn/pH9s7kWaXpXhZAtHHzXkHteWXu2EFJRoFr5EYnMSUVp9adJe40lnUhESJ1vhGp7 4hEZphaJ0wBy8RKvIColkCxckVJRkbQSDt4M0H/TAqqC0yWKDmt1ptFM5DesNPRl9m9t0BDfFEWZS 3Wk6J0l4tXnhRVyiUNgODQf4krVFYRmdEibo30wwKfjOYc/dLRB5yU8XTFVP9ui4tZntss8Sv/6vL JC5WmFZG0oVPKaTOJnIXI0Hoi+mEniI2caJHbJYKndIkAaA9kfNN6XhmldN5tNQFw5ddMELGwnaGR e9x6qwDA==; Received: from muru.com ([72.249.23.125]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liuOQ-00EQSb-03 for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 07:43:59 +0000 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id A67E580F5; Tue, 18 May 2021 07:43:56 +0000 (UTC) From: Tony Lindgren To: Vinod Koul Cc: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, Aaro Koskinen , Adam Ford , Andreas Kemnade , Peter Ujfalusi Subject: [PATCH] dmaengine: ti: omap-dma: Skip pointless cpu_pm context restore on errors Date: Tue, 18 May 2021 10:43:47 +0300 Message-Id: <20210518074347.16908-1-tony@atomide.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_004354_098665_18421778 X-CRM114-Status: GOOD ( 11.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There's no need to restore DMA context on CPU_CLUSTER_PM_ENTER_FAILED as the DMA context won't be lost on errors. Note that this does not cause invalid context restore as we already check for busy DMA with omap_dma_busy() in CPU_CLUSTER_PM_ENTER, and block any deeper idle states for the SoC by returning NOTIFY_BAD if busy. If other drivers block deeper idle states with cpu_pm, we now just do a pointless restore, but only if dma was not busy on CPU_CLUSTER_PM_ENTER. Let's update the CPU_CLUSTER_PM_ENTER_FAILED handling for correctness, and add a comment. Cc: Aaro Koskinen Cc: Adam Ford Cc: Andreas Kemnade Cc: Peter Ujfalusi Signed-off-by: Tony Lindgren Acked-by: Peter Ujfalusi --- drivers/dma/ti/omap-dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.c --- a/drivers/dma/ti/omap-dma.c +++ b/drivers/dma/ti/omap-dma.c @@ -1608,7 +1608,8 @@ static int omap_dma_context_notifier(struct notifier_block *nb, return NOTIFY_BAD; omap_dma_context_save(od); break; - case CPU_CLUSTER_PM_ENTER_FAILED: + case CPU_CLUSTER_PM_ENTER_FAILED: /* No need to restore context */ + break; case CPU_CLUSTER_PM_EXIT: omap_dma_context_restore(od); break;