Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3324099pxu; Sun, 29 Nov 2020 23:40:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJydGG0HRY7ANN7+ZzEANF7K694ILR8c1RJFXxzyT5eKF/7KNxlb++Dw6bSAHW2gXykI7iAO X-Received: by 2002:a17:906:68d1:: with SMTP id y17mr7923424ejr.447.1606722038440; Sun, 29 Nov 2020 23:40:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606722038; cv=none; d=google.com; s=arc-20160816; b=UUACaFgQoqAEi82luJ1EwmECRzureYxPcjl54FHoImJnttZnBxDv8C2RAdcDp4/kXR RPu8hz9pkNc7/plTIP3DZ9GSoiQVSDxGqekIX0IVNE7GWvNahspohUv3AiETMD/EFcGj vfPV7kjIzc8pqb+4vSIjSxhgdOecBdKCmJSYExjo2/PT9EvvDjNN5pEQkmjelo+3dSTQ RtynnCGuH4RM31EmfyDtexwJeKaUf2fEkNlC3OQqpwpDGTB8XLfXPYrqGa81SLRDuhg/ jU9txIbzvgycJ4mhrN05Jo4iythWyIkVni5FLg+8FKaW4TruB5wicWL8tB7rI/zArXrt g1EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:to:subject:ironport-sdr:ironport-sdr; bh=Ymwv6HmY6aFLTeNWPkoTyTdoIvDeCnj4Rb5g1ajxSxU=; b=rND7soZY0fSZDBeDwlrLflybxXBBRuIN4haVNwPLAtaze0fYjLt62owGkSvGwy7Q06 I4yockT5e1JuvkqR/mhSjDupcH66odT9Nhe5YyT7koU9JYcSz1iFV23SPgl/yPZq6b7M dfseps7ivrQS3IO9f8Fm1do5GaU4rizqbqU/TOLqexr8/F2PdkUOTRIsxQ184I4vuYYm kCZhBAQU/m59p7ydey8/Ske6yvS5f0DHBjaiGH/UFIAnKimtB7Oe46Db2yBs/HRTxptl J4I2ytaavoNEeVGG0miPZoNhlDrfkgK4XLwyf3QOhm3d0mELinX++3UPKD5sy+iv/GjU 5gXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id u21si176983edx.350.2020.11.29.23.40.13; Sun, 29 Nov 2020 23:40:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726929AbgK3Hie (ORCPT + 99 others); Mon, 30 Nov 2020 02:38:34 -0500 Received: from mga07.intel.com ([134.134.136.100]:22249 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726628AbgK3Hid (ORCPT ); Mon, 30 Nov 2020 02:38:33 -0500 IronPort-SDR: t9KOsXKynBOkTvPxLmsMrfKI9PKIELAU2rq6eSxAr/EtioAgbD8DZnxCir4e5oWC6VPiWaPFsA xrpaN1QdF6qg== X-IronPort-AV: E=McAfee;i="6000,8403,9820"; a="236720095" X-IronPort-AV: E=Sophos;i="5.78,381,1599548400"; d="scan'208";a="236720095" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2020 23:37:50 -0800 IronPort-SDR: Y7AQECkXbJHbbM3cZvKpb2N7C+ifUkwH3siFUpbYjl478HQJC8Xopmgs7JimNCc9hbtsde/4KK 01ozh9YOeNWQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,381,1599548400"; d="scan'208";a="329483080" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.94]) ([10.237.72.94]) by orsmga003.jf.intel.com with ESMTP; 29 Nov 2020 23:37:47 -0800 Subject: Re: [RFC PATCH v3.1 12/27] mmc: sdhci-uhs2: add reset function To: AKASHI Takahiro , ulf.hansson@linaro.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, ben.chuang@genesyslogic.com.tw, greg.tu@genesyslogic.com.tw References: <20201106022726.19831-1-takahiro.akashi@linaro.org> <20201106022726.19831-13-takahiro.akashi@linaro.org> <20201130062016.GC48535@laputa> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <073c9cc8-24bb-5efc-48bc-cc66f5024923@intel.com> Date: Mon, 30 Nov 2020 09:37:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201130062016.GC48535@laputa> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/11/20 8:20 am, AKASHI Takahiro wrote: > On Thu, Nov 26, 2020 at 10:16:11AM +0200, Adrian Hunter wrote: >> On 6/11/20 4:27 am, AKASHI Takahiro wrote: >>> Sdhci_uhs2_reset() does a UHS-II specific reset operation. >>> >>> Signed-off-by: Ben Chuang >>> Signed-off-by: AKASHI Takahiro >>> --- >>> drivers/mmc/host/sdhci-uhs2.c | 49 +++++++++++++++++++++++++++++++++++ >>> drivers/mmc/host/sdhci-uhs2.h | 1 + >>> drivers/mmc/host/sdhci.c | 3 ++- >>> drivers/mmc/host/sdhci.h | 1 + >>> 4 files changed, 53 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c >>> index 08905ed081fb..e2b9743fe17d 100644 >>> --- a/drivers/mmc/host/sdhci-uhs2.c >>> +++ b/drivers/mmc/host/sdhci-uhs2.c >>> @@ -10,6 +10,7 @@ >>> * Author: AKASHI Takahiro >>> */ >>> >>> +#include >>> #include >>> >>> #include "sdhci.h" >>> @@ -49,6 +50,54 @@ void sdhci_uhs2_dump_regs(struct sdhci_host *host) >>> } >>> EXPORT_SYMBOL_GPL(sdhci_uhs2_dump_regs); >>> >>> +/*****************************************************************************\ >>> + * * >>> + * Low level functions * >>> + * * >>> +\*****************************************************************************/ >>> + >>> +/** >>> + * sdhci_uhs2_reset - invoke SW reset >>> + * @host: SDHCI host >>> + * @mask: Control mask >>> + * >>> + * Invoke SW reset, depending on a bit in @mask and wait for completion. >>> + */ >>> +void sdhci_uhs2_reset(struct sdhci_host *host, u16 mask) >>> +{ >>> + unsigned long timeout; >>> + >>> + if (!(host->mmc->caps & MMC_CAP_UHS2)) >> >> Please make a helper so this can be like: >> >> if (!sdhci_uhs2_mode(host)) >> >> The capability will be always present for hosts that support UHS2, but not >> all cards support UHS2 mode. I suggest just adding a bool to struct >> sdhci_host to keep track of when the host is in UHS2 mode. > > Given the fact that UHS-2 host may (potentially) support a topology like > a ring, this kind of status should be attributed to a card (structure) > rather than a host. It is very unlikely we would ever need to support that, so don't let it make things more complicated.