Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp839374imm; Tue, 3 Jul 2018 00:31:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ44jHJXX3ZftAr+B6OeFEgibPDn275yFYP8rbLyNurYaIb//zjoq9aHqnVlJqHbsawXzs/ X-Received: by 2002:a17:902:3f81:: with SMTP id a1-v6mr28873142pld.29.1530603097155; Tue, 03 Jul 2018 00:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530603097; cv=none; d=google.com; s=arc-20160816; b=fOEaq8wJ1vJzBhF4DHxGiTC5l1lwMEzieenPtw/oymZm2+dlD2CkuTgHGAiXyuLX0S UtMOhQnwlhC7qCswWEKmlZDFLbadZfk+sNCb6dRkTwLMg7cXDH7sLfNFriQhUkT3/x2V CLEdO7bVIRnQRzz+6/eh5MoyDyL1/u5VdMmxMASTp3t7b4p2uN3QsdIm2xSRTz122Doi 1nUCKdrnyFgAnp1mCmT+aSlHP+lkDJDDO7AAoFUTOjDIIrBLGt8VusjZBSgkEoxYiOpq QV3+wOgKQrUQ+k6/9klG4IJQoovK2EEfJQGdDwPHk6jOBTK/Nlm9tkulO3MAbACoH62F hRNQ== 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 :arc-authentication-results; bh=z7k9ii6QmRNcWqUyNt/JMCIoemtqcXBJlvXaXpjwIQc=; b=bsOF8cUAuvunfZOuLBQTww3RAdhJXasbkBkvL70z4B88HevroChkSffI87Zp5CX7mG VD/g+MIUaew7GPQG7ojyyoQpLtR1sTfWaaJttTt7YJis1ll8rLH3CMy3MTXP0/M3bEF3 8mWgKtcuZ2YcdDgTRjMLb7Qyn9t00CmB3FaCL4NuA0eQT2XLlJqPSrqXsHhX2WJJ1koG rSz1+72JNP58Mx/U1YaDGIODD77ozJvzPGRhfXWlrLTJF1FIqNKkv3rgJW31nlh9ek3a 63+6++9WiWqMESNyVwCoJ6cG3DmuREdGJq+EbPCx7PQrxrPQbZv6eX3lrCxxVT+vWsFy DHpQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12-v6si448594pgt.384.2018.07.03.00.31.22; Tue, 03 Jul 2018 00:31:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932263AbeGCH3P (ORCPT + 99 others); Tue, 3 Jul 2018 03:29:15 -0400 Received: from olimex.com ([184.105.72.32]:53984 "EHLO olimex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753591AbeGCH3N (ORCPT ); Tue, 3 Jul 2018 03:29:13 -0400 Received: from localhost.localdomain ([195.238.85.143]) by olimex.com with ESMTPSA (ECDHE-RSA-AES128-SHA256:TLSv1.2:Kx=ECDH:Au=RSA:Enc=AES(128):Mac=SHA256) (SMTP-AUTH username stefan@olimex.com, mechanism PLAIN) for ; Tue, 3 Jul 2018 00:29:12 -0700 From: Stefan Mavrodiev To: Ulf Hansson , Maxime Ripard , Chen-Yu Tsai , linux-mmc@vger.kernel.org (open list:MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND...), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Allwinner sunXi SoC support), linux-kernel@vger.kernel.org (open list) Cc: Stefan Mavrodiev Subject: [PATCH 1/1] mmc: sunxi: Disable irq during pm_suspend Date: Tue, 3 Jul 2018 10:28:43 +0300 Message-Id: <1530602925-7714-1-git-send-email-stefan@olimex.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When mmc host controller enters suspend state, the clocks are disabled, but irqs are not. For some reason the irqchip emmits false interrupts, which causes system lock loop. Debug log is: ... sunxi-mmc 1c11000.mmc: setting clk to 52000000, rounded 51200000 sunxi-mmc 1c11000.mmc: enabling the clock sunxi-mmc 1c11000.mmc: cmd 13(8000014d) arg 10000 ie 0x0000bbc6 len 0 sunxi-mmc 1c11000.mmc: irq: rq (ptrval) mi 00000004 idi 00000000 sunxi-mmc 1c11000.mmc: cmd 6(80000146) arg 3210101 ie 0x0000bbc6 len 0 sunxi-mmc 1c11000.mmc: irq: rq (ptrval) mi 00000004 idi 00000000 sunxi-mmc 1c11000.mmc: cmd 13(8000014d) arg 10000 ie 0x0000bbc6 len 0 sunxi-mmc 1c11000.mmc: irq: rq (ptrval) mi 00000004 idi 00000000 mmc1: new DDR MMC card at address 0001 mmcblk1: mmc1:0001 AGND3R 14.6 GiB mmcblk1boot0: mmc1:0001 AGND3R partition 1 4.00 MiB mmcblk1boot1: mmc1:0001 AGND3R partition 2 4.00 MiB sunxi-mmc 1c11000.mmc: cmd 18(80003352) arg 0 ie 0x0000fbc2 len 409 sunxi-mmc 1c11000.mmc: irq: rq (ptrval) mi 00004000 idi 00000002 mmcblk1: p1 sunxi-mmc 1c11000.mmc: irq: rq (null) mi 00000000 idi 00000000 sunxi-mmc 1c11000.mmc: irq: rq (null) mi 00000000 idi 00000000 sunxi-mmc 1c11000.mmc: irq: rq (null) mi 00000000 idi 00000000 sunxi-mmc 1c11000.mmc: irq: rq (null) mi 00000000 idi 00000000 and so on... This issue apears on eMMC cards, routed on MMC2 slot. The patch is tested with A20-OLinuXino-MICRO/LIME/LIME2 boards. Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support") Signed-off-by: Stefan Mavrodiev --- drivers/mmc/host/sunxi-mmc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index e747259..acae7a8 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -1446,6 +1446,7 @@ static int sunxi_mmc_runtime_resume(struct device *dev) sunxi_mmc_init_host(host); sunxi_mmc_set_bus_width(host, mmc->ios.bus_width); sunxi_mmc_set_clk(host, &mmc->ios); + enable_irq(host->irq); return 0; } @@ -1455,6 +1456,7 @@ static int sunxi_mmc_runtime_suspend(struct device *dev) struct mmc_host *mmc = dev_get_drvdata(dev); struct sunxi_mmc_host *host = mmc_priv(mmc); + disable_irq(host->irq); sunxi_mmc_reset_host(host); sunxi_mmc_disable(host); -- 2.7.4