Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp731283ybc; Sat, 16 Nov 2019 07:43:30 -0800 (PST) X-Google-Smtp-Source: APXvYqx233U8M+gY3PdNaHNzhgHVb5KFHoHKdz4k7kVnL2vvdzst25R8KToqsl1seB6/yhqQ3MIF X-Received: by 2002:a17:906:4dd5:: with SMTP id f21mr10558181ejw.203.1573919010150; Sat, 16 Nov 2019 07:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573919010; cv=none; d=google.com; s=arc-20160816; b=jy9cEOruLttD7wq8KNOSSIbEAfLDw5p3yK+DJ5gW0DFJIB/hyp/hoXYfxqdrHPWPoV Xygw+7OkyVKvyu4C4DOX15dPjGAHeKS3lne728uG8njP5BRNNkNO3CgLbPwK5xULsniT dsxQltDhh2TCK7X9Eup+NWN5mEAEw+qsFy+BUdzIGFD8gNi/y5ElWjyz2U0UErItfiry /7wiAd15WvLOcieH4oI1iHoOMRnywOt0q/fYvjMyCMeAr82EkTeOXvQyb5UmWwcOes1d o7st0bm9eXAoLae5o4YAjG3pL8s3rWJ6FgR2dUFlWBXMWpwEnD7Hh7iJuTeFtZgTf2Pi XaJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sVi+ikc5JMhTNM4A0YpYnVOj5cZY2DeSjUIh/DVZyJg=; b=SyYiDUu2wTidFDXffdVOXOBfdv6S5enGwIw4lWYvV4/YwN9VgjSYXAFua6x3QpjF7C ANl6EiUVNGZsQ64HSrvwPCD0sfGVxe2p2HgEU4pIwj9pStzCRQWQ9E+OGMREKJLYjGbp EgctFo+MxyPIPIhAP7dA2DPV896ZnRvAAchbAA9pOoBo5bPuIckBfeVWDBWRHH8IA5dw HqXTjeK922chJRlsMHIjAj1bjXsnHLEoFo6w1gXODaqfuuJmkYJ/LuJ84LtZ+w0zU612 bAPtmO0O19QCu4EDqquWycJ3ZikWFy06ofaFf1sIsmASqw+JIFDybQUmUeAqKfvLX/s+ dELA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I4wSMHd7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d22si834240edr.370.2019.11.16.07.43.05; Sat, 16 Nov 2019 07:43:30 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=I4wSMHd7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727995AbfKPPlp (ORCPT + 99 others); Sat, 16 Nov 2019 10:41:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:44854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727953AbfKPPli (ORCPT ); Sat, 16 Nov 2019 10:41:38 -0500 Received: from sasha-vm.mshome.net (unknown [50.234.116.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DDDF42081E; Sat, 16 Nov 2019 15:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573918898; bh=0dbdYLGTq2BVs9/jCLHYxBB0RMEi4AQzMdhJs3x8hd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I4wSMHd7dNVqCjNotxgLaH6TGYqb3MuTDTud179jHbTw1/JAwyJ7UIP+9Lqlk1Zq0 dL1H64nxjcD0w7rpDSWLheq/0jZegrAqPJjDBYdsc96uEug5yLuNJ2+BEDfG7EH6oG G4zsMJmIOfdsLnpBKVSWQfKCX0wfmRzgjevQUDUA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chaotian Jing , Ulf Hansson , Sasha Levin , linux-mmc@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 025/237] mmc: mediatek: fix cannot receive new request when msdc_cmd_is_ready fail Date: Sat, 16 Nov 2019 10:37:40 -0500 Message-Id: <20191116154113.7417-25-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191116154113.7417-1-sashal@kernel.org> References: <20191116154113.7417-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chaotian Jing [ Upstream commit f38a9774ddde9d79b3487dd888edd8b8623552af ] 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 Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- 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 621c914dc5c01..673f6a9616cd9 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -1056,6 +1056,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; @@ -1067,7 +1068,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); -- 2.20.1