Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2740476ybh; Mon, 5 Aug 2019 06:08:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVVIMAzsy5xZo4iMOtgCQT85816XFPdWAMyE1nQBpFh2eFfsaoUsS69JD9NevuA0t8MjCP X-Received: by 2002:a17:902:100a:: with SMTP id b10mr102527519pla.338.1565010504349; Mon, 05 Aug 2019 06:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565010504; cv=none; d=google.com; s=arc-20160816; b=VBKVhslxE4shX3EB3uYkr8DvqQLFTsfwHMp6fk/tfUmnRGya4g1zSBXTBhg8d6OuS3 siU3MhGotrpiAMn6SXIqtev94vzsVis64uodd/m69k3TW/jNgeYpN+SfRt9CYkAWK+ai 17hgw3nV4Vf0q4Dx3WWEiMXKRolGgL0Q01wZA+t1TWGrPPJCH3b8beZ/keA9m4qjL4GI VYeExNaAU7wJaadGfjwoBRa8aPo3Bwg5jG2emI6yZA3iv9ioBLgQ6zpQRDPV01diaH+X i+FXEZU3ajCl3Z4OBwOrylNaur0Yufj1zuisoePRsYeSQBnIw8NaQLAkRXw/EwHXWfFB Sc/A== 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=HGh3TaKBN8+ep1G8UXeYTmqQn9idQvQJabTnABECzcA=; b=YCQknvjqvQeUKOEvZU9AHCk32KtHtSViMKX1ybPHYYB4nDTHvMOm4EXEJDZSV8Lq8l I5lqA+36z+z3qa1K5QP/S9DxyciNtg1zdSIy2AHTXkWpRzYikWM+StstLEqwc4cRVO1n z+N2eYTN5soECztLRetF0Q+oFEfx5jBzUyAikYgQytU+w4vo1JIzs+mjjcgRKyQ8zPfX 1VJO0el4q2QRkirvkFK209Ei37YuXlw+VVzEp4t9A2Aojj5ghUyDhrk/8jIxleFzk+eb zTErJimiVL84JFuU35n6A1883bR8yiOtm5oWMe2oGBVztVZIElRE+156spawNl3SA9Gk Ur3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dJbaRMCB; 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 y13si10870619pgp.339.2019.08.05.06.08.09; Mon, 05 Aug 2019 06:08:24 -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; dkim=pass header.i=@kernel.org header.s=default header.b=dJbaRMCB; 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 S1729387AbfHENFp (ORCPT + 99 others); Mon, 5 Aug 2019 09:05:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:41762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729322AbfHENFj (ORCPT ); Mon, 5 Aug 2019 09:05:39 -0400 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 CA117214C6; Mon, 5 Aug 2019 13:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565010338; bh=Nmlb5wfC42tddgRjfyYBWRqNjGCK8Cczaz7880C1yDM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dJbaRMCB4VskP6eEgXVeCvepb37wgUQ1Hn7BEC7IobH4duiLBFc7TCDkpwTNrtAwJ w9ApHYBc751EuNmVL5p6FXMAT+fWrrXdK1Y2THlePxKa3xUVSTqldQVJ1C8A0yCDDN jxHBttmkcn4YthTqVXd+BmnyAAIcqcQuH7mHJbXA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Douglas Anderson , Marek Szyprowski , Alim Akhtar , Enric Balletbo i Serra , Ulf Hansson Subject: [PATCH 4.9 28/42] mmc: dw_mmc: Fix occasional hang after tuning on eMMC Date: Mon, 5 Aug 2019 15:02:54 +0200 Message-Id: <20190805124928.333036879@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805124924.788666484@linuxfoundation.org> References: <20190805124924.788666484@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: Douglas Anderson commit ba2d139b02ba684c6c101de42fed782d6cd2b997 upstream. In commit 46d179525a1f ("mmc: dw_mmc: Wait for data transfer after response errors.") we fixed a tuning-induced hang that I saw when stress testing tuning on certain SD cards. I won't re-hash that whole commit, but the summary is that as a normal part of tuning you need to deal with transfer errors and there were cases where these transfer errors was putting my system into a bad state causing all future transfers to fail. That commit fixed handling of the transfer errors for me. In downstream Chrome OS my fix landed and had the same behavior for all SD/MMC commands. However, it looks like when the commit landed upstream we limited it to only SD tuning commands. Presumably this was to try to get around problems that Alim Akhtar reported on exynos [1]. Unfortunately while stress testing reboots (and suspend/resume) on some rk3288-based Chromebooks I found the same problem on the eMMC on some of my Chromebooks (the ones with Hynix eMMC). Since the eMMC tuning command is different (MMC_SEND_TUNING_BLOCK_HS200 vs. MMC_SEND_TUNING_BLOCK) we were basically getting back into the same situation. I'm hoping that whatever problems exynos was having in the past are somehow magically fixed now and we can make the behavior the same for all commands. [1] https://lkml.kernel.org/r/CAGOxZ53WfNbaMe0_AM0qBqU47kAfgmPBVZC8K8Y-_J3mDMqW4A@mail.gmail.com Fixes: 46d179525a1f ("mmc: dw_mmc: Wait for data transfer after response errors.") Signed-off-by: Douglas Anderson Cc: Marek Szyprowski Cc: Alim Akhtar Cc: Enric Balletbo i Serra Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/dw_mmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1864,8 +1864,7 @@ static void dw_mci_tasklet_func(unsigned * delayed. Allowing the transfer to take place * avoids races and keeps things simple. */ - if ((err != -ETIMEDOUT) && - (cmd->opcode == MMC_SEND_TUNING_BLOCK)) { + if (err != -ETIMEDOUT) { state = STATE_SENDING_DATA; continue; }