Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7039317rdb; Wed, 3 Jan 2024 02:29:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWF17yIvXIcbDpVeHUgBLNWQ71RnS0ktNPSoZmWho/UB2b3SSiPgGTVL3eYcs8qNvAvHOX X-Received: by 2002:a17:90a:9203:b0:28b:512a:858b with SMTP id m3-20020a17090a920300b0028b512a858bmr1062371pjo.9.1704277754661; Wed, 03 Jan 2024 02:29:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704277754; cv=none; d=google.com; s=arc-20160816; b=kxenPaLfLvmHY4n6envH45uYX4VJjOuYp7JGmjlMCnZ+1zVw5gdPECUTQsESguIBXz 0a/KcJNAzhNRYeGx5x4XnXgcDvUujjC7b88TZeBkALZ4ULacMfXI9Unw5hkMOLr0NX4d EXJwSTusoV+W1/EwG2FbPuwSHDER91y/4X1Y7PyWAsi57JBKe2hnLbg0Qy6BN2sEjSGj j/mfjK7PoWczcBMdDsjL7VL43VS7u+ttbgyJDugYRswKDEKeYdnovZjNFAYbVxjyZm0A rpu+BEuaNqHVubjlEOURNOaI1NMvKGr5B55m9BNL5nrZMKDcwSWBYVxqnbANc9HiJiqm Kq4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=L8nUGwMGmcdQ37anP4pXbySXho8ZvOsvtGKAUVKkBoE=; fh=Jn3jWF0ITaHAyLAVUtFgsWwiigtFjBSHspjWHl82nko=; b=vU3ZhoDzP97w2bSGPgIGpJC1IwdfoPMf9RnA2KSRNTlL7XAI/MxZ3HA0Jr3Ku+QAWp Y3Q2XQxD5zIhSxWUyGaCEMqRbkJGvCe1FtiVS7KLfKA4Y7Lv5QETPTo66F0R80FHuw1d kHv8ELqIGvl+WJ+ZsvGrXIpQ1+qay9koC1BB2E21WQ9i87NsJmiHyulN5F6wLTKj53Jr J9vZvBeXgz+iKb4/fd1HPkw2OtDuUXKp8AsMtyMRM9OFlMGayQXXGuZwdz9QtoCykSCx iS9/I4lRGXe9IGqLHd5IazXfQLppYY/OC2j++7Xpz/bv5IspQta0BwpxQuxxlcnjdYfb /kcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AAcaFfEL; spf=pass (google.com: domain of linux-kernel+bounces-15391-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id fs24-20020a17090af29800b0028c2cdaca2fsi954132pjb.16.2024.01.03.02.29.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 02:29:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15391-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AAcaFfEL; spf=pass (google.com: domain of linux-kernel+bounces-15391-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 448FDB21829 for ; Wed, 3 Jan 2024 10:28:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1134018C2A; Wed, 3 Jan 2024 10:27:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="AAcaFfEL" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEFDE18C0A for ; Wed, 3 Jan 2024 10:27:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f172.google.com with SMTP id 3f1490d57ef6-dbdb8e032f7so209921276.1 for ; Wed, 03 Jan 2024 02:27:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704277673; x=1704882473; 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=L8nUGwMGmcdQ37anP4pXbySXho8ZvOsvtGKAUVKkBoE=; b=AAcaFfEL/zc+DPcuT8WIV6yyWCd4JyyIjNw7C+plFq4U91Bpyq7huqFrp1FfoIK0TX zn8ddkK030kUmth5Rfszt3bkN2SXF5GAB2WA1ADLIO0xIWGH1OapIID8wz4QR5AyyTu1 CCXuCCKo7R8ho6P2apU63W7LysB3FIDFTA/X8b9g3V6cM3p6xqFQqOvJrnR/z/nMZPO/ SfEOgZvlkzupgP5aERbaiAfTGqjAryxUZHsgQH7gBLcqTgHSw/cQiQGEnJL5oINe1ji8 LMtRxRWRmmtg7/FQSiC/bCtBGxslUAmZdg0qXyK0MBbTuc2AHhX2U5dQZ1tx/6Ky9fBg shvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704277673; x=1704882473; 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=L8nUGwMGmcdQ37anP4pXbySXho8ZvOsvtGKAUVKkBoE=; b=wnB8XZL3WBTDCmTEp8PDd9/CNyUkkrYxv0kwk0eAHmEUyTMoC+/Qr9YynX2M+/bt4G NaSaHHXTp15g7OyyAGhfZfbsKPQ6RuHogYo762Kvau7kilJ6KDJUzrQoxicT8ywZj2W4 spGb5oSBffjSE8GmEC+srZZwYqjimKGcA+prO7cKkIjZ6MNyo9NXwe/6M4n7UUFQcbO5 qf9Tkozk1NUedJDjF0FnlTgrRv5x/gt1FHKL77WDo/INMVf6N3WYMot+85avPglIumbQ +PoEkyWqazgeyYFmDKE/Db6SL/53SAi+f23tMntA6xnrl1wNDH1GkfHrl+xsddrcaC/r r8Eg== X-Gm-Message-State: AOJu0YyNT/Faf/90S47ma53IfdviuF0NzNT3tBIzwFq4h/oruMtcjgHG UUNSn0QLJl3/pJ1EyE0KnkBNJpnDUFXL+g04Yg19v6Sc4N28lNBTvdRimK1P X-Received: by 2002:a25:8a88:0:b0:dbd:998:5fbd with SMTP id h8-20020a258a88000000b00dbd09985fbdmr449597ybl.32.1704277672737; Wed, 03 Jan 2024 02:27:52 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231204064934.21236-1-wenchao.chen@unisoc.com> <7541f17a-f0a7-486b-9664-3573623d7154@linux.alibaba.com> In-Reply-To: From: Ulf Hansson Date: Wed, 3 Jan 2024 11:27:16 +0100 Message-ID: Subject: Re: [PATCH] mmc: sprd: Fix eMMC init failure after hw reset To: Wenchao Chen Cc: Baolin Wang , Wenchao Chen , zhang.lyra@gmail.com, orsonzhai@gmail.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, zhenxiong.lai@unisoc.com, yuelin.tang@unisoc.com Content-Type: text/plain; charset="UTF-8" On Wed, 3 Jan 2024 at 02:41, Wenchao Chen wrote: > > Gentle ping. Thanks for pinging and sorry for the delay! Patch applied for fixes and by adding a stable tag, thanks! Kind regards Uffe > > Thanks, > Wenchao.Chen > > On Tue, 12 Dec 2023 at 10:57, Baolin Wang wrote: > > > > > > > > On 12/8/2023 7:52 PM, Wenchao Chen wrote: > > > On Thu, 7 Dec 2023 at 21:59, Ulf Hansson wrote: > > >> > > >> 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 > > >> > > > > > > Hi Uffe > > > Sorry, I forgot to add fixes commit. > > > > > > Fixes: ff874dbc4f86 ("mmc: sdhci-sprd: Disable CLK_AUTO when the clock > > > is less than 400K") > > > > With the Fixes tag, looks goo to me. > > Reviewed-by: Baolin Wang > > > > >>> --- > > >>> 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 > > >>>