Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4132158ybi; Mon, 15 Jul 2019 04:22:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZMjJ41A+urB4mWi1qp2b4Ka71NqQ4iqd1+e1h/GZGd3Ug3QdiOdXP3hPKMMPX3NZYNbJS X-Received: by 2002:a17:90a:b115:: with SMTP id z21mr28719736pjq.64.1563189778046; Mon, 15 Jul 2019 04:22:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563189778; cv=none; d=google.com; s=arc-20160816; b=QBg5a+TJ71mdzatkbNb1YE+ggxxL/30BPI4PoZiEiCWEMYxDZgleXRNhLS1TGwqwUx EyYYbKChWCqr1N9Zkx7ggTGSntYWW2pcsnfs/eTusqM1N6rMBoDxrfGH1+d4U+lnkrNN IKQ/sxeHuibcxgYTCHnlt8NSr+kEizgOU/djrrId1Wbqp5yYs8pAuueWIhCd4VCuLd0n bK9gWlQyKEBBeal+Zpe4BiO1G3eus9Ved9/XluE1bN0FEQvXZlO87+G8C9lq1Hy91wpX Q1+gFZQRBCP7igjsz7X9frwDOEfylzZvs0Rpu9QF9OElZks70yOXPajXPdu8Y3Vixx8O xyMQ== 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:cc:to:subject; bh=ltUyhxG2qqMY4DBYuRqLgGYWanIrY2lIbvFp5ipt/B0=; b=xZOz6FOmAEsHbwFULsHpc9J7H5LV4Eysm6dP74+lguB+34/NwCtZQy0r0dfUCKMvd7 kle6uDzQxDy/Qleq2c3LnabExWGKswOAePfViwvIfaX7LYYnQHI5AgBdQVsuSIMtg9ff aCzSiXUyUGtrI6jvxhN3l5iI5W+rp03DZrUI2hm1v8g6fz6KmX+++nLzVZOroIHu0BR7 zo39odiMUNHSTWE6au5J0mpjlVo/l0P1K+ranvpPBZpRMAH6qutKXeg4OJ8IiMWnK2Fh HZ+xO3QB3R4ZUnMfH6ivwBgVirInfw6PkLlWChmnQtU6fVGaain0cjSK/3ChV2hg43AG qVIQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f89si16629236pje.50.2019.07.15.04.22.41; Mon, 15 Jul 2019 04:22:58 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729799AbfGOLUx (ORCPT + 99 others); Mon, 15 Jul 2019 07:20:53 -0400 Received: from mga14.intel.com ([192.55.52.115]:65163 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729725AbfGOLUw (ORCPT ); Mon, 15 Jul 2019 07:20:52 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jul 2019 04:20:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,493,1557212400"; d="scan'208";a="169584028" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.122]) ([10.237.72.122]) by orsmga003.jf.intel.com with ESMTP; 15 Jul 2019 04:20:49 -0700 Subject: Re: [PATCH] mmc: host: sdhci: Fix the incorrect soft reset operation when runtime resuming To: Baolin Wang , ulf.hansson@linaro.org Cc: zhang.lyra@gmail.com, orsonzhai@gmail.com, linus.walleij@linaro.org, vincent.guittot@linaro.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org References: <4c5812f54e5094fa54a85bdc86687a523df254b3.1563184923.git.baolin.wang@linaro.org> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Mon, 15 Jul 2019 14:19:35 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <4c5812f54e5094fa54a85bdc86687a523df254b3.1563184923.git.baolin.wang@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/07/19 1:58 PM, Baolin Wang wrote: > In sdhci_runtime_resume_host() function, we will always do software reset > for all, but according to the specification, we should issue reset command > and reinitialize the SD/eMMC card. Where does it say that? > However, we only do reinitialize the > SD/eMMC card when the SD/eMMC card are power down during runtime suspend. > > Thus for those platforms that do not power down the SD/eMMC card during > runtime suspend, we should not do software reset for all. > To fix this > issue, we can add one condition to validate the MMC_CAP_AGGRESSIVE_PM > to decide if we can do software reset for all or just reset command > and data lines. > > Signed-off-by: Baolin Wang > --- > drivers/mmc/host/sdhci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index 9715834..470c5e0 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -3333,7 +3333,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) > host->ops->enable_dma(host); > } > > - sdhci_init(host, 0); > + sdhci_init(host, !(mmc->caps & MMC_CAP_AGGRESSIVE_PM)); We have done a full reset for a long time, so it would be surprising to need to change it. What problem is it causing? > > if (mmc->ios.power_mode != MMC_POWER_UNDEFINED && > mmc->ios.power_mode != MMC_POWER_OFF) { >