Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp608537pxj; Thu, 20 May 2021 17:44:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgP0T/0Lqm+PX8/VwCb+MhfIhQFl+5rk0x3XzOCACqtRWhmWHjWfPgj8jKSYUMzZKTvMGZ X-Received: by 2002:aa7:c9cb:: with SMTP id i11mr7838625edt.331.1621557875024; Thu, 20 May 2021 17:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621557875; cv=none; d=google.com; s=arc-20160816; b=JkYagzihnw6lIz8VfcX820yQoMewStrZ17pk6oXUngRC8wJMSt/Itt71OJ7Qo8lryb FbAmgFylUY1+uxJCaNjbQ4H7+9iZKrWP8pwPwkXHZV8PojI1OlH92LjDvnuu0SST7mvo zYGkSRuIq63gBPCgENAMjHUBC2jIsIvMLlO9kWD0jMghW+wA5VwrkKRN3/VYEykTLHWn YRBU5S1rQhStPsvqdHarmAa9qBhpQlkGpaqkDN0EHFWmbZ8uE3atrBVDt3I1BaAoA/i/ 16FL0s4uOwKFHc5ISQlCBms3vMQO5xhsIXwggF7cvgmbI2sJ3tRNCSrDxB3ir0vRlpu6 0Ofg== 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=tLky6EqS9YRfFLGuhf1cvkIFg6I0zkZDqY2jBj4GT2U=; b=SBtF6p9kZAnsJintRvkaFuEHQq11hNpdNXvFiXcoqp3jjfUzYdtTLEnSP+oP9wR9cr F2VzxDk4xJJDSLqNWtzUn+wGjMPja6bBsCzlDqOh0ZNygb0q6CPczHJjBlPVf90VW8H6 cQ+zIv/YkxcomDpo4sZXmGFoYICpE4xGh0YrT3nYVEUcnQiXz5/bWySiukxEga4wKbz8 dkqNTIp4265hf8yOYlVHFX1OmhrKGSs++QjcPyvynQ0jCbtEszsfAOl0+skhXMbwaTmx QdrL5A4FzzwoFrNHILxegwCk2otTJiOOdVIIn6Q5rHEn8xm+hjIX54+FzLm8Ij/3/Gh0 wqCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ccSMp79x; 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 ca28si3551004edb.453.2021.05.20.17.44.10; Thu, 20 May 2021 17:44:35 -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=ccSMp79x; 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 S238040AbhETL1t (ORCPT + 99 others); Thu, 20 May 2021 07:27:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:39632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239329AbhETLIB (ORCPT ); Thu, 20 May 2021 07:08:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8D41660200; Thu, 20 May 2021 10:06:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505166; bh=A5inPiDro2dmLvOCGI1sSMAgCihZAUQs94S2G83GUg8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ccSMp79x4zO7RysLwFL8/4aIwlAQ0SYk+uiSrt/d3Hh6xeSL+GCgmMam+oLMxnPp9 Q81yoZzPNT2/vJ9fGCJbmPzh2PNgvygume4JGb2XRPhDUbgNujD5k2hTapoS6VFSGJ qG4LTI6+gZDPCAhEz5mdZZrm2LWOw/xHLTyfX+Z4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, DooHyun Hwang , Ulf Hansson Subject: [PATCH 4.4 012/190] mmc: core: Do a power cycle when the CMD11 fails Date: Thu, 20 May 2021 11:21:16 +0200 Message-Id: <20210520092102.581769861@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092102.149300807@linuxfoundation.org> References: <20210520092102.149300807@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 @@ -1593,7 +1593,7 @@ int mmc_set_signal_voltage(struct mmc_ho 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;