From patchwork Wed Jan 22 14:27:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 182919 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp5149266ile; Wed, 22 Jan 2020 06:27:56 -0800 (PST) X-Received: by 2002:a19:5013:: with SMTP id e19mr1955262lfb.8.1579703276769; Wed, 22 Jan 2020 06:27:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579703276; cv=none; d=google.com; s=arc-20160816; b=bMLVTCDB1tBEr8BrHfLZtCSxllia6IFP1x2Zr+xbPQpZGVqYTqQuKtStRiRf7vlhou /ZnyU9lBf8iqA/Z8CcEzS4a4RaDjQJT4VX3ywpoVc90L9Q96KaaYzxJ4QouDtRhV5I4u zW9NgYwqKe2nhiAi41lDTLWbqS0Y8r34MuN0H/Zs+iIwYM/b5+ro1K1vH6/MlF+pG2LY 2ITqviMD1dGo4GKTDPzjjaFzZnHuw0O534Gih0dJEENVs6u+clhMXwb+pM1Hq2oHjVL9 JOxyZoAxHv+DBN9XLVhz5aka2OE+Sq0nB4otnkXURKqHCWsPs4nhSBqSV/JH1tzEWSbM 7kdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7VzLcJjeEnS45bKw7Lmz/k90q+rRtqK0BCgzKkLywLM=; b=X5/uVFtgQ9QHufeIAMlxSt0cthGi2GBvkwCMq9QESjffHr8SG2+xr239Qq9NUzPF5a JsAvTGZn9gdLIQ1rN2dWSj2oZ6AS1qi3iVsT/OZz7YJr61KtDlIDb79RhJT628iOUlr1 eogUfwelZaihmbo5ZQ53r1QDGC+SdQS8r3FsVnmuDE0NOtx4JKMeB26NFCAAaNA/LoT7 6/12e86Mv0Bhonp3aUsATORW4AJU5VTLirKGcUrYdgyOZ6F3sNzQWuxm5+xHJKhVOFB9 aWrSOOd6FA7MgL53f9YJk/9LiEDKJ5D4U20FL7NaxDzjDVvenHWkrwzNyLRs/qqTelCn M4jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZB5T1AhW; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g15sor25280342ljk.9.2020.01.22.06.27.56 for (Google Transport Security); Wed, 22 Jan 2020 06:27:56 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZB5T1AhW; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7VzLcJjeEnS45bKw7Lmz/k90q+rRtqK0BCgzKkLywLM=; b=ZB5T1AhWhlYE9OxX4czvsDOmCie3OIq2PCb7t3+brXVJN03D6GPlKa9qMqFd99HI6X 3XnsPloGO2mJnQIgNFVxF+cucMuck6V1u5DIjxjfnb6UOn/Kj+B+R8vwi9GFxasDYD4q QibUbtru7HHBCqi1kTrxQ2MUZi6mBOVAH1ottkcYuVJKWAySJPRadOT4H+zOQIwR9PGW awqO6mW51Moye8qt5nFFVY2lVBwZwZLCUXreh55elFDSpXptkNhnLZ0Q/v0gXDchaJkZ ictvabxWEGB6IdMCAahlk3PJeGBZ8p6h08LhoW9QKh+wjJeKsRU5kW5glCEV3OmDe3lm x54A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7VzLcJjeEnS45bKw7Lmz/k90q+rRtqK0BCgzKkLywLM=; b=C8YtXs3TUvX+pcvE3hplz1IDaMi/gdWvWEQ9ATl5MAlQHqY8WNTY/yYHqzwGpx+wL5 y+qj+pzYtO8gExX5VTREXK3BLmsEpXUnGpIeHfaBosjg5jiEr+ELiWNYJgRaOJndcko5 COYu+KOm/BIGgdeu2/Iwimst35TVGOu2RKHZyVr/AkjE/1UJQJ1DmcZgrkxZlhvDAwur x9UcQC/0qWV2PcgwDCsT5WY45cQjenn9wzAwUhIi6LScunRQ77tRRnO80DgItPm1sJ8P NsqF+Ckr8GSlB3TuSHBiepMWMNzpTiQ7UZEFCSzdlYac3+z6ZQLuKaTWhIDmM/bCOkez 2n+w== X-Gm-Message-State: APjAAAXR8mY/FK7zVq/pBtvC1oPb79OcMf83y+GKqO9IhTOfbWmNQi7F xvKb7Yv9pCFcVqxHtvXd7XqSVYsb X-Google-Smtp-Source: APXvYqzlO8BGgEneuZccgn8tDP+LUmTOH9B89/9xKXCs35QSQAIAtq4lZyviJFDHB/ha87fK/REzaQ== X-Received: by 2002:a2e:9041:: with SMTP id n1mr19009718ljg.133.1579703276414; Wed, 22 Jan 2020 06:27:56 -0800 (PST) Return-Path: Received: from uffe-XPS-13-9360.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id u17sm20369548ljk.62.2020.01.22.06.27.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2020 06:27:55 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Adrian Hunter , Chaotian Jing , Shawn Lin , mirq-linux@rere.qmqm.pl Subject: [PATCH 2/3] mmc: block: Use generic_cmd6_time when modifying INAND_CMD38_ARG_EXT_CSD Date: Wed, 22 Jan 2020 15:27:46 +0100 Message-Id: <20200122142747.5690-3-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200122142747.5690-1-ulf.hansson@linaro.org> References: <20200122142747.5690-1-ulf.hansson@linaro.org> The INAND_CMD38_ARG_EXT_CSD is a vendor specific EXT_CSD register, which is used to prepare an erase/trim operation. However, it doesn't make sense to use a timeout of 10 minutes while updating the register, which becomes the case when the timeout_ms argument for mmc_switch() is set to zero. Instead, let's use the generic_cmd6_time, as that seems like a reasonable timeout to use for these cases. Signed-off-by: Ulf Hansson --- drivers/mmc/core/block.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 95b41c0891d0..663d87924e5e 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -1107,7 +1107,7 @@ static void mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req) card->erase_arg == MMC_TRIM_ARG ? INAND_CMD38_ARG_TRIM : INAND_CMD38_ARG_ERASE, - 0); + card->ext_csd.generic_cmd6_time); } if (!err) err = mmc_erase(card, from, nr, card->erase_arg); @@ -1149,7 +1149,7 @@ static void mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq, arg == MMC_SECURE_TRIM1_ARG ? INAND_CMD38_ARG_SECTRIM1 : INAND_CMD38_ARG_SECERASE, - 0); + card->ext_csd.generic_cmd6_time); if (err) goto out_retry; } @@ -1167,7 +1167,7 @@ static void mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq, err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, INAND_CMD38_ARG_EXT_CSD, INAND_CMD38_ARG_SECTRIM2, - 0); + card->ext_csd.generic_cmd6_time); if (err) goto out_retry; }