From patchwork Mon May 30 07:40:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9140347 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 8F16B60467 for ; Mon, 30 May 2016 07:40:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FF621FF65 for ; Mon, 30 May 2016 07:40:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 748DD281C1; Mon, 30 May 2016 07:40:43 +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.9 required=2.0 tests=BAYES_00,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 2F1E71FF65 for ; Mon, 30 May 2016 07:40:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932686AbcE3HkY (ORCPT ); Mon, 30 May 2016 03:40:24 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:60146 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932623AbcE3HkV (ORCPT ); Mon, 30 May 2016 03:40:21 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O7Z01GRCBZ13Z50@mailout3.samsung.com>; Mon, 30 May 2016 16:40:13 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.114]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id D6.B5.05082.D5EEB475; Mon, 30 May 2016 16:40:13 +0900 (KST) X-AuditID: cbfee68e-f79b26d0000013da-ac-574bee5d9091 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 19.7D.06657.D5EEB475; Mon, 30 May 2016 16:40:13 +0900 (KST) Received: from localhost.localdomain ([10.113.62.216]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O7Z00D99BZ17780@mmp2.samsung.com>; Mon, 30 May 2016 16:40:13 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ulf.hansson@linaro.org, arnd@arndb.de, a.hajda@samsung.com, akpm@linux-foundation.org, torvalds@linux-foundation.org, k.kozlowski@samsung.com, Jaehoon Chung Subject: [PATCH] mmc: core: fix the wrong error control Date: Mon, 30 May 2016 16:40:14 +0900 Message-id: <1464594014-31934-1-git-send-email-jh80.chung@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLLMWRmVeSWpSXmKPExsWyRsSkSDf2nXe4wYNlGha31p1jtZizfg2b xd9Jx9gtbvxqY7V4/cLQ4vKuOWwWR/73M1o86nvLbnF8bbgDp8fvX5MYPe5c28PmcWLGbxaP vi2rGD0+b5ILYI3isklJzcksSy3St0vgytj0Yw17QTtXxewpq9gaGFs4uhg5OSQETCQ6F/9l g7DFJC7cWw9kc3EICaxglPjb28AGU7R3zQGoxCxGid3bJ7NCOD8YJa7O+ApWxSagI7H923Em EFtEwFri+vc7zCBFzAJ7GSUunm8CSwgLmEu03JzGDGKzCKhKLL7UyQpi8wq4STw8dIYFYp2c xMljEBskBPrZJWZsa2aFaBCQ+Db5EFARB1BCVmLTAWaIekmJgytusExgFFzAyLCKUTS1ILmg OCm9yEivODG3uDQvXS85P3cTIzCUT/971reD8eYB60OMAhyMSj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xZuz/yfs8ux8uIcpOIVzbuvpH/NfP11QukrU/GPs y/lf7Weu8xDOn6mS6bmZ5eVpW/bIp6dFeRiVWIozEg21mIuKEwGFrp0+rQIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected 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 After applied "remove lots of IS_ERR_VALUE abuses", it shoold be misoperation. (commit 287980e49) If mmc_bus_test is successful, it returned the bus-witdh bit. The below log is error log [ 2.542260] mmc0: mmc_select_hs200 failed, error 3 [ 2.542275] mmc0: error 3 whilst initialising MMC card Signed-off-by: Jaehoon Chung --- drivers/mmc/core/mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index c984321..aafb73d 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1276,7 +1276,7 @@ static int mmc_select_hs200(struct mmc_card *card) * switch to HS200 mode if bus width is set successfully. */ err = mmc_select_bus_width(card); - if (!err) { + if (err > 0) { val = EXT_CSD_TIMING_HS200 | card->drive_strength << EXT_CSD_DRV_STR_SHIFT; err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, @@ -1583,7 +1583,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, } else if (mmc_card_hs(card)) { /* Select the desired bus width optionally */ err = mmc_select_bus_width(card); - if (!err) { + if (err > 0) { err = mmc_select_hs_ddr(card); if (err) goto free_card;