From patchwork Tue May 17 18:32:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 574769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4C7BC433EF for ; Tue, 17 May 2022 18:32:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352228AbiEQSce (ORCPT ); Tue, 17 May 2022 14:32:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352159AbiEQSc3 (ORCPT ); Tue, 17 May 2022 14:32:29 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DA603D1D4; Tue, 17 May 2022 11:32:24 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id i17so18077114pla.10; Tue, 17 May 2022 11:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Oac74zs7UeOjKQRdpb+Td3T589EU3K7hbAq7QVHJ8PM=; b=mbYKyuopYnBMN0wBO01acMUKoUrcyNW3nt8q++Bf7DBwrpIhdw6LAqIHosfMBWQrkm ZBdQBdYvFAasCMQxvZAPcGh156vfQYcfmwrw5IAhjUcekYZLgYqeyZi/nGLeW+c9QV0P 4EBKwkk3kfiXXhJIj5Fu16jIFkMUYMhlNw7oR8XHukXOWHERrcp3Ol64r3h2GEpTXxpT oqc28+YsjkftRCHWBb7XnpMrRT/Ab6AyFsBJwrgM6ELCFws4aBRBFbjGqqXANFL5l4Hj xYJBPp5/sQHo2ZN7LI2NE9D+vagfZztsHTdDowk3zNLhgyArKr/J+irLmYZUTXSl+Ksr t4oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Oac74zs7UeOjKQRdpb+Td3T589EU3K7hbAq7QVHJ8PM=; b=EZqNOAh/hVkFgdGnnod/gN5W0CfToT5M17LI0ji1kAZmF1Wr9rr/HNbCTiJQpg9Q6E SVAQcuUSvh8mep4S15MEq6dq4feAynUdE9+wRL6UQBfEgzzpKqTZD0L0zjXhyzjh4PGx gJnP9Q6GPMVuwDxwiNYqEpVLa+fZCAnwJG2Fbs3Vxv8lR3WtdSfNvzO6kuxTQpnf29gj AzAFy2oobzXUOf/+BYguWEQUWAuDGvDY7aMTl2lkvueRWuTQxD+f1yc9dszFq5TQPF74 S7NRhaARv8OcFJ9MKPR7sN24JyKiH0sZJd1tqrQrEmoIfZg6bUIcjzquaAT5UCHV6VM+ IUOw== X-Gm-Message-State: AOAM531pAIFRogndYwdtsjZC5XF4z92hyUzZmwo9ZFoqoV4NoLCQ6/f1 FMuqDqiFAzRWY/biWuLvF/zSHpJ/5Ds= X-Google-Smtp-Source: ABdhPJx2Zze5zEix5qgl1h8ATK7J5FIyAyyumQCrYGBGA2GNLBWNpKicrUIWz5ZBVhB1TLGMhwYgiw== X-Received: by 2002:a17:902:d48d:b0:15e:c236:4fd3 with SMTP id c13-20020a170902d48d00b0015ec2364fd3mr23479962plg.113.1652812343400; Tue, 17 May 2022 11:32:23 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d26-20020a634f1a000000b003c619f3d086sm8950355pgb.2.2022.05.17.11.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 11:32:22 -0700 (PDT) From: Florian Fainelli To: stable@vger.kernel.org Cc: Ulf Hansson , Kamal Dasu , Florian Fainelli , Adrian Hunter , Greg Kroah-Hartman , Avri Altman , Bean Huo , Nishad Kamdar , =?utf-8?q?Christian_L=C3=B6hle?= , linux-mmc@vger.kernel.org (open list:MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND...), linux-kernel@vger.kernel.org (open list), alcooperx@gmail.com Subject: [PATCH stable 4.9 2/3] mmc: block: Use generic_cmd6_time when modifying INAND_CMD38_ARG_EXT_CSD Date: Tue, 17 May 2022 11:32:06 -0700 Message-Id: <20220517183207.258065-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220517183207.258065-1-f.fainelli@gmail.com> References: <20220517183207.258065-1-f.fainelli@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Ulf Hansson commit ad91619aa9d78ab1c6d4a969c3db68bc331ae76c upstream 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 Link: https://lore.kernel.org/r/20200122142747.5690-3-ulf.hansson@linaro.org Signed-off-by: Kamal Dasu Signed-off-by: Florian Fainelli --- drivers/mmc/card/block.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 709a872ed484..7b8c72a07900 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1192,7 +1192,7 @@ static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req) arg == MMC_TRIM_ARG ? INAND_CMD38_ARG_TRIM : INAND_CMD38_ARG_ERASE, - 0); + card->ext_csd.generic_cmd6_time); if (err) goto out; } @@ -1235,7 +1235,7 @@ static int 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; } @@ -1251,7 +1251,7 @@ static int 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; }