From patchwork Fri Mar 22 15:43:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10866117 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 58517139A for ; Fri, 22 Mar 2019 15:45:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CCF429182 for ; Fri, 22 Mar 2019 15:45:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C43E2A67E; Fri, 22 Mar 2019 15:45:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76C5129182 for ; Fri, 22 Mar 2019 15:45:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727442AbfCVPpG (ORCPT ); Fri, 22 Mar 2019 11:45:06 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:45359 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbfCVPpG (ORCPT ); Fri, 22 Mar 2019 11:45:06 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1M2w8Y-1h8TLT0ncK-003KEI; Fri, 22 Mar 2019 16:44:59 +0100 From: Arnd Bergmann To: stable@vger.kernel.org, Ulf Hansson , Janusz Krzysztofik , Linus Walleij , "Tobin C. Harding" , Geert Uytterhoeven Cc: Julia Lawall , Arnd Bergmann , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.4.y 01/25] mmc: pwrseq: constify mmc_pwrseq_ops structures Date: Fri, 22 Mar 2019 16:43:52 +0100 Message-Id: <20190322154425.3852517-2-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190322154425.3852517-1-arnd@arndb.de> References: <20190322154425.3852517-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:oe8376lywJ1RlgN89xWJQlf+8ZN8YDWsg4NYJjq+An/jq+TA3OO iRU3TJcxTNCk2RPXuCFKIGL03nBVIEj79YFJiDLmz1HJZhgoAroXmEqJjWtOS8rjBwBABhY IWwRX0wx8cMrHa1cZE6u1U9/XXHYduegiEDbHGGRXfwewHHR0nZdYOGyZo1bJxrkm++SImw H0m9QaPU7eMWkeR79GdVQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:W4KUOBxIZrU=:yV+7BtWADOH09wsWx39kaZ wHIZrDycVFQIt7W3f2Pdi4h5KFryWkZWTFjBkkANQXkdqErAZgiFsf4vdTyGCjzw+sxfeNPrj 4wssvVI9T1x9Pkb1MuE9+qI3FhzdqfaBhSRzqzz68qtjz74VjzONMZO9VmlhA378jrSxv/ipX CWjeQ45empv1htdOXAmjM4DNn/CtXw6aIVBizPH6nWqihoglMVbt/H0i9ZhxRKoJUMdYOMwq6 V+shWTBgqwMuTcFMkR8B+B89yi7QaJsfJKEidra36l7lH7kMH70fyF33xdJusJl3x20rZyMX0 WlAYYCb5nDBi3dY0U7iNbufDdRIbd+46gy1zClKr2DdnWgeoDG92FuO5p0fcGn8SBmjpIQPB2 1GAGQuAm8kfUO8tiepI090EpKmX4qbV23kcQxFH14uCiZCSJeqZ7Pz8lfAolVaOakcbhtFrte u5xEmuhQab+OJYeXrHWjbkr9TNXaeInF3/w8MjllwayfX9P/87Hd0pow/gnhR+XvgCWCGgkbQ wg44V6CnYv5UFAE7mB60set1WbYe6o0Ziu6qOACWRewly+hxSKt7ozDnATQjqQY3Tb+ws8/Uf 9du26OULb4lXQaQRbunR3X/fFksm/gqxgjv30JlFmJCjzYkP8+bM4DZAPI2zUfWw7nB5Eq303 qArUwlLDqYMBfiCDTMQZC5VtBnDU7086Am6DsJF6xXhBuByFotzII8Jf+NISofo8knykflgvW g2Hh3O6gyq6tpAdlDuFQA0XnGK9OwD+g1UNP/g== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Julia Lawall The mmc_pwrseq_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Ulf Hansson (cherry picked from commit ffedbd2210f2f4cba490a9205adc11fd1b89a852) Signed-off-by: Arnd Bergmann --- drivers/mmc/core/pwrseq.h | 2 +- drivers/mmc/core/pwrseq_emmc.c | 2 +- drivers/mmc/core/pwrseq_simple.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/core/pwrseq.h b/drivers/mmc/core/pwrseq.h index 096da48c6a7e..133de0426687 100644 --- a/drivers/mmc/core/pwrseq.h +++ b/drivers/mmc/core/pwrseq.h @@ -16,7 +16,7 @@ struct mmc_pwrseq_ops { }; struct mmc_pwrseq { - struct mmc_pwrseq_ops *ops; + const struct mmc_pwrseq_ops *ops; }; #ifdef CONFIG_OF diff --git a/drivers/mmc/core/pwrseq_emmc.c b/drivers/mmc/core/pwrseq_emmc.c index ad4f94ec7e8d..4a82bc77fe49 100644 --- a/drivers/mmc/core/pwrseq_emmc.c +++ b/drivers/mmc/core/pwrseq_emmc.c @@ -51,7 +51,7 @@ static void mmc_pwrseq_emmc_free(struct mmc_host *host) kfree(pwrseq); } -static struct mmc_pwrseq_ops mmc_pwrseq_emmc_ops = { +static const struct mmc_pwrseq_ops mmc_pwrseq_emmc_ops = { .post_power_on = mmc_pwrseq_emmc_reset, .free = mmc_pwrseq_emmc_free, }; diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c index d10538bb5e07..2b16263458af 100644 --- a/drivers/mmc/core/pwrseq_simple.c +++ b/drivers/mmc/core/pwrseq_simple.c @@ -87,7 +87,7 @@ static void mmc_pwrseq_simple_free(struct mmc_host *host) kfree(pwrseq); } -static struct mmc_pwrseq_ops mmc_pwrseq_simple_ops = { +static const struct mmc_pwrseq_ops mmc_pwrseq_simple_ops = { .pre_power_on = mmc_pwrseq_simple_pre_power_on, .post_power_on = mmc_pwrseq_simple_post_power_on, .power_off = mmc_pwrseq_simple_power_off, From patchwork Fri Mar 22 15:43:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10866119 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A1CC013B5 for ; Fri, 22 Mar 2019 15:45:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81A6B2A635 for ; Fri, 22 Mar 2019 15:45:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75B462A609; Fri, 22 Mar 2019 15:45:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D48792A609 for ; Fri, 22 Mar 2019 15:45:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727567AbfCVPpj (ORCPT ); Fri, 22 Mar 2019 11:45:39 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:46287 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727566AbfCVPpi (ORCPT ); Fri, 22 Mar 2019 11:45:38 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1MIMT4-1hAiPn1nlM-00EKiE; Fri, 22 Mar 2019 16:45:31 +0100 From: Arnd Bergmann To: stable@vger.kernel.org, Ulf Hansson , Janusz Krzysztofik , Linus Walleij , Geert Uytterhoeven , "Tobin C. Harding" Cc: Martin Fuzzey , Tony Lindgren , Arnd Bergmann , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.4.y 03/25] mmc: pwrseq_simple: Make reset-gpios optional to match doc Date: Fri, 22 Mar 2019 16:43:54 +0100 Message-Id: <20190322154425.3852517-4-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190322154425.3852517-1-arnd@arndb.de> References: <20190322154425.3852517-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:pXc1FdV5baiz8nobVE1STGDw+yPyuO8D5aCB7/njBTG3bn2KmqX B54PkMpx2O48DEyo0oTsTQh2OqB99IvxhcqDqcLvpXZfvWcMbXb7DI02DPEHVMTHsR3zJAE C9EHBZBp/8tdh65r5gU1/Y/445Fw9vYXoq0ruLJnN8yeCxvQTazXKptL+lHAGGDfU2I1jOn mHrJNqxoVwc9g9fUUdmAg== X-UI-Out-Filterresults: notjunk:1;V03:K0:i9vy6Ber0Rw=:2FHa5XeVUadCz07UFhhK8Q N0/0jVYWsP57lD454t4yBp3B0pMSi49Qhk91shLAA0gYXRziF7WzAhFGZb8HRpnLhzNG4Cy+p EKK9kGmm++e9Okqii/UqYDRyl9vm0sKbxeqnmPnsdfT5czujW9EtFnxBIwJ20d/3Kr6sP9Oqz ejEcFBLcob/fe69f6SA7rpv3leb9mBpLXoIh/RPAtkMqVbnU6nBasI6dgLbHHM+K/NBk+HuCR E8jfZOCpMhzGG74+M1flAByPNFDF0PZA0F4mNOM2XbjXwn9YX1TWgu/5rTBVnkX8YYwTo96Yw E/oMPXjPgR4WPml1T1N/RmMq/mMTcYN2+N6iVLgeaN0vIJ2xxM1rSp4DuQ+RdJuGDSZwgkc9a 7uYaCoeJHIBUq8jHP4+l4t5pvLDeefD0MbhLW/A/aSR+xjy98khe4K9+kjQhsKZ4zebaQHxut i1HPbQ7bPD6NhpL4xGIRAlHLnzSsEZsX/dG/KtOh/r1ehU4E4LrrBV0Uy32Cn83jipe5kNwfG JlML2T7xhU9LFYSG28pYJxJskHtCjgaqNtp7QllVwgSC6tRjaaQ2MAYC3dXy1brfzTGR3GIbi 4MU/u9CVT3iJVKShy2+1D5xr6DRX3UU3or2zQO+K/eZQ0Cmdxi85UYebUTr59mnuTpY2TGDWA lg2xDtZxAWmh6bXSVxvzlALJBRO3lhFYTgAXkslDkiVvOIe0HEj1d31AWGsDSaR7bsb1pN/R8 e3Lu5RZUO9igX40C8mSYHLWqDsc4sR2Hk1eigw== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Martin Fuzzey The DT binding doc says reset-gpios is an optional property but the code currently bails out if it is omitted. This is a regression since it breaks previously working device trees. Fix it by restoring the original documented behaviour. Fixes: ce037275861e ("mmc: pwrseq_simple: use GPIO descriptors array API") Tested-by: Tony Lindgren Signed-off-by: Martin Fuzzey Signed-off-by: Ulf Hansson (cherry picked from commit 64a67d4762ce3ce4c9466eadd152d825fbf84967) Signed-off-by: Arnd Bergmann --- drivers/mmc/core/pwrseq_simple.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c index 2b16263458af..aba786daebca 100644 --- a/drivers/mmc/core/pwrseq_simple.c +++ b/drivers/mmc/core/pwrseq_simple.c @@ -29,15 +29,18 @@ struct mmc_pwrseq_simple { static void mmc_pwrseq_simple_set_gpios_value(struct mmc_pwrseq_simple *pwrseq, int value) { - int i; struct gpio_descs *reset_gpios = pwrseq->reset_gpios; - int values[reset_gpios->ndescs]; - for (i = 0; i < reset_gpios->ndescs; i++) - values[i] = value; + if (!IS_ERR(reset_gpios)) { + int i; + int values[reset_gpios->ndescs]; - gpiod_set_array_value_cansleep(reset_gpios->ndescs, reset_gpios->desc, - values); + for (i = 0; i < reset_gpios->ndescs; i++) + values[i] = value; + + gpiod_set_array_value_cansleep( + reset_gpios->ndescs, reset_gpios->desc, values); + } } static void mmc_pwrseq_simple_pre_power_on(struct mmc_host *host) @@ -79,7 +82,8 @@ static void mmc_pwrseq_simple_free(struct mmc_host *host) struct mmc_pwrseq_simple *pwrseq = container_of(host->pwrseq, struct mmc_pwrseq_simple, pwrseq); - gpiod_put_array(pwrseq->reset_gpios); + if (!IS_ERR(pwrseq->reset_gpios)) + gpiod_put_array(pwrseq->reset_gpios); if (!IS_ERR(pwrseq->ext_clk)) clk_put(pwrseq->ext_clk); @@ -112,7 +116,9 @@ struct mmc_pwrseq *mmc_pwrseq_simple_alloc(struct mmc_host *host, } pwrseq->reset_gpios = gpiod_get_array(dev, "reset", GPIOD_OUT_HIGH); - if (IS_ERR(pwrseq->reset_gpios)) { + if (IS_ERR(pwrseq->reset_gpios) && + PTR_ERR(pwrseq->reset_gpios) != -ENOENT && + PTR_ERR(pwrseq->reset_gpios) != -ENOSYS) { ret = PTR_ERR(pwrseq->reset_gpios); goto clk_put; } From patchwork Fri Mar 22 15:43:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10866121 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E73C6139A for ; Fri, 22 Mar 2019 15:46:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C698F29183 for ; Fri, 22 Mar 2019 15:46:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B90222A8A6; Fri, 22 Mar 2019 15:46:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 638AE29183 for ; Fri, 22 Mar 2019 15:46:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727550AbfCVPqE (ORCPT ); Fri, 22 Mar 2019 11:46:04 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:55939 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727244AbfCVPqE (ORCPT ); Fri, 22 Mar 2019 11:46:04 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1M89TB-1h3FUl0ZQx-005ERN; Fri, 22 Mar 2019 16:45:56 +0100 From: Arnd Bergmann To: stable@vger.kernel.org, Ulf Hansson Cc: Chuanxiao Dong , Yuan Juntao , Pawel Wodkowski , Arnd Bergmann , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.4.y 05/25] mmc: debugfs: Add a restriction to mmc debugfs clock setting Date: Fri, 22 Mar 2019 16:43:56 +0100 Message-Id: <20190322154425.3852517-6-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190322154425.3852517-1-arnd@arndb.de> References: <20190322154425.3852517-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:rNgMA6KuyisLXRfCfenSe1Wq9wIOuO34n904IfRUOVdG701BO8N BsWka5aFdovs3ew+Atu2vZWxg2WBWaFa1PfkL7gqK4/urtKXNZzjMx9p075htozU3cz4MKv FDXFRMP33vZohqA/5KGjaaY7zwUXCbtHbvArBIyuJz8TESWvwKg1hI3Y9EYIK7NlLkcV+kx xRhUoIfRl9jIlvCxXAU8g== X-UI-Out-Filterresults: notjunk:1;V03:K0:zFe/6JXOYhA=:acYPAqDC7pVn98rLvZMSES 4THsCAGfnVUZdV33tqRBRvFIdFNieDIkxhcrQQmTL0gXyMx6EH2BfZgj8Tg2/NqHFf6H3Pza4 MK31PMRC6MqlDc7CUs4xJb/10ChMv7QPJcTUORNK/WBxCTgD/o05lWUCkAbHIZzXBaRlCvkue 43jgkIU2E/aa44EpNzMUNO7FeUzKejJANjDiJYfj8IAR96i0XVy6hsUOVErbkS1cxJvf6c63f 8JIp321mrCl9VEDUC3mCZLKOhlnWnOeIR7Y+6vzwOh4zLVxUaiDnZNN/8MSlo6SUlxbpcPKWF RTLuMKwEWX31ao4qqHM1rbxVTcbUW9Ph9TW5rngLeVnO4netSEkBLP5Wx8Pa2zkeBetw7ItYu N770UisrdkNy06VMvXGwN9ijs/9ZONfFxkgy/MgxdWeKEERG9h436seFiUcBJeh2CxEqtB2pg 1iJ39mxln+0S/JO6NLFc2op1X9h0I0M+20Q+MacNGiErMRDTaEgKCoE1XlyflqJ2VWO/tmPJL jS2h6VyEGIfk9h1wTFrz+4hPpr9hCbK7XAnsr7vBRTTVtGIATQ3QmoJ4I1n6hLH9T0qGO+5Mu K2t50KugpzaJHaXx7bXoZ4RYZEFwKqhNJTpkoMImgnMOvc6jx41jL+lbdzPbSQhQ4ReXioBD6 qs0JyYJzNuTowuraliXuZWmWRYTrk/YJkiFIzH/H1FDkjhDxijpZFpZL5b/y8rclYyNZ7XZ75 EgYpTtfyCOntmVn61fyx4BrT+qMzBbRmE9UUeA== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Chuanxiao Dong Clock frequency values written to an mmc host should not be less than the minimum clock frequency which the mmc host supports. Signed-off-by: Yuan Juntao Signed-off-by: Pawel Wodkowski Signed-off-by: Ulf Hansson (cherry picked from commit e5905ff1281f0a0f5c9863c430ac1ed5faaf5707) Signed-off-by: Arnd Bergmann --- drivers/mmc/core/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c index 154aced0b91b..705586dcd9fa 100644 --- a/drivers/mmc/core/debugfs.c +++ b/drivers/mmc/core/debugfs.c @@ -220,7 +220,7 @@ static int mmc_clock_opt_set(void *data, u64 val) struct mmc_host *host = data; /* We need this check due to input value is u64 */ - if (val > host->f_max) + if (val != 0 && (val > host->f_max || val < host->f_min)) return -EINVAL; mmc_claim_host(host); From patchwork Fri Mar 22 15:43:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10866123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A3D5913B5 for ; Fri, 22 Mar 2019 15:46:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86EFF29183 for ; Fri, 22 Mar 2019 15:46:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AE972A8A8; Fri, 22 Mar 2019 15:46:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C13A429183 for ; Fri, 22 Mar 2019 15:46:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727231AbfCVPqh (ORCPT ); Fri, 22 Mar 2019 11:46:37 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:39051 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727251AbfCVPqe (ORCPT ); Fri, 22 Mar 2019 11:46:34 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1M1Hi8-1hA7Fs3q1K-002mWu; Fri, 22 Mar 2019 16:46:07 +0100 From: Arnd Bergmann To: stable@vger.kernel.org, Ulf Hansson , hongjiefang , Simon Horman , Jennifer Dahm , Yinbo Zhu , Avri Altman , Kyle Roeschley Cc: Wolfram Sang , Arnd Bergmann , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.4.y 06/25] mmc: make MAN_BKOPS_EN message a debug Date: Fri, 22 Mar 2019 16:43:57 +0100 Message-Id: <20190322154425.3852517-7-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190322154425.3852517-1-arnd@arndb.de> References: <20190322154425.3852517-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:RWCkPDa1RfODQ0CZQuzMTOyyy2eIm16NST7+OZno7XSgnPYCTH4 /y/qoDARhKGdcdXUcBB4gtsDxCKATndrYjVgnud2zIa+wI3TUMYa1jKjZXOOctVijd/vINm cY1kv17brk0/njzjWlJdCJMo2RTliVmdF15KW8BkgZKGk81Bzo42F/6GkMIp1ufgmyrgOSU 1Z4jmvQdJrKbgjk8xMz1g== X-UI-Out-Filterresults: notjunk:1;V03:K0:YgBfrG/uq1c=:I4UntfcZItaVU6X37yNOeT dywgzQnJK7DWuALu/7Mq0b4nDZRwmHqmWMvtbM5g9zG6RzdOd72CrO7W6A7FNqDniazvCfhYu 1mvkBe0gIMRUT2+WVM89yxmZC7YWK/wcAN1ugXXa02CwA19EiHV0AcLBsd/tEKZlPaBbfahhB rNUXoW0pKvQNPsBf5+kuMMHRBdsF+sEOCCTg5S2YSnhWg8rPX1ReAtOTbAJA3y0zIZos0CyNt gM2Zo5kevM8l9CkWsBU88mZzskgjuO02MsjXu8MA6CgJOPvdax+NPVlib3ZX9hVPs8j4qAsVD M6w987t8L4+17ECIexEWIrRrtdJ8cAA7NvEJ201sM7faZ+VkZ+8QloGmj4jRCYj6QRMslffcI GfXp1DEUs+mfkZ2QT8PCfORkJTZvNvUWuUVWazE8N+YSK8t7aKLrq5bjYeAB1j1ZzJ7VkiH1D f+IEszEdJMMuRZYOMPrGV2NWVU+BFFJi0f8qg9GSlYTKEILMlNmVs932F3d4gJ24Vgvk4S2iI wISMmt2bz87uVEIZKgUCE19VA9QMAG7uQNUpi4bywERe2kqubghIQSMXBzCnP35a+5UgQgdGM SnqVOXGZTeBNldMqiQSWRYcmYlAhi1icivNYN/BmTDBsNz8yQMgJXyT+gyl9JmfK7dFmG13D5 vEjV7T1Z70sPPZOySMfDvxm4R/p5l0vQxpy9NIsux4rUylT50rAAC6wjPegoyGaPS4ORgnTPa +BdjwTWxlsyi/mzDtyf4T4KiwRJRL6fI1vbT4w== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wolfram Sang IMO this info is only useful for developers. Most users won't need this information, since there is not much they can do about it. Signed-off-by: Wolfram Sang Signed-off-by: Ulf Hansson (cherry picked from commit 4ec96b4cbde8d5714a4477b5a2562c3dd40bc5fa) Signed-off-by: Arnd Bergmann --- drivers/mmc/core/mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index a31789be0840..adc3291e9d6a 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -508,7 +508,7 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd) card->ext_csd.raw_bkops_status = ext_csd[EXT_CSD_BKOPS_STATUS]; if (!card->ext_csd.man_bkops_en) - pr_info("%s: MAN_BKOPS_EN bit is not set\n", + pr_debug("%s: MAN_BKOPS_EN bit is not set\n", mmc_hostname(card->host)); } From patchwork Fri Mar 22 15:43:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10866131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A5EA6139A for ; Fri, 22 Mar 2019 15:47:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 841272A635 for ; Fri, 22 Mar 2019 15:47:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 783112A8A8; Fri, 22 Mar 2019 15:47:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85CE629182 for ; Fri, 22 Mar 2019 15:47:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727442AbfCVPqx (ORCPT ); Fri, 22 Mar 2019 11:46:53 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:57135 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727251AbfCVPqx (ORCPT ); Fri, 22 Mar 2019 11:46:53 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1Ml6du-1giFMn2xJs-00lUfW; Fri, 22 Mar 2019 16:46:21 +0100 From: Arnd Bergmann To: stable@vger.kernel.org, Ulf Hansson , Avri Altman , Shawn Lin , Martin Hicks , =?utf-8?q?Niklas_S=C3=B6derlund?= , Wolfram Sang , Ritesh Harjani , Simon Horman , hongjiefang , Yinbo Zhu , Kyle Roeschley Cc: Arnd Bergmann , Jiong Wu , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.4.y 07/25] mmc: sanitize 'bus width' in debug output Date: Fri, 22 Mar 2019 16:43:58 +0100 Message-Id: <20190322154425.3852517-8-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190322154425.3852517-1-arnd@arndb.de> References: <20190322154425.3852517-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:G768/5n7N+5yTCnRzLr3RNwvzu/HYJiMFqxjs0wDv/J34Szl14D ox4n6suF/EFsAqlzN5tGJcDQeBomC44kIT1Opy/9ltW98MuFx8iQOTAdh6V4Y4E8/Q04Vq8 zKSNVc3eiLey+XUBSjqgbkYVmQG8JrIq4aPEOmdNxWtaewmVNV6EnbbB2XDXz7HSHF+M7zI fr9ElsuIRW32OqLNzcnLA== X-UI-Out-Filterresults: notjunk:1;V03:K0:7T/GpsWXrRI=:gv5/lMUz3Skxdq2x4iCNw+ sU6OSLFoZYnZpQt1+S9bwibN8jBoon6VFG1qC2ImbUemPsECYLxT9ZbeHcnAjQZdkVEhLAmuF yl46ggRrpiFXEXk6uSO4gq5OUGeQ1nFglHQ38RK90n4tM3NAsnfEeFhT1Lujfm4OkcihFY8/v rxKppeDax2KUhokn2BvHVHYJQpTrh4/1mHiMY40D1xYJCbJL8fbwuE6Eqj4gdsnhF8NGCB/qR SG9Q4yYlCCWQ9WeY7DrxIf7NCm1RKKVjjMWckSuBFAXmj50m2tqem0nz4feDAt1Ymnh0sfbQ9 fM6X5f83+xxb5+8rpctpxiQqkIr26l4cFuX75SjGXKJ65WwiLomgjrx4LNABekiTAkKWS9ovr Ql5EUUAXC7eg9Ed8I9KHRPDWQiVDrjXbx94uxmrfRFENYG9r07lP97FfIP/yY4hZtYAGn0zPc 0n5aUm4jRlvdjwcGK0unpI07ivx+bdwpva4c2z5oBMxmTcaTSD3epFj1sgS94HIJGfr8mZpz3 ROwJRE+OqtgyL0rystPgFaybsfXd7Qnxp2JqQiTemf3C2btIakaa5188Ze44Bt7S+6uugRv6+ tWqxYxLQ2CBPxKIF5UhKlWlZ1XwZTUmo2uoq/1J+jypGgaV1YNHXyprhh/ozWzeveqkC9pwmA CvUw2pAabo/BSaXurlWmOUr3f5Yp66f0tarxnxo+W4cYj/karKv8VoSg3JVYFDKB2g52CUpWT IqJIqwl7naZsgWNi/FJgQ1vTRKxiz9OirC7rwA== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wolfram Sang The bus width is sometimes the actual bus width, and sometimes indices to different arrays encoding the bus width. In my debugging case "2" could mean 8-bit as well as 4-bit, which was extremly confusing. Let's use the human-readable actual bus width in all places. Signed-off-by: Wolfram Sang Signed-off-by: Ulf Hansson (cherry picked from commit ed9feec72fc1fa194ebfdb79e14561b35decce63) Signed-off-by: Arnd Bergmann --- drivers/mmc/core/core.c | 2 +- drivers/mmc/core/mmc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 299a83f1ad38..e2e927d1f7e4 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1039,7 +1039,7 @@ static inline void mmc_set_ios(struct mmc_host *host) "width %u timing %u\n", mmc_hostname(host), ios->clock, ios->bus_mode, ios->power_mode, ios->chip_select, ios->vdd, - ios->bus_width, ios->timing); + 1 << ios->bus_width, ios->timing); host->ops->set_ios(host, ios); } diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index adc3291e9d6a..7286d0d324e1 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -952,7 +952,7 @@ static int mmc_select_bus_width(struct mmc_card *card) break; } else { pr_warn("%s: switch to bus width %d failed\n", - mmc_hostname(host), ext_csd_bits[idx]); + mmc_hostname(host), 1 << bus_width); } } From patchwork Fri Mar 22 15:43:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10866127 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 906C3139A for ; Fri, 22 Mar 2019 15:47:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7575C2873B for ; Fri, 22 Mar 2019 15:47:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69BC72A8A8; Fri, 22 Mar 2019 15:47:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02FC22873B for ; Fri, 22 Mar 2019 15:47:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727797AbfCVPq4 (ORCPT ); Fri, 22 Mar 2019 11:46:56 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:52233 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727363AbfCVPqy (ORCPT ); Fri, 22 Mar 2019 11:46:54 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1N1whr-1h0jYs2B7R-012LGN; Fri, 22 Mar 2019 16:46:39 +0100 From: Arnd Bergmann To: stable@vger.kernel.org, Ulf Hansson , Avri Altman , Shawn Lin Cc: Russell King , Arnd Bergmann , Ritesh Harjani , =?utf-8?q?Niklas_S=C3=B6derlund?= , Jiong Wu , Martin Hicks , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.4.y 08/25] mmc: core: shut up "voltage-ranges unspecified" pr_info() Date: Fri, 22 Mar 2019 16:43:59 +0100 Message-Id: <20190322154425.3852517-9-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190322154425.3852517-1-arnd@arndb.de> References: <20190322154425.3852517-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:xKzkjcZ9sdwnDMJpHCbZubw9iVQy1Q+3iwt6jMNhxhxj57MfM1U KRwERkSOzuQyLrMuc4JjyBHg6PY1SETZcdz+006q7Dc70RQE1RiwoOtEQGGXuDaAfz7mky2 mZeRU+KuQZel2C+oRNwwEdzxN/C5X0WLsn63h3lX6tvI+A43BgcHGqEoaPimxWyspzoS/x9 jYrL+tBnVbxtFEYisI4Xg== X-UI-Out-Filterresults: notjunk:1;V03:K0:8UOTv7lvoss=:sYhAnRI77z0j8XUghrTEtS LJz3BkBZP4wJHmpsn4c0dIw7NeC4IKcR/UzN86DL9VkqWHu+seWOfst8bslpwRsD23LcWx3f/ NBZATyxs9JP9mdJp8G3dGa98HbopsnUlz6cjpEHarLKpyPJLWwMxv6NStlTkSdm/N9pnqwiSL oTVGmbfHgKTNWZvTRgIKSriRrMSBMLtH07NllhK/3lFXermaL+5E7gGp/Iexc4YDVeJaLSqnC bG+qztu94rEqhtDdVfnCxaPmozC77OHkOBlWKPYKdnLyRThlSz2zdBPPdRkJ9JwRDSvCNhtqP w38LeYAQHiX/fvztDnwA6GV9Q9d7apT4py6dURXQuX6AIX+8/MGSSgNjUO9UzS5TiRlS59yEt i/u4/L1vmQXKxeXwNy3VH9ANbMdrvMAQygA5NZHr1lh3OHgIqyQli6oWQbEnPLcC0gVmw0MvI VgTZ1AAcYbg+/uwFmChajj5evzLDVfNHRhz6t9V+Gc6D/WOwQglH2RGpRj5hDNBBffKA869gb JbYKJ6XS3nMyqgyEdyBos66HAdBPCiQ7EGq3lQNw5b811FRHpqmcfSk0W/knzaEXyPs3exvbi 8XmnaDq5vlfHK4gmJDJr3OLfmfYQoz/LI4QrF7Za6el4Hz2Ta/j3lZZAlZpRRc80iIpIvvg6u 8Ds6gcbpemgYDltBjj2U07LAZVD9LArwXGgqdspyUvTWn8quxi6Rkk5llHqGgchDwVZzWfN2v 1NibpG3Z0TF80gjUSH8itOi0UFeloxhliU3k/Q== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Russell King Each time a driver such as sdhci-esdhc-imx is probed, we get a info printk complaining that the DT voltage-ranges property has not been specified. However, the DT binding specifically says that the voltage-ranges property is optional. That means we should not be complaining that DT hasn't specified this property: by indicating that it's optional, it is valid not to have the property in DT. Silence the warning if the property is missing. Signed-off-by: Russell King Signed-off-by: Ulf Hansson (cherry picked from commit 10a16a01d8f72e80f4780e40cf3122f4caffa411) Signed-off-by: Arnd Bergmann --- drivers/mmc/core/core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index e2e927d1f7e4..df074f8c7cb7 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1220,8 +1220,12 @@ int mmc_of_parse_voltage(struct device_node *np, u32 *mask) voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges); num_ranges = num_ranges / sizeof(*voltage_ranges) / 2; - if (!voltage_ranges || !num_ranges) { - pr_info("%s: voltage-ranges unspecified\n", np->full_name); + if (!voltage_ranges) { + pr_debug("%s: voltage-ranges unspecified\n", np->full_name); + return -EINVAL; + } + if (!num_ranges) { + pr_err("%s: voltage-ranges empty\n", np->full_name); return -EINVAL; } From patchwork Fri Mar 22 15:44:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10866137 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E286139A for ; Fri, 22 Mar 2019 15:47:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F9C92A8C0 for ; Fri, 22 Mar 2019 15:47:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 038372A8C1; Fri, 22 Mar 2019 15:47:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 550352A8BE for ; Fri, 22 Mar 2019 15:47:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727969AbfCVPr1 (ORCPT ); Fri, 22 Mar 2019 11:47:27 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:37727 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727504AbfCVPr1 (ORCPT ); Fri, 22 Mar 2019 11:47:27 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1MXY6b-1hUrZP1Wvv-00Z2OT; Fri, 22 Mar 2019 16:47:04 +0100 From: Arnd Bergmann To: stable@vger.kernel.org, Ulf Hansson , hongjiefang , Simon Horman , Kyle Roeschley , Jennifer Dahm , Yinbo Zhu , Avri Altman Cc: Dong Aisheng , Arnd Bergmann , Shawn Lin , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.4.y 11/25] mmc: core: fix using wrong io voltage if mmc_select_hs200 fails Date: Fri, 22 Mar 2019 16:44:02 +0100 Message-Id: <20190322154425.3852517-12-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190322154425.3852517-1-arnd@arndb.de> References: <20190322154425.3852517-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:AUdmkZ5z4T+73YX5eDFD7nmt0VVn8VFjTyPcIjAgXkBryoY38Sj KEcTEgx2j4b1CAowPC21uD6NWeJPhVix5lXJxvPisKKZMMLTRUE+GzTDFNAGLXmNC8CW03q hA9kqPKM+DHGYRHZj4/ktdzzz1eL9xENAZSY5XspO741kft7ouFaXIbZ8zfzPdrUBfZPUA1 FuaD1Hf2yB4JzAoLOtEdg== X-UI-Out-Filterresults: notjunk:1;V03:K0:h6UQKPJz7PE=:vYowmL9ByE7hVEvss4ayn1 woXB+qzcoNA4PzL6YY12oOviTzsKDgsrlF34hj39WmZUFmSY6On06LDxDrPDOKCBIfDkMAFtq HLJSFNaiA2hOdOSewbr2iwec/BeWTm9kPHClLEV+f+c7Q701UFG7LbZqkG2ZKmMEeKs4QpgUz exfXn1hgSeC4MgoaBmcL+MjJtNkdnuef75gmhAP1yiAdAGHy5YMCzRzVcEgOFHIOim8FOd1/4 xMiykaSEwBU3rRAffLXAHHxbE/jveSdkvTdWXIc2Blo8pd+8fTk/UOHEzoTta0Lqw8YMMvFuN OVeqbyXS5F/TPP9hY1Dk5BtfCxFdD6F6ZhidQuz9RoywmB2iebJnD0Rdej6NRT6YJv9wKpTqQ hqCpId7RBpXo79BJmMpFb4GJQZMUiev4zYKwUcWY+78KLGydZekwr2X6BRbpr44yrY+W8+8OA p91HpFRUM+1SqFKeGY6VpZZskmPa2UVOMrBF3mm1hITPng52DP3ae1feG01mwMkVogwBMLMID g2kdgPOzp1WB7RqrulQ6EvhoCny8JjZF9APCS6M13VJjwTdVLTriswhrOYR/8YdgvVsrKxX2k vle3P1ivlGvmfwSDvIyX/CKvE8C9Sd2ONVQPzrBlS+aPLHYtD2qi6NRatqAXEolm/IPkioaMf qY+YxXeLpfQzhUvR5tViimndJoFOa6whKUyUea+irh/yxewFbP+xmDYJKDZRSdC/sQqDyH6pp OshfE9+T4JLKngiDterlyd3CkYuTG8mAMtUE5g== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dong Aisheng Currently MMC core will keep going if HS200/HS timing switch failed with -EBADMSG error by the assumption that the old timing is still valid. However, for mmc_select_hs200 case, the signal voltage may have already been switched. If the timing switch failed, we should fall back to the old voltage in case the card is continue run with legacy timing. If fall back signal voltage failed, we explicitly report an EIO error to force retry during the next power cycle. Signed-off-by: Dong Aisheng Signed-off-by: Ulf Hansson (cherry picked from commit e51534c806609c806d81bfb034f02737461f855c) Signed-off-by: Arnd Bergmann --- drivers/mmc/core/mmc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 7286d0d324e1..7844baecf306 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1251,10 +1251,11 @@ static int mmc_select_hs200(struct mmc_card *card) { struct mmc_host *host = card->host; bool send_status = true; - unsigned int old_timing; + unsigned int old_timing, old_signal_voltage; int err = -EINVAL; u8 val; + old_signal_voltage = host->ios.signal_voltage; if (card->mmc_avail_type & EXT_CSD_CARD_TYPE_HS200_1_2V) err = __mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_120); @@ -1263,7 +1264,7 @@ static int mmc_select_hs200(struct mmc_card *card) /* If fails try again during next card power cycle */ if (err) - goto err; + return err; mmc_select_driver_type(card); @@ -1297,9 +1298,14 @@ static int mmc_select_hs200(struct mmc_card *card) } } err: - if (err) + if (err) { + /* fall back to the old signal voltage, if fails report error */ + if (__mmc_set_signal_voltage(host, old_signal_voltage)) + err = -EIO; + pr_err("%s: %s failed, error %d\n", mmc_hostname(card->host), __func__, err); + } return err; } From patchwork Fri Mar 22 15:44:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10866141 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AACD817EF for ; Fri, 22 Mar 2019 15:48:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F6ED2A8C1 for ; Fri, 22 Mar 2019 15:48:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 811372A8C5; Fri, 22 Mar 2019 15:48:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01E3A2A8B7 for ; Fri, 22 Mar 2019 15:48:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728480AbfCVPsH (ORCPT ); Fri, 22 Mar 2019 11:48:07 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:58217 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727473AbfCVPsG (ORCPT ); Fri, 22 Mar 2019 11:48:06 -0400 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1M1Hi8-1hA7He3ZN4-002mWu; Fri, 22 Mar 2019 16:47:53 +0100 From: Arnd Bergmann To: stable@vger.kernel.org, Ulf Hansson , Shawn Lin , Avri Altman , Ritesh Harjani , Jiong Wu , Martin Hicks Cc: Ziyuan Xu , Arnd Bergmann , Wolfram Sang , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.4.y 17/25] mmc: core: don't try to switch block size for dual rate mode Date: Fri, 22 Mar 2019 16:44:08 +0100 Message-Id: <20190322154425.3852517-18-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190322154425.3852517-1-arnd@arndb.de> References: <20190322154425.3852517-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Up6hvE5bt3o/vSsgJuCZN3OfmzkMDswwd0o14/Q/eUjurBBO/3c 78coqjWfdKnwPvALN2Mji5pfrU/Em0bTpvUCoi2FruCjQ+Iw5ZdNO/pgLgV0aDbjTMdR0Gc fx+0xasgAsErwZbxrSAtheeXGGT417xtCLpe5Fc5wUIh+fRHn0XwDVkiub50tST2TR5+4QT 3+MnUuZfPuzxoviPfPHUg== X-UI-Out-Filterresults: notjunk:1;V03:K0:V6unOQIF1tY=:VNjvKIu+JKJD9f+Z+tIja+ gACnTL9EtUPYw75NentheME7zykhMYM6y24ycmoU7fiefKLq7NB5A+y3apgwGmYwpULzG05cj zJuJogd0wF21L6Cc3LzvT0F1bQvP0Wu3OXhkD55r/HoUMempR1/ASxVLzT76JacW5+/Sr/Mqk neJ1Xu/uzsA1FiGc/xlOcZB7/LpglNzRvNT3GjaGSo4TmIlYwim5XZeYhn+7fBGjc6cRFaYg9 JQ2UgnHZbzs/PfdXzJlo3m1SnT3aJBMegI2iUCPto0ES7aLceQEIQoWLNc4CrN6TvQCX3d8x/ hU+2gW02c+qsVgsFIO7vJf5oJ4wYfIlJFnZHS7dPZZgzOpSwFOeGeU6XuDF5S9U+7C2Ng+KwV f4u6co97xlqYnTxAP0Z59EogvveqwTjlIYhc2yVJqI5QFCydAM/PTX9uf2ycmZFUbDT/e1ZoQ +Jdh9+5cvEK2jaHyZ/F+Rz7ARp3dTQdTnByhJzlG0DstWvl9zKXi/Tq6nRkFJWyubT4ZKNaRQ My4VezSTZLcWNGraXn73YRQ1uKvoWAWGwkpSu5p1Bj4kTHhIW3QV0LVTUQXhIU9Qq+SgRCo3g ZmfoQ/85aKTuEgVCNk5Bay6/CyECP6ISU0dxp5Rvxxt6ZVo5pW5+NaXE1PWQJyn5Cjdynvp+3 xr+y/J6t1kt4kCoD3ya76l/xCUE+6rVAO2J0AOEuviRsW8cHpgyHp8Oj4qr1fQS0lClQTy1DG CF5k1oywOG2pGy2dTGgkqV/iNR0zCP9Q7dhnrQ== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ziyuan Xu Per spec, block size should always be 512 bytes for dual rate mode, so any attempts to switch the block size under dual rate mode should be neglected. Signed-off-by: Ziyuan Xu Signed-off-by: Shawn Lin Signed-off-by: Ulf Hansson (cherry picked from commit 1712c9373f98ae8ed41599a8d7841a6fba29c264) Signed-off-by: Arnd Bergmann --- drivers/mmc/core/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index df074f8c7cb7..3e17268b9994 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2406,7 +2406,8 @@ int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen) { struct mmc_command cmd = {0}; - if (mmc_card_blockaddr(card) || mmc_card_ddr52(card)) + if (mmc_card_blockaddr(card) || mmc_card_ddr52(card) || + mmc_card_hs400(card) || mmc_card_hs400es(card)) return 0; cmd.opcode = MMC_SET_BLOCKLEN;