From patchwork Wed Nov 19 15:15:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 5338021 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 61B63C11AC for ; Wed, 19 Nov 2014 15:15:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 92204201FE for ; Wed, 19 Nov 2014 15:15:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 51DB320172 for ; Wed, 19 Nov 2014 15:15:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754998AbaKSPPv (ORCPT ); Wed, 19 Nov 2014 10:15:51 -0500 Received: from xavier.telenet-ops.be ([195.130.132.52]:50024 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754153AbaKSPPv (ORCPT ); Wed, 19 Nov 2014 10:15:51 -0500 Received: from ayla.of.borg ([84.193.84.167]) by xavier.telenet-ops.be with bizsmtp id HTFn1p00J3cczKo01TFnE5; Wed, 19 Nov 2014 16:15:47 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1Xr6yw-0002ls-TO; Wed, 19 Nov 2014 16:15:46 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1Xr6yx-0007ir-Rr; Wed, 19 Nov 2014 16:15:47 +0100 From: Geert Uytterhoeven To: Vinod Koul , Dan Williams Cc: dmaengine@vger.kernel.org, linux-pm@vger.kernel.org, linux-sh@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] dmaengine: shdma: Runtime-resume device in .shutdown() Date: Wed, 19 Nov 2014 16:15:46 +0100 Message-Id: <1416410146-29652-1-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP During system reboot, the sh-dma-engine device may be runtime-suspended, causing a crash: Unhandled fault: imprecise external abort (0x1406) at 0x0002c02c Internal error: : 1406 [#1] SMP ARM ... PC is at sh_dmae_ctl_stop+0x28/0x64 LR is at sh_dmae_ctl_stop+0x24/0x64 If the sh-dma-engine is runtime-suspended, its module clock is turned off, and its registers cannot be accessed. Runtime-resume the device in the driver's .shutdown() callback to fix this. Signed-off-by: Geert Uytterhoeven --- drivers/dma/sh/shdmac.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c index b65317c6ea4e722c..a13c6ba7468f12a6 100644 --- a/drivers/dma/sh/shdmac.c +++ b/drivers/dma/sh/shdmac.c @@ -585,7 +585,10 @@ static void sh_dmae_chan_remove(struct sh_dmae_device *shdev) static void sh_dmae_shutdown(struct platform_device *pdev) { struct sh_dmae_device *shdev = platform_get_drvdata(pdev); + + pm_runtime_get_sync(&pdev->dev); sh_dmae_ctl_stop(shdev); + pm_runtime_put(&pdev->dev); } static int sh_dmae_runtime_suspend(struct device *dev)