U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Judith Mendez <jm@ti.com>
To: "Kathpalia, Tanmay" <tanmay.kathpalia@altera.com>,
	<u-boot@lists.denx.de>
Cc: <trini@konsulko.com>, <peng.fan@nxp.com>,
	<jh80.chung@samsung.com>, <marex@denx.de>,
	<tien.fong.chee@altera.com>
Subject: Re: [PATCH] mmc: sd: Handle UHS-I voltage signaling without power cycle
Date: Thu, 14 May 2026 17:21:26 -0500	[thread overview]
Message-ID: <2fc6397f-83d9-49ff-aaa1-ab4d773c95bd@ti.com> (raw)
In-Reply-To: <190995da-40e1-422d-baec-dd3bdad0b315@altera.com>

Hi,

On 5/14/26 1:50 PM, Kathpalia, Tanmay wrote:
> 
> On 5/14/2026 5:09 AM, Judith Mendez wrote:
>> Hi Tanmay, all,
>>
>> On 10/21/25 3:45 PM, Tanmay Kathpalia wrote:
>>> Some boards have SD card connectors where the power rail cannot be 
>>> switched
>>> off by the driver. However there are various circumstances when a card
>>> might be re-initialized, such as after system resume, warm re-boot, or
>>> error handling. However, a UHS card will continue to use 1.8V signaling
>>> unless it is power cycled.
>>>
>>> If the card has not been power cycled, it may still be using 1.8V
>>> signaling. According to the SD spec., the Bus Speed Mode (function 
>>> group 1)
>>> bits 2 to 4 are zero if the card is initialized at 3.3V signal level. 
>>> Thus
>>> they can be used to determine if the card has already switched to 1.8V
>>> signaling. Detect that situation and try to initialize a UHS-I (1.8V)
>>> transfer mode.
>>
>> This implementation broke am65 IDK board SD card boot, I have still
>> to check why this breaks only one board, potentially there might
>> be a quirk only for this board... But for now sending the question
>> in case anyone might have an idea what is going on & save me some
>> time.
>>
>>
> 
> Thanks for reporting this. I had a deeper look at the code and found
> an issue that is likely the root cause of the failure on am65 IDK.
> 
> During a normal cold boot with a UHS-capable host and UHS card, the
> voltage switch to 1.8V is already performed inside sd_send_op_cond()
> as part of the ACMD41 handshake, and this is recorded in mmc->ocr via
> the S18R bit. By the time mmc_startup() calls sd_get_capabilities(),
> the card is already operating at 1.8V and reports UHS bus speed modes,
> causing mmc_sd_card_using_v18() to return true. The warm-reboot
> recovery path then fires unconditionally and switches the host voltage
> a second time, which on boards like am65 IDK can leave the controller
> in a bad state.
> 
> The fix is to guard the recovery path so it only activates when the
> voltage switch was not already performed during the current session:
> 
> -        if (mmc_sd_card_using_v18(mmc)) {
> +        if (!(mmc->ocr & OCR_S18R) && mmc_sd_card_using_v18(mmc)) {
> 
> Could you please try this change and let me know if it resolves the
> failure on am65 IDK?
> 
> I will send the patch for review on the mailing list.
> 

Seems like that did not work for me [0] :(

[0] https://gist.github.com/jmenti/bb2dfc93630219a4d137edf2e20ce66c

I might not have a chance to debug/respond here soon since ill be out
until may 25, so until then, happy hacking :D

~ Judith



  reply	other threads:[~2026-05-14 22:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21 20:45 [PATCH] mmc: sd: Handle UHS-I voltage signaling without power cycle Tanmay Kathpalia
2025-10-22  3:16 ` Peng Fan
2025-10-22 14:06   ` Tanmay Kathpalia
2025-10-23  8:46 ` Peng Fan (OSS)
2026-05-13 23:39 ` Judith Mendez
2026-05-14 18:50   ` Kathpalia, Tanmay
2026-05-14 22:21     ` Judith Mendez [this message]
2026-05-16  9:44 ` Peng Fan
2026-05-16  9:43   ` Kathpalia, Tanmay
2026-05-16 11:44   ` Kathpalia, Tanmay
2026-05-27 23:22     ` Judith Mendez
2026-05-29 17:21       ` Kathpalia, Tanmay
2026-06-08 15:19         ` Judith Mendez
2026-06-09  7:51           ` Kathpalia, Tanmay
2026-07-13  9:45           ` Kathpalia, Tanmay
2026-07-13 10:21             ` Peng Fan
2026-07-14  1:37               ` Mendez, Judith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2fc6397f-83d9-49ff-aaa1-ab4d773c95bd@ti.com \
    --to=jm@ti.com \
    --cc=jh80.chung@samsung.com \
    --cc=marex@denx.de \
    --cc=peng.fan@nxp.com \
    --cc=tanmay.kathpalia@altera.com \
    --cc=tien.fong.chee@altera.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox