From patchwork Thu Oct 12 20:11:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10002781 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 A934560216 for ; Thu, 12 Oct 2017 20:13:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C0E828E98 for ; Thu, 12 Oct 2017 20:13:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90D8428EA0; Thu, 12 Oct 2017 20:13:30 +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=-4.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID, URIBL_BLACK 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 44EDC28E98 for ; Thu, 12 Oct 2017 20:13:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754886AbdJLUN2 (ORCPT ); Thu, 12 Oct 2017 16:13:28 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:52992 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755408AbdJLULk (ORCPT ); Thu, 12 Oct 2017 16:11:40 -0400 Received: by mail-pf0-f174.google.com with SMTP id e64so6444937pfk.9 for ; Thu, 12 Oct 2017 13:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bKU0llHlHeaJxWUB79HyzVBK0xDuM/6geonsgpLPYeM=; b=neR9yWUJ8xuF8vWtILGHxyiqoiiGFuTd1KHqtS8XB9oI8+9yaYB8bqpva00aZDUP+9 bb7bcCSD6fBDL9vxTDO/xukc0Vjjg5gbWPBl7OW8Ld8XasHM1gurSLWKWU2tLBo8A+8k rD/+IRQ78kOxjKuVFRvoCwt6YilYw3cjjZeno= 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:in-reply-to :references; bh=bKU0llHlHeaJxWUB79HyzVBK0xDuM/6geonsgpLPYeM=; b=RYxyFeqes893CUdiASXmgt8hBbmi+HcCjsHdUG+4mY5KoWbhoJ/L/ylzHmKjE5zKkG TJKoQ/hRUfUdIOwYLdYYZfHSB1Bf217Gu/4aypNt9tkfpb1ezZzbnHDnrKsCREDGlT4U X4oAzJAZ85CvCzvbw2upnh+XH1TutaogIxlCkGTWTWkpTP8TYfhV3UdhHpc7tUkIHhEt Wy5CmhIEa9y28UD8U+JKQ40/777a09FVRzYjOS2UyJoA3t6cUN6Yxlf8H9a5DpM9cqR7 4bZe6ITUtD2qC8m/DSr1IfHy8QZ9RlJpT9ceB8yRJZRxW7kadc8LVCPYABABZFPTyPd5 5vPA== X-Gm-Message-State: AMCzsaUMoJDSikeUcDYdg6cB2reCOTHkpjeJlUapvPoPOUCnQKuDlmGS Ubv3iGHqC7ph64ekKr3KC7oKWw== X-Google-Smtp-Source: AOwi7QDpZBj8rIjDDzt+mISqYGBsY1uda9GmlHHJC1kMNrFftW953f8P+0Cb/welPc4kKSn4DLbINQ== X-Received: by 10.98.72.83 with SMTP id v80mr3232520pfa.54.1507839099761; Thu, 12 Oct 2017 13:11:39 -0700 (PDT) Received: from tictac.mtv.corp.google.com ([172.22.112.154]) by smtp.gmail.com with ESMTPSA id l3sm29749635pgn.36.2017.10.12.13.11.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Oct 2017 13:11:38 -0700 (PDT) From: Douglas Anderson To: jh80.chung@samsung.com, ulf.hansson@linaro.org, shawn.lin@rock-chips.com Cc: xzy.xu@rock-chips.com, amstan@chromium.org, linux-rockchip@lists.infradead.org, briannorris@chromium.org, linux-samsung-soc@vger.kernel.org, kernel@esmil.dk, Douglas Anderson , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] mmc: dw_mmc: cancel the CTO timer after a voltage switch Date: Thu, 12 Oct 2017 13:11:14 -0700 Message-Id: <20171012201118.23570-2-dianders@chromium.org> X-Mailer: git-send-email 2.15.0.rc0.271.g36b669edcc-goog In-Reply-To: <20171012201118.23570-1-dianders@chromium.org> References: <20171012201118.23570-1-dianders@chromium.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When running with the commit 03de19212ea3 ("mmc: dw_mmc: introduce timer for broken command transfer over scheme") I found this message in the log: Unexpected command timeout, state 7 It turns out that we weren't properly cancelling the new CTO timer in the case that a voltage switch was done. Let's promote the cancel into the dw_mci_cmd_interrupt() function to fix this. Fixes: 03de19212ea3 ("mmc: dw_mmc: introduce timer for broken command transfer over scheme") Tested-by: Emil Renner Berthing Reviewed-by: Shawn Lin Signed-off-by: Douglas Anderson --- Changes in v2: None drivers/mmc/host/dw_mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 860313bd952a..f5b2bb4b4d98 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2570,6 +2570,8 @@ static void dw_mci_write_data_pio(struct dw_mci *host) static void dw_mci_cmd_interrupt(struct dw_mci *host, u32 status) { + del_timer(&host->cto_timer); + if (!host->cmd_status) host->cmd_status = status; @@ -2662,7 +2664,6 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) } if (pending & SDMMC_INT_CMD_DONE) { - del_timer(&host->cto_timer); mci_writel(host, RINTSTS, SDMMC_INT_CMD_DONE); dw_mci_cmd_interrupt(host, pending); }