Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3701506imu; Mon, 28 Jan 2019 09:16:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN5+jgVZkcm1YR1ICJl0+16MOtdLs3cY1q3hzjBBVwz8E/GtxWrvIB+fWfIljA56Gq0ETM0q X-Received: by 2002:a65:4049:: with SMTP id h9mr20215798pgp.304.1548695809546; Mon, 28 Jan 2019 09:16:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548695809; cv=none; d=google.com; s=arc-20160816; b=vuzMZHgueqDg0Wc0ow6MbEJ4SwuHhpA0pO+CggxkF0f4r7ytal9MI+n7x0kItRqtwg NfufhdCIoURT9mOMZe+sWwu8ieEqfQ+/nP2XgM11Rj8k9FNH5zTAA+P2OHupmyXRL4IY 8902QIOPGqzbYY9KwZY0CbZJFXTnPPVOe6Xixd2/y+x5/wOA2K6qTiC064058rXldYJK LkDwrN6Uvou/kQgrOO4rznAhN6zEU15R98MxKj358CkVmxzoXNt7RwL0PIdpS6bXvOWr z7dk5hgeaZSU3xylF8Hjy3J/9AorYGEsNU6AXX5lVNXSo/VpIiQlylseTXWk8+KkVZpp rHnw== 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=Nth20oWVZ/CL44ZN84x36u0rY2VLPDimzPNB9fBXFGE=; b=FW+rLDATlE9fWGvzICUe/qHE14jgw72ZHr7oChiUK/fU5CfU1Jiyl8SKh20LagginQ kkKQlVIu0Hidp3sV4GKwcBnViOYwhbrn/BfeoOTRgs4ULByaje4WdNju+5f9vT+Rnqio f9v7qlN5mRxKyrVH2WRHKKwQIxkSC9nQ7cH6Bndy4+dbEv/frLWRhoOW9kAjvESv4zR4 9GyCjwv6flqo92oFUAy5lVe8/8JSPIE0r7NuIKCS1B1UMyoQEnVJHw0rp/3SHECDrvsH y38+h1ql7Biu7P9AMB/I/U9ekGdisr6pWj37ihhhTpXBgV6N2p9T2U+yBGMd/c9ecLd3 rWGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sgJxbhXx; 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 d9si32515336plr.127.2019.01.28.09.16.33; Mon, 28 Jan 2019 09:16:49 -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=sgJxbhXx; 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 S1731571AbfA1QGd (ORCPT + 99 others); Mon, 28 Jan 2019 11:06:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:55558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727985AbfA1QGc (ORCPT ); Mon, 28 Jan 2019 11:06:32 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 45DB72147A; Mon, 28 Jan 2019 16:06:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691591; bh=P0oOs61tq//lvwzcpa3l3hK24HNWIhwRluwau96AKpc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sgJxbhXxw5lrjZppYwbkl82fAlpBlv0+FYVff19AAx14QlrXnxyE1W4tQMd4ogt0/ fntwN0lVeZl08u1vikysoQ2I0mkHxNEVlOTcDFvhNYdADa0hKpAlP7enslF+HABSXA 8SkLiLNO1ZwHBl9uKphuve5SoFNtu+fRCVj23DIA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Michal Suchanek , Stefan Wahren , Ulf Hansson , Sasha Levin , linux-mmc@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 152/258] mmc: bcm2835: reset host on timeout Date: Mon, 28 Jan 2019 10:57:38 -0500 Message-Id: <20190128155924.51521-152-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 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: Michal Suchanek [ Upstream commit f6000a4eb34e6462bc0dd39809c1bb99f9633269 ] The bcm2835 mmc host tends to lock up for unknown reason so reset it on timeout. The upper mmc block layer tries retransimitting with single blocks which tends to work out after a long wait. This is better than giving up and leaving the machine broken for no obvious reason. Fixes: 660fc733bd74 ("mmc: bcm2835: Add new driver for the sdhost controller.") Signed-off-by: Michal Suchanek Signed-off-by: Stefan Wahren Acked-by: Eric Anholt Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/bcm2835.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c index aef40e1739ee..a251be266ad7 100644 --- a/drivers/mmc/host/bcm2835.c +++ b/drivers/mmc/host/bcm2835.c @@ -286,6 +286,7 @@ static void bcm2835_reset(struct mmc_host *mmc) if (host->dma_chan) dmaengine_terminate_sync(host->dma_chan); + host->dma_chan = NULL; bcm2835_reset_internal(host); } @@ -846,6 +847,8 @@ static void bcm2835_timeout(struct work_struct *work) dev_err(dev, "timeout waiting for hardware interrupt.\n"); bcm2835_dumpregs(host); + bcm2835_reset(host->mmc); + if (host->data) { host->data->error = -ETIMEDOUT; bcm2835_finish_data(host); -- 2.19.1