From patchwork Fri Jan 19 13:39:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 10175323 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 6E1D56056F for ; Fri, 19 Jan 2018 13:39:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FA532865F for ; Fri, 19 Jan 2018 13:39:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5445C2869D; Fri, 19 Jan 2018 13:39:24 +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 0A2662868D for ; Fri, 19 Jan 2018 13:39:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754759AbeASNjU (ORCPT ); Fri, 19 Jan 2018 08:39:20 -0500 Received: from kirsty.vergenet.net ([202.4.237.240]:47838 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754542AbeASNjT (ORCPT ); Fri, 19 Jan 2018 08:39:19 -0500 Received: from penelope.horms.nl (unknown [217.111.208.18]) by kirsty.vergenet.net (Postfix) with ESMTPA id 035D125B790; Sat, 20 Jan 2018 00:39:16 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1516369156; bh=mVPic7TJWV3vpF/JRn0RRbt+YhTw5ZVl4j/wowa4bgQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RcArEKJls2+FoGt4oV/fllgqekIHnTLl4sYj/ACapS/j82Yf80QX+7MoA3iE/uW9w RLg/FzFPV+MQEDddVSRo0eL0f1BDcjbR2yslDoJCjfjy+knBtcmB2XubIbG2F9vWcA LeSNrjD0t/xBr9Ugp61w+xXHKXYh4SL2kDawgBVE= Received: by penelope.horms.nl (Postfix, from userid 7100) id 06765E204E8; Fri, 19 Jan 2018 14:39:14 +0100 (CET) From: Simon Horman To: Wolfram Sang , Ulf Hansson Cc: Magnus Damm , linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH v2 1/3] mmc: tmio: correct treatment of errors during tuning Date: Fri, 19 Jan 2018 14:39:04 +0100 Message-Id: <20180119133906.11280-2-horms+renesas@verge.net.au> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180119133906.11280-1-horms+renesas@verge.net.au> References: <20180119133906.11280-1-horms+renesas@verge.net.au> 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: Masaharu Hayakawa If the return value of mmc_send_tuning() is error other than -EILSEQ, the tuning fails and process goes out of for_loop. But the correct processing is to judge their TAP as bad. Signed-off-by: Masaharu Hayakawa Signed-off-by: Simon Horman --- v2 [Simon Horman] * Added to patchset targeted at upstream * Minor revision of changelog v0 [Masaharu Hayakawa] --- drivers/mmc/host/tmio_mmc_core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 6d8719be75a8..41767d33ef97 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -800,10 +800,7 @@ static int tmio_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode) if (host->prepare_tuning) host->prepare_tuning(host, i % host->tap_num); - ret = mmc_send_tuning(mmc, opcode, NULL); - if (ret && ret != -EILSEQ) - goto out; - if (ret == 0) + if (!mmc_send_tuning(mmc, opcode, NULL)) set_bit(i, host->taps); usleep_range(1000, 1200);