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: 10002753 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 6E5EE60216 for ; Thu, 12 Oct 2017 20:12:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5EF6A28E98 for ; Thu, 12 Oct 2017 20:12:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5326928EA0; Thu, 12 Oct 2017 20:12:06 +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.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DEA1328E98 for ; Thu, 12 Oct 2017 20:12:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=2kjat9yXh86/Y/3I2kPXDp1flXqa8ASWZVC1DmgnBFM=; b=glwYcatv3+V7Q7fEqes0jnOSi4 O61K0e15+no+pVhBPtqbwxPa0nmk1xElYQ/Q2vl0Mu3k5baKSX2IJKiLQQ76k69V5Z6+oguX+WPKs FbpAxszM9z/im43no6WKigPD65eiv2Aw0qZ/ns8tOa/VK3kdOxdUlfwOCjN1/pllnpUWKzsGpDL/e IPgfFfXIaA8iVhbGkcJgVdaAzo4e1GYx7Nd9jso6LTD0yfFs5OFCsrp31KtdAyx9sfbY2We6Pl0wB acLJpTI1VWrF84Xc1rPkwrbL99SnoVLJaYVwRIuUlsJtvAKH6CJO/nCa/T7lqQg0REwpU8IL+9F05 6LQxQwVw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e2jpt-0002t0-Fc; Thu, 12 Oct 2017 20:12:05 +0000 Received: from mail-pf0-x235.google.com ([2607:f8b0:400e:c00::235]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e2jpp-0002ni-DZ for linux-rockchip@lists.infradead.org; Thu, 12 Oct 2017 20:12:03 +0000 Received: by mail-pf0-x235.google.com with SMTP id b79so6457804pfk.5 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=QabenV9LsAwwC9KE7bD4kuOQWbwv8qd/ykqWAdSjp6aWfqRKu8o6+ESOZebkLHGQPH xysWwFJ1zggM10CNI8g47/kjzmqSnI1iAzzHoj9d6BpPUNVwdSIM1BGbwMRfXyuxaQMM gIHWb2PgdwVMR8nKzwf4OquuLeM24d/p1a0yOPLUHwAe3JsbZ8dywcfRPY+CKYBtOlBO KSe/mjM6Zg03NOlzEZl4Qg1/mpYqGXuKq8OMU+oiro/qg1BgIJgCpH6IRx262l7p+is1 2J82pSDZVO+uFncFVqLixP9jZU0qEm5MXxXd/JLC8JXW1Nf+WqtRGOiknug98VrD0opN pPGA== X-Gm-Message-State: AMCzsaXQGuFs85XR28OEzaXTP1NFEs6rbMB4sX+VYnuBn8aZkt5RFrhp RJEYIB0Fa82eQ1M4hrqFK76qPw== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171012_131201_559606_7198F8F6 X-CRM114-Status: GOOD ( 11.32 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, kernel@esmil.dk, briannorris@chromium.org, xzy.xu@rock-chips.com, linux-mmc@vger.kernel.org, Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, amstan@chromium.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.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); }