From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 926032D8796 for ; Thu, 18 Jun 2026 15:15:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=205.220.168.131 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781795716; cv=pass; b=phhaWP7coSmvT004Y+FPkT8ssVGWsooY06JcXF20NFW7Lw3SxKdiUfeIaUlTxdJdfmxX+CpTBydoFZUigOGLATTn8RVzE0N8l00ZOwCG0VhvML8/sWvWjmU3vkmuKlwrDY1iosm1RnPfIhOr7WcBBgF5nFKIkr8mUvTHN7y+Ezw= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781795716; c=relaxed/simple; bh=OfQJjT9mcDuwucAC2FRRfrK4qbXUKj7zz6ijBXA2qd4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=f3p0B97RLTTV1YmJhbZKXEDtCUvd8cgClVwx4sbPL8JOxgy7RafIZrdRE6QDb9BADcBSO4DwvmyFAeEPGAWDbpfUVzvIlzZl+dHJdJJvIZCHmmOOMg7cMULlMUR/j5/AztKcAg1DITuMBzZ1EIlgRTg6CLy9EyX+pg32sK2SECs= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=oyR10Vud; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Mp6xM7vK; arc=pass smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="oyR10Vud"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Mp6xM7vK" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65IFDvv7149629 for ; Thu, 18 Jun 2026 15:15:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= S+KNlYIZo/dliTPA4hgLKiv+42uY0+PvGl8oACiJs4g=; b=oyR10VudCcDAEPTy p6EzuC0vxqZT625KS2fwi3MVYymn2TRt4jIXRXYg8k717X1nCcI7RNYBMweXRt7m JcLAMpNpAEkelVpLjvu/4aIzOAHEgp+nuHx6M+OzsLjH30+1RApJmAqPzkbAvZnr UZHqxf1UnPJFmMncMOxmfB3BF6Qu1p2E3LiaAJcf+5rQH0K1uIXclw8wAZlqKjk5 Ejj6PIRAFrZkCJbdeHA9dTuPNU5RhXsgUP7WWG/2spycyPQ7jq9gUzu4m5mU6m+q RaYDoNgO+HQvftXjEneijOqV5PiVQKLC3AYnU0nrV7Y6CTc7mqANBRPcXpVp6z9t 7IPQPw== Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com [209.85.217.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ev0vk3ykg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 18 Jun 2026 15:15:13 +0000 (GMT) Received: by mail-vs1-f70.google.com with SMTP id ada2fe7eead31-6cf37fe12faso502494137.0 for ; Thu, 18 Jun 2026 08:15:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781795713; cv=none; d=google.com; s=arc-20240605; b=PBg6iDzLgT2suIXL3ffAQNFsAMZoRkXO935bFAz/TZZVfLIXnLNbbv5p/jBoubv6Sl dHs+w5hJ0S6zs31rVQBuBkg9keUhSUmsgmfGD6Qn5yQxM18vv/dfOb7VUcqXmLYojHdf JM9Z6eZq1RRw5TX+jEwa+FZDq0H1wGp7kHME6gLIs4qasJK318k3XzUZK+iizSTWhDwr QMCkNICg1RIU6Z6o7AwtKqFk/BcHbWmUlC7JMwWZ8NMrgfqkle0RaXbgS3zBwdTReRN6 GttMnc7cGrbMtTUW5Dujs4fCfU0kCyw3KhhZMkQ68JTUlK9clyeo+0Y2k6JKlAsoA587 4gTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=S+KNlYIZo/dliTPA4hgLKiv+42uY0+PvGl8oACiJs4g=; fh=e2udTL1C/2pg+qV/66uyo4X3F185Nu/0M1Fz4btdzUA=; b=a9mi/yMjuM6H8om4uWMxb4QM06jleCYkRjzUlMJg1uItbFSQNniq8Z4HZpcj/Dt2dq z2YN8BSLOwU9PNCe4EJi9WgGQjNc4m4+sz4vvOedHALXqITsQ+Oq0jRu1bXy7HDMRoSB EQt4cyyYjN5KizBMzSkDxstH6YZkBOeasQoWlOBqwnevV1qWFMrMoWL7C0M2wUdyzJqo K1KRNrESxVQEgBMfKq84Zl+F5tsTCa5zAXMsdHgXrVCqdLeu1QkPu5oODAKhZ/gKrPA7 yMK6q/ms1Sp10hV8usYwYFttQtXKqwTSjGUiR91be7vl/ow2/y/UceTRbTkhF+YW1gGU Iksg==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1781795713; x=1782400513; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=S+KNlYIZo/dliTPA4hgLKiv+42uY0+PvGl8oACiJs4g=; b=Mp6xM7vK/UaKd9zkV2zcuujWTXak7sM1Qx5AWyDjPDsdFtNAcT9XLaaWlBgm5bKKnS /aqm8TiajACFwL2XO90Krx589IFHW9mDj6Agopq77H6oz5+kYx0EudapCsfb0CduE7mr 48/AjKBjcijKEvqXA1dTW73nx80uq/J9hG52QsT7eLL6wW4ZbuC6XnYcGDD+hElHAN+a naHIEp/j1ifXFVLEkkY2pAe/+WiGGiWSHibDivJ4eXTUVhC/URKM6IvFRHFMVeCh90Cx rrxrLqj1Rdja0/4M10d/H9UEggj46LSVGUUhjOUWorEveVuo+bNe8ZTQHvuE61uZCYCW Phbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781795713; x=1782400513; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=S+KNlYIZo/dliTPA4hgLKiv+42uY0+PvGl8oACiJs4g=; b=HpGWuPBdvMkPwwDWnL5XfaLRRe5Mxx9tMe4lvg/kWVM76rE5s4+HvlbbeTT9Oos1Dg NNqE2QjgplGUGxVmVriYAH/D/tgUWCSUHJnLDKapbp2uv2Z9xXoZnSxxMrwm2eHMvDPi 3eqvCx7CjtDm7wooTyJ107a2eu8F5VYuXDOS/B2oAZMOn89YznI4GnDDo9pwTZiq6X2J 3xk5ykv4PgQwBjYbIVORvbcjyrwVCU+Sc3c09GEedh2RUxmFSZx138g2MVn/5s+FVQcT 2oVc6+nFeM8bHuG1ICsRvcT+2J37cHqfklLuee3Um9MVWAOtuwKSrIC/1xmTSiltjzR9 NdtA== X-Forwarded-Encrypted: i=1; AFNElJ+iC0qX8j8Jnf3OjjCl9Hn30NWcij6aEcLcOpjXF6z1b/bMAwuyzjEFjCL2lbNlYBgTDrZb6/2QX05pwhE=@vger.kernel.org X-Gm-Message-State: AOJu0YycctRaBkDAhMuKOli79Yh9sdE9HMj8DN53QaBqMOyrlnxjGe74 vgRt/D2Uvx+Tnzp3bZkDOLdTxPMRKypbN8a7iEjLmI3i+DvQuhyEfXVCiRnlnymGI+X2DeE9IAz IZJgCOJCwXwtMfmfrfofdLhAuM536a8TigOFmuZxB1twXFKN1ALqQDLe9hTblKd0CjAvGb6l8K5 cXGZMaiMNIlW8QNzPmdau064SRVkf1LsUftNUuPRXFpg== X-Gm-Gg: AfdE7cnbNKhouF9eRKZqFX/qXyUMPf14B07KfXOh+MeacqhD3hfLdp7glIxAaN+yDqB MPCo+CWNlGpp6MCFLa0+oyYnEdIMl8cG/KmCpJhmKCeFA5swfyX2JH34fsUVKYuIOSqBnaXy6ab nWUPAImA/BMaA0oc17LUubgb/GmXRWDWzURd/4naSrRbFiui+sOUPNnYkbS5MQcFoMPOTy X-Received: by 2002:a05:6102:160d:b0:726:ec78:9513 with SMTP id ada2fe7eead31-72a0188306dmr60584137.4.1781795712608; Thu, 18 Jun 2026 08:15:12 -0700 (PDT) X-Received: by 2002:a05:6102:160d:b0:726:ec78:9513 with SMTP id ada2fe7eead31-72a0188306dmr60434137.4.1781795711883; Thu, 18 Jun 2026 08:15:11 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260413180551.3683969-1-florian.fainelli@broadcom.com> <1d583be4-b1cd-4226-bdbe-5ebd275de9c2@broadcom.com> <915473f9-64bc-4630-9c82-41fcf4401042@broadcom.com> <487cf4a4-218c-4a6c-8eed-a4ab170f01c6@broadcom.com> In-Reply-To: <487cf4a4-218c-4a6c-8eed-a4ab170f01c6@broadcom.com> From: Ulf Hansson Date: Thu, 18 Jun 2026 17:14:57 +0200 X-Gm-Features: AVVi8CePJJLrnOqQUb5vqLPmlkhge41kAdJKCiiFVl5nF7phUp-xC9IcVMl4tGU Message-ID: Subject: Re: [PATCH] mmc: core: Kioxia 016G01 does not enter boot mode after SLEEP To: Florian Fainelli Cc: Kamal Dasu , Ulf Hansson , linux-kernel@vger.kernel.org, Ulf Hansson , Wolfram Sang , Oleksij Rempel , Avri Altman , Pedro Demarchi Gomes , Erick Shepherd , Adrian Hunter , "open list:MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND..." Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: WgtSulqqnNVpqFrdgRGWz8S2harex1Qt X-Authority-Analysis: v=2.4 cv=DNy/JSNb c=1 sm=1 tr=0 ts=6a340b81 cx=c_pps a=N1BjEkVkxJi3uNfLdpvX3g==:117 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=Q-fNiiVtAAAA:8 a=EUspDBNiAAAA:8 a=nGK9Xfj9c10kWem_e0IA:9 a=QEXdDO2ut3YA:10 a=crWF4MFLhNY0qMRaF8an:22 X-Proofpoint-GUID: WgtSulqqnNVpqFrdgRGWz8S2harex1Qt X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE4MDE0MSBTYWx0ZWRfX4pzP6Og5fckz Jnkr4JcwuevFRPMcFP+1GXLP2a9n48cn4UEpOwbV5IhDLENJ5HbKLgogoXTshILKvqpqXPQVGng SX9sKuP4Vxr9kCtcDEv9RbKxFd2r3h0= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE4MDE0MSBTYWx0ZWRfX7U1eHakpaH1s 0vMdCJRdNETFV+sOGMI5NnPiGRCgTpduyxYjk6V//pYqoTNBo1U6UgxNiPURz2a77CMDDo5T25Q +YXoeKZZgwEK8UfiAnOBT6WwfrubApYWRxW2qbrTJuwTeSgAxZ6DKSbMzDyT2nWWrECa4lIak6L ZeUHm5geKFqvqjLJ6vZYChfWltL8zzhFQ58cUG1mfWSbynUVWmdUKCEMLkc8mMQ1/rCLcfWcMCI UOkltkATXJE5lcDN7f1KJyutkBZeVv+iXMQQCAvacmCF2qVzHPmRJexkqJ+1fLhMdeyxi1LDuD/ oJZf/GCBEdq6E0i2UUZTXfduHLIkatKouuuESiOXsInda1Ln7hjroEkEH2BAauOXYCjJYUG6Xnn fglnwHQN5YEbR3RWE3aM1y/jkaIdsYbjjgW3SNtvIwSxKazukq/tSw7R+rq7FKpzQL8FSfucCrN IxgO+drHtzTTS3/664w== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-18_02,2026-06-18_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 phishscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 malwarescore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606180141 On Thu, Jun 18, 2026 at 12:23=E2=80=AFPM Florian Fainelli wrote: > > > > On 6/17/2026 2:49 AM, Ulf Hansson wrote: > > On Tue, Jun 16, 2026 at 8:58=E2=80=AFPM Kamal Dasu wrote: > >> > >> > >> > >> On Thu, Jun 11, 2026 at 5:53=E2=80=AFPM Ulf Hansson wrote: > >>> > >>> On Tue, May 19, 2026 at 5:27=E2=80=AFAM Florian Fainelli > >>> wrote: > >>>> > >>>> On 5/12/26 06:33, Ulf Hansson wrote: > >>>>> On Mon, 11 May 2026 at 18:01, Florian Fainelli > >>>>> wrote: > >>>>>> > >>>>>> On 5/11/26 07:18, Ulf Hansson wrote: > >>>>>>> On Mon, 13 Apr 2026 at 20:06, Florian Fainelli > >>>>>>> wrote: > >>>>>>>> > >>>>>>>> The Kioxia 016G01 eMMC device does not exit SLEEP mode when send= ing CMD0 > >>>>>>>> which prevents the system from properly resuming from S3 warm bo= ot where > >>>>>>>> the eMMC is necessary to pull in the boot components. > >>>>>>> > >>>>>>> Is the bug confirmed by Kioxia? > >>>>>> > >>>>>> We've been going back and forth with them without much progress as= far > >>>>>> as a resolution goes. Since there was no progress and I would like= to > >>>>>> get this included in downstream kernels at some point, this was su= bmitted. > >>>>>> > >>>>>>> > >>>>>>> If not, can you explain a bit more what is actually happening dur= ing > >>>>>>> system resume? > >>>>>> > >>>>>> Upon entering Suspend-to-DRAM, the eMMC will be put into sleep mod= e. > >>>>>> When our systems resume, one of our hardware cores driving the eMM= C (HIF > >>>>>> block) in command mode will send a CMD0 command for the eMMC devic= e to > >>>>> > >>>>> Is the CMD0 sent solely by HW/FW before the mmc core executes > >>>>> _mmc_resume() during system resume? > >>>> > >>>> That is correct. The sequence basically goes like this: HW sends CMD= 0, > >>>> then FW pulls in boot code, identifies this is a Suspend to DRAM, do= es > >>>> its steps, and eventually Linux resumes and calls _mmc_resume(). > >>> > >>> Okay, so it seems like this problem boils down to the fact that the F= W > >>> decides to send a CMD0 command for no good reason at system resume. > >>> Unless I am missing a point here? > >>> > >> The JEDEC JESD84-B51 boot sequence is normative. > >> The host sends CMD0 (0xF0F0F0F0 / GO_PRE_IDLE_STATE) to enter pre-idle= /boot mode > >> Broadcom mmc controller does not skip CMD0 and has no knowledge of the= power > >> State that the kernel left the device; it runs before DRAM is initiali= zed and before Linux resumes, > >> before any kernel state is accessible. > > > > I understand the CMD0 generally works to wakeup/initialize the eMMC, > > but that isn't really sufficient. > > > > Please, consider these scenarios: > > 1) If the kernel decides to turn off clocks/regulators (VCC/VCCQ) at > > suspend for the eMMC, then how does the FW know that it needs to > > restore these before sending CMD0? > > If we had such capability on our board designs, then we would make sure > that there is adequate power sequencing within the board design to > guarantee that the eMMC device gets powered back on upon resuming from > warm boot. We have a variety of signals that can be wired-OR to relevant > discrete chips, or use an external PMIC to achieve that goal. Your point > is well understood and valid in general, but not applicable in our case > here. > > > 2) At resume the kernel wants to wake up the eMMC by sending a CMD5 > > (awake) instead of CMD0 (not implemented, but since it is faster we > > may decide to add this at some point). If the FW already sent CMD0, a > > CMD5 path would fail. > > That assumes the kernel is the first entity involved in interfacing with > the eMMC device, but that is not the case for us, see below. > > > > >> > >> > >>> > >>> The problem is that the FW doesn't know what low power state the > >>> kernel decided to put the eMMC device into at system suspend, hence i= t > >>> should really leave the decision to the kernel to wake up the eMMC at > >>> system resume. > >>> > >>> Would it be possible to fix the FW instead? > > This is not an option for us, see below as to why. > > >>> > >>>> > >>>>> > >>>>>> exit SLEEP mode. The Kioxia 016G01 device takes 10ms rather than t= he > >>>>>> tSLEEP_EXIT value of 1ms which is advertised and so our HIF block = does > >>>>> > >>>>> Can you please clarify what tSLEEP_EXIT refers to? Are you referrin= g > >>>>> to the S_A_TIMEOUT in the EXT_CSD register for the eMMC card? > >>>> > >>>> Yes, sorry I am referring to S_A_TIMEOUT in the EXT_CSD register. > >>>> > >>>>> > >>>>> Anyway, waking up an eMMC from sleep state in just 1ms sounds a bit > >>>>> optimistic to me. > >>>> > >>>> Fair enough, but AFAIR we wait up to 30ms before declaring a timeout= , > >>>> every other vendor we have seen exits and acknowledges boot within > >>>> 1-10ms at most. Similarly if the device is not in SLEEP, then it > >>>> acknowledges boot within 1ms. > >>> > >>> The S_A_TIMEOUT specifies the time the eMMC needs to complete the wak= e > >>> up from its sleep state. > >>> > >>> If the device isn't in sleep state but fully powered-on (as it seems > >>> to be what you have been playing with), the eMMC should just respond > >>> immediately as with any other command when the eMMC is in "TRAN" > >>> state. I assume that's why it works if we don't send the CMD5 (sleep) > >>> command at system suspend. > >>> > >>>> > >>>>> > >>>>>> not see the Boot ACK pattern in time and does not service the read > >>>>>> request from the processor that wanted to read from eMMC, we get a= reset > >>>>>> of the system, rather than continue booting. > >>>>>> > >>>>>> When SLEEP is not enabled, the eMMC device responds within tSLEEP_= EXIT > >>>>>> as advertised and we don't have that problem. > >>>>> > >>>>> Okay, I see. > >>>>> > >>>>> In this regard, it's important to understand for me how the mmc hos= t > >>>>> driver (and the HW/FW) manages VCC and VCCQ when the mmc core calls > >>>>> mmc_power_off() from _mmc_suspend()? > >>>>> > >>>>> Does this turn off any of these regulators or what happens to them > >>>>> during system suspend? > >>>> > >>>> We don't have software controlled regulators for VCC and VCCQ and ou= r > >>>> reference boards using that specific eMMC device keep it powered on > >>>> through suspend-to-DRAM. This is the very reason why if it stays in > >>>> sleep mode, powered on, and then we attempt to boot from eMMC we hav= e > >>>> this issue. > >>> > >>> Okay, thanks for elaborating. > >>> > >>> So you are mixing the system suspend/resume scenarios with boot here. > >>> Is the problem for both? > >>> > >> No the problem only occurs when we suspend/resume if we put the device= in suspend as per spec, > >> subsequent resume fails. > > > > Okay, thanks for clarifying! > > > >> > >>> > >>> I understand the timeout problem, but not why the FW needs to send th= e > >>> CMD0 to wake up the eMMC from system suspend. In regards to boot, tha= t > >>> is an entirely different scenario. > >>> > >> > >> Vendor datasheets implementing JESD84-B51 quote from spec : > >> "In the Sleep state, the power consumption of the memory device is min= imized. > >> In this state, the memory device reacts only to the commands RESET (CM= D0 with > >> argument of either 0x00000000 or 0xF0F0F0F0 or H/W reset) and SLEEP/AW= AKE > >> (CMD5). All other commands are ignored by the memory device." > > > > Yes, that's correct but doesn't explain why the FW needs to send CMD0, > > rather than relying on the kernel to do it. > > See below. > > > > >> > >>> Does the FW need to read something from the eMMC before the system > >>> resumes? Or that is just during boot? > >> > >> > >> It's just booting up on resume and reads bootcode. > > > > Would you mind elaborating what "reads bootcode" really means here? Is > > it reading data from the eMMC? > > We have a boot ROM masked within the chip that interfaces with the Host > Interface (HIF) controller which drives the eMMC in boot mode in order > to allow the boot ROM code to pull in the subsequent boot components. If > that first access fails because the eMMC device is still asleep then > that boot ROM considers it a fatal error and will issue a chip reset. > From there on, this is no longer a warm boot, but now a cold boot > because the reset reason changed. From a system architecture > perspective, a warm boot is similar to a cold boot except: > > - there is a reset controller bit indicating this is a wake-up from what > we call S3, rather than a cold boot > > - DDR contents are guaranteed to be preserved by having kept the > supplies on, therefore we can restore SW/FW states > > - there is additionally an on-chip memory RAM that can store persistent > information, too > > - first stage boot loader identifies the warm boot condition and then > proceeds with restoring DRAM calibration parameters, and then hands off > control to the remaining FW/SW running on the system. Eventually Linux > resumes and can interface with the eMMC controller > > > > > To me, it looks like we may have two ways forward to fix this problem: > > 1) Fix the FW so it doesn't need to send the CMD0 at resume. If that > > is possible, this would be the best option. > > That is not an option for us because the > > > 2) Instruct the kernel to keep the eMMC powered on at suspend, while > > still doing a regular re-initialization of it at resume. > > OK, so your angle is that we should not focus on the kernel sending the > SLEEP command, but instead have a notion of "keep eMMC device > always-on", which would also tentatively address a board design where we > could turn off the eMMC device voltage regulators? Thanks for all the details! Yes, keeping the eMMC device always-on seems to do exactly what we want. Although, since the FW sends a CMD0, we need to re-initialize the eMMC from the kernel point of view, at system resume. So, let's move away from the card quirk and invent a new mmc host cap bit that instucts the mmc core what to do here instead. Not sure if this a DT based platform, but if so, we may also to want to add a corresponding dt property, unless the mmc host cap bit can be derived from a compatible string. Kind regards Uffe