Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2720445imj; Mon, 11 Feb 2019 07:29:23 -0800 (PST) X-Google-Smtp-Source: AHgI3IZw/slM+InJ5XRWTZWi80sjUIaN8rlCddHMMubdeDkWhGyAfynO9FXyblNOQQUPFxuHEHzw X-Received: by 2002:a17:902:6b46:: with SMTP id g6mr37985396plt.21.1549898963662; Mon, 11 Feb 2019 07:29:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549898963; cv=none; d=google.com; s=arc-20160816; b=TnwPQ1zDRMZOnqzPRaEmCwTFtzAo4EE2zmpfDyd0Mo79mUuxrY0lb4uduPk/ChtE3L n1PC0kbEun57RIXXsHPrq0nM2F1zICUAPvaV/OJ7j1hAor1CrSnKGZE8MZB3Vis4S7+N aU8l0HVC7vDSuNozZWXrOTF7tUnKYN28PxHhUI6BPLYYSo/vr3cEOEtWcI6AfSOo2muF O/Ct2bxek0+2AyI+iKBkg1860DD7bZ+FsZu/QHU6VoFjzUYH1x6KTE2oGVeHG84uky5a 3l4WorBaFq4kyI3Rimjw9M014cfweEev51H6TKGunPd+pHJhPVqZuHAjs03deJkJD8r/ ftoA== 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=zdHBiif4tD/r+Mn49OFw1CnKMjEmn0Fjk0msqOyhg0I=; b=YX5PfiBF++AqDhXp8dOCqWTSSS8tH3BWoEBBm3f144JhZNa237DSdJ5sPvbNLPNCAv H2HviciF/5g4TOBDvM4NZWROrkeg5VeSFgVXuGFZ0+NTxOiU0QL1xoo0+Z/Vx/Qrrxye D8X/D/J5r2uzNlHkcE0IYmiUy5lbTisF8Tp9+IM5nikP1ZnH+8lsDs1tYhvtLsP4UXw+ lgho+XpVX5DOfTc/xuokwBmWFnba6zNUJ72YVSSZ6pfcmDmOI2xIkcVm914ywunGVQDx WnutP+8fhGCqZTbrdaE7O6aMzjvg+/k8ZC2t9qHOsvzKjVxuAzQi+ryO4/wGeVggXX2V C13w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tNr9v114; 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 i9si10831733plb.35.2019.02.11.07.29.07; Mon, 11 Feb 2019 07:29:23 -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=tNr9v114; 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 S2389607AbfBKO6i (ORCPT + 99 others); Mon, 11 Feb 2019 09:58:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:46264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389177AbfBKO6f (ORCPT ); Mon, 11 Feb 2019 09:58:35 -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 D3A0A222A6; Mon, 11 Feb 2019 14:58:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897114; bh=sZLeKUCcedlJ0/GEdaCochuP6vAU4P2Vc+7V2HW6H2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tNr9v1147J7Ea1s+QWn8slNN9RXH3OftD3myw8iwqiIB6atWMQgE+Knm8H+JW44gL XD1B6372AQEjxxxRf0vzPVk/O9ShEGDVD98QLF4cDBDkJiQCyC9dcj/JLUV8f66Ex+ p82iUg1PRrdD7Xi5zzppOuotoR+5SzF9tMDzYvGY= 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.14 096/205] mmc: bcm2835: reset host on timeout Date: Mon, 11 Feb 2019 15:18:14 +0100 Message-Id: <20190211141834.901138160@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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