Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4426177ybe; Mon, 9 Sep 2019 09:06:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyn5Y8iYtA1mARsXaTUWFz4lig6NaOYm8oywGnBazZjfgeFNdm8w9VJMsQdja6Pkza/8dS7 X-Received: by 2002:a05:6402:1598:: with SMTP id c24mr25197052edv.174.1568045210033; Mon, 09 Sep 2019 09:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568045210; cv=none; d=google.com; s=arc-20160816; b=zoiVAHMmP9BIKsa0Tkb7FWpXRakqWSxR6esOoc/eS4OG5ox1n1bpYblDKKT5OMZgv9 W63cXpCmnnP0mNZYvSk61q0VtMZA6DkyZWwrIATOuM2WglAMZwVjJjtZReOGJ1FpRmp5 +PJxUNBDwN1R03uUGbhkj9XF9yRNdb6MGK7yA1fWUBIfFNp4ErTBA/wIyHCrKc2NP4Gj NyccQdJIdegcO7Mh12dL3nGKDOchX1rzqNab+pUqfgTEer5A9TcRSZ9iKOkClWGZcMgS OFNaAf/hADGRJUPPXnDj5B7AfvIqDWydCZBmzHjmdLaUWo/fBF2GKTO5NSgJebs5g8s3 4O2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lx7zs9g1DL31S2K/89a+Fnrk25vHFABQ7kK6CeJWN3U=; b=Pr4e75vqC4a145g6jCMBvRjhoHRIS4B19F75Ha3qjEWG6vnMYmjwVblLqlI7sgm/HF G6tUoeXCZGTZVGUsdgX5nOThH3QjKWWuMC2+/pzCPUNRKjGGBg6b23Wf20ZAvOjraCmp nldGXbsNpxpkTyqVxiyg4g329KKwph6dS/rbp0Ig5EZ/ORY7t4tHI+ssAzLzwc+X4+yg 4gcyd+KdoqUBoC28DecTT7wWPuVBu0IEAC0SzuwVCbytcylgemjFoed7OQYOw0gSV3Bm cnjHS1BIhS2PvcaWuzytImXy3aiVycvOX88Rc6VOcfd/m6ZhwkiDmDpu+whYW/PMwNhs qZKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ldpBJLpy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w25si8970947eds.357.2019.09.09.09.06.25; Mon, 09 Sep 2019 09:06:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ldpBJLpy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387523AbfIHMxO (ORCPT + 99 others); Sun, 8 Sep 2019 08:53:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:45996 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387448AbfIHMxL (ORCPT ); Sun, 8 Sep 2019 08:53:11 -0400 Received: from localhost (unknown [62.28.240.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 859EA2196F; Sun, 8 Sep 2019 12:53:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567947191; bh=9qZaXUcIS1VhdeTvIeC/wQSRr4d1JEXwODCu9R6q8QI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ldpBJLpyKFKU94NxAUfmWe9+Ap1uhhaHuuwWbEVW2gTrJsKxROxtM6D754sUl7Gjd pcVQj1R78o77+LUaBlQgT/OJE/UHWJ+GbGZrFcYgSY37MU8UWOMQatZHsf+WyfySw9 pznqMfvLuGl2AvBqerXSZxFsrLUOnKDzg84OZ5/E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Kaisrlik , Ulf Hansson Subject: [PATCH 5.2 94/94] Revert "mmc: core: do not retry CMD6 in __mmc_switch()" Date: Sun, 8 Sep 2019 13:42:30 +0100 Message-Id: <20190908121153.122988057@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121150.420989666@linuxfoundation.org> References: <20190908121150.420989666@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan Kaisrlik commit 8ad8e02c2fa70cfddc1ded53ba9001c9d444075d upstream. Turns out the commit 3a0681c7448b ("mmc: core: do not retry CMD6 in __mmc_switch()") breaks initialization of a Toshiba THGBMNG5 eMMC card, when using the meson-gx-mmc.c driver on a custom board based on Amlogic A113D. The CMD6 that switches the card into HS200 mode is then one that fails and according to the below printed messages from the log: [ 1.648951] mmc0: mmc_select_hs200 failed, error -84 [ 1.648988] mmc0: error -84 whilst initialising MMC card After some analyze, it turns out that adding a delay of ~5ms inside mmc_select_bus_width() but after mmc_compare_ext_csds() has been executed, also fixes the problem. Adding yet some more debug code, trying to figure out if potentially the card could be in a busy state, both by using CMD13 and ->card_busy() ops concluded that this was not the case. Therefore, let's simply revert the commit that dropped support for retrying of CMD6, as this also fixes the problem. Fixes: 3a0681c7448b ("mmc: core: do not retry CMD6 in __mmc_switch()") Cc: stable@vger.kernel.org Signed-off-by: Jan Kaisrlik Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/core/mmc_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c @@ -564,7 +564,7 @@ int __mmc_switch(struct mmc_card *card, if (index == EXT_CSD_SANITIZE_START) cmd.sanitize_busy = true; - err = mmc_wait_for_cmd(host, &cmd, 0); + err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); if (err) goto out;