From nobody Sat Jul 25 04:54:45 2026 Received: from mail-pl1-f226.google.com (mail-pl1-f226.google.com [209.85.214.226]) (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 D985937C0EB for ; Fri, 17 Jul 2026 18:06:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.226 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784311599; cv=none; b=NyRDt3fWQs+IPzb4CxkZXCWW2KSvRtj/0jF342jMLrqAy9yUdFBmF0f+QVWP5idfWOFKI2RoFH/THlHB5p924GyTMPT8OAAYRKTdxzCxlT4xhWbANytpm2o3nMlV5N+JMkZiRs+AocxZJj9V0QvxK57cK9IA+wMsC3UQTn9BkHs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784311599; c=relaxed/simple; bh=+GOgfNtPrmMuyHFx75brM9BcQ2B58WHv8lKKR9nhUkA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=V+MF67vR/ZR/xug3cSDFyoRAe00k0kD65wueWIXmLeoAhHFFBjifQDL7P0Qxtbmvj0uEv+vKPYyiHXQoSI94br7nfks06puP/3G1mGi7Bjb00ns2za59KQH0xkajVoR1gJhHNrkt8KfKwrQ7LTT1jtTnglHz9h0VkplzZfxoq6g= 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=MyPOkRkF; arc=none smtp.client-ip=209.85.214.226 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="MyPOkRkF" Received: by mail-pl1-f226.google.com with SMTP id d9443c01a7336-2ceab75934dso82920775ad.2 for ; Fri, 17 Jul 2026 11:06:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784311596; x=1784916396; 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=93QkjjRqo0Te9/7g0wIib649nSDyvtIkr1k+4IQmqiM=; b=rvphSc0nl2pScLzfFiX1DRpZMzWv1Ba3EObN5b9tkaDZykwjIhCK4PiDpqMWhp+9RT Wd77No4GuTP17Ute5TUjwuQlFKfDEhTIyOgHmjOMSOv1EOFRS4UtJYI0vicm0CnpGiBs U/jzNyoj2PkeY22Cahq6/a1EPc1PQvcswbHEbH/fC5s8k3TYOwvHpy7X+Kh3fruKTJnO i5GiNA2YlTBYith2QbzjgTY1i4zbVytVVjuO3aK3uJilzybTyIRyrPmcVSdIdECCF4ZM ZJXiNAqfH54hy5nW1fvjxvIo8t2grzLN/LwKpy5aHwDEPBOnCeMzORsYnIFDBOXKTqIN Gclw== X-Forwarded-Encrypted: i=1; AHgh+RpFeEtWdQflLkOLHoSdu6XZ2mSkxpYZOpWK+zOsVU/auAO0DqSh7kuBH6QPnRhAm3tlSTfHeM9RhQK96t4=@vger.kernel.org X-Gm-Message-State: AOJu0YzutYJyIg5k+XCGyanDKwRuPpGNa37xOqJi+g6Puk/0kLugYNvq gFDUhHB6xMLHH4fN4O5T0zpY6YQdcoXhM5quAJ43S+r1S9qmmI3xVg/KXAsBiksVPjxBtIinMe1 OMnQIvhzqMl37VCP2XkHIeuFKkmflh+WqTJVD1feBf2VJEASLL0XkPycIpI6sjF9tuKy539s3nz ymJoXPKmVo3Q35wLjN28bsWwfGxcKJ1lFT4Cu/TvTOq9rN0rXoONha7rrzZOBttKBXdcZNBPxHI LjeCzgz1uhEAVcM X-Gm-Gg: AfdE7cnDVsXjjV93tn74wzyq+j6wZpfw4YZ1WwOtD0t598WhYLGQJculzGGZ98R7CYc 4h6v/BMBANi9XrOEYuR3ttaq67U+4W/MqbVnpQzalLXMl5aZgqtdtKYe0dPTmSbtWOVomcNbEya MnsmVI5qTCDKvmKrOVsiRatpsUrYWin9ttyD7XQKq8ER4Foaj+z9pMJURCNwFrmiyXtCzSRtywV sBngEoyZ1NkyXXlSYcsRKTsBJ3nTFJUggKVfJtrtv/AMWn5/8GVyd1/ntYcC0NiZ0o/kzpTdc+W RzBDQtbVd4GuBLxHsw3Pz3D4JiRKXeZqNOBPgSKDu/dKSpNMUdto3X6kMbhxx8aUpwi8A9JaVcf ZMKFFnBFhRdlBv2E1QvvkaMr1Lngo08cStGyjm6tkoUQq9QwPgVoOSyqUgy9LMyrmaMTfeitGf5 l7OAj1ktIcIIo0tC/w1igEptr1lfNZPjsu X-Received: by 2002:a17:90b:2c84:b0:37f:bfa2:1887 with SMTP id 98e67ed59e1d1-38e4b422bebmr3945121a91.8.1784311596140; Fri, 17 Jul 2026 11:06:36 -0700 (PDT) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-22.dlp.protect.broadcom.com. [144.49.247.22]) by smtp-relay.gmail.com with ESMTPS id 5a478bee46e88-3142a1bb764sm140877eec.14.2026.07.17.11.06.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jul 2026 11:06:36 -0700 (PDT) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-8ef8249f871so145065416d6.0 for ; Fri, 17 Jul 2026 11:06:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1784311595; x=1784916395; 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=93QkjjRqo0Te9/7g0wIib649nSDyvtIkr1k+4IQmqiM=; b=MyPOkRkFVJ1cehCqTJcpIDUTEhC7LpJyzyN8IpO8l97h1xrOnO2XkfuLlt/wa32Qzs mA36FYvAxUK3aRgVShGVtTuhQ4pRn1qk617xeu9G8DFU51zpsqE9/9itV/FQbEmqLYwV KhTQ+1zhsumYrjV4wdBirxXtwhM4EyGdiMGBo= X-Forwarded-Encrypted: i=1; AHgh+Rpys+80vFfpTk/UAGWutg264xdsfas7adA6Ev/xb1vmiQcl+wQoh/2ZYxamz7W+Ng17XCBuApyy5NfeApE=@vger.kernel.org X-Received: by 2002:ad4:5f06:0:b0:8ea:658b:aff9 with SMTP id 6a1803df08f44-9077852a123mr40715546d6.50.1784311594763; Fri, 17 Jul 2026 11:06:34 -0700 (PDT) X-Received: by 2002:ad4:5f06:0:b0:8ea:658b:aff9 with SMTP id 6a1803df08f44-9077852a123mr40714966d6.50.1784311594095; Fri, 17 Jul 2026 11:06:34 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2026 11:06:33 -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 1/2] dt-bindings: mmc: Document no-mmc-sleep property Date: Fri, 17 Jul 2026 14:05:35 -0400 Message-Id: <20260717180536.1757204-2-kamal.dasu@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260717180536.1757204-1-kamal.dasu@broadcom.com> References: <20260717180536.1757204-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" Some (e)MMC devices cannot reliably resume from the SLEEP (CMD5) state within their advertised 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. Add a no-mmc-sleep flag property so affected boards can tell the mmc core to never put the card to sleep. Signed-off-by: Kamal Dasu --- Changes in v2: - New patch. v1 used a card-level MMC_QUIRK_BROKEN_SLEEP quirk instead of a DT property; this documents the DT property backing the host capability added in patch 2, per Ulf's suggestion. - Reworded the rationale in the commit message and the binding description per Florian's review. .../devicetree/bindings/mmc/mmc-controller-common.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/mmc-controller-common.ya= ml b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml index 3d7195e9461c..11df0524530c 100644 --- a/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml +++ b/Documentation/devicetree/bindings/mmc/mmc-controller-common.yaml @@ -232,6 +232,14 @@ properties: description: All eMMC HS400 modes are not supported. =20 + no-mmc-sleep: + $ref: /schemas/types.yaml#/definitions/flag + description: + The attached (e)MMC card cannot reliably resume from the SLEEP + (CMD5) state within its advertised S_A_TIMEOUT, so the + controller must not put it to sleep during suspend or power + off. + dsr: description: Value the card Driver Stage Register (DSR) should be programmed --=20 2.34.1 From nobody Sat Jul 25 04:54:45 2026 Received: from mail-qt1-f226.google.com (mail-qt1-f226.google.com [209.85.160.226]) (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 6E7E137C904 for ; Fri, 17 Jul 2026 18:06:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.226 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784311602; cv=none; b=q/GNY+OeEIdzI7z5Ce+cY02rGWMwyuYerVBqLZDIgOCc5EMbwsM1AOwneS2t/W2+jz6Xsflc6x8TU42DveAkeioPRvfJDpCwisGeC8hu6sNS17N4eIMiXRMRetSXSQeJMn0+5A+mgka7IVHo6Bc4xbVa4xKHiRsbPM27UcoSMTs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784311602; c=relaxed/simple; bh=C7iR5TL2sRKHhjZ+5i65XW4I0/9qKRfRfqWcp3ikyfs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GhI0+6MKbUzpJdkeZ4kyUIY7r45FPEBiG/RFxpeApb1SWQKkWLsJF9+Y/BjACPVo8Za4oXW8kHW6qOBrKZ+o2nmRlD2Qe8/mhCLC54F3ChtbDhuZfDit7V2zCyh5RRar3JvHM0+qYtb9EH3rmoiKavHPNXLB3+e4guI2hlyycWg= 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=JuqGfxS0; arc=none smtp.client-ip=209.85.160.226 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="JuqGfxS0" Received: by mail-qt1-f226.google.com with SMTP id d75a77b69052e-51c2a818fc4so67813941cf.2 for ; Fri, 17 Jul 2026 11:06:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784311599; x=1784916399; 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=qk8fOSTNKdpV10bE/M7xcnHMgAcvmP8Zk1rifIUjMZU=; b=ft5tQPeicnsi4r0oCxvQFjlVLVl6jWDXQ+Rchhg0Q1dk8OWOSoytyn1woLA7h9w1Gz I0PZV/284/9XVjCCN7tJDwf1869X6uj/169MocdW0VGp+5zI67xPU5NZ5KqRgi4kZmau VQiRKaj8Aio1Lo/V1usbV3uGdRRtSATeAwbpej1s4tYgO9mv6xsXp4sGBE9EX553Z9EA HWQCetqKohD0B3LtozVhu0BTjUcRXA853pW4xeH//Iy1Sqie6xWPx8/fkVjsZwab3b6f n3X8RaWyCtyi31H+vBKw0cvugECLfRNUY7LYg0WeSylHPKIhYq2haqOOrYAQAhAMgF8R bpdg== X-Forwarded-Encrypted: i=1; AHgh+RqYfj1/OR4fa0nzOoTyCADsMmyfg9UBNdSAbOg4jGBESQ2/nWrpVgllYNzMJs7Pkn7DCSAW6jPqH/Ah5x8=@vger.kernel.org X-Gm-Message-State: AOJu0YxkeXkRIXqwS5B1XkT7hdb84UmxQ5WV/JFX6NRgzWZK9qCzOn7O q3Fm7RkhL+xxwEysk3G0ZrAN42RkS0mVKq7L+5seg2rgg0s72aYoMQBobj9J5e7gNfah0WMUR6C 4qzH7oHtKXet23X1VJRppoazIlFNg/YNfP2TYRfAIBCHx0vMmwXB/hCB6gaRnMzD+yPYJQhMLr9 IpRFlJPZ9TGwdpvt6xqhDdCllbvQ32TD7P5ODPXEH/SyF72Bihey3q/2Qi5Pc4+iUgqbURNHoIQ R0hO0sj6P5jqM+d X-Gm-Gg: AfdE7cnZDVjSaQOsU26vqJvbUrUruuwQHxInCBp8ZM759DZOj23JgUJNmAiIkbBD3qW Ee+cUN9dQ6HI0tIfbHk/DTuJ+67QVhB5HjF8nEWFCr3p4setxUQYB6LVyaq2qB4qcTBjTR6zJ3e P2nIQVRSc0PezGqQGACmLUFtYyDdaDRybnNq4SNgcma/IvXIFt8x4aptGyLvY970fEfMYdkwV/4 o/yRtUOF3npi9Pz103TFmCgqRMaZRYx3AJsVdIJLMcDXsYivxeFISyhZvjq7Wu5ZFM1U1+kCsBL p2svoRav0+rxsjWJVInB7IIrhrW4fwtR0bpWWDOn9e6G+Ukyx9X2Yp/hdRUH5ZWd7pFMmg40VwW mk9SAEPbRzlwYw3asZJ0aFfPUKFW8Xd+ogFQ6jY+4GFA9HFJslZuNfb70WKYq25OeQsCiPawsb3 NNx+T0yJ/aFnPoSBfGj7oYypHt+fxkmtqC X-Received: by 2002:a05:622a:4e0d:b0:51c:7b12:6000 with SMTP id d75a77b69052e-5213e77a4b7mr31387701cf.76.1784311599092; Fri, 17 Jul 2026 11:06:39 -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 d75a77b69052e-5214fdd31c3sm793121cf.20.2026.07.17.11.06.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jul 2026 11:06:39 -0700 (PDT) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-8fc92c5373bso143267426d6.1 for ; Fri, 17 Jul 2026 11:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1784311598; x=1784916398; 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=qk8fOSTNKdpV10bE/M7xcnHMgAcvmP8Zk1rifIUjMZU=; b=JuqGfxS0RhFVNSYPTKUWr5n07pmBY3YbAZv5tljME6hS51t8uBbiulWhya6XTjTHR/ gcjOMjbRgJQ8FvwKt5V7sbjV5WKYvrX8GPDJBeu2SzBagE9Jj4QW6WDIfl2R6jFPWrk0 tzEaBy2xSCzAFVPyCq0ZHU3wB3HonTQmwNKNs= X-Forwarded-Encrypted: i=1; AHgh+RpuAuN6Z241FWN26wsbmO6LPiGL2yCHR+/WN+hjYQFSrFE2gYUoiTjrT/dw0u3I30i+0DrwNoDOmeZbxBo=@vger.kernel.org X-Received: by 2002:a05:6214:2027:b0:904:2e70:78f with SMTP id 6a1803df08f44-90778353d4cmr43901966d6.9.1784311597698; Fri, 17 Jul 2026 11:06:37 -0700 (PDT) X-Received: by 2002:a05:6214:2027:b0:904:2e70:78f with SMTP id 6a1803df08f44-90778353d4cmr43901616d6.9.1784311597175; Fri, 17 Jul 2026 11:06:37 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2026 11:06:36 -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 2/2] mmc: core: Add MMC_CAP2_NO_SLEEP_CMD host capability Date: Fri, 17 Jul 2026 14:05:36 -0400 Message-Id: <20260717180536.1757204-3-kamal.dasu@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260717180536.1757204-1-kamal.dasu@broadcom.com> References: <20260717180536.1757204-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" Some (e)MMC devices take longer to exit the SLEEP (CMD5) state than their advertised S_A_TIMEOUT allows for. On platforms where a boot ROM sends CMD0 and reads boot code from the card immediately on resume, a card still asleep at that point causes the ROM to treat it as fatal and reset. Add MMC_CAP2_NO_SLEEP_CMD, settable via the new "no-mmc-sleep" DT property, so affected hosts can tell mmc_card_can_sleep() to never put the card to sleep, regardless of ext_csd revision. This is a host-level capability rather than a card quirk so it also covers cards whose bug can't be identified by CID/ext_csd matching alone, and it is resolved before the card even exists, avoiding any ordering dependency on when a card-quirk table would be applied. Reported-by: Florian Fainelli Closes: https://lore.kernel.org/r/20260413180551.3683969-1-florian.fainelli= @broadcom.com/ Signed-off-by: Kamal Dasu --- Changes in v2: - Replaced the card-level MMC_QUIRK_BROKEN_SLEEP quirk (keyed off CID) with a host capability, MMC_CAP2_NO_SLEEP_CMD, set from the new "no-mmc-sleep" DT property, per Ulf's suggestion that this generalize beyond one device's CID. - Resolving the capability in mmc_of_parse(), before any card exists, also addresses Oleksij's concern that a quirk registered in mmc_blk_fixups[] (applied at mmc_block probe time) could lose a race against an earlier SLEEP/poweroff on an under-voltage path. - Added Reported-by/Closes tags crediting Florian for the original bug report. drivers/mmc/core/host.c | 2 ++ drivers/mmc/core/mmc.c | 3 +++ include/linux/mmc/host.h | 1 + 3 files changed, 6 insertions(+) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index b7ce3137d452..3bc19645ea96 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-sleep")) + host->caps2 |=3D MMC_CAP2_NO_SLEEP_CMD; =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..5e80fa5c1a28 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1972,6 +1972,9 @@ static int mmc_init_card(struct mmc_host *host, u32 o= cr, =20 static bool mmc_card_can_sleep(struct mmc_card *card) { + if (card->host->caps2 & MMC_CAP2_NO_SLEEP_CMD) + return false; + return card->ext_csd.rev >=3D 3; } =20 diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index ba84f02c2a10..0447a8efed50 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_SLEEP_CMD (1 << 29) /* Card can't reliably wake from C= MD5 SLEEP */ =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