Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp2106013lkv; Thu, 20 May 2021 03:33:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUtfinGABLywhfaIM4Rn5fW1HJ0D8709d2H9/OJhTCcLGx8/d1fIuhs4mJV8R2oVhRtXD4 X-Received: by 2002:a17:906:6549:: with SMTP id u9mr3898948ejn.506.1621506781243; Thu, 20 May 2021 03:33:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621506781; cv=none; d=google.com; s=arc-20160816; b=KJc2Kz9zMOa+EN8KO7i7Q1AqsVu7jfBTWzEN221ZUvyeVe1VhbsIClPFDBHAkt411z 2LUOadQcrr3X3iwd36oZQPCEhiCMsDVxQMemtq81E/+JFVBYI53qHOqzMWcWgAjcWDdG 0rdoON6Xf9v3i+djzqn2FtaAWHjldyaAQQfOyVqqhSHnT3yqf/R8Pok3qNQYrJiWvqmO rdFLvLLvbu/XleoMRn/mEbFA1mLLoIshJDtEdsrs7QybAlk+41gFAxbtB00PZ2T4+iWi DH2RGignDKbkkyYfL62bJeQUwT5d7uEeSzLGDOrDPG1cJxdb7BhF+CpX5FZ0Th41mMfG vEpw== 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=QWV/79r76AXKvv5+canWr3AbHMOUv/Di8HfjrYes114=; b=eCc+ZJb7jH6Ao6XCml4Lb5TCcxJw4rFaKnnrumvx3494gaJoBCKyMRc3bdgtUeb3cH R1Z0RLrTYT9XJuL9GzL0E3eo49b+pkYEAAzmupiWSc2s/gnOc3wOXspC88iSxQqQgO0Q 4RibQ/ZF7syTs0O4bU3WQkWwgvs1ZC/kLUdAq68n9aptsRapO0sn3lJupJ5zI/GVLxnR 3ztVMm86dZqO5WgAieBH3y9cplyhG+MpM1qK+zExhrrqd7/uEhMNVaC1xsURRwW+CYCk tF+e0hdSnVFzc9WKQDE9T8f2Jjhce68tFYrt/svz/BvPGqxdl006IrWhB30r4GtBfSTG fGbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=betnyyTv; 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 nb19si2475394ejc.581.2021.05.20.03.32.35; Thu, 20 May 2021 03:33:01 -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=betnyyTv; 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 S237108AbhETKbl (ORCPT + 99 others); Thu, 20 May 2021 06:31:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:51948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235448AbhETKTO (ORCPT ); Thu, 20 May 2021 06:19:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4F18D613F2; Thu, 20 May 2021 09:47:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504020; bh=sAYr0DJapOyVriQnr9pgTvIoXm2ab43QKaLcBLu4Gtw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=betnyyTvKIdtnS9u+NdCpbQn8y7K8gUpqU4tY6lwdy4pTiMY3ZPj6Oe9g28UuYdN2 PlbpqKK4P4ul8uBoqE07Jt/+OJ5phkZzg2ZBNqO7SpIL0sCxRD74KagBsnvWqY43rI gyWWSPwp4hwqRYOELtrpN5gEi+elfriec/GfpxRI= 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.14 024/323] mmc: core: Do a power cycle when the CMD11 fails Date: Thu, 20 May 2021 11:18:36 +0200 Message-Id: <20210520092120.941589677@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 @@ -1506,7 +1506,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;