Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6020762ybc; Wed, 27 Nov 2019 13:32:08 -0800 (PST) X-Google-Smtp-Source: APXvYqyfaEooRjoGnL8H86KORc6w3r0hzjRrhT/k0yVUW2oliR7YkYOarCMOmwVfY2/JH9n8X+XB X-Received: by 2002:a50:f747:: with SMTP id j7mr34428389edn.247.1574890328137; Wed, 27 Nov 2019 13:32:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574890328; cv=none; d=google.com; s=arc-20160816; b=rqTrZ1q7LSHWUdu/ZWhcRqfryeGphMhdvTidfazzziksZC2pOnky0luagR+KiyJ3cx Wlaz+/g9bblcW7v4l0n5QYjY8nthMTNsW7YFHuWXd4+3db4Lks0+8opG+X/UyMyxvIhH ZHwSaxwq3LhgtEPdZ0o7SnEQJUZhetSkWqITBiZvr9aP964pmXVq8bSbBefBhzNt/kIN Xfz8iAKSYmDrLYEDAbMZzECXCPSo6wFBqCbzgAHWpYpj/XrAFE68/i8v7OeDaiVMe0gX vCFnHbcb0Cm6/qoxeQo28oco7EMDehkNH2xzYDogqNH/OdLSW0WQo61WEKC4bZtHHULE 7Iuw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sVi+ikc5JMhTNM4A0YpYnVOj5cZY2DeSjUIh/DVZyJg=; b=yfiQDcuG7XdaxMwktdJu8fT5TGkeICGzjmu12OpoqWUqR2lbGqqBcmwywLG+L90qa2 1hy6XvXmy3Eetljif/T5BbAXLaQYj9eKi6KOZ21dyyFxBFaiqK88RAi0OKGM3ODE5lR9 pQ6HoclgG4AqopeT31kxXY+IBx5im1JUjg51X/hr3AeJfRL0h1u6LDZVr/ybxJ4sXY9G jngf9yKKw2U86JlTkJvwtjBvBJfc0UsbwdLw8maCqSTMXG3BDQy1yHvvGHo/8RHQJGTl iAYhEaKav88WT+gzmtvOzMC6bXP5zQxq1t+w/1Bn9EJE0Qr0s/59iDfAafnyZy0hOfzy YDNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AQl3RcrF; 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 r8si306767edw.220.2019.11.27.13.31.44; Wed, 27 Nov 2019 13:32:08 -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=AQl3RcrF; 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 S1730700AbfK0V3k (ORCPT + 99 others); Wed, 27 Nov 2019 16:29:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:47798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731118AbfK0U4z (ORCPT ); Wed, 27 Nov 2019 15:56:55 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DED0F20862; Wed, 27 Nov 2019 20:56:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888214; bh=0dbdYLGTq2BVs9/jCLHYxBB0RMEi4AQzMdhJs3x8hd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AQl3RcrFVPq6isdsi8Q+3MQjyYePnX4u41LQX3oda3LoV93LJdXOK9xX66LWTeF6w vat05VNhW06EdKHrrB6NXBi6NoaTHs7JOcQibPRIH+kcLdo3FY5l4JqMd/tCPiAUiw 42lp9MX8qyTuFolIbePnmBQsfxeLegrWRabsYomo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chaotian Jing , Ulf Hansson , Sasha Levin Subject: [PATCH 4.19 046/306] mmc: mediatek: fix cannot receive new request when msdc_cmd_is_ready fail Date: Wed, 27 Nov 2019 21:28:16 +0100 Message-Id: <20191127203118.178576070@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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