From patchwork Fri Aug 14 15:21:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 11714711 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E64F7739 for ; Fri, 14 Aug 2020 15:22:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE801208B3 for ; Fri, 14 Aug 2020 15:22:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E/t/2SEO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726919AbgHNPWH (ORCPT ); Fri, 14 Aug 2020 11:22:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726444AbgHNPWG (ORCPT ); Fri, 14 Aug 2020 11:22:06 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64F0CC061384; Fri, 14 Aug 2020 08:22:06 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id i6so7096488edy.5; Fri, 14 Aug 2020 08:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fQmCXjIJLm4FOxf1HtQwARu0AkrMVdJ4Csr5yAIm0vc=; b=E/t/2SEODb0FlrlwFdSy8mvqOSQ+hxjDltw15BEagw1Pc5SFcB3E5mKO32U9sQ/SMA OGh5sBaVu4MVPBSD0qcSxykJDVd2KOoMKD+v6zw5Ct3sbclbEiMUK2Yq3d/ovECIp/76 JZsf4kFkoF7pgwtE6/HTJOffvD/8S4uKB24wSIJggfnuoKxiXOt16mWNUKYYBrNJCm+A 5kuUXMdsIS72j/MqkfkBzCUQsp9BZvI90MV5CkABPE4jXRecOzc5pat5o8cN/ilgMl3q f+gY5nmc6Khm/FcmvRk1n7Yrx2vOO6lVGBbhLD0wVnKP8Y0faITGnAXnbhE6wZXn3z25 rqZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fQmCXjIJLm4FOxf1HtQwARu0AkrMVdJ4Csr5yAIm0vc=; b=i2l8H0+2M8wQPD0s4Rcc1O2xIuMkmLDJQ6IBqB6L9jyUyIM446e8mXqUTa1gTECmTk FblWqMo7XOb9zVz70paTTnpK4pXe2xVPn+EfxQ5xpc07Pi8bDz+C4r1D96QZSQGIP3x6 8PKiYfx51kD8g54CF5Vpd+WUGRQp5H3urlpEVU+21zIKvsjRxAdFl1JkhHVDbVG8hG+w IuOyVYof965mavQQXpO5Sc+14D6MHj6WlhBY721+1LrZAo4hFQ+fgqHSeL+L2s8G6ZIu dMAXkSoIlqdXCFE58Cd6bcVEnfsBSuR9ybcwHQfSQXO6IbCvt8yxY74YZvZv52x5rdNW RxvQ== X-Gm-Message-State: AOAM532f71dn7OPxtUgBN9uRMOUByrkSr5VB9BED/BNiHgDdzJGhmUCG hsYG3/Bs9J82Ez0Xw1JVOmg= X-Google-Smtp-Source: ABdhPJyIyTb9/qHX42b92RxbUctP0qmUWK2msIV5OUMivkT40jOjszH4t2eA5MNELxhzAmTXQbDFCw== X-Received: by 2002:a05:6402:1282:: with SMTP id w2mr2593059edv.183.1597418525094; Fri, 14 Aug 2020 08:22:05 -0700 (PDT) Received: from localhost.localdomain (abag79.neoplus.adsl.tpnet.pl. [83.6.170.79]) by smtp.googlemail.com with ESMTPSA id e8sm6087974edy.68.2020.08.14.08.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 08:22:04 -0700 (PDT) From: Konrad Dybcio To: ~postmarketos/upstreaming@lists.sr.ht Cc: Konrad Dybcio , Ulf Hansson , Rob Herring , Andy Gross , Bjorn Andersson , Adrian Hunter , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 1/2] [-next] mmc: host: msm: Add optional full power cycle property. Date: Fri, 14 Aug 2020 17:21:59 +0200 Message-Id: <20200814152201.254010-1-konradybcio@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- 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)) { From patchwork Fri Aug 14 15:22:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 11714717 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A367E13A4 for ; Fri, 14 Aug 2020 15:22:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8B841207DA for ; Fri, 14 Aug 2020 15:22:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="apTCCIIR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727112AbgHNPWQ (ORCPT ); Fri, 14 Aug 2020 11:22:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726270AbgHNPWI (ORCPT ); Fri, 14 Aug 2020 11:22:08 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42799C061384; Fri, 14 Aug 2020 08:22:08 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id v22so7115889edy.0; Fri, 14 Aug 2020 08:22:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/ih4Rf1fys+3V3bYHR06uQQ/6JimIUcju77eK2mx+a8=; b=apTCCIIRtZJe2OdaK+cQWlkqeq7lOBkdmQTPxItcxLC6M+Vo5BLbKn6pZ9e+jaQsqa 8CDuxHy5HatIbPaA3sCOEBU9t7p/tw/EENH+l3aweoCdjEJk1ql/ftuS3TC/uHGugyab gDHiF/+J46W5IhqopoYvXMKepADIyPp6BtDu9wL+OcU5pT4oR6x2RqLwnOuCuleJQYK5 d4I6OQ8TgFP45auoSFoojgG9O1ESDEJrV50lDb2pxTnpk8mLU/sphA71i4+nRQmrPuqm NRDmHjz8aiZhJubhHLLNKE2M2F/bJ1qFMGckEzPLiYdzWbbXA/2wBc5pn1s8rsiZg0lz fswg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/ih4Rf1fys+3V3bYHR06uQQ/6JimIUcju77eK2mx+a8=; b=J1Q3aFUgCqNKIu2DU1aifDAC6NJPBZ5y/5xy6aAxOh8IXgO9d2wg014pazFE60qLN5 PC/HqUk5S94SkouJ3nuYvU0yTg/ES5xaZ9BDfo6MDODZLIT7qQ6CWt/UgttND5e5yYc5 xszCY7ouT8AwUc70RDxnqAZHCSDvbTYN5kwFHVxti9RzNGSaDQgb9giQ8P1W2m21dNvj Wh85F+CAAAzThQbZgTyafyaSVItDw9XaCOnR7QdKdmNBnDOxK5hm1InMzXIttMyj6GWg KBQ6zHjrgmWz76DLAtMDNWhCdGNBuZ7uKHLHIZlx5Cws+r8zeds0I+mJ1CJDNGnOt1Ed TKXw== X-Gm-Message-State: AOAM532K8ypgRxmFra9yXD1ANHeJCWRNMaqZBZ57VnFKDXY370cVBsEy TKhGaXpcy6OETcFIiLSlOqU= X-Google-Smtp-Source: ABdhPJw2WN3FXSBnT1ya0PnsO1C+XaduTRHZBOS2jAUmuI6LT40u+WhxoEh+VkXqMPZKMZpAA6mvqg== X-Received: by 2002:a05:6402:1c09:: with SMTP id ck9mr2807701edb.74.1597418527065; Fri, 14 Aug 2020 08:22:07 -0700 (PDT) Received: from localhost.localdomain (abag79.neoplus.adsl.tpnet.pl. [83.6.170.79]) by smtp.googlemail.com with ESMTPSA id e8sm6087974edy.68.2020.08.14.08.22.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 08:22:06 -0700 (PDT) From: Konrad Dybcio To: ~postmarketos/upstreaming@lists.sr.ht Cc: Konrad Dybcio , Ulf Hansson , Rob Herring , Andy Gross , Bjorn Andersson , Adrian Hunter , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 2/2] [-next] arm64: dts: qcom: kitakami: Enable qcom,full-pwr-cycle on SDHCI1 Date: Fri, 14 Aug 2020 17:22:00 +0200 Message-Id: <20200814152201.254010-2-konradybcio@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200814152201.254010-1-konradybcio@gmail.com> References: <20200814152201.254010-1-konradybcio@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This is required to prevent permanent eMMC damage. Signed-off-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/msm8994-sony-xperia-kitakami.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8994-sony-xperia-kitakami.dtsi b/arch/arm64/boot/dts/qcom/msm8994-sony-xperia-kitakami.dtsi index 30cb3aa7d734..eb806d1e4454 100644 --- a/arch/arm64/boot/dts/qcom/msm8994-sony-xperia-kitakami.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8994-sony-xperia-kitakami.dtsi @@ -439,6 +439,8 @@ &sdhc1 { * vmmc-supply = <&pm8994_l20>; * vqmmc-supply = <&pm8994_s4>; */ + + qcom,full-pwr-cycle; }; &sdhc2 {