Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1669669rdb; Thu, 7 Dec 2023 05:59:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IETYVM0y1JYpBiqIn6/0xUJtNuok3OEuqC3v4+oT1NjRHecyM4mvqTbXmd+FpHJsiWqSvGS X-Received: by 2002:a05:6a20:da9f:b0:18c:91ff:8268 with SMTP id iy31-20020a056a20da9f00b0018c91ff8268mr6222175pzb.9.1701957590247; Thu, 07 Dec 2023 05:59:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701957590; cv=none; d=google.com; s=arc-20160816; b=tKCKxX1ICf8x5XRBWGLjfZciN/eFxRe9LZiQYL2nmOqXFbzmdwwwYo79mEIbnB8rc6 /3GhefcpSuVAVKmprMaB4qL5mvlaArsdR+cP3TBw209lcljoocIUSfrLFnPGD/3sifVO CPgCI1u+YSFkFZ4Aex+oxFzICPADon0qXv5tgdyiP+gL2YX055DPn5fOyxdtDaOVUEWe W3lPzB6TA3r++u/ZHQrLNicrlerHtGvL6Ebj2El0CKkFuyazg6GWYi/mx8VkjKEgvUXK 0JvsbIwF4k17r2SvOKE+L/K0UiLYlfDLsPuptSxuLFaYojraz/1NC6vkSARBPTSF1dHS 2nSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=s0vyvlC9eF+1wpIASte+MSRLcH7gFX9ras58OkHQG/I=; fh=F3UnqIe7Cv2H7wsoUQKJbLL3hvwyA7W3aE64VxcC1VI=; b=csLsBBUwQ/RUUhFjjZvydT6no/11mA6KMKUpWjiyyzMpV00/PtQqQUBsbpxMP9TDSr 2oXK4F6sdliJRQjqUyczZg2IiqNBQ3FygM4XyeOBBhF2F8WgcMG+ZTQH9HXHoDFvykuX tAQ/xkDblQJZIgkpqwQwKIwusNYz0hEww4nYgkXMZDXhWJrV0506SDn5vRdXP/e6OBnp YWHCW/rwERbq8hecAfMpgMhAiSNvnltwT5hnzghYffYCJ1QSciXYBUtufZispacCisO/ xy8dLuq4UL/yP/e9oy4Zb1K7sh0sJSLbnOnwdWAKEJ4ZgTTAfo1lsJKahEUXUPU0UOHe BcUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hVm3rQYW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id bw39-20020a056a0204a700b005c5e2331ba9si1243573pgb.324.2023.12.07.05.59.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 05:59:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hVm3rQYW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 56A808034658; Thu, 7 Dec 2023 05:59:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442536AbjLGN7a (ORCPT + 99 others); Thu, 7 Dec 2023 08:59:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235208AbjLGN7a (ORCPT ); Thu, 7 Dec 2023 08:59:30 -0500 Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 463C510F6 for ; Thu, 7 Dec 2023 05:59:34 -0800 (PST) Received: by mail-yb1-xb2b.google.com with SMTP id 3f1490d57ef6-db5e5647c24so1804987276.1 for ; Thu, 07 Dec 2023 05:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701957573; x=1702562373; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=s0vyvlC9eF+1wpIASte+MSRLcH7gFX9ras58OkHQG/I=; b=hVm3rQYWBYyVQ0uW9eomnQO118KuY8vUU5VT4x04hP4lwY/YCAllr9jgjyqbys8MMG dj5meFr1Q6g9GwKFI+aj/ETYowxBtv9DxpESvA39YToX0TZBA1f5VqmJSddQgkZw+LK7 OLKG9E1fC4Hd25hUdm62w4Kq1xiGMpy2RzRbQZ2nfudJmh5iuf0rEC30I31odzu1fEAh iXxLhaJ2DAb3TStrVXEf2feDxqCqzJgkAXfn6pKPHepKGm5WzIDB9V7+EPadsh6IrFjF V5a1QAWXP2xr30KhT3/gRK3RXQXUVTXmjLQ5tayalxVWCET2c3J2y2SiYoA0xLEHdUOJ JtAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701957573; x=1702562373; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=s0vyvlC9eF+1wpIASte+MSRLcH7gFX9ras58OkHQG/I=; b=hvFyO49nupd+MI94V+fR68wBpPdQBdAoVgKaPHw4jg1DQop+G3cRvVrmMgDF7CeR2j tN3R//UjaWZYfMfxh7V1t82fbcr2oF/Tdww9aboGolGlm23hwJjUuAx/562fvG9HbZox GvTsCVReTh4E8faxgjIzLrJvhs27M9sPBskj+AKzaVTdWgXHqU556BRAcqs9FXpPpfsT ELPwaZr9aEQ/cac6jYfWd8tikYCYbdfseIsk1aB42qpUS2EapMHeMuGxy95uKNDFbGkh lcWNFSZPiYHVCnQspiqVMfHd7/aOnQ6mI9Bs7zh3v5JvoRq5UbyAvvxGtgNUmsWBzNO4 iWQQ== X-Gm-Message-State: AOJu0Yxn8wmUYmXLUkAu771oSdDSumOBHXzNugjvY3/r1xDW7YMghqi/ XB+rbPO4gGP2rQnEmPyWJFgYcHlXyMAGLjgN/HdPWY5d5K/JmUGy X-Received: by 2002:a25:e64e:0:b0:db9:52dc:62c1 with SMTP id d75-20020a25e64e000000b00db952dc62c1mr3391214ybh.65.1701957573313; Thu, 07 Dec 2023 05:59:33 -0800 (PST) MIME-Version: 1.0 References: <20231204064934.21236-1-wenchao.chen@unisoc.com> In-Reply-To: <20231204064934.21236-1-wenchao.chen@unisoc.com> From: Ulf Hansson Date: Thu, 7 Dec 2023 14:58:56 +0100 Message-ID: Subject: Re: [PATCH] mmc: sprd: Fix eMMC init failure after hw reset To: Wenchao Chen Cc: zhang.lyra@gmail.com, orsonzhai@gmail.com, baolin.wang@linux.alibaba.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, wenchao.chen666@gmail.com, zhenxiong.lai@unisoc.com, yuelin.tang@unisoc.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 07 Dec 2023 05:59:46 -0800 (PST) On Mon, 4 Dec 2023 at 07:50, Wenchao Chen wrote: > > Some eMMC devices that do not close the auto clk gate > after hw reset will cause eMMC initialization to fail. > > Signed-off-by: Wenchao Chen I assume we want this tagged for stable kernels too, but do we have a corresponding fixes commit that we can point out? Kind regards Uffe > --- > drivers/mmc/host/sdhci-sprd.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c > index 6b8a57e2d20f..bed57a1c64b5 100644 > --- a/drivers/mmc/host/sdhci-sprd.c > +++ b/drivers/mmc/host/sdhci-sprd.c > @@ -239,15 +239,19 @@ static inline void _sdhci_sprd_set_clock(struct sdhci_host *host, > div = ((div & 0x300) >> 2) | ((div & 0xFF) << 8); > sdhci_enable_clk(host, div); > > + val = sdhci_readl(host, SDHCI_SPRD_REG_32_BUSY_POSI); > + mask = SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN | SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN; > /* Enable CLK_AUTO when the clock is greater than 400K. */ > if (clk > 400000) { > - val = sdhci_readl(host, SDHCI_SPRD_REG_32_BUSY_POSI); > - mask = SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN | > - SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN; > if (mask != (val & mask)) { > val |= mask; > sdhci_writel(host, val, SDHCI_SPRD_REG_32_BUSY_POSI); > } > + } else { > + if (val & mask) { > + val &= ~mask; > + sdhci_writel(host, val, SDHCI_SPRD_REG_32_BUSY_POSI); > + } > } > } > > -- > 2.17.1 >