From nobody Fri Jul 24 22:17:22 2026 Received: from mail-vk1-f228.google.com (mail-vk1-f228.google.com [209.85.221.228]) (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 F3097435EC8 for ; Wed, 22 Jul 2026 21:14:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.228 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784754865; cv=none; b=YRkhVRElFTvDJHK1CI/2/XoZXTNP6GViynB2yonEF6gToRi3OQHAJWkjruXSGHJlBlClRaZ0L12bayBv/3yY+Ca2AWkTxIrG7JT9q6a32XLOWslYPsqi4mMv654cuCCNLFQTz7ss2NRcm1VuOZS3tu8UTNuZIHsBBrUyNbOa2Mc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784754865; c=relaxed/simple; bh=vvm9MiiF4qT9D4Qs2ERzb7rUVfglIiNSjcfJaY+TlO4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KXjDPIBzGz4ggcSrD+1/Itjfw59gY/o6Yg/m4JuWusupEEltOQH1dGy6/5uzPjHPMeE5San/9o/v41cDaJCsS2zcRFKHZTmvfVEepYQ0OiWKf5FnrlalkYbCnXvx0Xe9lLxXZ2616n2UigHXCi+9qM6FgFpCVFkO1UUOXpbn1dk= 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=MVa41s8V; arc=none smtp.client-ip=209.85.221.228 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="MVa41s8V" Received: by mail-vk1-f228.google.com with SMTP id 71dfb90a1353d-5bfb3347dc4so7713056e0c.0 for ; Wed, 22 Jul 2026 14:14:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784754863; x=1785359663; h=content-transfer-encoding:mime-version:references:in-reply-to :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=79r229Sv14C/d08t9Dy2alwJans9h85H9rzz2r6puFo=; b=BtAgGh5+uBXPN1SqZ4rD7STVtaVCoq263a95zHHCgyB+Va4pqVAbYAm1dm2xvWH7R7 bi5F6uFziipKZcl+ZftBM2WPZAgehfcQeBxAmZMbSCwZPjNtzMUdTqZNt4gMPluvD9ha 7109Dd9UIq2m/QK+h42rIwSOmKXwbERWf2SonyY4EdHQgW6oR9tJ07GqoC7NwbDyzdfb 48ebITrzZ2uQDlgKlDkZ1jMWR+iEyFI5WuIZ4j5zT+8RmseY97EVxGOkVVGzpbTWi22t Nh2VAne+K8ehoHX2IYwLPJp5DGXl23uQsJ4Ks49bHnLmycwPn5ysXjMPTnjmbYMMeG04 bSrA== X-Forwarded-Encrypted: i=1; AHgh+Rqi9pydbmCs289oDf7lHCje8gtwyR82Ayzbj5+ReRBrE3c/siCDVWAVtx6xBMLqvVwuS18uhlUTIZVwUfg=@vger.kernel.org X-Gm-Message-State: AOJu0Yxvs55k2JCro6d2BlXZ2YES137fbfwfo2Q/pssoAmwt+H15i/uL GMgaCLuG30JZr4cEPXV4OrGM5z74WjEKUJqSkSWVtYTPsgAgEYigTgijTfUrwXxVglnc2fYaKb0 vzGjx5f7yzzPZKu93SCifeU5FzE2eX0I5uG+LQrs0w/102sP7kFE9Fx5OQNi0wbnMzL+iz1VL/Y khO6Sx+tlDSKUoI4VQXOwcfwss+rPW1TchCdkegoH7D1w7TFu0UgEIXpyqp7Rj/ogGcCZECvRkA EoPpnnZjmYBkcFZ X-Gm-Gg: AR+sD118Ic2Q988ZUJNymb2ea3SdcpmTvP5a0EBv+Hr++6S6i0EJacNrpMD8mksbmAy 98CoazjmzdHoBQ2nRZ72MGPV8Psn01Mu1mIXDr0GzGycamy91o1gSu0yxqxudkA+kBMIE4i6ff8 Nu8OmzIVQonfNexINeNlK4rFu+vJRmCXewG9cIwbcrFZ2g8soa0wTJAQmw8y5rd43z3mq4MVH8e 9TjCspu3SH+DHuKu2xj5CAyxqTX5MEZh5+oIBJrqFhzLsAfPcvMdsS1V4qX+BGQJd7KaRaFQULa GE6UejDJ10Dkxqh8sppVWIxLrqDb3EjIis9nUp8IqX53qRNULUA9sESFxLvvDps19GAwWvavAIE Nxkte/hj49wDbGV9I10Ge1DJhy+Mu+5EMjb0fFKpky2HmbC7ChhIGub89XZTdK1GFaDt1O4Y+Ro ujoLnbblIrV+BL0sVUyPC2VmgSmTXOKud8 X-Received: by 2002:a05:6122:8f8c:b0:5c2:bb83:462d with SMTP id 71dfb90a1353d-5c2da0c5d8amr135382e0c.6.1784754862231; Wed, 22 Jul 2026 14:14:22 -0700 (PDT) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-29.dlp.protect.broadcom.com. [144.49.247.29]) by smtp-relay.gmail.com with ESMTPS id 71dfb90a1353d-5c2c5fc5427sm329938e0c.0.2026.07.22.14.14.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2026 14:14:22 -0700 (PDT) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-51c0e702df8so202098881cf.2 for ; Wed, 22 Jul 2026 14:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1784754861; x=1785359661; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=79r229Sv14C/d08t9Dy2alwJans9h85H9rzz2r6puFo=; b=MVa41s8VFt1xJeCuh1IVRh4zDPdiFBmgxRzw0bv4lyigAJIq8oA2C35weJo0Kh5Ed4 svNJYdVrizgqs/bd3OkUSpr+HSuvw2j8GlDsQRgK8G9+zGUEjCL5PrQagrGK5hNL/4sj Hzqmp1jtGThAkr/39jcNXzhE6ZQpJhkcwjmN4= X-Forwarded-Encrypted: i=1; AHgh+RrsplTUvff2kOiai6kGvE5AmHrD9Cl1MNLuQ4NLUPfuqGNDt/81bZl+4BVs+oR13eMawhJzlqkXUPmFLjU=@vger.kernel.org X-Received: by 2002:a05:620a:3911:b0:923:7821:dc0d with SMTP id af79cd13be357-931038938c0mr40973285a.33.1784754861639; Wed, 22 Jul 2026 14:14:21 -0700 (PDT) X-Received: by 2002:a05:620a:3911:b0:923:7821:dc0d with SMTP id af79cd13be357-931038938c0mr40969085a.33.1784754861114; Wed, 22 Jul 2026 14:14:21 -0700 (PDT) Received: from mail.broadcom.net ([192.19.144.250]) by smtp.gmail.com with ESMTPSA id af79cd13be357-930f68a7fffsm253004785a.11.2026.07.22.14.14.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 14:14:20 -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 v3 1/2] dt-bindings: mmc: Document no-mmc-poweroff-suspend property Date: Wed, 22 Jul 2026 17:14:16 -0400 Message-Id: <20260722211417.3702709-2-kamal.dasu@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260722211417.3702709-1-kamal.dasu@broadcom.com> References: <20260722211417.3702709-1-kamal.dasu@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e Content-Type: text/plain; charset="utf-8" On some platforms, firmware accesses the (e)MMC card directly during system resume from Suspend-to-DRAM, before the kernel's own resume path has run, in order to load boot code using hard wired logic that is not field updatable. This requires the card to remain powered and responsive throughout suspend: it cannot be put to sleep, sent a power-off notification, or have its supply removed. Add a no-mmc-poweroff-suspend flag property so affected boards can tell the mmc core to keep the card powered across suspend instead of sleeping or powering it off. Signed-off-by: Kamal Dasu --- Changes in v3: - Renamed from no-mmc-sleep; dropped S_A_TIMEOUT framing per Ulf. Changes in v2: - New patch, replacing v1's card-level quirk, per Ulf. .../devicetree/bindings/mmc/mmc-controller-common.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller-common.ya= ml b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml index 3d7195e9461c..5f7b3f8ef1dd 100644 --- a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml +++ b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml @@ -232,6 +232,16 @@ properties: description: All eMMC HS400 modes are not supported. =20 + no-mmc-poweroff-suspend: + $ref: /schemas/types.yaml#/definitions/flag + description: + On this platform, firmware accesses the attached (e)MMC card + directly during system resume, before the kernel's own resume + path runs. The card must therefore stay powered throughout + suspend, and the controller must not send it a sleep or + power-off notification. The kernel re-initializes the card + after resume, since firmware may have already reset it. + dsr: description: Value the card Driver Stage Register (DSR) should be programmed --=20 2.34.1 From nobody Fri Jul 24 22:17:22 2026 Received: from mail-vk1-f225.google.com (mail-vk1-f225.google.com [209.85.221.225]) (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 28B7D43C06B for ; Wed, 22 Jul 2026 21:14:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.225 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784754867; cv=none; b=Q62q+rt75aiN0lh4jorB6CniaYM3lLZtt0XdXc46FVhVHGdCDxOwB4u3Y1tNglVt8nMbXH2frEum9dioBvfCXoQovuZqVRvE2d0Zp3n1Mb2XGA3kczslsRqVwk7hUiE6G3U5F+IXgpu/SAOEDwSomjidhw9qjFek9qC1aKU8M2w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784754867; c=relaxed/simple; bh=C5P90tGezlyCOSDPePcHNgwfT8nb8g7pu0+Lnox8hbk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EZ10mHgCbjNqon/xm6YwwqmlkcVYwKtQp/vegnRWwBhR4oJhs91gXENly9VY+M4b8/6/HcIEQHHD5GEy4CNL/mP94u8WJHlgp0Jpg8hg+Jb/TKdTOa5bNHH8rQb3aUyGVNN7npsLV8dPWjQ2mye1h9APmlTOJaPaEvUv7EdLe+0= 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=avljIUfZ; arc=none smtp.client-ip=209.85.221.225 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="avljIUfZ" Received: by mail-vk1-f225.google.com with SMTP id 71dfb90a1353d-5bfaa014978so4189204e0c.3 for ; Wed, 22 Jul 2026 14:14:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784754864; x=1785359664; h=content-transfer-encoding:mime-version:references:in-reply-to :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=1k0chG/ElRTFeeqYAhiA74GXOEyQdR5QSifouTac3W4=; b=o0gGUeAT6BlKUK1YPUzVGbNt+szKYoNrsWn9d5XrT27+qocedzgXjg/AocgTF4VLvq +MWNI1/q2diQp1DchfrVeGU/Rtcfw8Bgc+3fmkZManWvhBNTywUlpJN9dI1Nv5CU7QrP TSXdIXl/y0yK0Z4+4m+5VDz1OOtDt/qTDP6FpQhsTuPmB1fp9LqG66p+ONLKoo13Hl1b bKOlZiOD7XdL/+lgrqx+mY2QU2Ar2e6FVVWLWgpjMg0c8LhfKmG7q8WIeTM8BTnnWhdL /mhq8YvnMstD95Mw9YIQxB868tHo7Hhn/vlMuE7sz9ofURJdv1IiV1/SHfCZMi0DgFqK wiyQ== X-Forwarded-Encrypted: i=1; AHgh+RqB0g8HODpTfno6Rq6CmyWkIY1nyIXatksn0demyo7tkGMmc2bbDeIGVSg2jJZhnmmaAqezybwCLf5daDE=@vger.kernel.org X-Gm-Message-State: AOJu0YxBBvpGMdCq1LAgmddkUgSrsWNihQG5ONdXW4HhMmIZG17Pimzt rs4Igky+r7QrKEuCD+cKV+7ftUpZWzh1A+CDnSMR51rVG17tgecEOoRHBjuPIF6pBKqx9vLrZZV x46rSHXdyGHZDVIinUtFxRNKReOFIyzgDNpHts4I6idBHn9F0arPLpLxteFO0gMpaecXlbO5Cm1 SCeF3+a9j/DfCgk7jFT9jXIDRTxmBIBmSLxoHFIsB1rg2MLPlZtcfu4KjAY4Ybeg5nEWFiBC6dt 1gEYqYiMbhwM/dY X-Gm-Gg: AR+sD12pB0JAX6KG0tDIRUfdVz71u2X/lsd5sKVMCaP4yeUWSqRJWjXkpKkE9IQdld0 OUeAI82pdJpf4SJqa+nVr+XindyEnG+FrE/kxsXVVkq4wvLNc65b9pZHurV8UuqGn3FXfJ5smRG TUqSTbshynflgy3jzUsF4Ey5MgJZkKfyl5UixrzPOQuEmVwmJTp4uqHrW0Jls9T3meT7x1jASJX cGBYEc/+7lf4YCoTuV9zKjXzDrlc5g/IFyEsrLNLIca+Esr+bSaVULXXZnxN2EOMg+0l69kY11O gLnzMbw23ei6Vr6cG+xXBniyaP1HDmjifzMH9HhanH8ym9OyJP+m752f0e7+7KTuToXkIRSpzZX rSGo13ySPPCysPAk0rYZdDYt0W9lmsFIJ2RpbvOND5ntcbwR6rUvnxY37qMC7ng5WO5Y1kWQmO9 CILCIidzsJdNJEJKjsTsTj1eNZlKuleDy7 X-Received: by 2002:a05:6102:1612:b0:740:32ae:8ec7 with SMTP id ada2fe7eead31-74d6060212amr68929137.23.1784754863854; Wed, 22 Jul 2026 14:14:23 -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-74ad3598bc6sm296024137.27.2026.07.22.14.14.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2026 14:14:23 -0700 (PDT) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-92e606e8f3eso1890911685a.3 for ; Wed, 22 Jul 2026 14:14:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1784754863; x=1785359663; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1k0chG/ElRTFeeqYAhiA74GXOEyQdR5QSifouTac3W4=; b=avljIUfZD7ig/m60+0MFp/LHKR1s3t8AhOFgtv0mchQGB+NpmUmuMrYsT1mEjm2Dk2 lN6NCk/65V2FPU/Q0oP9Bq+VHYxTsa/8ytjvbwDHaeGm2oHTRTKE7blPp+F0fY24fH72 A2bHjuNyx5A8Fw3zIh3QlGur+ONhahpGOnxPc= X-Forwarded-Encrypted: i=1; AHgh+RrpC9h8VRM1OyRSGEj41wsWbjo9q0GJbW7ryvsHyevKQ5p2fVcq8hxrBPEc2OZQ7YIzOqEem2z1gZ4u+N0=@vger.kernel.org X-Received: by 2002:a05:620a:690c:b0:930:9585:e0b2 with SMTP id af79cd13be357-931036eab8fmr45189885a.51.1784754863215; Wed, 22 Jul 2026 14:14:23 -0700 (PDT) X-Received: by 2002:a05:620a:690c:b0:930:9585:e0b2 with SMTP id af79cd13be357-931036eab8fmr45186085a.51.1784754862687; Wed, 22 Jul 2026 14:14:22 -0700 (PDT) Received: from mail.broadcom.net ([192.19.144.250]) by smtp.gmail.com with ESMTPSA id af79cd13be357-930f68a7fffsm253004785a.11.2026.07.22.14.14.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 14:14: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 v3 2/2] mmc: core: Add MMC_CAP2_NO_POWEROFF_SUSPEND host capability Date: Wed, 22 Jul 2026 17:14:17 -0400 Message-Id: <20260722211417.3702709-3-kamal.dasu@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260722211417.3702709-1-kamal.dasu@broadcom.com> References: <20260722211417.3702709-1-kamal.dasu@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e Content-Type: text/plain; charset="utf-8" On some platforms, firmware accesses the (e)MMC card directly during resume from Suspend-to-DRAM, before the kernel's own resume path has run, in order to load boot code. This requires the card to remain powered and responsive throughout suspend: putting it to sleep, sending it a power-off notification, or removing its supply is not safe, since firmware needs to talk to a live card. Add MMC_CAP2_NO_POWEROFF_SUSPEND, settable via the new "no-mmc-poweroff-suspend" DT property. In _mmc_suspend(), when this capability is set, skip the poweroff-notify/sleep/power-off sequence entirely: just deselect the card and mark it suspended. At resume, _mmc_resume() already unconditionally calls mmc_power_up() and mmc_init_card(), so the card gets fully re-initialized regardless of what firmware may have done to it in the meantime. Reported-by: Florian Fainelli Closes: https://lore.kernel.org/r/20260413180551.3683969-1-florian.fainelli= @broadcom.com/ Signed-off-by: Kamal Dasu --- Changes in v3: - Reworked _mmc_suspend() to skip poweroff-notify/sleep/power-off entirely, not just SLEEP, per Ulf. - Renamed to MMC_CAP2_NO_POWEROFF_SUSPEND/no-mmc-poweroff-suspend. Changes in v2: - Replaced the card-level MMC_QUIRK_BROKEN_SLEEP quirk with a host capability, per Ulf. - Added Reported-by/Closes crediting Florian. drivers/mmc/core/host.c | 2 ++ drivers/mmc/core/mmc.c | 15 +++++++++++++++ include/linux/mmc/host.h | 1 + 3 files changed, 18 insertions(+) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index b7ce3137d452..35fd0be99c58 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -400,6 +400,8 @@ int mmc_of_parse(struct mmc_host *host) if (device_property_read_bool(dev, "no-mmc-hs400")) host->caps2 &=3D ~(MMC_CAP2_HS400_1_8V | MMC_CAP2_HS400_1_2V | MMC_CAP2_HS400_ES); + if (device_property_read_bool(dev, "no-mmc-poweroff-suspend")) + host->caps2 |=3D MMC_CAP2_NO_POWEROFF_SUSPEND; =20 /* Must be after "non-removable" check */ if (device_property_read_u32(dev, "fixed-emmc-driver-type", &drv_type) = =3D=3D 0) { diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 05444ecf3909..27a559e6fcc0 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -2157,6 +2157,21 @@ static int _mmc_suspend(struct mmc_host *host, enum = mmc_poweroff_type pm_type) goto out; } =20 + /* + * Some platforms need the card to stay powered and responsive + * throughout suspend, since firmware accesses it directly during + * resume, before the kernel's own resume path has run. Just + * deselect it and leave power alone; mmc_init_card() will fully + * re-initialize the card once the kernel resumes. + */ + if (host->caps2 & MMC_CAP2_NO_POWEROFF_SUSPEND) { + if (!mmc_host_is_spi(host)) + err =3D mmc_deselect_cards(host); + if (!err) + mmc_card_set_suspended(host->card); + goto out; + } + if (mmc_card_can_poweroff_notify(host->card) && mmc_host_can_poweroff_notify(host, pm_type)) err =3D mmc_poweroff_notify(host->card, notify_type); diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index ba84f02c2a10..e082aab8f4c4 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -463,6 +463,7 @@ struct mmc_host { #define MMC_CAP2_CRYPTO 0 #endif #define MMC_CAP2_ALT_GPT_TEGRA (1 << 28) /* Host with eMMC that has GPT en= try at a non-standard location */ +#define MMC_CAP2_NO_POWEROFF_SUSPEND (1 << 29) /* Card must stay powered a= cross suspend */ =20 bool uhs2_sd_tran; /* UHS-II flag for SD_TRAN state */ bool uhs2_app_cmd; /* UHS-II flag for APP command */ --=20 2.34.1