From patchwork Thu Aug 14 15:23:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 4724511 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 274C09F375 for ; Thu, 14 Aug 2014 15:24:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB9BB200E1 for ; Thu, 14 Aug 2014 15:24:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06EA4201BC for ; Thu, 14 Aug 2014 15:24:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755226AbaHNPYN (ORCPT ); Thu, 14 Aug 2014 11:24:13 -0400 Received: from albert.telenet-ops.be ([195.130.137.90]:36338 "EHLO albert.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755194AbaHNPYM (ORCPT ); Thu, 14 Aug 2014 11:24:12 -0400 Received: from ayla.of.borg ([84.193.84.167]) by albert.telenet-ops.be with bizsmtp id efQA1o00P3cczKo06fQAzp; Thu, 14 Aug 2014 17:24:11 +0200 Received: from geert by ayla.of.borg with local (Exim 4.76) (envelope-from ) id 1XHwss-0001ow-86; Thu, 14 Aug 2014 17:24:10 +0200 From: Geert Uytterhoeven To: Ian Molton , Chris Ball , Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] mmc: tmio: Fix hang during suspend Date: Thu, 14 Aug 2014 17:23:53 +0200 Message-Id: <1408029833-6970-1-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.7.9.5 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 On R-Car Gen 2, the SDHI registers cannot be accessed while the SDHI module clock is disabled. Doing so will cause a lock-up. When suspending, enable the module clock before disabling the SDHI interrupts, and disable the clock again afterwards. This fixes suspend and resume on r8a7791/koelsch. Signed-off-by: Geert Uytterhoeven --- drivers/mmc/host/tmio_mmc_pio.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index faf0924e71cb..83192420a7e3 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -1147,8 +1147,18 @@ int tmio_mmc_host_suspend(struct device *dev) { struct mmc_host *mmc = dev_get_drvdata(dev); struct tmio_mmc_host *host = mmc_priv(mmc); + struct tmio_mmc_data *pdata = host->pdata; + + if (pdata->clk_enable) { + unsigned int f; + pdata->clk_enable(host->pdev, &f); + } tmio_mmc_disable_mmc_irqs(host, TMIO_MASK_ALL); + + if (pdata->clk_disable) + pdata->clk_disable(host->pdev); + return 0; } EXPORT_SYMBOL(tmio_mmc_host_suspend);