From patchwork Thu Jun 24 15:16:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 466589 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F32E9C49EA6 for ; Thu, 24 Jun 2021 15:16:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9A48613DC for ; Thu, 24 Jun 2021 15:16:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232191AbhFXPS4 (ORCPT ); Thu, 24 Jun 2021 11:18:56 -0400 Received: from www.zeus03.de ([194.117.254.33]:46214 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232195AbhFXPSt (ORCPT ); Thu, 24 Jun 2021 11:18:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=zLhZ5XhmpaK6vn Q2F6ioAJSqoOMCa/VxjSTgAYsZUAo=; b=XZQ1rC7CxTP1fStMePf2kjNoHV3EEg 93q6fYjtPC7AZ7Hbep7Yfy7u2tVNkStcNYncDBlv2Hy1ecK5/d9Y2qxBV4P+2P/R 0VcUrDUqX3xllV89niqm9i+ZT7RMld3e5hDaG9Wgn+opE80bdm4BcpRqH69EyQpK /kr7igigz+wsI= Received: (qmail 3016692 invoked from network); 24 Jun 2021 17:16:26 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 24 Jun 2021 17:16:26 +0200 X-UD-Smtp-Session: l3s3148p1@3OC5gYTFVMkgARa4RWOqASgLlirhLBBp From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Adrian Hunter , Yoshihiro Shimoda , Wolfram Sang Subject: [PATCH 2/3] mmc: host: add kdoc for mmc_retune_{en|dis}able Date: Thu, 24 Jun 2021 17:16:15 +0200 Message-Id: <20210624151616.38770-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210624151616.38770-1-wsa+renesas@sang-engineering.com> References: <20210624151616.38770-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org I wanted to use it in a wrong way, so document the intended way. Signed-off-by: Wolfram Sang --- drivers/mmc/core/host.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index eda4a1892c33..0f084c9b2684 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -95,6 +95,10 @@ void mmc_unregister_host_class(void) class_unregister(&mmc_host_class); } +/** + * mmc_retune_enable() - enter a transfer mode that requires retuning + * @host: host which should retune now + */ void mmc_retune_enable(struct mmc_host *host) { host->can_retune = 1; @@ -126,6 +130,12 @@ void mmc_retune_unpause(struct mmc_host *host) } EXPORT_SYMBOL(mmc_retune_unpause); +/** + * mmc_retune_disable() - exit a transfer mode that requires retuning + * @host: host which should not retune anymore + * + * It is not meant for temporarily preventing retuning! + */ void mmc_retune_disable(struct mmc_host *host) { mmc_retune_unpause(host); From patchwork Thu Jun 24 15:16:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 466588 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59CC7C49EAF for ; Thu, 24 Jun 2021 15:16:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3BB2B613DA for ; Thu, 24 Jun 2021 15:16:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231942AbhFXPS6 (ORCPT ); Thu, 24 Jun 2021 11:18:58 -0400 Received: from www.zeus03.de ([194.117.254.33]:46224 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232196AbhFXPSt (ORCPT ); Thu, 24 Jun 2021 11:18:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=xUE4EbDuo9xFDk J25+s0Hrzl6p4tAZUiuKfTE4SgLfQ=; b=o6fMjws2XkYqXy0bb2sZQknGOBuIlV E2GfUNfPQANRPe7HJfiFz42J5UAu2V022FYTEOzsaW7aGK+MBP/DJ6yM36HYX8Mp hcwMZkRG4squRvMt7mXNVi9o8wMY3PWcm9zuexYns5dDdHnej8PDNDkmDupp2c35 X+vz2lsWYoXqQ= Received: (qmail 3016735 invoked from network); 24 Jun 2021 17:16:27 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 24 Jun 2021 17:16:27 +0200 X-UD-Smtp-Session: l3s3148p1@PNPBgYTFVskgARa4RWOqASgLlirhLBBp From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Adrian Hunter , Yoshihiro Shimoda , Wolfram Sang Subject: [PATCH 3/3] mmc: host: factor out clearing the retune state Date: Thu, 24 Jun 2021 17:16:16 +0200 Message-Id: <20210624151616.38770-4-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210624151616.38770-1-wsa+renesas@sang-engineering.com> References: <20210624151616.38770-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org We have this in two places, so let's have a dedicated function. It is also more readable. Signed-off-by: Wolfram Sang --- drivers/mmc/core/core.c | 3 +-- drivers/mmc/core/host.c | 3 +-- drivers/mmc/core/host.h | 6 ++++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index f397cf051b8d..469bc58c2113 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -941,8 +941,7 @@ int mmc_execute_tuning(struct mmc_card *card) pr_err("%s: tuning execution failed: %d\n", mmc_hostname(host), err); } else { - host->retune_now = 0; - host->need_retune = 0; + mmc_retune_clear(host); mmc_retune_enable(host); } diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 0f084c9b2684..52d37587cf45 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -141,8 +141,7 @@ void mmc_retune_disable(struct mmc_host *host) mmc_retune_unpause(host); host->can_retune = 0; del_timer_sync(&host->retune_timer); - host->retune_now = 0; - host->need_retune = 0; + mmc_retune_clear(host); } void mmc_retune_timer_stop(struct mmc_host *host) diff --git a/drivers/mmc/core/host.h b/drivers/mmc/core/host.h index ba407617ed23..48c4952512a5 100644 --- a/drivers/mmc/core/host.h +++ b/drivers/mmc/core/host.h @@ -21,6 +21,12 @@ int mmc_retune(struct mmc_host *host); void mmc_retune_pause(struct mmc_host *host); void mmc_retune_unpause(struct mmc_host *host); +static inline void mmc_retune_clear(struct mmc_host *host) +{ + host->retune_now = 0; + host->need_retune = 0; +} + static inline void mmc_retune_hold_now(struct mmc_host *host) { host->retune_now = 0;