Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1244064imm; Tue, 3 Jul 2018 07:55:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLpH5Cy+AbwBeKqoBQ5IWfLnS498/GPlzR4k+1KfKDFbyycLdcW+b9d3U4ZvUcI/1vd8a5q X-Received: by 2002:a63:6004:: with SMTP id u4-v6mr25730223pgb.441.1530629754757; Tue, 03 Jul 2018 07:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530629754; cv=none; d=google.com; s=arc-20160816; b=kDSzP0xgndMy5kR1XrEOdT6KinyYtjpXB8pcsfrF30fxK1kSSIkezIq9dv3bBXDHxR iPNYONqtFXgqvTUDZn4wXEkx4MA67yqd4CJE9uZHh/qECU9tvwDALwUjLKMWESRe9QLZ iJUr071qGeLmb+icao2Jv/H0Y2RHarrlusn8XYjFrZnYSCu3jCMW0u8MKrRn+PAq4J33 mKpjSwsMa/IpCLNJ4fg+xXs4XH9i3xDSVio32Bj1EPOfBRCbhx7lD1gl0pkkMOCtwKCy 4njN2i6ZBj42GgCB+txi9dZESkB1qE/aV02BQzlq1rTms8dD74XiUMXgj8p2c63pvV/v yiXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=4Zf0Erh2YcHUY7K5oFJmSKJJfRkBXeOWBZAT5wXJfjI=; b=oNVj2IAPd3SoqrSgwIkDgLed4JxHfq8pyBQ+DnvL/uQmBfHhHYu1ZRnf1osEDNStGm IafNeIdlaSFO1651KHed6YzR+rCtIsyOQbotKpq9ekmxdhcfVxQWzz8X5jmdjKaFdJ8U 2XdtJtd2cdbC95NZuQpm6j8q90LhEIyE6ZY3+jNWRNpvi5CorBHLYFMyJPn6opuAA6tN nS4Q+uTGB3goeEEDW0mpiRdtWzYe+iP0JDBQyip9Z1VhsNgOpDrw7vsQX0ObQFJ+7xRB fK9F96Lw2wbjpQ0+WyQjoRCPTpodq5wVpe4mltg59BHvIW6eJaC6PmP8c5KTHaLJaZK7 K5DA== 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 s71-v6si1318933pfa.367.2018.07.03.07.55.40; Tue, 03 Jul 2018 07:55:54 -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 S932673AbeGCOyz (ORCPT + 99 others); Tue, 3 Jul 2018 10:54:55 -0400 Received: from mail.bootlin.com ([62.4.15.54]:41979 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932410AbeGCOyx (ORCPT ); Tue, 3 Jul 2018 10:54:53 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 557BF20750; Tue, 3 Jul 2018 16:54:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (AAubervilliers-681-1-39-106.w90-88.abo.wanadoo.fr [90.88.158.106]) by mail.bootlin.com (Postfix) with ESMTPSA id 236C5203EC; Tue, 3 Jul 2018 16:54:51 +0200 (CEST) Date: Tue, 3 Jul 2018 16:54:52 +0200 From: Maxime Ripard To: Stefan Mavrodiev Cc: Ulf Hansson , Chen-Yu Tsai , "open list:MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND..." , "moderated list:ARM/Allwinner sunXi SoC support" , open list Subject: Re: [PATCH 1/1] mmc: sunxi: Disable irq during pm_suspend Message-ID: <20180703145452.o2zbchnnvncpvwfj@flea> References: <1530602925-7714-1-git-send-email-stefan@olimex.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wmtnw3hn2w3npscp" Content-Disposition: inline In-Reply-To: <1530602925-7714-1-git-send-email-stefan@olimex.com> User-Agent: NeoMutt/20180622 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --wmtnw3hn2w3npscp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Stefan, On Tue, Jul 03, 2018 at 10:28:43AM +0300, Stefan Mavrodiev wrote: > 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. >=20 > 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... >=20 > This issue apears on eMMC cards, routed on MMC2 slot. The patch is > tested with A20-OLinuXino-MICRO/LIME/LIME2 boards. >=20 > Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support") > Signed-off-by: Stefan Mavrodiev Thanks a lot for figuring this out, I have a (very) minor comment though.. > --- > drivers/mmc/host/sunxi-mmc.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > 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); > =20 > return 0; > } > @@ -1455,6 +1456,7 @@ static int sunxi_mmc_runtime_suspend(struct device = *dev) > struct mmc_host *mmc =3D dev_get_drvdata(dev); > struct sunxi_mmc_host *host =3D mmc_priv(mmc); > =20 > + disable_irq(host->irq); Can you add a comment there stating why we need them in the first place (which is basically what you described) so that it's obvious for anyone editing it. Thanks! Maxime --=20 Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com --wmtnw3hn2w3npscp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE0VqZU19dR2zEVaqr0rTAlCFNr3QFAls7jjsACgkQ0rTAlCFN r3QigQ/+OtJlUCJXwjAg2q8E+32X2TgIge/B/sF+ezKwMCwYqA6uFD1yG9TA5twQ EJVU0aGid1kwEBzj45Z6NHLthhq+TKCY+alRlg+gGkuKMJJyZ1V7/JYMX3vLEJBk D7nwwGeFbz42QsiXsXhxHrsl1KgtS6dBz+o0+3DhT7NmvUWkeTdwYsnWwwk2fCv3 F9KbAIz2reFN9fEJUMY3VoDZ5BC980uqAQKe3gIQv+e120iLtbmFaMRCftMJ+iU9 hLyX0iCNENCCA+ONzwHMnGvIpZUQYWinjTBaWTCQxJUzybJHur8lDGnZ0czVdTsy 6SmFRMiEk5ZvtFNG8GuQ5CFC8/EOl32K1dGr7s74JIV8dJjZFGY5rN7uNhH+82EB 7Cp7Z1IFFmjg/qyI3qkrwgJ9/girVK1Fv/jalnW7MJ03GQeRusd0fqNYrMzIoR7q yqLR5KwO687EnB62t8Qyc72pDHbddDpY3ZYQ81n7dNWsKLE2wIGy3gObkJiO/eNE SBgd9mQu30glDPRq9O73gSYsvAGcH28bBofrezcO4cn9u3s+0chkBPJYL4xVd5ee 8IAUl7YnK3v5P0BLnbL6NReKm7+C1IvPY+nnyzVjn2XsO+p4rPgZRQafJaAP462h FPElvG+y5j6s/s+UWHpEklKcpyMH4JXnvBV4p//qIhs1Uf3+r20= =qg1H -----END PGP SIGNATURE----- --wmtnw3hn2w3npscp--