From patchwork Tue May 17 18:22:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12852846 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 28697C43217 for ; Tue, 17 May 2022 18:22:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245072AbiEQSW1 (ORCPT ); Tue, 17 May 2022 14:22:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352080AbiEQSWX (ORCPT ); Tue, 17 May 2022 14:22:23 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4F372C134; Tue, 17 May 2022 11:22:18 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id x12so17640380pgj.7; Tue, 17 May 2022 11:22:18 -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=iVU3h4f0WZUD4XgqWW0mRoZDtcwIOGH+1cszdDO/eKk=; b=VgJ7KHGa7GF8GJ1nWAGngQfXo0pUP0Ls5pZ+kEkVbByzzT3HXDz4Y3eAc1M+lNby5I AfMUIUw9cjFBo4dYK+gBynIzj4y6PL20CRPbM2fLAvM1MU+7tFut12Ok0Xwcu9eSDIy+ QmPfFQa/SykOCqHuxmYQOZlsLGc1J6QgSzyoGNGW+jd3H+5ZhO5CtCkI75gEhkmXzlPC N7P7JhFjEqNTbmLFmNNTFX4ZJXweHjUOYIzx4OCZJGGc9OFvSHtaF+aGRFwFL04+Ew0M laljQGm28FpYqfPRsW2TGx6guKcsixJhsh9QpP4tF/KW8Pu2KPn7SpBCBaiXs3Hlw/K6 DiGg== 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=iVU3h4f0WZUD4XgqWW0mRoZDtcwIOGH+1cszdDO/eKk=; b=eW6OZVc/J+su8o7oPoEPK7YotCFofGskxHMY6jO6lveU90PpBIFKeayJ8XXpj0lFZg 4roZOPoa8jrtpKbLB0irtGeQGTMaCdqk8fjFurmmZnQS9CWDfUs1D9eWfd2q1gmzAGzR A5EQtoDCsxSg6SPWf1X56taoZc2P+xDZ9rmCdfLd2COAcwvFFTe7jM1kWN2QrnKfP577 nek3ohXIv1ZJjpZblK14WdNiGAmgcgzyNgE0i2kfzA70iByFlCxxY29IvndjEuca5Q4u Vxf9i2THnJMDgOEwrO7dSHjrAvuRFVqEneEeQ2CX/flFGeUDB1fbLhyAj1Gy34NmQ7cW j3pw== X-Gm-Message-State: AOAM532/5ExwXBcoqGzfREHxuKDTjy2W7apfg6ne8+wKY3XT07bLrEdx 5Cba4Cc4ELH6jxqywVuZaMtvtGAH55k= X-Google-Smtp-Source: ABdhPJwa3FDrdwTi3pbvAyMPp8xl9lnAKpXXkHdPSPjiZrKHcEq5Vl7UqJA8/5WyJYWSJ6Kji1Pw3w== X-Received: by 2002:a63:8a4a:0:b0:3ab:25b9:5c2 with SMTP id y71-20020a638a4a000000b003ab25b905c2mr20797242pgd.213.1652811737213; Tue, 17 May 2022 11:22:17 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x4-20020a17090ad68400b001d7dd00c231sm1998141pju.22.2022.05.17.11.22.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 11:22:16 -0700 (PDT) From: Florian Fainelli To: stable@vger.kernel.org Cc: Ulf Hansson , 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, kdasu.kdev@gmail.com Subject: [PATCH stable 4.19 1/3] mmc: core: Specify timeouts for BKOPS and CACHE_FLUSH for eMMC Date: Tue, 17 May 2022 11:22:09 -0700 Message-Id: <20220517182211.249775-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220517182211.249775-1-f.fainelli@gmail.com> References: <20220517182211.249775-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 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 --- drivers/mmc/core/mmc_ops.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index 334678707deb..3e10023cf485 100644 --- 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, @@ -986,7 +988,7 @@ void mmc_start_bkops(struct mmc_card *card, bool from_exception) mmc_retune_hold(card->host); err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, - EXT_CSD_BKOPS_START, 1, timeout, 0, + EXT_CSD_BKOPS_START, 1, MMC_BKOPS_TIMEOUT_MS, 0, use_busy_signal, true, false); if (err) { pr_warn("%s: Error %d starting bkops\n", @@ -1016,7 +1018,8 @@ int mmc_flush_cache(struct mmc_card *card) 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); From patchwork Tue May 17 18:22:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12852848 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 E6499C43219 for ; Tue, 17 May 2022 18:22:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352109AbiEQSW2 (ORCPT ); Tue, 17 May 2022 14:22:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352086AbiEQSWZ (ORCPT ); Tue, 17 May 2022 14:22:25 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0FAB2C66B; Tue, 17 May 2022 11:22:19 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id ds11so6581059pjb.0; Tue, 17 May 2022 11:22:19 -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=B5z0WBrh/BYYCHvUIIawnVVkGhzF2/2dcuB+5FV8icU=; b=AbmiKr13LjgHA635CCvhqbpmwmKepo6wngtA1F550JNQxJC3Osg5bRdXGL1Vo2Tc62 2pMzTwyxYU1XYVg1C7uebLES6pcrHRK2QxLTtQocI5ovbyD1qY6J2Mihj+vKZXcVbZ7V gRHae3em/E3V7nEQO9M+Nz+p0CpCEaTyxAqkzPjXHK1ya0KdxUhhGg8S4j8iyS3Lgq0O 2D9RNoI2E/dqrxK0kl0vIVRIPo8FIl2HWYAKorCso6+5P7A6qOejYQXrMi3SnyhhsgdN O+P38Ygoube0r5jgLDrdBSf4JK003qLs1rac/B7MBOmDy7S1muUWBg7aIGe3G05mv45s UibA== 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=B5z0WBrh/BYYCHvUIIawnVVkGhzF2/2dcuB+5FV8icU=; b=ueYU1p0Vxk+OfjOJy4VW54/DL4YmLQbXUL1vW6aM1wQ9im1+zVRqXbKLYULPxnO0Th OFSNFGrTPjy5Hr+NT4XkbInU6J+bvSsV7nDUGNv4di8TM7NVupjzUDB1sapJej88dsxB ETT0L6w3YABBytv6knLANvyZ3NHARXnW1MJpELQLFp10QDpl2bBfNzcDTX5C4aAvuYXm nucXQLTSsjERAzu5Gy/aqDPodrkC7B8bCWDBoypSvZc8f3DibwvdowDttjDGpKg3Oee+ IO4d0DMNoatdzK+4UXqcmU3rore+vsYqKnl+WHe6W7uKlvMn8rpIjKfEITwsYKuX6CRN /BAg== X-Gm-Message-State: AOAM5318Xn9nZqNcSS70f0mTLnvDqQN0TGjSb809FTYwuDC1ocY7hAh2 Tqd1oXHRjwJRZecyIs9pzfkoZe4Zpbo= X-Google-Smtp-Source: ABdhPJzke1BkFrhoZLv3sDgDH8hPpHFfyyxhP4PJLb+EMGslHLQiFUrYb3dRzNamgAsCzZrgIwfIuw== X-Received: by 2002:a17:902:d896:b0:15e:fb07:ba92 with SMTP id b22-20020a170902d89600b0015efb07ba92mr23648389plz.148.1652811738511; Tue, 17 May 2022 11:22:18 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x4-20020a17090ad68400b001d7dd00c231sm1998141pju.22.2022.05.17.11.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 11:22:18 -0700 (PDT) From: Florian Fainelli To: stable@vger.kernel.org Cc: Ulf Hansson , 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, kdasu.kdev@gmail.com Subject: [PATCH stable 4.19 2/3] mmc: block: Use generic_cmd6_time when modifying INAND_CMD38_ARG_EXT_CSD Date: Tue, 17 May 2022 11:22:10 -0700 Message-Id: <20220517182211.249775-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220517182211.249775-1-f.fainelli@gmail.com> References: <20220517182211.249775-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: Florian Fainelli --- drivers/mmc/core/block.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 630f3bcba56d..f7379c3473e1 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -1133,7 +1133,7 @@ static void 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) err = mmc_erase(card, from, nr, arg); @@ -1175,7 +1175,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; } @@ -1193,7 +1193,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; } From patchwork Tue May 17 18:22:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12852847 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 0E95BC43219 for ; Tue, 17 May 2022 18:22:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233638AbiEQSW1 (ORCPT ); Tue, 17 May 2022 14:22:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352090AbiEQSWZ (ORCPT ); Tue, 17 May 2022 14:22:25 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6F592DAA4; Tue, 17 May 2022 11:22:20 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id nk9-20020a17090b194900b001df2fcdc165so3338618pjb.0; Tue, 17 May 2022 11:22:20 -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=6Cx+Yg+pJSpSbpHi8GAC7T8VbsPpv6YKELwai1HS3Tc=; b=kcIkQJ9iOzl5AewwWhGtdCVQJA7efCkTIxnj4IVAmJqBDG8R86R8ka8rUQE2RbPMkW 8uk44EU+zoZ8tMDyHjpOQuzmcyV01pRmRxF0iaEf6ZMEv7xjNR1UPS32ks95NLRKA9k2 VPa0ShkUvQudrSVOB1YknMbQFp4rfeNVSSLsf38GHLgJwy8Wk23U01QEpQBkpq8WRPFB B23qixQs45BPOsl+4EQ/Bib0TjObFNll9K2qMGgPumyuIUJTmsLAAPkY30RB0u3Bznl9 drFYL5uecjL9hrOMFMZMMLoBrD1l1aqmVFWHmDJ5rNYQOVXbVug4N50Drtb3shvdtSeO rAtQ== 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=6Cx+Yg+pJSpSbpHi8GAC7T8VbsPpv6YKELwai1HS3Tc=; b=40HR/S+llcHtp7C9G39WBAFEJT6ciTUaXjO+eVPzmUReuN9v0uIwalOg1mkjXkhMvt 3jTV1etah1SlhbaQBt5tPOVzPCWZFA8/dJmOCk4lwFNgkLObIkfmyQprcYwQscYcZ9CS A0d3xO/Wuq3bGu/2aRJtwIPHSXqzRjzK93ZjZVyGuzaBfZMU/zlVDfW1BUVxFSEZXZmD 3S2SelDLZPGT1hVIfbJEAqqlpSYRv2ZtFSxNbGfzwqNkqExIcrnlb2ISZZcY1qqF1nl8 eM/0E/Y619vNoYE0Lt7GKkHpHcPhy0NQEma9cU2R1lHZua936y//P60ackACJrYMt5ej CoMw== X-Gm-Message-State: AOAM531zHEvut/8GtZQlwT3ItWZ4Yg3ED2/9BlSDS+H3RZ4ZVNoIJauP orMIXPvq9VJ32v+D98LIOCAY9MPx0so= X-Google-Smtp-Source: ABdhPJypOz5QeLq1BCymxWb8BTSmhkuE4uf+8Kz/ml3fhTQOjEZJmCZk30sfg8NnNQoCjVGx7bhLuQ== X-Received: by 2002:a17:902:ce8d:b0:161:761f:6999 with SMTP id f13-20020a170902ce8d00b00161761f6999mr11409649plg.125.1652811739977; Tue, 17 May 2022 11:22:19 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x4-20020a17090ad68400b001d7dd00c231sm1998141pju.22.2022.05.17.11.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 11:22:19 -0700 (PDT) From: Florian Fainelli To: stable@vger.kernel.org Cc: Ulf Hansson , 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, kdasu.kdev@gmail.com Subject: [PATCH stable 4.19 3/3] mmc: core: Default to generic_cmd6_time as timeout in __mmc_switch() Date: Tue, 17 May 2022 11:22:11 -0700 Message-Id: <20220517182211.249775-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220517182211.249775-1-f.fainelli@gmail.com> References: <20220517182211.249775-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 533a6cfe08f96a7b5c65e06d20916d552c11b256 upstream All callers of __mmc_switch() should now be specifying a valid timeout for the CMD6 command. However, just to be sure, let's print a warning and default to use the generic_cmd6_time in case the provided timeout_ms argument is zero. In this context, let's also simplify some of the corresponding code and clarify some related comments. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20200122142747.5690-4-ulf.hansson@linaro.org Signed-off-by: Florian Fainelli --- drivers/mmc/core/mmc_ops.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index 3e10023cf485..26783a39c547 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c @@ -458,10 +458,6 @@ static int mmc_poll_for_busy(struct mmc_card *card, unsigned int timeout_ms, bool expired = false; bool busy = false; - /* We have an unspecified cmd timeout, use the fallback value. */ - if (!timeout_ms) - timeout_ms = MMC_OPS_TIMEOUT_MS; - /* * In cases when not allowed to poll by using CMD13 or because we aren't * capable of polling by using ->card_busy(), then rely on waiting the @@ -534,6 +530,12 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, mmc_retune_hold(host); + if (!timeout_ms) { + pr_warn("%s: unspecified timeout for CMD6 - use generic\n", + mmc_hostname(host)); + timeout_ms = card->ext_csd.generic_cmd6_time; + } + /* * If the cmd timeout and the max_busy_timeout of the host are both * specified, let's validate them. A failure means we need to prevent @@ -542,7 +544,7 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, * which also means they are on their own when it comes to deal with the * busy timeout. */ - if (!(host->caps & MMC_CAP_NEED_RSP_BUSY) && timeout_ms && + if (!(host->caps & MMC_CAP_NEED_RSP_BUSY) && host->max_busy_timeout && (timeout_ms > host->max_busy_timeout)) use_r1b_resp = false; @@ -554,10 +556,6 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, cmd.flags = MMC_CMD_AC; if (use_r1b_resp) { cmd.flags |= MMC_RSP_SPI_R1B | MMC_RSP_R1B; - /* - * A busy_timeout of zero means the host can decide to use - * whatever value it finds suitable. - */ cmd.busy_timeout = timeout_ms; } else { cmd.flags |= MMC_RSP_SPI_R1 | MMC_RSP_R1;