From patchwork Tue Apr 24 13:26:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10359865 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 4157560225 for ; Tue, 24 Apr 2018 13:31:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3370B28E27 for ; Tue, 24 Apr 2018 13:31:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2811A28E2A; Tue, 24 Apr 2018 13:31:26 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY 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 6DE4228E27 for ; Tue, 24 Apr 2018 13:31:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934064AbeDXNbW (ORCPT ); Tue, 24 Apr 2018 09:31:22 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:49174 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933306AbeDXNbT (ORCPT ); Tue, 24 Apr 2018 09:31:19 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3ODQ2lp195970; Tue, 24 Apr 2018 13:26:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=YXCdqcr0hDSPJ0ztx4kbZZDYcBEe1PKYaxcBsvvaNv8=; b=TlfEPSG+FOu7fCUZzTEqdEk8q8H55Cgkx1CaF3XvaIRlazRGZxwqnB/pcGwZgcbhGMq4 VDTZBl1V6P0UUoz33TmhX13bEoPvBs+cxDJ7FjRLptVMYjwNI+B/uoSAwjzI63VwSeIh /ftbpkJYe5dL5ZGVZmFrgESZXyPotMXmYBkWg4BAaODikStmd30OZc8HibvdwnrNFLge GcO8eGYrWmsoyL/giEymRIYHE80swEOh+ErBcr98ByQv5cdz7+xCmJ7ZJugcKhggs1E0 7tWyZpk/WD5qWrvDFFi/co+mMCwmTNmNXMN3QzbL9f2HjhIEgLR+iR5IDwVKlrj42Akh Pw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2hfwy9j0us-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Apr 2018 13:26:15 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w3ODQFS0029229 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Apr 2018 13:26:15 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w3ODQEgf000457; Tue, 24 Apr 2018 13:26:14 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 24 Apr 2018 06:26:13 -0700 Date: Tue, 24 Apr 2018 16:26:06 +0300 From: Dan Carpenter To: Adrian Hunter , Masahiro Yamada Cc: Ulf Hansson , linux-mmc@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] mmc: sdhci-cadence: Fix a loop in sdhci_cdns_set_tune_val() Message-ID: <20180424132606.GA10167@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8872 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=750 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804240130 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 We were supposed to go through this loop twice but there is a missing if statement so it only loops once. Fixes: 213fae74318b ("mmc: sdhci-cadence: send tune request twice to work around errata") Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c index bc30d1637246..7a343b87b5e5 100644 --- a/drivers/mmc/host/sdhci-cadence.c +++ b/drivers/mmc/host/sdhci-cadence.c @@ -274,8 +274,8 @@ static int sdhci_cdns_set_tune_val(struct sdhci_host *host, unsigned int val) ret = readl_poll_timeout(reg, tmp, !(tmp & SDHCI_CDNS_HRS06_TUNE_UP), 0, 1); - - return ret; + if (ret) + return ret; } return 0;