From patchwork Thu Nov 2 14:10:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 117816 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp2124058edm; Thu, 2 Nov 2017 07:10:38 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RxsH5vPmiGxyklyq+Lc61aw2tx5SMsgfAFlP197kKRkP1ZpA+dIfCnrIm32V7/Wk/jHi66 X-Received: by 10.80.167.34 with SMTP id h31mr4859427edc.43.1509631838073; Thu, 02 Nov 2017 07:10:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509631838; cv=none; d=google.com; s=arc-20160816; b=hPw6sS6g2uuHBVxMRBiz8zwdxleDN/Qm80bC2SIEIqJsG9VHkooUvYGTB6VKxX0Hym Fuxg3Ph6CXa5hm67InQcZ6rnHY8EhMVWgrHnWLfiKEGpA2Uk33rrmqVcUKq4+7ba287P BjZ4B0xMK+8THjP+6YsNWVCNZppz5PtTXlzzbWsFdo8xme6ccOC7q4Ic0GHy8txROBwP M0mrre6pNKNDB+QjwpoIjnWxKThOqDahGG3bkfF28HHkfqZMsmjfAy4Iazx6CDvCxmwz 908hIrkm+jBhpqEup1XTFOPU5cT4rswSKjZhoZyYG1p4OBKqaiNk3BnUYf1qhLK1ggO3 xutg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=3O7vyID7uE7A1emFuRMqltb32s1kJ8GOL8BTWBkQ9LI=; b=uACaX+v7FchHfCut1mTLOWZnfVB7R99RnuJuJ5CxKH7DE5PonN8kJKH4bEcN9w8m+Y ZTksIfXKx1ekWDFY2lkBzx/+/Jnakwtb6LLm1aVqldDcDFTAUSH+QZzoqpQqQ2gfuuLe ZRd/P1QAA0M0KTqAnO7NWRNG9h3bP1rzr6xebMMfdNJJpsnFaXoC4TVkvqEFEz0oCwYV ZTcXfrXaUwbsqdmFSgPPv/tad5toZQVNCt0tpOiKT4FdNEC9/P3TwXCCDjTZKlQvi8L5 H59idbjlWWDdDeS3O+V8dAC15asQI/Q6eknrbf52IZaDNfmgR9pBeqkHKXKSqfBujn/k O2sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=NptBfKo5; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id 5si701145edo.503.2017.11.02.07.10.37; Thu, 02 Nov 2017 07:10:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=NptBfKo5; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 4A492C21D7B; Thu, 2 Nov 2017 14:10:34 +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_H2, 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 DFAE4C21C29; Thu, 2 Nov 2017 14:10:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3C043C21C29; Thu, 2 Nov 2017 14:10:31 +0000 (UTC) Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by lists.denx.de (Postfix) with ESMTPS id C679DC21C26 for ; Thu, 2 Nov 2017 14:10:30 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id w105so5145240wrc.0 for ; Thu, 02 Nov 2017 07:10:30 -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; bh=W6uK1//7AAzo3YrB8+vLxtAobFhQKON4eAewXk1EICc=; b=NptBfKo5BsjmMcSg3K8ckXgn4pT4TTAPUJyEYpwW5zy4j3muuMJVHdMWz100WT3Za0 kg8z4mBsKtqST12sZCORPLOZWbRKZ9UnH06UeEoK6FsVEPkVgx0zYeMfQgpCKnGiczkD FgdRw6l/pRxca6UCErfAnwKxpl4es3ffBF4Eg= 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; bh=W6uK1//7AAzo3YrB8+vLxtAobFhQKON4eAewXk1EICc=; b=KtcTFzb16FPxdmq28b/cXhgtWs/PfSiacQoVKnQhxEhpxI5XPda2NZ0qrlcruURiDk 2LlPPPknM7ozCJ4rRZExde10EmcDyMnRd7Tl7gBTkuYOd+iClOh42tfAOyaepi/Ge2FQ Ii8WI0Pl0l+ZQSMgvd2dXKpcJ5a347zlwrC8gHWaOLZkct42cimJlHNLFkidms751eeE jVVsKwym9asdLjugNycwF2GXYMn2t4xyXlBjjRW6kCQgpn/CSJnSwlz4c/tfgdeGznUw 2/tRxLycUvHXAhZhDTovZaFlJJ5APA09DRXHm4zLzDY8rhdkBEtvzSpaSDB2XHMeZg7I 8x5A== X-Gm-Message-State: AMCzsaXXp7YQkALc4RXUcxhhK1gcOPYR7Biwf5pVvQdgnDjmYUyuFM+7 OukT+7KXlMVY6rvYP+zkXNuf4w== X-Received: by 10.223.186.140 with SMTP id p12mr2942851wrg.235.1509631830202; Thu, 02 Nov 2017 07:10:30 -0700 (PDT) Received: from localhost.localdomain ([90.69.89.191]) by smtp.gmail.com with ESMTPSA id o24sm3213164wmi.39.2017.11.02.07.10.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Nov 2017 07:10:29 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, u-boot@lists.denx.de, trini@konsulko.com Date: Thu, 2 Nov 2017 15:10:21 +0100 Message-Id: <1509631821-18232-1-git-send-email-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.7.4 Cc: nicolas.dechesne@linaro.org Subject: [U-Boot] [PATCH] mmc: sdhci: don't clear SDHCI_INT_STATUS register during CMD_INHIBIT 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Fixes emmc initialization regression on the db410c platform. Clearing this register while SDHCI_PRESENT_STATE reports SDHCI_CMD_INHIBIT leads to undefined behaviour on the db410c. When commit 7dde50 was merged (mmc: sdhci: Wait for SDHCI_INT_DATA_END when transferring), SDHCI transfers transitioned to wait for bit SDHCI_INT_DATA_END before flagging transfers done. Without this patch, the db410 platform fails to initialize its eMMC due to all of its transfers timing out (SDHCI_INT_DATA_END is never raised after all the blocks have been transferred). Signed-off-by: Jorge Ramirez-Ortiz --- drivers/mmc/sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 11d1f0c..f0c5aad 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -157,7 +157,6 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd, /* Timeout unit - ms */ static unsigned int cmd_timeout = SDHCI_CMD_DEFAULT_TIMEOUT; - sdhci_writel(host, SDHCI_INT_ALL_MASK, SDHCI_INT_STATUS); mask = SDHCI_CMD_INHIBIT | SDHCI_DATA_INHIBIT; /* We shouldn't wait for data inihibit for stop commands, even @@ -181,6 +180,8 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd, udelay(1000); } + sdhci_writel(host, SDHCI_INT_ALL_MASK, SDHCI_INT_STATUS); + mask = SDHCI_INT_RESPONSE; if (!(cmd->resp_type & MMC_RSP_PRESENT)) flags = SDHCI_CMD_RESP_NONE;