Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1893727rdb; Tue, 3 Oct 2023 04:37:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErY1qDoYGmVI7FEG+ltpJTIDOY9S1wxumvzWe/o20cco1/Gcyj6AyTig28klVaDduUjcof X-Received: by 2002:a17:902:c942:b0:1c7:4ab6:b3b7 with SMTP id i2-20020a170902c94200b001c74ab6b3b7mr12101935pla.67.1696333062681; Tue, 03 Oct 2023 04:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696333062; cv=none; d=google.com; s=arc-20160816; b=VkrWnitdkeSzgAFqYg0HTf/ALNrJSfq3ovrXr2GB2grHlkn4r6I1b43JBAQPdcCV4x ysasnPTcSb2C9gkuD0OynOHfAnI3fFPm1PWXK8G7q3CDQM3Gwh0WEouuSm0qgNzbicVM 0ymD6HSrlYm7TI2T1QwUP6EvZHLn6XTyopsIK5tLXd79sJvH7ApFDTAaiPJGD890+QqX EZ7BldKpX4N/CkFZtQTf+Cpriik/ArktVAmCTWcj6ce5AjKMcKPuqT/MT6DShotqtSBA wROCE/p5iNiNn0Wv33DAlj5DuvFXGPOUw6CoLVpNWGpyoTroDvdAwEW8NNmjXF7qW6Em SevA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=O5YFDqYwjBKE17/ucr+aXXJCH1DIBmc0La7cd4e5QDg=; fh=Y2D7wYOM6mrNmIoR6t5MwbOLdjOdAPxiljKT7DQUnWw=; b=Pa/EZ8HRM91KFJqWk064hfSeDikaAbAtwUvQyI2eitNYvSrU8XBDIt9qvhLWYl3aSU vD00Kfwt3vaPu1hWoqTFgvWsMRw3chxnCKPKBzgWkrBKj6NIxUZzUFMbElRjoKTntRly Mks8fK7lEX4N5LeTCIFx6onNSqDVWweTqhlu9CtagPacEZM5NII51hWqPa6Mf1d2fuXt 3ZOlIRYO8/Alyp+ZU/xO5emcasiKsYfFIOZE55zRcGCAtj5U6oauv0NdavW+n+cTzuF3 YRp7CEtSDR+jXd40bDooJD+7T4vAKrvExz4FgbaISey9DKp86WT/BoDVlLjlE+bY89i9 hqTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Rx2ObdGE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id lb5-20020a170902fa4500b001c3e8a6748asi1088912plb.644.2023.10.03.04.37.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 04:37:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Rx2ObdGE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 23F3F80226B7; Tue, 3 Oct 2023 04:37:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240493AbjJCLhe (ORCPT + 99 others); Tue, 3 Oct 2023 07:37:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231472AbjJCLhd (ORCPT ); Tue, 3 Oct 2023 07:37:33 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1AEC8E; Tue, 3 Oct 2023 04:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696333050; x=1727869050; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=C32ByUo447YYv+RlPWVC6MinO3qaNAkiZax9oAqDLHg=; b=Rx2ObdGErZQg+C/yarFH08mmd+74aaPDSx7eLzC7SAv9MX4XGt/eMZSv HGgK5TdAiwuJTsUphRnkER63yY7PzuYKNd7nyffwv8y5yY+VW4+9S5XrC UmqVT86cIdDd07jute3yvHoEQIDOOAlZTGvtJs/kCga3SrhSsc8V9pmlq gxrcgHr5APmdQugHVRETwwXL/nUdhiOP377YXkZ7OUT7WV8HJG9CoZwTH o/yDbS499kPLAt4HL+c8VXmTPhOhT2GcxRP5jW3mbtTQLa/F1aAvQ0MPB 3Hh4oB+nQIXCauQpDZpv+KjzgmQfdjEziYmEI1e/i48H+V41kU+0Gklvy Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="413765305" X-IronPort-AV: E=Sophos;i="6.03,197,1694761200"; d="scan'208";a="413765305" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 04:37:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="997984639" X-IronPort-AV: E=Sophos;i="6.03,197,1694761200"; d="scan'208";a="997984639" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.56.99]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 04:37:27 -0700 Message-ID: Date: Tue, 3 Oct 2023 14:37:22 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V12 10/23] mmc: sdhci-uhs2: add reset function and uhs2_mode function To: Ulf Hansson , Victor Shih Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, benchuanggli@gmail.com, HL.Liu@genesyslogic.com.tw, Greg.tu@genesyslogic.com.tw, takahiro.akashi@linaro.org, dlunev@chromium.org, Ben Chuang , Victor Shih References: <20230915094351.11120-1-victorshihgli@gmail.com> <20230915094351.11120-11-victorshihgli@gmail.com> Content-Language: en-US From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 03 Oct 2023 04:37:40 -0700 (PDT) On 3/10/23 13:30, Ulf Hansson wrote: > On Fri, 15 Sept 2023 at 11:44, Victor Shih wrote: >> >> From: Victor Shih >> >> Sdhci_uhs2_reset() does a UHS-II specific reset operation. >> >> Signed-off-by: Ben Chuang >> Signed-off-by: AKASHI Takahiro >> Signed-off-by: Victor Shih >> Acked-by: Adrian Hunter >> --- >> >> Updates in V8: >> - Adjust the position of matching brackets. >> >> Updates in V6: >> - Remove unnecessary functions and simplify code. >> >> --- >> >> drivers/mmc/host/sdhci-uhs2.c | 45 +++++++++++++++++++++++++++++++++++ >> drivers/mmc/host/sdhci-uhs2.h | 2 ++ >> 2 files changed, 47 insertions(+) >> >> diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c >> index e339821d3504..dfc80a7f1bad 100644 >> --- a/drivers/mmc/host/sdhci-uhs2.c >> +++ b/drivers/mmc/host/sdhci-uhs2.c >> @@ -10,7 +10,9 @@ >> * Author: AKASHI Takahiro >> */ >> >> +#include >> #include >> +#include >> >> #include "sdhci.h" >> #include "sdhci-uhs2.h" >> @@ -49,6 +51,49 @@ void sdhci_uhs2_dump_regs(struct sdhci_host *host) >> } >> EXPORT_SYMBOL_GPL(sdhci_uhs2_dump_regs); >> >> +/*****************************************************************************\ >> + * * >> + * Low level functions * >> + * * >> +\*****************************************************************************/ >> + >> +bool sdhci_uhs2_mode(struct sdhci_host *host) >> +{ >> + return host->mmc->flags & MMC_UHS2_SUPPORT; > > The MMC_UHS2_SUPPORT bit looks redundant to me. Instead, I think we > should be using mmc->ios.timings, which already indicates whether we > are using UHS2 (MMC_TIMING_UHS2_SPEED_*). See patch2 where we added > this. > > That said, I think we should drop the sdhci_uhs2_mode() function > altogether and instead use mmc_card_uhs2(), which means we should move > it to include/linux/mmc/host.h, so it becomes available for host > drivers. > UHS2 mode starts at UHS2 initialization and ends either when UHS2 initialization fails, or the card is removed. So it includes re-initialization and reset when the transfer mode currently transitions through MMC_TIMING_LEGACY. So mmc_card_uhs2() won't work correctly for the host callbacks unless something is done about that.