Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1064959imm; Tue, 3 Jul 2018 05:02:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdtop8/tBH8TkqVPVQZJyXOZde2qL54ouTIxwnHqbNRufJTEH8Fi8HI8WfOoSVVmn+GvAd5 X-Received: by 2002:a17:902:5501:: with SMTP id f1-v6mr2859434pli.108.1530619375421; Tue, 03 Jul 2018 05:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530619375; cv=none; d=google.com; s=arc-20160816; b=AKF9Axuzkh404IHX2TIEYWiYSYjYxewVMfH82ar6ym/0Ac5TDTPG/Hj2vlfREXciSL NfWoXIEifVl1Q1LSsSlExn5tYv7ioJvUmSDw+wXb6M4SDhfFOzLY5EpJweVSwIehtyKW VmS+9HQmd6W8Z5eHS8Q7mCGDWofFi2SX0/K6/eytZpUZ39GA6nfamu7EymgLPW6nTjSt ggFigt0xAiy1pJDaDiaA6W1sRwNUpfrM2UM1+cpFTGhKJgoufp7m0nZ12swXpxVqqmb0 L4fKJamCbqK5A9BmUnTNnTk0TMNGp4uXYvmU6CMdyCp8lkw1dUH0NuyynjIFSdvWAlub kj3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:to:subject :arc-authentication-results; bh=FiIQKbRdJc8HmSM4qdHP9/uFt1I5tvMJZclgWB+RKsA=; b=qVeNUPh/8aehnZMLpWTYUUJGrq7EwDVzCYZZyvizFMOANF4EcExISZ6xdMGhu3kdSH r2I82aqXIeSUnAAbu5b03RqDE+Mzy/S7yrzuBh3k3w+J1jHt5u0y2D+AgBmtBnaH5YyF M4enAmDC0fft0rNLJ7yuOyYrBlkqj9u5TVmQskjd30odzrP7HHLYvEti4QBM8KtrANHV aZga2WuQ9bXkkSKXVuTe3ZTIsMZy1wDqvhmM8Xc3FqwpOeebJTzg5bIjEJ55E1kL6RW+ cv7Izvrk/IcOULU6AQcqwsBsb1rG6VgSFYPE4mJy/PMWvcvMJRJ1bOcwWtcmuWWl9KuR M/Yg== 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 w4-v6si858522pgr.549.2018.07.03.05.02.36; Tue, 03 Jul 2018 05:02:55 -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 S1752889AbeGCMBy (ORCPT + 99 others); Tue, 3 Jul 2018 08:01:54 -0400 Received: from foss.arm.com ([217.140.101.70]:48196 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752533AbeGCMBx (ORCPT ); Tue, 3 Jul 2018 08:01:53 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0DD9F80D; Tue, 3 Jul 2018 05:01:53 -0700 (PDT) Received: from [10.1.206.75] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D01C63F5BA; Tue, 3 Jul 2018 05:01:51 -0700 (PDT) Subject: Re: [PATCH 1/1] mmc: sunxi: Disable irq during pm_suspend To: Stefan Mavrodiev , Ulf Hansson , Maxime Ripard , Chen-Yu Tsai , "open list:MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND..." , "moderated list:ARM/Allwinner sunXi SoC support" , open list References: <1530602925-7714-1-git-send-email-stefan@olimex.com> From: Marc Zyngier Organization: ARM Ltd Message-ID: <627d5e40-651a-062c-aac4-742727b23ddb@arm.com> Date: Tue, 3 Jul 2018 13:01:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1530602925-7714-1-git-send-email-stefan@olimex.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/07/18 08:28, Stefan Mavrodiev wrote: > When mmc host controller enters suspend state, the clocks are > disabled, but irqs are not. For some reason the irqchip emmits Not so much the irqchip, but the device itself. > false interrupts, which causes system lock loop. I'm not sure the interrupts are fake. They are indicative of some state of the HW... > > 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... The clock is off, and yet the thing manages to generate interrupts. Great... > > 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); > > For the record, this patch fixes the boot issues I've observed on my cubietruck. Acked-by: Marc Zyngier Tested-by: Marc Zyngier M. -- Jazz is not dead. It just smells funny...