From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f97.google.com (mail-ot1-f97.google.com [209.85.210.97]) (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 91A5D3AB273 for ; Tue, 28 Jul 2026 19:03:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.97 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785265408; cv=none; b=VEdZsQvpib5asRNmeGi8EWSQkNrBm2d1/GHTjJ8r9iOnxegcEU3woKhP0EhnlHRfvNiaokRWn8iNwmc+c706IxAlR3UBhTrfBssylWicNURbp8v0EpIqpOaserJiwxkv5y05X38DC1/AAZRkQPuSIH8+4Gb0XJb4Ep7EZEbkc4c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785265408; c=relaxed/simple; bh=1lRR871VJrXi9CdE5wjzgROnvgD8zT1RlB/Mt3ecGWU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=a/OdZiGaaefehgaIiahM924vonGoG19Gt94kPrClSoKuVwIZvitpEjimbCK/CY/mxEUO89HT9mGOqJwCjn/LMSpkPhh4rj9m+1Eu7nBatHZHhU9soZVWqbj30zmbNHh4bBlNxFRgkEGV8zwt5BBfD7WRkb5vznn2UnbjxkzvG8U= 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=Sdls+dLg; arc=none smtp.client-ip=209.85.210.97 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="Sdls+dLg" Received: by mail-ot1-f97.google.com with SMTP id 46e09a7af769-7eb64085c45so188538a34.2 for ; Tue, 28 Jul 2026 12:03:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785265405; x=1785870205; 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=06R0C5Az4WbwaNLd3vMNncYkeUGQ09VjFTKgkN5pTMs=; b=kuZlaKew60KHgPsdWj8ppcyZFuZT16TpbizMCSoDvhZhBJf5ZDIawSJ9CWIb6X9mPo 16zZGaD6n+OQbxFbysLeVtlgk4z0IhOcB4JryLqTpWi2MiZzM5Pbla2Bw0FJrLmFDqg+ Y+voB818V1A9kR5JpQ4uAdAcvWu+eLMzkN2K2fc8R5MW+HUqJiLPCLD9gqaqCDt7SeNk l6SLIck7UERhyUdrOJ+3NdDBBzeeq+PmyHKqUNn85Xw+hsZQThv55xLIEkreArRsI/pC dOC2FgAFSHc51AKk0JYEqWBk0mVylapr110EKAEWSIBczMp52tB+9GYfdPMv1c1hI9pq 60zA== X-Forwarded-Encrypted: i=1; AHgh+RoJqwNXxvN3WZ+pfz1hcq4rBKgWNcCrqdEKPWCPLzzOxPHJHUA3CetFAeb2I6ZTKXqs7caGKK7TUdkQnZk=@vger.kernel.org X-Gm-Message-State: AOJu0YxjmghE1e19LAI1UbolQTERtVRPYFEYJuigSEvqxz60p+lyTkvz 67fzZyvo0Zzr/MMp8rmuoxsvhQwbVjHZDPQROP90zFOeRZG3/nbkXgB+ndaFQVXD+Bkzdm4z8er WrdG/LRQwln7cYJc3r2/Rq2OflXh/mW3ub06IUFaZIOgOmGQKSPZVcdr7jEQ8BOPXBIM/gcnZ2u lLMH0elLrUV6nrCvkc3D/1yz1bVeAw7ekWICu9Td3bSd1lCpW17ir8uw6fX/9B6Swl/Nj0SxlYk W3IMQal04Qh3h7H X-Gm-Gg: AR+sD12d95xg4Uq0YjFd+zbwMnRCJHJ4KPoNk4vO9JEaiUeQXxpXN6VBz3jWMceOZPd nvw13Ktv+k569MP4JHt/EXlvW52IMb4GQmL7MSsP+MBCkxzMURYSyppTR3zvD8i6zW4cphdN4Z6 Seq2BSJGZAMXjF4cjLBa+VB0+ofXWDcPSaLvnSYQa+lVG3/aBR8LiK6IoXNH9FAJ1JSamfwt5Bv kIK9mqkncySqyITQXnNAPlGDaIAW9jHALCkFgdIuctFVIIlKEkikmViLBrwAqxpIf+TOnr+C+tn 6z/V7XGq0DOjgEgrLHnALrH1ZuqYRXGCIG9Wxu3NTRu1LHd8vm0Fm3ir6aRYS7FuZxnmBPaFYzs /Rc2pnQP9PdTDExPTnbmB7vXOPtyh4UxSbWIfCsRfiigBFWa5mTKoautrwcTqGkJlJJQjxOFlxE 1kOQN/KwlBNwUwaJCx5DYl6+QGD6EGfn22 X-Received: by 2002:a05:6820:f48:b0:6ab:223:6128 with SMTP id 006d021491bc7-6ac96c45f9amr1779815eaf.56.1785265405064; Tue, 28 Jul 2026 12:03:25 -0700 (PDT) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-25.dlp.protect.broadcom.com. [144.49.247.25]) by smtp-relay.gmail.com with ESMTPS id 006d021491bc7-6aca53f20fasm14087eaf.20.2026.07.28.12.03.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2026 12:03:25 -0700 (PDT) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-907a1e04111so2103306d6.2 for ; Tue, 28 Jul 2026 12:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1785265403; x=1785870203; 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=06R0C5Az4WbwaNLd3vMNncYkeUGQ09VjFTKgkN5pTMs=; b=Sdls+dLg/Vv/1jEO4Z/GtRiC/RMAcgB9IQp9if0ZRJNEtYnNjK1829hBpK0PY83zUZ S8k1gQ/l+7rs+eai02axnFEY8sOiEFWekjZBOHOrUVBIQi2GyBa6e/d5vtOHF6UMIDOF TkqRr14xZsuPcCH4aB8AWR8u0DNG70PffAJqY= X-Forwarded-Encrypted: i=1; AHgh+Rr6+QD3CCkPrLBori55Yu6xsqny5Exl2qD1KBSnC6elsEHKTmkruWeJiitBEjS/mbg4tbTkEDzr0yR81x4=@vger.kernel.org X-Received: by 2002:a05:6214:33c6:b0:8f2:940e:2406 with SMTP id 6a1803df08f44-90816fbcfeamr40134306d6.2.1785265403451; Tue, 28 Jul 2026 12:03:23 -0700 (PDT) X-Received: by 2002:a05:6214:33c6:b0:8f2:940e:2406 with SMTP id 6a1803df08f44-90816fbcfeamr40133526d6.2.1785265402810; Tue, 28 Jul 2026 12:03:22 -0700 (PDT) Received: from mail.broadcom.net ([192.19.144.250]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-9081dd8b21esm5502856d6.46.2026.07.28.12.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2026 12:03:22 -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 v4 0/2] mmc: core: Keep the card powered across suspend when firmware needs it live Date: Tue, 28 Jul 2026 15:03:12 -0400 Message-Id: <20260728190314.2325906-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 v4. Background: on brcmstb boards with a Kioxia 016G01 eMMC, firmware accesses the card directly during resume from Suspend-to-DRAM, before the kernel's own resume path runs, in order to load boot code using hard wired logic that is not field updatable. The card needs to stay powered and responsive for that access to succeed. Changes in v4: - Dropped the no-mmc-poweroff-suspend DT property and MMC_CAP2_NO_POWEROFF_SUSPEND host capability entirely. Krzysztof pointed out they described exactly the same contract as the existing keep-power-in-suspend property (don't power off the card across suspend/resume). Extended keep-power-in-suspend's scope beyond SDIO instead, and reworked _mmc_suspend() to check host->pm_caps & MMC_PM_KEEP_POWER directly rather than adding a new capability. (e)MMC has no per-function driver to make the dynamic sdio_set_host_pm_flags() request SDIO uses, so this reads pm_caps -- the DT-derived, fixed platform characteristic -- not pm_flags. - Gated the fast path on pm_type == MMC_POWEROFF_SUSPEND; it was previously unconditional, so it wrongly skipped the required power-off/notify handling during shutdown, unbind and undervoltage as well. - Reset the host to its initial bus state (mmc_set_clock() + mmc_set_initial_state(), the same helpers _mmc_hw_reset() uses for a non-power-cycle reset) before marking the card suspended. - Set/clear host->pm_flags |= MMC_PM_KEEP_POWER around the suspend/ resume, mirroring the SDIO convention, so host drivers can tell power was preserved if they need to. Changes in v3: - Reworked the fix in _mmc_suspend() (drivers/mmc/core/mmc.c) to skip the poweroff-notify/sleep/power-off sequence entirely. - Renamed no-mmc-sleep/MMC_CAP2_NO_SLEEP_CMD to no-mmc-poweroff-suspend/MMC_CAP2_NO_POWEROFF_SUSPEND. Changes in v2: - Replaced v1's card-level MMC_QUIRK_BROKEN_SLEEP quirk with a host capability and matching DT property, per Ulf's suggestion. - Added Reported-by/Closes tags crediting Florian. Kamal Dasu (2): dt-bindings: mmc: Extend keep-power-in-suspend beyond SDIO mmc: core: Honor keep-power-in-suspend for (e)MMC in suspend/resume .../bindings/mmc/mmc-controller-common.yaml | 7 ++++- drivers/mmc/core/mmc.c | 30 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) -- 2.34.1