From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ua1-f98.google.com (mail-ua1-f98.google.com [209.85.222.98]) (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 72A2C35C1A9 for ; Fri, 17 Jul 2026 18:06:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.98 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784311593; cv=none; b=PcHYX5XkH/V8MZDOC24YzPDqa+zJ96HUPfUUqiRHDNuj/wFirEBKmPrIUAlag60Ktz1QSwVawB4txJaVFEbUeookOJW8dYmUVbpJym/q3pBgJjOPbj+fV1umVZIRDTMjDoXlwZu2wsmiDX5XKSPl5GI/erbiCg7lbVPu3a4zDh8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784311593; c=relaxed/simple; bh=+hV0vQQ2qccegCAb9oQyV62O6SKN6X4yQBpfcmEKnnE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=r3ylzQPIITX5Ssb6isuNoqoHcazjeoFvoAmz6jef6xPrqi+JTOVNjNRuI7mmf3Bn5Kgr7V82Y9vim/8xzV8F0GLs/PvP+xWGrC++gyhwyRp+PWwoLtNdi8lggO458G2Q0l9f+tvtgY5PfPhIglWq6Ygn36ABqL1er6FNtAWwF8M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=Kf/QXJtg; arc=none smtp.client-ip=209.85.222.98 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="Kf/QXJtg" Received: by mail-ua1-f98.google.com with SMTP id a1e0cc1a2514c-963f63fe025so1549132241.0 for ; Fri, 17 Jul 2026 11:06:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784311591; x=1784916391; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=TzgfqCvjoQZnveGpPF7MFJ2MVCAWx2MGGUIgss3Wdts=; b=qs2CvSgs3HJsrZkxyy6kIgEq4OflxRJ0ZiB32SQFhp3bYQGYPiK1IFDogBIgN4G59e zSC1ID/oYoP9aSmMbBw+OGzxfdw1jQLOy16GOCQBjPQbcTOQtGvljGNNaH/U0uMYN0zq MXkB2HFChAwoAEl/Ki6jhbVPu1v8aQi5kJKwOIdF7jTBUOZ8/nwVR8f+vkBBF2+1XrMC 2z4jxGm8dBrFFeduvI3irp/qwm0ZrJE10eAejnUyCySvc4GE2tFuwltNrpfgu6rvoSu1 /jwFmLgsd06aPyFAtTbaYTHlwXH40p6TQOWC/sUB/04Y9veO83rktRJd7Mw9LkYai0Zm USYQ== X-Forwarded-Encrypted: i=1; AHgh+RoG18C+qXy5emE6kn4gO6LumD8PEaJ+LveGnRBZDiW/r0DqkLZQAcS4i/bj8jE6yBz+HHpDe9QsKCIvwP8=@vger.kernel.org X-Gm-Message-State: AOJu0Yxzg0abdwc9dpItZ29q1LZsu+9JmnNviRouUtNkcYqpfukppzu2 s0k7ZH0tHayrEPxfFCqgxYTSeT112M1e5NbfP/R1KwkSr5BZPnyl47M7vXybR2dxgCvOoViNUy/ PzYdO+py0mVP2ePLl343geuV/yxLTdFEMwMOy0YEMlTzNb6Xqf75ergfv73TMGhKVJshx8oB6H2 T6tl9XlvFv9BdUWEaSfiLM2w6vCT0tPD9jM0yEsaZJa7hfriKEksAeV299cRmYb8l5TtEjAt4qB 7o8u9hnDbJyHt8t X-Gm-Gg: AfdE7cl+QA9OTaI5pZ478azgQCoWzMa7W9XT3sw6xT5TuOH6AGmW6bHG8TKKPFngLYR kOCCum08vHxfWVCATyxWVMS8jeH1uSyOqFjFeLQlB9phGbODoNwXCzUI2ENAfyUzUNMNYCW21wd sdF0qOkIEkTEW4vFz8GJj2H5dXVmEKbmbCVXKf2DAUJtcwN8P2cHvlRMQU5n9PtNqPXMf9JWBiT g9t693oCAKlUV/aRmNb/fvZyfhSKgZExxkVSCM210jpvPLTc9sDdZXqbUAdnrPRTUKeuBbsO/Oa dQps2VEfDKV7NLAxfoRwm8D416STyVstKzjab/fee8NZpxWm2Ph4o5WDeXzDqEmQQjjtnmULtMU nhCBFQViFFRhPgGM5nx3T3OLsoYQFZS0pW3Gg/GFJV7soLvcOecCEjtJrEqlbmfN1MyyrtH0Tmc XNK/oHhoV25uS2fULhMpO2e3fuG3JAnPRA X-Received: by 2002:a05:6102:5e8b:b0:744:dc62:55ae with SMTP id ada2fe7eead31-7475369b519mr735049137.16.1784311591072; Fri, 17 Jul 2026 11:06:31 -0700 (PDT) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-12.dlp.protect.broadcom.com. [144.49.247.12]) by smtp-relay.gmail.com with ESMTPS id ada2fe7eead31-74757f445a2sm162616137.9.2026.07.17.11.06.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jul 2026 11:06:31 -0700 (PDT) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-8ec235c7c66so66675506d6.0 for ; Fri, 17 Jul 2026 11:06:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1784311590; x=1784916390; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=TzgfqCvjoQZnveGpPF7MFJ2MVCAWx2MGGUIgss3Wdts=; b=Kf/QXJtg4ZPT43THpMyP6ntKSrXuECkPTKWeMGwbPUCMWUOPA3G2jCUVwn+iy0VuoJ 3k17dk2/QSDsV9WU4hO8UH8g1zEUGiLdAR4liHVxu7613lJXHwT/v0SC0bSfbdNsQJnD iVzcB5hAozn/gBR/S9juPC08kkpRFhqEuVbPM= X-Forwarded-Encrypted: i=1; AHgh+Roirj0k83jWi/aslaXmuET1qro2+qIKrE3oeMmNOe77rcVB9gIF+9NJ9l9DtwDtyFBWQsukYvoNTQmBidY=@vger.kernel.org X-Received: by 2002:a05:6214:2387:b0:8ec:a010:9af9 with SMTP id 6a1803df08f44-907783b332cmr41217246d6.40.1784311590023; Fri, 17 Jul 2026 11:06:30 -0700 (PDT) X-Received: by 2002:a05:6214:2387:b0:8ec:a010:9af9 with SMTP id 6a1803df08f44-907783b332cmr41216276d6.40.1784311589265; Fri, 17 Jul 2026 11:06:29 -0700 (PDT) Received: from mail.broadcom.net ([192.19.144.250]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-9077856002esm23175896d6.11.2026.07.17.11.06.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2026 11:06:28 -0700 (PDT) From: Kamal Dasu To: Ulf Hansson Cc: Kamal Dasu , Florian Fainelli , Wolfram Sang , Oleksij Rempel , Avri Altman , Pedro Demarchi Gomes , Erick Shepherd , Adrian Hunter , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] mmc: core: Add a host capability to skip SLEEP for cards with a broken resume Date: Fri, 17 Jul 2026 14:05:34 -0400 Message-Id: <20260717180536.1757204-1-kamal.dasu@broadcom.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e This is v2 of Florian's original patch: Link: https://lore.kernel.org/r/20260413180551.3683969-1-florian.fainelli@broadcom.com/ Background: the Kioxia 016G01 eMMC takes ~10ms to exit SLEEP (CMD5) instead of the ~1ms it advertises via S_A_TIMEOUT, which can be problematic on systems that resume from Suspend-to-DRAM by first pulling boot code from eMMC using hard wired logic that is not field updatable -- if the card is still asleep when that logic reads it, it resets the board. The device stays powered throughout suspend-to- DRAM (no software-controlled VCC/VCCQ regulator toggling on this path), and the CMD0-before-resume sequence follows the JEDEC boot spec, so this isn't something the kernel's resume ordering can fix on its own. v1 addressed this with a card-level MMC_QUIRK_BROKEN_SLEEP quirk keyed off the device CID. Ulf pointed out that a device-specific quirk doesn't generalize well and suggested a host capability bit instead, settable from DT (or derived from a compatible string), mirroring the existing no-sdio/no-sd/no-mmc properties. Oleksij separately noted that quirks registered in mmc_blk_fixups[] are only applied once the mmc_block driver probes, which is too late to avoid a race against an earlier SLEEP/poweroff triggered on an under- voltage path -- a host cap resolved in mmc_of_parse(), before any card exists, sidesteps that ordering problem entirely. This series implements that direction: - Patch 1 documents a new "no-mmc-sleep" DT flag property. - Patch 2 adds MMC_CAP2_NO_SLEEP_CMD, parses the DT property in mmc_of_parse(), and has mmc_card_can_sleep() honor it. The actual board DT change (adding "no-mmc-sleep;" to the affected brcmstb eMMC controller node) will follow separately once this lands, since that DT lives outside of mainline. Changes in v2: - Dropped the card-quirk/CID-match approach entirely in favor of a host capability bit, per Ulf's suggestion. - Added a DT property ("no-mmc-sleep") to set that capability, following the no-sdio/no-sd/no-mmc precedent, per Ulf. - This also resolves Oleksij's concern about mmc_blk_fixups[] being applied too late to close the race on an early SLEEP/poweroff path, since the host cap is resolved in mmc_of_parse() before a card exists. - Reworded the rationale in patch 1's commit message and binding description per Florian's review. - Added a Reported-by/Closes tag crediting Florian for the original bug report. Kamal Dasu (2): dt-bindings: mmc: Document no-mmc-sleep property mmc: core: Add MMC_CAP2_NO_SLEEP_CMD host capability .../devicetree/bindings/mmc/mmc-controller-common.yaml | 8 ++++++++ drivers/mmc/core/host.c | 2 ++ drivers/mmc/core/mmc.c | 3 +++ include/linux/mmc/host.h | 1 + 4 files changed, 14 insertions(+) -- 2.34.1