Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1638664imm; Sat, 13 Oct 2018 00:22:18 -0700 (PDT) X-Google-Smtp-Source: ACcGV60n6VHJYfutiJAaR/2s1rmEsyIQGd32R9R+OXDyPYeMXpI3673Cd7LMiqffx+0aRyxnDuKT X-Received: by 2002:a63:306:: with SMTP id 6-v6mr8426252pgd.393.1539415338063; Sat, 13 Oct 2018 00:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539415338; cv=none; d=google.com; s=arc-20160816; b=SiPxtc9JH3b8r6f8Tdo26jfWSYOZ6kCUhhHXEq/rDovmg44oNNPCkIyxsQZHisfj8T n+5uh62cZ5SMghKqC4g3MoFpApVSGOgKrwO3Cv+4V6UzqmSuEFyBwsJOmNHPGXmZR82W 0l1pAb5UUDA58EV2YQcEl0H6z4qCLEEMnsWpMe7Q+iw0x90m/5ZTXDv9XfG1xW8MFse1 cnGEPYib52qyyixDEihk5a3ByldnNekbBBxk6uiNC/v+x/a+0NPdyjdhF9yViQqfCOd7 fjI6gQiDIpe1KLc2xvuuiLB/MgUTQ9kLXCAWNGkv5oBUFrLKT09CIchofAgfFBHx1Bx5 kNLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=UM0RThllJMuKjj2Okpn7QIIo9dXjdvYwMMi0JiVQi6c=; b=feA4tUl49wtbc8s5MQOBbViOiMT4whP614owL7ccdaBcq060xLQZPCcnlYdJ7lEQyv mxIp0Li88HT2RXbGMytyOrsKo+lLjuMFP9s4joASVS9Jk9Eo6bWgFGUyQy3yLlYgKhVx ap9qIK29VzgRLnyJWCQLAd1RiVjAlxn6/SREEcAcQG7BamJC2RoG4mvCjAuBBgsijzMf k+8Qh06ciPNa2A07+xoeDGYRneejazsgAoFcnqozPgeHb7uJ17N82tNk3LnmY402mgUZ j5ygqNm+8JiAuo8Mx+0fNl5yvzKMCHyv3OQ2oDVvONZ12pon+8CWc2i046mg28gzJGZ8 mbkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f25-v6si3697946pgb.170.2018.10.13.00.22.03; Sat, 13 Oct 2018 00:22:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726647AbeJMO5W (ORCPT + 99 others); Sat, 13 Oct 2018 10:57:22 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:56666 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726072AbeJMO5V (ORCPT ); Sat, 13 Oct 2018 10:57:21 -0400 X-UUID: b515c41c13de4219bdd931aa7223df76-20181013 X-UUID: b515c41c13de4219bdd931aa7223df76-20181013 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1341376412; Sat, 13 Oct 2018 15:21:14 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs03n1.mediatek.inc (172.21.101.181) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sat, 13 Oct 2018 15:21:13 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Sat, 13 Oct 2018 15:21:12 +0800 From: Chaotian Jing To: Ulf Hansson CC: Rob Herring , Mark Rutland , Matthias Brugger , Chaotian Jing , Ryder Lee , Wolfram Sang , Sean Wang , , , , , , , , Subject: [PATCH 3/6] mmc: mediatek: fix cannot receive new request when msdc_cmd_is_ready fail Date: Sat, 13 Oct 2018 15:20:47 +0800 Message-ID: <1539415250-32337-4-git-send-email-chaotian.jing@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1539415250-32337-1-git-send-email-chaotian.jing@mediatek.com> References: <1539415250-32337-1-git-send-email-chaotian.jing@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org when msdc_cmd_is_ready return fail, the req_timeout work has not been inited and cancel_delayed_work() will return false, then, the request return directly and never call mmc_request_done(). so need call mod_delayed_work() before msdc_cmd_is_ready() Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index ef45f1d..fe80a1d 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -1059,6 +1059,7 @@ static void msdc_start_command(struct msdc_host *host, WARN_ON(host->cmd); host->cmd = cmd; + mod_delayed_work(system_wq, &host->req_timeout, DAT_TIMEOUT); if (!msdc_cmd_is_ready(host, mrq, cmd)) return; @@ -1070,7 +1071,6 @@ static void msdc_start_command(struct msdc_host *host, cmd->error = 0; rawcmd = msdc_cmd_prepare_raw_cmd(host, mrq, cmd); - mod_delayed_work(system_wq, &host->req_timeout, DAT_TIMEOUT); sdr_set_bits(host->base + MSDC_INTEN, cmd_ints_mask); writel(cmd->arg, host->base + SDC_ARG); -- 1.8.1.1.dirty