From patchwork Wed Aug 14 19:52:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 1147191 X-Patchwork-Delegate: van.freenix@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="hyYfAG3i"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4680ck0QxXz9s00 for ; Thu, 15 Aug 2019 05:53:09 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 9EB00C21E12; Wed, 14 Aug 2019 19:53:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 23494C21C3F; Wed, 14 Aug 2019 19:53:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E9AE6C21C3F; Wed, 14 Aug 2019 19:52:59 +0000 (UTC) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by lists.denx.de (Postfix) with ESMTPS id 43B4BC21C2F for ; Wed, 14 Aug 2019 19:52:59 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id m12so73363plt.5 for ; Wed, 14 Aug 2019 12:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CK0FmC7YAFmIDmLJZOyTsQeNkCVwpEa22u6LCbBkUNM=; b=hyYfAG3io5euEUpqs55QP8VekdGsnmy2u/ebmBsz5OjsqB5HOHjpQy0KTY1Rowp6M+ hifyhzaNOtQC2NE43jXiW6jS3cPm6X8H3/zPw6E325bQUyQAg2k4/p1q1Me2jm3KlMR6 VktwbvKKPjGX2ALR/x2R9uj0E58rU6U5ZMp47duyITaCD20DuhOpSMAmbZOs3byl2Iuo 3h2R0a/KebKbun4S1wr/c4UszdMNz99czalmLbjxpJ8IKXp0PggKUTK5BUjgpTH1ym8T goDe4G2zORn82UHvn4xHUNM6QGDnONib1o/UWfmlI92Bq8ecjtTlRr9fHg1jMg8kwuiq LZhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CK0FmC7YAFmIDmLJZOyTsQeNkCVwpEa22u6LCbBkUNM=; b=qv3H953os2xVS9CUr2XyHvhLM1tqMq/beMoTy6ka3DVOmNXlqyo0GyvgWx9WPEcBmF YVy6icKiN/j2XVewXLgBcWXVewT2qWXzOc6RbPteAqrxVFyq2GI75xrDu+F4KBBNb7nz bkxYyho9fj7Cukv3PKbwKnjl/e542H6dFOQ+qCGgQ5G3dFJhjPQzD2a+RgHI+kGqz4Ml 9ps5CFTsAOmd20OkfeXEEu1uY+4zcicGkyYAD7xfoCEjIrtbvMpjzXhV/ZDoCl1A+WFB N8eCNwlR7KGbVo40Ed2pNynlfB9WF401NAW9I89HxKMFCQNcs0TQTBBVn8TEjlCjVkxf ZOEw== X-Gm-Message-State: APjAAAW9Jx9+2rGLK8dM61CmgVLi7XQclrYm7uWBTmzVGSWGeAWGsZQt T+18owYXw27+YdRyB8O+7hUVcvOw9MyIig== X-Google-Smtp-Source: APXvYqxHIwTvickydR6IDd4zLPKiS2KHrwTkIiLpYEDcVmuG6z/O6HDxFaAKhmY0q0nXLljMtBFuOA== X-Received: by 2002:a17:902:4401:: with SMTP id k1mr974120pld.193.1565812377194; Wed, 14 Aug 2019 12:52:57 -0700 (PDT) Received: from localhost ([2001:67c:2e5c:2011:2e0:4cff:fe68:2882]) by smtp.gmail.com with ESMTPSA id b24sm683150pfd.91.2019.08.14.12.52.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2019 12:52:56 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Wed, 14 Aug 2019 22:52:50 +0300 Message-Id: <20190814195251.14208-1-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: Tom Rini , Praneeth Bajjuri Subject: [U-Boot] [PATCH 1/2] mmc: Fix timeout values passed to mmc_wait_dat0() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" mmc_wait_dat0() expects timeout argument to be in usec units. But some overlying functions operate on timeout in msec units. Convert timeout from msec to usec when passing it to mmc_wait_dat0(). This fixes 'avb' commands on BeagleBoard X15, because next chain was failing: get_partition() -> mmc_switch_part() -> __mmc_switch() -> mmc_wait_dat0() when passing incorrect timeout from __mmc_switch() to mmc_wait_dat0(). Fixes: bb98b8c5c06a ("mmc: During a switch, poll on dat0 if available and check the final status") Signed-off-by: Sam Protsenko Reviewed-by: Eugeniu Rosca Tested-by: Eugeniu Rosca Reviewed-by: Peng Fan Tested-by: Igor Opaniuk Reviewed-by: Igor Opaniuk --- drivers/mmc/mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index eecc7d687e..e247730ff2 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -235,7 +235,7 @@ int mmc_poll_for_busy(struct mmc *mmc, int timeout) unsigned int status; int err; - err = mmc_wait_dat0(mmc, 1, timeout); + err = mmc_wait_dat0(mmc, 1, timeout * 1000); if (err != -ENOSYS) return err; @@ -778,7 +778,7 @@ static int __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value, start = get_timer(0); /* poll dat0 for rdy/buys status */ - ret = mmc_wait_dat0(mmc, 1, timeout); + ret = mmc_wait_dat0(mmc, 1, timeout * 1000); if (ret && ret != -ENOSYS) return ret;