Received: by 10.223.185.116 with SMTP id b49csp763229wrg; Wed, 14 Feb 2018 06:40:53 -0800 (PST) X-Google-Smtp-Source: AH8x227zrhOPJVzGEwt/RdSDA8uWZ2/VIOSgucDMUzneGoTTYGTFg+SPZimSwLVqw6s9d9FN8ynJ X-Received: by 10.99.181.94 with SMTP id u30mr4135237pgo.205.1518619252893; Wed, 14 Feb 2018 06:40:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518619252; cv=none; d=google.com; s=arc-20160816; b=F4ayOzcOctAMn0KlWx5C/OJ3T8xvexX+nRj94+v5TWufdo9KRhi+fhxZgfJP6/crE7 vzRUisUww8N1/1Oni52vmcT0n6/JZpU1r0U2SIN9BovPnApadztpocGeahFe07XX0jJc z8ywCt2pPMmSLHQ5KopvApJuI8itVJAmoA8Yc9DgRfkBUPjjwbbip6YaFsuoCTDSeWPJ nHVbjJctFzNLOfh0dyNPS9FxUlFyV0s3cmRZCF9Il6AmlpWhDftushjHgnZCCe/eBw0h u1Ij6t76ozGVlG90XwqmcDh6LvuYWXOkjF8m0tO3kp8aY4LOLIM/elltmOTaYpQ520EY zp0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from :arc-authentication-results; bh=YqtopfoEnqsL6ooO3n0c9Cy3LLzmljRTMqdtJknTchc=; b=qnaaSyL4FYWPKTHg5OES05WcINuUmqOGhZR+hhmlBVAQ2GbrSuEpVdO7tHvhto+KXZ cfLuk6fbXTq33oS83+Vm7hxGc9SbB88xfyfX8Nexc7MwX3WOCnFkob882Rcx0ocRgvTM kSan1TThDPBXuKuxn7xoMC/UStWy39wdQL/VF7Ot9cvPyqhGXaeK9QL5mkJiLOP+uL7S u0zGqPqHChYNuvf6KOpwosEj1SGq9EUl9zrR5QbIkFq35Xc4LFwe2xFQu35/7pirWQQX 0I16fztk7QEcmWt7dtGD80CSnBdTDol2MGkCjMgJU79Y6S+JVK6xpGWKWcccAcmJuXZ9 MneA== ARC-Authentication-Results: i=1; mx.google.com; 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 l91-v6si1416017plb.345.2018.02.14.06.40.37; Wed, 14 Feb 2018 06:40:52 -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; 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 S1030856AbeBNOjG (ORCPT + 99 others); Wed, 14 Feb 2018 09:39:06 -0500 Received: from mx2.suse.de ([195.135.220.15]:34490 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030381AbeBNOjF (ORCPT ); Wed, 14 Feb 2018 09:39:05 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DE6D2AAAD; Wed, 14 Feb 2018 14:39:00 +0000 (UTC) From: Michal Suchanek To: Ulf Hansson , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Eric Anholt , Stefan Wahren , Michal Suchanek , Gerd Hoffmann , "Gustavo A. R. Silva" , Julia Lawall , linux-mmc@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] mmc: bcm2835: reset host on timeout Date: Wed, 14 Feb 2018 15:38:57 +0100 Message-Id: <97593d6e1a41af1baff61f7d9e6e68a450fc9da6.1518619058.git.msuchanek@suse.de> X-Mailer: git-send-email 2.13.6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Michal Suchanek --- 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 229dc18f0581..ce05fe72f865 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); } @@ -837,6 +838,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.13.6