lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200814152201.254010-1-konradybcio@gmail.com>
Date:   Fri, 14 Aug 2020 17:21:59 +0200
From:   Konrad Dybcio <konradybcio@...il.com>
To:     ~postmarketos/upstreaming@...ts.sr.ht
Cc:     Konrad Dybcio <konradybcio@...il.com>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Rob Herring <robh+dt@...nel.org>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Adrian Hunter <adrian.hunter@...el.com>,
        linux-mmc@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org
Subject: [PATCH 1/2] [-next] mmc: host: msm: Add optional full power cycle property.

On some eMMCs (at least the ones used on Sony msm8994 boards)
enabling full power cycle is required to prevent permanent damage
to the flash memory, whereas on others it results in better performance.

Signed-off-by: Konrad Dybcio <konradybcio@...il.com>
---
 Documentation/devicetree/bindings/mmc/sdhci-msm.txt | 4 ++++
 drivers/mmc/host/sdhci-msm.c                        | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/sdhci-msm.txt b/Documentation/devicetree/bindings/mmc/sdhci-msm.txt
index 3b602fd6180b..939c8df2a25c 100644
--- a/Documentation/devicetree/bindings/mmc/sdhci-msm.txt
+++ b/Documentation/devicetree/bindings/mmc/sdhci-msm.txt
@@ -54,6 +54,10 @@ Required properties:
 - qcom,dll-config: Chipset and Platform specific value. Use this field to
 	specify the DLL_CONFIG register value as per Hardware Programming Guide.
 
+- qcom,full-pwr-cycle: Enable full power cycle CAP2. This is required for optimal
+	performance on some eMMCs, whereas others need it to prevent permanent
+	damage to the flash memory.
+
 Optional Properties:
 * Following bus parameters are required for interconnect bandwidth scaling:
 - interconnects: Pairs of phandles and interconnect provider specifier
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 5a33389037cd..8d5c65e13dca 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -2242,6 +2242,12 @@ static int sdhci_msm_probe(struct platform_device *pdev)
 
 	msm_host->saved_tuning_phase = INVALID_TUNING_PHASE;
 
+	if (of_find_property(pdev->dev.of_node, "qcom,full-pwr-cycle", NULL))
+		msm_host->mmc->caps2 |= MMC_CAP2_FULL_PWR_CYCLE;
+
+	else
+		dev_info(&pdev->dev, "MMC full power cycle is not enabled. This might result in subpar performance or permanent damage on some devices.\n");
+
 	/* Setup SDCC bus voter clock. */
 	msm_host->bus_clk = devm_clk_get(&pdev->dev, "bus");
 	if (!IS_ERR(msm_host->bus_clk)) {
-- 
2.28.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ