Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2111295ioo; Mon, 23 May 2022 10:17:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFdnKZiCo6cME/Qp1Aokv8Jc0JLhj3/8rqendt+eiJxASDW1+Tbq6xEE2pW03SwPUbQKzg X-Received: by 2002:a17:902:c752:b0:161:7cb4:78b8 with SMTP id q18-20020a170902c75200b001617cb478b8mr23355312plq.39.1653326235042; Mon, 23 May 2022 10:17:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326235; cv=none; d=google.com; s=arc-20160816; b=qxIT2pSpm6GnnDbNrVF9wCgNSdgKpQObistQmFS4c4OJHJySyHjY/waM1b7dL4M7Vw I3PP6sgMGFiRRPEvnXCqK/oITWPS0XqTR4UKl0gU0OpUDihpMZ0y9XNVyaQfhzNJoInN qrww++nX3BeJBoTC9i9K7TuUj9/RwFpBuu3JAJ2JOvl1nAxMhWb5sjlgFDQ4aF7gHbXd lwCT8XKa6d+x1P/Wl1T4YUng0AZ6Zsv1UGs2bBQPp+3t27sobdAjiniMH5XTtthjGIq5 KB5HYRhiWt7aBT8/Qb4BeD/bYn7vpzg52weI7qPv8work2V9fDNEnynrzVlqmd69IMwj JJeg== 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=o57rhzMa8c7tcZp8jiwqfAe4Q+q0YLuuYTz8gphjdAY=; b=r9COdszrYGhLBREvdfKAuKoHVj5iz8I+AVxkfVLTppPtrpm3b9/lWQn7FTmssBMmrH RnfNk0ThpcAWz9mGwgvhdshmUtqb3wjO6g0pSoa/N0D25i/J7U7uOimdTGwl4oYfj6ow KZhYjGH7A2M0VzUC1YKwpC9GQKk2Vq4wBl1v6+QRJtPWPLA6s4Q4zK4RetKOJN+gKw1b Kg1a16eTUGYWts+VnmeBn/zcaCO/+qK52grM1HvO0rvaR091rbkuKTuDqXjrf/Tw4dOB pF6LP21LqOkBDyHwQvPrrmm31XVR3tR0sPAfA14YHZ2xyhujTGlr95fJPMOoZH94boaE ncZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0qKOAybk; 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 c11-20020a170902724b00b0016180d0eecdsi9584802pll.52.2022.05.23.10.17.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:17:15 -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=0qKOAybk; 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 50D3762D6; Mon, 23 May 2022 10:15:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240006AbiEWRPQ (ORCPT + 99 others); Mon, 23 May 2022 13:15:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240531AbiEWRMb (ORCPT ); Mon, 23 May 2022 13:12:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C458762CCB; Mon, 23 May 2022 10:11:42 -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 2B47861509; Mon, 23 May 2022 17:10:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E404C34118; Mon, 23 May 2022 17:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325809; bh=G9ZRHRw/SjKlN1Cm8RgRF6kGTUhjJSALMeiIry7VasE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0qKOAybkDRj3DRcDBWp6VXdpzjCvAuBs9PSdcs7NPV1f+/DX703bfjCguU337i3Lq +fVttgc9PnTegps2jxDEEUl0PyR5Nn8+8Yvw+YWusL3YqzEc0WcBCg7NHrMO1APeph tZjmeeLR8sAk2aOpqTUlq8t8o7VNLT7OSJcy7flo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Ulf Hansson , Florian Fainelli Subject: [PATCH 4.19 18/44] mmc: core: Specify timeouts for BKOPS and CACHE_FLUSH for eMMC Date: Mon, 23 May 2022 19:05:02 +0200 Message-Id: <20220523165756.536633554@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165752.797318097@linuxfoundation.org> References: <20220523165752.797318097@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 @@ -23,7 +23,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, @@ -947,7 +949,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); @@ -965,7 +967,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);