From patchwork Tue Aug 8 10:54:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bough Chen X-Patchwork-Id: 9887345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A7453601EB for ; Tue, 8 Aug 2017 10:48:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97C2A28776 for ; Tue, 8 Aug 2017 10:48:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89C09287A3; Tue, 8 Aug 2017 10:48:15 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 71BC728718 for ; Tue, 8 Aug 2017 10:48:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752003AbdHHKrx (ORCPT ); Tue, 8 Aug 2017 06:47:53 -0400 Received: from mail-he1eur01on0049.outbound.protection.outlook.com ([104.47.0.49]:20126 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751921AbdHHKrw (ORCPT ); Tue, 8 Aug 2017 06:47:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vFdccv1jkQcz0pgeIA5k6enEIr2mylz5oD2QKlQG8C8=; b=f4wfeKeSbqWfJc2zTrzG+c0hZapHFgear5zBR/Cj5M8xnO74eG+k8nu8m2gPvXUO8AH0x055uDVyv6JqnHEIECc6Bzvzrhb/HByg9bSJ6im4nmHHipdjijMrM0hOCRIVGfjnAiCr+FAgB86eA+lG05084MrheouPIv5kuGJCZ0w= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=haibo.chen@nxp.com; Received: from b51421-server.ap.freescale.net (192.158.241.86) by DB6PR0401MB2326.eurprd04.prod.outlook.com (2603:10a6:4:49::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1304.22; Tue, 8 Aug 2017 10:47:47 +0000 From: Haibo Chen To: ulf.hansson@linaro.org, shawn.lin@rock-chips.com Cc: stable@vger.kernel.org, linux-mmc@vger.kernel.org Subject: [PATCH v2] mmc: mmc: correct the logic for setting HS400ES signal voltage Date: Tue, 8 Aug 2017 18:54:01 +0800 Message-Id: <1502189641-29092-1-git-send-email-haibo.chen@nxp.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [192.158.241.86] X-ClientProxiedBy: HK2PR02CA0158.apcprd02.prod.outlook.com (2603:1096:201:1f::18) To DB6PR0401MB2326.eurprd04.prod.outlook.com (2603:10a6:4:49::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 720dbca9-7e50-49e3-f913-08d4de4ae9c0 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DB6PR0401MB2326; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2326; 3:g794UuCPEPvnmMPkf0VzG5QJGRB7YlVs4nCAvM04qE8ysYM9VOiyOgrHt770xf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KYAtzlcg8UR/pRpbxlgZHtwoCYL8jY+whnvwG1FymfbgtJ69/mQh+5eZXQa4jKJikb400EMXCUEhoNayXEEF4MUuIy2kg6npsEO/K4i9OfOVIaWd3VksuzrHsHAyEqJbwzQBOSaWLpyw5bzXZiqJgOyGlVYdozryYQIlZKV5clU/rvb+WymvirTaUiECr9jwWJ88tNgvV5ARHBiQJuuyiwOTQYcp4xydDvCFX4P/+kgWC9SsnnGO26B8tL1Kfouf7lUcUX046JW1ZuuLE9M60M05LogXZOrL; 4:gtQ07lIkT6LV6/3K/wPkN4JIWEXCXTHk3bqOZs5uaRixoRuydP0O9KyzUknuxhQ3xYAbL/x2Bd7DHUAjFsPpSBm7gb6MUaU4j0I/T4KA1ot1J4adYFOWfn2MhCYxcdJ+0FbDUn2xjwKzugUOQqHDjHYA1Smkl9giCeM1YJkRXYF9Ak5qb6VWMxw26s1CO5E1RwqkA9rT5iEYqjrSG4zhR6G2GObFifuM1o2xQgjUw94lq7tyPiWN8xsJ5VxxN7nw0N7+lkEHUHh0jh1UGaDAfHvZ+G13HQk/W5M6psMhYpzCbIzJLQt4Q7P6dX55o53oHfBea975ElAbD27zMgjt3w== X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0401MB2326; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0401MB2326; X-Forefront-PRVS: 03932714EB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(979002)(6009001)(39410400002)(39400400002)(39860400002)(39450400003)(39840400002)(39850400002)(199003)(189002)(8676002)(4326008)(86362001)(42186005)(101416001)(33646002)(105586002)(36756003)(478600001)(106356001)(50986999)(50226002)(97736004)(68736007)(7350300001)(5660300001)(2906002)(48376002)(110136004)(50466002)(81156014)(25786009)(47776003)(189998001)(5003940100001)(6506006)(81166006)(66066001)(6486002)(6666003)(305945005)(7736002)(6512007)(3846002)(53936002)(38730400002)(6116002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0401MB2326; H:b51421-server.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0401MB2326; 23:5QPEXZhuwuSedF6UU+0pi4VvLVMxPaPxElxWBCY?= =?us-ascii?Q?muY7yknBeQeapZ2hEFQE8iWnklzHYokRlE7BrlSr49KJNhEuYDCqSgWRlfxB?= =?us-ascii?Q?h2STVP7rxGqgBjsMz4MmYYWoZXeiAuOSNfeonLWHh0wyXDVBdUlNzWjzet/W?= =?us-ascii?Q?sJiOqu2tHulnU0MaRwFjBRcaDS4u1SP0iXmaNC8yJc31Y7dJ4ZkP1O8sXNdX?= =?us-ascii?Q?27JNbu0BsCJ4IY2JiXH7TlvVI+nR/MMiM9hr+hRzs/PPrVSE+qVk/B2KeHDO?= =?us-ascii?Q?yJDJjdEIWudJPfs+Ht8YKsk2EPuqgJ7jgQj6eqbzYRBNT45ejBDisCX6pYvN?= =?us-ascii?Q?viWPH9a6Tnr5kzDNxmTYeYjtBbhPEiYLadci4KTmJQzcAzfdgoU9lD/4LRqk?= =?us-ascii?Q?x9ddrNuKRiovNVz0gsHBwjBao63MzHl962oDCbcxfmgqC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X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2326; 6:RduPJsnrW9X74Onr8YiMC9VQ55z7SMTwM/FSrmxbXt2wQ+hwMKkQ6FZqVkjTeRXx/JlW4ua8p5S0WNS26acUjScDrXtyxw1KRYcpgjZxvR5FC6b83DS6z11KnyFZHW/oaptiNB09HPAqW3X77HFPEo9fNirAAlKIhqjQlgzNs27NygHTTtfLWO4jHdRSfTDWUD7rbsYG9wlZePReAQvPga1sg6sTNtjolLuieNfeUb4nCUMAwjCK1LVRFXQz3czzXnq9Ytqvcl9pE3iiu9euQe1V/W6C76urAYsZ9gS/140IzwUQWgbk7z004cFB+Sy1f4bwEFcZwx4U8dzk4jomrw==; 5:XqcD/T+P4+mzLHBDB9x7SDm8P9Kyhj3fG+P7PA16g4+3FmiHU+tBVSqf2618Y58plRFUI4DLko4afSHhkAuHZqY+X5LuS48QePGCceLS4ZUYQ8SlKxDJu2xcDpxfdY8MCOC27zqMi1seCH0YIZpk4g==; 24:y6W5MijRElRrMxJM1yE7YH7QGSZOudxFHBNznbI3iYIXGUIYj9zRkrGyZziBx60AGXP0qAaJuzez7Jf3mv8jmkeBBY25JClUaccFpTKmCSo=; 7:eXxin4ZoBDhQ+VWASqrC5pLxaj215rsdI/edB7y9IxW69u27xMH9E2g9iJT6WY9D/lLdIWyuTAq8mp3QBe2/6pQUzk2AuoiZFyWVAtAfygLGAPFlqwPqGRYX85TrpuIduJnIR067QzBO7jQUerqjduSHvI2nlO3Tqvd69yvgl9fiqQ9cBfD90AY4+QaujX95+JcTuZDJcIAglYDq7Cvy8fZ3B6tLgjVvKaTLf3d0S/c= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2017 10:47:47.3329 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0401MB2326 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 Change the default err value to -EINVAL, make sure the card only has type EXT_CSD_CARD_TYPE_HS400_1_8V also do the signal voltage setting when select hs400es mode. Fixes: commit 1720d3545b77 ("mmc: core: switch to 1V8 or 1V2 for hs400es mode") Cc: Signed-off-by: Haibo Chen Reviewed-by: Shawn Lin --- 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 30a13f0..83d9468 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1289,7 +1289,7 @@ int mmc_hs400_to_hs200(struct mmc_card *card) static int mmc_select_hs400es(struct mmc_card *card) { struct mmc_host *host = card->host; - int err = 0; + int err = -EINVAL; u8 val; if (!(host->caps & MMC_CAP_8_BIT_DATA)) {