Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp291158pxv; Wed, 30 Jun 2021 05:54:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8Vb5i0bIXO2sLEVxgSqxL4cXTZJjjC+7m5vfei7IaJfrN6Gra4k/WaGGdvW7qXdhZtmAw X-Received: by 2002:a05:6e02:1183:: with SMTP id y3mr7798491ili.199.1625057643336; Wed, 30 Jun 2021 05:54:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625057643; cv=none; d=google.com; s=arc-20160816; b=WFV/k7B0umh7cQ2N6cd93CQxY0XY0r2J1wVSpKUIq9v3LJv6+4Ygg7RWThnmSPyqzl ua6v3DtXNs4H93s7B461WK3D2F1XYVEFD6eyQkkTOc/twkxsBRNakfIT51jUTd4Pqwo+ D+G0a0UqX0/ScXRI7WdUVc8VIwzqRbDpFPA4xu2uyr5Ntz5dMdy9SqTfRJxzlQOMElNl kv6bB0SFPYaqhxjNOSW27otaspvCSM6M6FNc2vXVr1x+jKKQEmwJCOzzOiKZEopUmhz/ FXeTIOlUccpsvETUeWDktoISClXh5NKbL3gS/L5cgtmnTwsyPBwCB4nET1MQhlia8kOk bA0w== 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:cc:to:subject; bh=pdD2egtzzF+xZmvCNtzBEdMEKzOAADrWJ8AGR/FkPPc=; b=JA3+B3Ei6U9xIClCWkoCef700B0b9R4uFnzoQkEUO6qBgJWa5y4NW6CDPgDcfA6f5T m9UBLz22N6h3Qa0xacgSB+VBvnuM53CL2ilR8TjZ4BY4v/tIVyH7+xhGcc6kvJvL+jF3 ryVWvdabbOWZFMhYwPb5ihxy50UnyWQYuDTRxqvbLs3wtnAmD/SNgI8FXsz78vC5DYdX 20QJso8hs8KCQl6Vcr+bgsKjxhUWfJh2odWHZZgFWXH+hY0RE3m9MPPgMiKk3v51b82g rzKOoR6ZBZq09oWqJHsdd8Crxm+4pS9kAIZ4RnfcdL50+z4bsrTRIWGgSRLqvyi9ueKi 01xg== 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 u8si7316640jat.6.2021.06.30.05.53.51; Wed, 30 Jun 2021 05:54:03 -0700 (PDT) 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 S234804AbhF3Myz (ORCPT + 99 others); Wed, 30 Jun 2021 08:54:55 -0400 Received: from mga06.intel.com ([134.134.136.31]:61720 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234761AbhF3Myy (ORCPT ); Wed, 30 Jun 2021 08:54:54 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10030"; a="269474314" X-IronPort-AV: E=Sophos;i="5.83,312,1616482800"; d="scan'208";a="269474314" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2021 05:52:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,312,1616482800"; d="scan'208";a="419979517" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.79]) ([10.237.72.79]) by fmsmga007.fm.intel.com with ESMTP; 30 Jun 2021 05:52:22 -0700 Subject: Re: [PATCH] mmc: sdhci: Fix warning message when accessing RPMB in HS400 mode To: Al Cooper , linux-kernel@vger.kernel.org Cc: linux-mmc@vger.kernel.org, Ulf Hansson References: <20210624163045.33651-1-alcooperx@gmail.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Wed, 30 Jun 2021 15:52:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210624163045.33651-1-alcooperx@gmail.com> 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 24/06/21 7:30 pm, Al Cooper wrote: > When an eMMC device is being run in HS400 mode, any access to the > RPMB device will cause the error message "mmc1: Invalid UHS-I mode > selected". This happens as a result of tuning being disabled before > RPMB access and then re-enabled after the RPMB access is complete. > When tuning is re-enabled, the system has to switch from HS400 > to HS200 to do the tuning and then back to HS400. As part of > sequence to switch from HS400 to HS200 the system is temporarily > put into HS mode. When switching to HS mode, sdhci_get_preset_value() > is called and does not have support for HS mode and prints the warning > message and returns the preset for SDR12. The fix is to add support > for MMC and SD HS modes to sdhci_get_preset_value(). > > This can be reproduced on any system running eMMC in HS400 mode > (not HS400ES) by using the "mmc" utility to run the following > command: "mmc rpmb read-counter /dev/mmcblk0rpmb". > > Signed-off-by: Al Cooper Acked-by: Adrian Hunter > --- > drivers/mmc/host/sdhci.c | 4 ++++ > drivers/mmc/host/sdhci.h | 1 + > 2 files changed, 5 insertions(+) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index bf238ade1602..6b39126fbf06 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -1812,6 +1812,10 @@ static u16 sdhci_get_preset_value(struct sdhci_host *host) > u16 preset = 0; > > switch (host->timing) { > + case MMC_TIMING_MMC_HS: > + case MMC_TIMING_SD_HS: > + preset = sdhci_readw(host, SDHCI_PRESET_FOR_HIGH_SPEED); > + break; > case MMC_TIMING_UHS_SDR12: > preset = sdhci_readw(host, SDHCI_PRESET_FOR_SDR12); > break; > diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h > index 0770c036e2ff..960fed78529e 100644 > --- a/drivers/mmc/host/sdhci.h > +++ b/drivers/mmc/host/sdhci.h > @@ -253,6 +253,7 @@ > > /* 60-FB reserved */ > > +#define SDHCI_PRESET_FOR_HIGH_SPEED 0x64 > #define SDHCI_PRESET_FOR_SDR12 0x66 > #define SDHCI_PRESET_FOR_SDR25 0x68 > #define SDHCI_PRESET_FOR_SDR50 0x6A > > base-commit: 7426cedc7dad67bf3c71ea6cc29ab7822e1a453f >