Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2113493ioo; Mon, 23 May 2022 10:20:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnYf4dCk03X4JSwi4LrOrRQ+WXCFzjWGZOCkN2pRVCR+h3fmccxq+wW7oARJv/zBZ4itZK X-Received: by 2002:a17:902:9a49:b0:162:20d3:6756 with SMTP id x9-20020a1709029a4900b0016220d36756mr6618972plv.124.1653326420748; Mon, 23 May 2022 10:20:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326420; cv=none; d=google.com; s=arc-20160816; b=dHV2ZzhFgYnwr/vX1OFr17+N6UJDJ5nEDKqCjSOWxHb3Ztf2JnlZ/4sT7rnL9uCbS4 8kr/sZiwNpJOP4tN3E2tGxvcztY+lQqgY6fC90F3iVJYaRogVAwsaqNjf/HvapcxVUyN +Ai/26eAaAqnl7JDs3gfl4i6M5Hk213bHrXr/JN72lVputQBc6f1MEHj0Oo0brE9ujRp zAgK6ZMyq1BP5eJ2ObH+UahRR6SQkQgCaycibixqlI0K2N561vZkuPliaUELjRSFvTpB RVGO418pJUV+7NIlNcKmZ/yuOfdMv67gYMS9eVfuHFVzEv6YVIuxCbW9DbhutyreCueJ 8eGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=v4pqEvkiGrzwiGPTR9/V0GROCPE38wMFqjSlAu59LhM=; b=M8KbdUhZLv+2BeWNN2vvkLMs7RDB5hfrAjAQNrXCNTSpuFZKc1oxD3IOoGE0XzEJx8 UChrL7c8pmkshpA6Yg+rZI8Q9BweCDgbPueU7TOgXmOKOUjHEyctqrZg+HVAhDw1i1oa Go4hG2S+ox3zGf4sVBMYN5Mbm8QZSql2pO2+WCXIsNWhiW0+fP0oPvh0xWAi4VSMkkXT fF3HX2iD6JjUQ5UFPyh1qnL1rtj+KVp4vPi2lhjGyKolJ7VxZ5WL6kmI52S4rCUs+wks b/6RsmF5TbcqcymVY0zSUiEYmAH97YkrrSeQCEtfv1zo/ynWrTtVdqNZoStK0tDRhupW WjxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G63c0RT9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u17-20020a170902e81100b00153b640ed90si12714057plg.38.2022.05.23.10.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:20:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G63c0RT9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 54B777DE2B; Mon, 23 May 2022 10:20:00 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240383AbiEWRRh (ORCPT + 99 others); Mon, 23 May 2022 13:17:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240068AbiEWROl (ORCPT ); Mon, 23 May 2022 13:14:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CCDF19C1D; Mon, 23 May 2022 10:12:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 535F2614CA; Mon, 23 May 2022 17:12:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 422DCC385AA; Mon, 23 May 2022 17:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325946; bh=3qPubRZJqFWvurfhRlWuV2CkPQq+buH2rgyRWRByWSw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G63c0RT9nv0g7mZCIHqpAiQ8FyxP6xuEPPZwVgtnKkjcugBkDNNcYoSrC5sSUlA/3 6M/brU5dKSWGk8ldm3VaaGofSVtDGsAHU2fJzYrzlL+5G4r/j1rTEcgn1nJ0AFb8wN hT+dAgIIr81KUHxMztb+Nu9m+kJD2v9AqySseUFU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Ulf Hansson , Florian Fainelli Subject: [PATCH 5.4 19/68] mmc: core: Specify timeouts for BKOPS and CACHE_FLUSH for eMMC Date: Mon, 23 May 2022 19:04:46 +0200 Message-Id: <20220523165805.839941209@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165802.500642349@linuxfoundation.org> References: <20220523165802.500642349@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ulf Hansson commit 24ed3bd01d6a844fd5e8a75f48d0a3d10ed71bf9 upstream The timeout values used while waiting for a CMD6 for BKOPS or a CACHE_FLUSH to complete, are not defined by the eMMC spec. However, a timeout of 10 minutes as is currently being used, is just silly for both of these cases. Instead, let's specify more reasonable timeouts, 120s for BKOPS and 30s for CACHE_FLUSH. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200122142747.5690-2-ulf.hansson@linaro.org Signed-off-by: Florian Fainelli Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/core/mmc_ops.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c @@ -19,7 +19,9 @@ #include "host.h" #include "mmc_ops.h" -#define MMC_OPS_TIMEOUT_MS (10 * 60 * 1000) /* 10 minute timeout */ +#define MMC_OPS_TIMEOUT_MS (10 * 60 * 1000) /* 10min*/ +#define MMC_BKOPS_TIMEOUT_MS (120 * 1000) /* 120s */ +#define MMC_CACHE_FLUSH_TIMEOUT_MS (30 * 1000) /* 30s */ static const u8 tuning_blk_pattern_4bit[] = { 0xff, 0x0f, 0xff, 0x00, 0xff, 0xcc, 0xc3, 0xcc, @@ -943,7 +945,7 @@ void mmc_run_bkops(struct mmc_card *card * urgent levels by using an asynchronous background task, when idle. */ err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, - EXT_CSD_BKOPS_START, 1, MMC_OPS_TIMEOUT_MS); + EXT_CSD_BKOPS_START, 1, MMC_BKOPS_TIMEOUT_MS); if (err) pr_warn("%s: Error %d starting bkops\n", mmc_hostname(card->host), err); @@ -961,7 +963,8 @@ int mmc_flush_cache(struct mmc_card *car if (mmc_cache_enabled(card->host)) { err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, - EXT_CSD_FLUSH_CACHE, 1, 0); + EXT_CSD_FLUSH_CACHE, 1, + MMC_CACHE_FLUSH_TIMEOUT_MS); if (err) pr_err("%s: cache flush error %d\n", mmc_hostname(card->host), err);