Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2652036imj; Mon, 11 Feb 2019 06:30:14 -0800 (PST) X-Google-Smtp-Source: AHgI3IZtR+ZwSLXLjRjbHaXmM4HE/dctuBXQUAgGFxTIeH9Xuv7GPAD9IQBo3PdZ/7LGEnCiIDUg X-Received: by 2002:aa7:8497:: with SMTP id u23mr5449749pfn.253.1549895414441; Mon, 11 Feb 2019 06:30:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895414; cv=none; d=google.com; s=arc-20160816; b=ip03UseXhxBwAqWHOEVBGbC7hFV2AhTIN0qab3/bLkkgLpZjBLruXxLXYSL+GUPx4v afZbbMXa5IVOaLdWrS0Fhq8V2Q7oLcGeYW2OlEzW6AW4dn9S45zTbdJeF441j2igT8DB Y3KhVVfHJuq3Z5+esbLpg3ZcV9IhfqrRWNr+wKp+cxRD3wu3vSjM3FYdVz4wra9rT9zO b35vkPQ3ek5FPf74Lyi+ssCwaWxsLfhJm198cJRGfRit6r1XWg0DUqnzy/YnrBU1d8v0 zKuBHrpP2iEgi9xyhjBVZWQ/11FTT8iCpMouAqtNrLW28VVl2ulDq5BeWtAHgMP85P4T UF2A== 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=BHIi9SxhNf/UIJQt1d5GVBZZl7/r5F5peC8V6AhOTJQ=; b=n50fgLmBM1MId4/VunKea+Ji0OonsJPDwxsc1fVlE2QgmRPofglBhdwSTEArV4knJ5 +Apmfm8Zj9+2K8tQAybIlpDly/S6SYKdn5BjedX5pi8bBUVDejxL3UDxHgR8MqvPnAna jEZ67QEvCWKMtzLBqgMkQmtNchVE+/6vuxuUITNkD+zv7tg5j7xlqh3ZC64F6uWzyMsg 3nEIpFfqpnscnJNgKY0Ea7RJpN0oIThccIcXOef1EUgv9Oka+9hjtzc24otsiRHnOapk kLQApgdT+7z/fiUfLgXxYiEBJIR8SZGxTIqABF0kHkdWNmWCo06DrLzN8AggTCdynqNe ITXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=r4MsGYaI; 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 130si6610895pfy.262.2019.02.11.06.29.58; Mon, 11 Feb 2019 06:30:14 -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=r4MsGYaI; 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 S1728242AbfBKO3G (ORCPT + 99 others); Mon, 11 Feb 2019 09:29:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:35048 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728058AbfBKO3C (ORCPT ); Mon, 11 Feb 2019 09:29:02 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 566E720838; Mon, 11 Feb 2019 14:29:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895341; bh=2ixxrOCCPc75tFGe8uFRQTiVFtRKtS0FNlv9rR9+Ue0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r4MsGYaImsSw6DCmQlrhsew3dT7RpuyVH2hInK92uZ6q2rlQuTBBEyDyhrjXdEnhh Pks3W85RahmNRxI+Pt+XIN2INWjaw5OS+U4zUEoF+ZhFLzHnTB8eqUKNsO56HpJhg6 ltkwT4BLjZBAgNhKDGllXLaXWdykUWWYXnurNR3A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michal Suchanek , Stefan Wahren , Eric Anholt , Ulf Hansson , Sasha Levin Subject: [PATCH 4.20 172/352] mmc: bcm2835: reset host on timeout Date: Mon, 11 Feb 2019 15:16:39 +0100 Message-Id: <20190211141858.031888480@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 abf1f3c8b0c3..5301302fb531 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