From patchwork Thu Apr 30 09:16:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 185884 Delivered-To: patches@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp1839126ilf; Thu, 30 Apr 2020 02:17:03 -0700 (PDT) X-Received: by 2002:a19:f611:: with SMTP id x17mr1515114lfe.51.1588238223606; Thu, 30 Apr 2020 02:17:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588238223; cv=none; d=google.com; s=arc-20160816; b=phau8nVrR6l+jx9oGMRFwhB8LurpdtFauKMJLN1UNTpQ9mWKcRsjgmK2cGiOGV8Ftx pCoLRM+SMuIWH7CqMGMZZ7Auq0v83S1bAh83e8fgj4PQXaFQ3XuEO0QXtkhVFOviGjxe jq+OyuLJpFoQJw7Sqv+zmnybrCU1xHUBazVj5zE2tvD4cOjNLUZRWeHMQ8Ea4x+BTz/1 I94iV79cRsWqVMwIMjl2g6uLMX3TioHzxpuCRzmTmy4IXfOiEqwBHuXsP/Xw+HYRsZwo 27UXgY6ERAkuxK+x5ImdQ/oDqsaQZ3/V12C1sZeo9xrNRG75S/4YbwQbDXL03EgOXoPK /4YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=OYtBS8/bdD7KI7PkR78/ZukbdqMPK7h5qCtkWF9k0YU=; b=cLkez+yEOcgbk5vSH9V+HYwZMzD59wR5MbFrgTZd/cy1s8p7hs5sRZ93PT7M+XAZ9U GfpwTAI/ctQC+dEzYcRTsuN8hpJRCvO/eCiNztpv3+sXrHh7MOOjOXZTxdBZYft6HoRr J6/cwYGdiH2C3nUodq56X7m3Sfl6OPH9VDEfb2lqGXFvbVkyK6H//2ohQ6CYDC15v7Oo LLkpRHu+P5JtpSBQgjN1DcVxZKwuKADGdEcIOx56y13KbGmDblqjO44ed/8hOsoPiJ6f eYLOkdiyYlL3YGOR/htYLW3U9jJX2jGZb2SK7Lm+o/qDUXHZWWWinPqZVGQK9rJCYakN FZhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c6hkv6C0; 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 y14sor3611459ljc.1.2020.04.30.02.17.03 for (Google Transport Security); Thu, 30 Apr 2020 02:17:03 -0700 (PDT) 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=c6hkv6C0; 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 :mime-version:content-transfer-encoding; bh=OYtBS8/bdD7KI7PkR78/ZukbdqMPK7h5qCtkWF9k0YU=; b=c6hkv6C0TY7SlLSo0HHsD8TibtF+oxLni1E/8ReD3pQTWO1T+s68/ye2YNSPbhofo0 X3/0IBH1kA3BmL7drTNNrGx4WSPP+XEQwbcx4WLf60zc/AEM7m21upvdkXH6+JF8tgJh L+3m0HnIPAoUBDbzwzuCIwbv5C3nlbovQ07c6FAeJ+Q3tb27gorLxkuoM3YF43L+qJ81 pFTfxQsu97W7PR6zrq0LVXUN/WvAITdYI/ES/fhvnlM1s6heFZlH7w31qUhmslgUKvgV Dg6a7/R5C3XRWi5Mej+w+8VHsNtCQY1/d6rjCixiW7i7TdMDb4OgsmGtqa6f2nBGxQcn rPKQ== 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:mime-version:content-transfer-encoding; bh=OYtBS8/bdD7KI7PkR78/ZukbdqMPK7h5qCtkWF9k0YU=; b=qarYVKekLnOSzmF+uaCtWYNv+bc/xkrOW9Sq46i5QprqcOae3FZ/IYMl2vENV3JArD fauSvfmy+2GW2ZluELSSNINHQFX9Z7B3Wvdsf7fHS5BEHPlaNZQyKviR4X/X7xDb6xI9 BtoNKyTf+0y+H38/a+LHwsh5/YtRlrLxXdbOa5io7/4/RmX1qksRMNnbzP3Nz5pM/rZQ zwHjofDgBaKbFDHC6R/ecfQCNCGppYCJ0iSKTma4SmtLUCGmDV6nKpst3cOWBOGTafra wNd8tM/+VkI8EW6ImqyZYosn/9rWeEMEaJ8kBgwdny7kbAXSmQ+EhSlVUSCeCnJ9hmrB 08OQ== X-Gm-Message-State: AGi0Pubr1g2rS/HsjhQEYYqKH2+sOkCUHFyNdFpu90Js8QuFxgTawZks Jz6W/Ol0RhR6t5JW0Rwtg1rzg7e/ X-Google-Smtp-Source: APiQypJXJNEDjnXvxoxl/55gotG0f2jHRvoKAQlg+Ap/uoeQIwlR5mebUgjpTdjde8nWPTOnwUBhdQ== X-Received: by 2002:a2e:760c:: with SMTP id r12mr1502937ljc.139.1588238223120; Thu, 30 Apr 2020 02:17:03 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-98-128-181-7.NA.cust.bahnhof.se. [98.128.181.7]) by smtp.gmail.com with ESMTPSA id x29sm4417818lfn.64.2020.04.30.02.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 02:17:02 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Adrian Hunter , Douglas Anderson , Matthias Kaehlcke , Shawn Lin , Yong Mao , Chaotian Jing Subject: [PATCH 3/4] mmc: sdio: Re-use negotiated OCR mask when re-sending CMD8 Date: Thu, 30 Apr 2020 11:16:39 +0200 Message-Id: <20200430091640.455-4-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430091640.455-1-ulf.hansson@linaro.org> References: <20200430091640.455-1-ulf.hansson@linaro.org> MIME-Version: 1.0 While initializing an SDIO card in mmc_sdio_init_card(), we may need to retry the UHS-I specific initialization, in case the first attempt fails. This leads to resending a CMD8, but also to restart from scratch with the so called OCR mask negotiations. This is unnecessary as we already have a negotiated OCR mask, so let's use that instead. In this way, the behaviour also becomes more consistent with other similar paths. Signed-off-by: Ulf Hansson --- drivers/mmc/core/sdio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 20eed28ea60d..853ac65f0485 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -543,12 +543,12 @@ static int mmc_sdio_init_uhs_card(struct mmc_card *card) return err; } -static void mmc_sdio_resend_if_cond(struct mmc_host *host, +static void mmc_sdio_resend_if_cond(struct mmc_host *host, u32 ocr, struct mmc_card *card) { sdio_reset(host); mmc_go_idle(host); - mmc_send_if_cond(host, host->ocr_avail); + mmc_send_if_cond(host, ocr); mmc_remove_card(card); } @@ -640,7 +640,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, if (rocr & ocr & R4_18V_PRESENT) { err = mmc_set_uhs_voltage(host, ocr_card); if (err == -EAGAIN) { - mmc_sdio_resend_if_cond(host, card); + mmc_sdio_resend_if_cond(host, ocr_card, card); retries--; goto try_again; } else if (err) { @@ -712,7 +712,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, */ err = sdio_read_cccr(card, ocr); if (err) { - mmc_sdio_resend_if_cond(host, card); + mmc_sdio_resend_if_cond(host, ocr_card, card); if (ocr & R4_18V_PRESENT) { /* Retry init sequence, but without R4_18V_PRESENT. */ retries = 0;