Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2469919pxj; Mon, 10 May 2021 03:53:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+YgiRY53v5Pi1J3m0etEFfKcZDoJUAcGkfTbV0g3q5KNJmeXCVUP3NCAeVg/NY9NWuC5g X-Received: by 2002:a92:c7a6:: with SMTP id f6mr20852643ilk.17.1620643997306; Mon, 10 May 2021 03:53:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620643997; cv=none; d=google.com; s=arc-20160816; b=XYiL9s6Zv4ypK/aIF4Y2PYZPB0eQtdmqgFlUigyrgJ2ww35NEQL0n+6a6WShMr7h7J Q/M3W7Klhmwzd+TQAJB0jxSolvLuJn34YCJToPPq96iX9ukmKHqKtlY22Xtoi1AxqUB4 5S2/12O1O1aKAVxxeZoBZY5t9zr0szwRJfvx/wjgHatXLQjxBhg+ngtsFIGN/5bNgnwD Vkz7frAp0KVN76rGfvYxQliwYKS1eKHEs6pq6OBE3hXJz1L0YKCj2+UuM/0/hbE4gmEY TCB10QTlmBq8A2vptXVZq+c39Bg/JG1BeOUCbPA3ImY4kUq+8/NdTowGQoiEMYBEnSGC ze+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=djOaUIG3cOzM6gKhWZszkhqXpAk6ix3EfHRikKbI8ok=; b=sk5gnATMoFnZyPq4kaRZBFuE5DUz8GMGVCX4vwYbLUU0TRor8LWhaOfE8PCTe9lXKw MorC9JBXvJ6VAureJGvldIb+RP6zllbDicK7+Uyb2mF5uGGNXThKc8JGNNVF9drAzY1s rSB5k6Mzh8dywReKnDrEKHonHfS0lhvuYXXnmA8LhYV/OKgY7GYhdfTqg/msUy39c2+j MapG+zMPdP3f2r/CjkqzTmcyxxrcNBiUXcnEkVB8LKVL6d6q0deoS81akJEk8/CCroJu fLSH4F30/vvQuU4+bqkRLiKSVDswE6Ou4WfD8yMqiFbwNXVFS67HMu4RmfUPfeh7P7KK t76g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FBk2XSih; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si14596327jam.34.2021.05.10.03.53.05; Mon, 10 May 2021 03:53:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FBk2XSih; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232313AbhEJKxF (ORCPT + 99 others); Mon, 10 May 2021 06:53:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:48980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232290AbhEJKmW (ORCPT ); Mon, 10 May 2021 06:42:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 407C66196E; Mon, 10 May 2021 10:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642751; bh=l9NlGs+WrWkWkP50pal1oVEQ6Gaug3majrHyfjRKi2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FBk2XSihxWq2Y5dY8Tk1GBxhsAll9YSWep87PSvaWma7MCG58bQGt5pFSES37v0mP BRUvRoNj6pfaYvPy69qn73qRiVJ9uQurKy2dAcAzdtNDtSTivJRw4PY4xPPuPxWyi1 +6matnYJKWeOoK9Zz5RZNv/LX84HSW2j+yC23bJk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, DooHyun Hwang , Ulf Hansson Subject: [PATCH 5.10 035/299] mmc: core: Do a power cycle when the CMD11 fails Date: Mon, 10 May 2021 12:17:12 +0200 Message-Id: <20210510102006.006958314@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: DooHyun Hwang commit 147186f531ae49c18b7a9091a2c40e83b3d95649 upstream. A CMD11 is sent to the SD/SDIO card to start the voltage switch procedure into 1.8V I/O. According to the SD spec a power cycle is needed of the card, if it turns out that the CMD11 fails. Let's fix this, to allow a retry of the initialization without the voltage switch, to succeed. Note that, whether it makes sense to also retry with the voltage switch after the power cycle is a bit more difficult to know. At this point, we treat it like the CMD11 isn't supported and therefore we skip it when retrying. Signed-off-by: DooHyun Hwang Link: https://lore.kernel.org/r/20210210045936.7809-1-dh0421.hwang@samsung.com Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/core/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1204,7 +1204,7 @@ int mmc_set_uhs_voltage(struct mmc_host err = mmc_wait_for_cmd(host, &cmd, 0); if (err) - return err; + goto power_cycle; if (!mmc_host_is_spi(host) && (cmd.resp[0] & R1_ERROR)) return -EIO;