Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2759857ybh; Mon, 5 Aug 2019 06:24:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSVm07opCLlVfbHf27SSV+ewPMt/NOjG2inPGp24Kzqx3TC5Xa2fnw+WUQjN20je86Jjv0 X-Received: by 2002:aa7:8752:: with SMTP id g18mr70430320pfo.201.1565011492470; Mon, 05 Aug 2019 06:24:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565011492; cv=none; d=google.com; s=arc-20160816; b=Rbj3ePrYyymVSCsNvHBwM9S/KyniNGiUgpANjmD7cDtFQz9+69j4UH4KRD9FdnxSZ7 vp4bsJswmU19kn4b6OM/X23fH2niTot3uxgPC2kw35AduHgVIjGXBD9KMHuEkQLUkkd5 xBV0KfMS7dJfK4Wl4F8H+IJtBZQOEZkZvR4mTdi2gUlgxGJHZh02W+RcjTHtVztlQjMf 7yWFay6Gz0gF10eE+7TTvAcS3EfsDStJJJ8X2xYOsT39CnVPzN03qKrOT9J8xZfM24EH w5JaeUFu9d6+UFz8q215ScMUgGR26cv7eSyzDpsnvsPxn8oaDVDP2zYyw4QQwMXEXUiW jy7g== 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=WPyPoNqkLRg0r2an1tEgallZmsH5nbXOA/yw54/rFn4=; b=vd0h38j4zGRvanrP8BhYnig14E0SgWkW5hvwYGdPFZa1QAOgNKm1xVYcaLSOQmOhO4 frw0iOGP3UOB/cQCsGwffd+ZEQXMY5yNA6jQkdkqtP4a3v3y37vlMA/06VQqIfqsDBlN DxQ4ckB27gd3rK08ZcIIF3dljX4z1Xl54A6IYA3+2W8HqmIp7f6pGaioNR3bPY3w4Njz 8OeLfboNYqTHxxrMNx8A2sv2hvK/xeWK78TXLNgmA5KpHJ9MLIfhtL9eYzZK6wuu5vEe ZQV6iH3hmGHopuHaxb6f1TS2UVxzKYyPvzIq8+PoeKpwZyxm9IVqlzeihYnsG3PYPDOM jR5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Hw55ZIPW; 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 15si36856307pga.575.2019.08.05.06.24.37; Mon, 05 Aug 2019 06:24:52 -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=Hw55ZIPW; 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 S1730894AbfHENXx (ORCPT + 99 others); Mon, 5 Aug 2019 09:23:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:60514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730644AbfHENXp (ORCPT ); Mon, 5 Aug 2019 09:23:45 -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 EBF0920651; Mon, 5 Aug 2019 13:23:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565011424; bh=o39PdSMzrs077BpBulehE/YGCmet2UzHgKM/weZOLSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hw55ZIPWI1zDUWo6vZqlACN7MvTzXyTtkSSkcbxW3Kkg1ctxBSCPIzvJpnzEKqckK p5lb4fizKw/CQ4yFRlmySd2I/7pzEl9Z5E0o/gY2X4v8GbTejWSvdCwBvuVD+SJOJg w6nXxNwIRBHy6SWpO2Uojux89R3wBj6VjOEjM/Tg= 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 5.2 083/131] mmc: dw_mmc: Fix occasional hang after tuning on eMMC Date: Mon, 5 Aug 2019 15:02:50 +0200 Message-Id: <20190805124957.514638922@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805124951.453337465@linuxfoundation.org> References: <20190805124951.453337465@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 @@ -2034,8 +2034,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; }