Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2747422ybh; Mon, 5 Aug 2019 06:13:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzstCOMQAQta0GqnwaBQD8VQ/1Zdej5zQVjOyV6Wj6QbvSFyOmtYOpTxvuyvhHvqbbZ0Otn X-Received: by 2002:a17:902:9897:: with SMTP id s23mr143185339plp.47.1565010831664; Mon, 05 Aug 2019 06:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565010831; cv=none; d=google.com; s=arc-20160816; b=m9zWuiECR8YB2q7kl0mEQbtygiQ28cYwh5AxSIOABSaY14o4ZmeDhEfd+VUebGtiwx YdNYqunqmrJUev7APH5Kef2XXQ5LqxJahUV+LKqcT3Jg/JUuFxqqKQdtUc8PkMtpzdNO +6wsWoJkfuiPLE+L01eHZhZ6UA3dRnKJ9x3fr5M7f9zD8lGiJLx7Q8/ThXB61JnmLiji 1fX1FLJ5tMudRgAACjKLNSasGJEoN3CVTzCLH6pkPuYW7PwhC2IOLr189mVXPI64FTFi MJcqZkM0KA8F25FQ47VUdVpEUhJelRxzW9HZy4C+2eHgEHe5PFCv+SHOIEPKU7Xbz/RP ptQA== 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=ghiOO9JKW9cfneOkDW42xwRxnH2pceX2wLgRM3TmM5A=; b=g8qF+S3U/AqYdolt60b/lV7bnHYfKjp683o03WBXzdNItUi+HG1jLdHWZt4TWbzjH/ MPSBP7sNwsPPh6TgE+97Roe4GcvxCmo26opTfdGcL70fLZBGUuvHL0tNL4Z+kFUlSIRz txvA3UMGZGQfQfa2XwSCVhVAI9ZUqNWqXv+Crlyhi9JA5xaD9BpW0vqcnKom4RznzAaN e62hO4wkAkpynXzQBJMAKZTIDFxJIo4dr9R7ypeOgviID3lhaD2OOKg9BVEUlzUqDbaU UQRoRFzne2/mjFYBfNfzE/7+JA24DdUd24gOk0zy9s0I1rteYxYfHGWR/5LKZfVZ4zgK ZDRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="QP/0M5S4"; 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 p16si44591084pgh.410.2019.08.05.06.13.35; Mon, 05 Aug 2019 06:13:51 -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="QP/0M5S4"; 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 S1730375AbfHENKm (ORCPT + 99 others); Mon, 5 Aug 2019 09:10:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:49690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729255AbfHENKj (ORCPT ); Mon, 5 Aug 2019 09:10: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 000212173B; Mon, 5 Aug 2019 13:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565010639; bh=LfdDGE9zo2n/W7A62nkEXpDTR+YgBiGfYmzTUL8n6nU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QP/0M5S43vfeEA1ZgfwBNLumEoIYhqazZvjXBMTs9dUuW+BDJjHhPWZF5mgfawXF1 2e8MQiHYoXVgn8cVEgcwkpLVYo/3hwrMFqucdX9CnsKU4XbXzRoTv19Blhwwc+oib+ mFDpwmG2RTYJhkS4Z/dQpfiZhUZ1Eis/O0y0J4aA= 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.19 46/74] mmc: dw_mmc: Fix occasional hang after tuning on eMMC Date: Mon, 5 Aug 2019 15:02:59 +0200 Message-Id: <20190805124939.613665562@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190805124935.819068648@linuxfoundation.org> References: <20190805124935.819068648@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 @@ -2038,8 +2038,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; }