All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Wahren <stefan.wahren@i2se.com>
To: Eric Anholt <eric@anholt.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
	Phil Elwell <phil@raspberrypi.org>,
	linux-mmc@vger.kernel.org, linux-rpi-kernel@lists.infradead.org,
	Michal Suchanek <msuchanek@suse.de>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 1/7] mmc: bcm2835: reset host on timeout
Date: Sun, 11 Nov 2018 21:23:53 +0100	[thread overview]
Message-ID: <1541967839-2847-2-git-send-email-stefan.wahren@i2se.com> (raw)
In-Reply-To: <1541967839-2847-1-git-send-email-stefan.wahren@i2se.com>

From: Michal Suchanek <msuchanek@suse.de>

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 <msuchanek@suse.de>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 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 768972a..f1712df 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.7.4

WARNING: multiple messages have this Message-ID (diff)
From: stefan.wahren@i2se.com (Stefan Wahren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 1/7] mmc: bcm2835: reset host on timeout
Date: Sun, 11 Nov 2018 21:23:53 +0100	[thread overview]
Message-ID: <1541967839-2847-2-git-send-email-stefan.wahren@i2se.com> (raw)
In-Reply-To: <1541967839-2847-1-git-send-email-stefan.wahren@i2se.com>

From: Michal Suchanek <msuchanek@suse.de>

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 <msuchanek@suse.de>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 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 768972a..f1712df 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.7.4

  reply	other threads:[~2018-11-11 20:23 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-11 20:23 [PATCH V2 0/7] mmc: Several fixes for bcm2835 driver Stefan Wahren
2018-11-11 20:23 ` Stefan Wahren
2018-11-11 20:23 ` Stefan Wahren [this message]
2018-11-11 20:23   ` [PATCH V2 1/7] mmc: bcm2835: reset host on timeout Stefan Wahren
2018-11-11 20:23 ` [PATCH V2 2/7] mmc: bcm2835: Recover from MMC_SEND_EXT_CSD Stefan Wahren
2018-11-11 20:23   ` Stefan Wahren
2018-11-11 20:23 ` [PATCH V2 4/7] mmc: bcm2835: Avoid possible races on data requests Stefan Wahren
2018-11-11 20:23   ` Stefan Wahren
     [not found] ` <1541967839-2847-1-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2018-11-11 20:23   ` [PATCH V2 3/7] mmc: bcm2835: Release DMA channel on driver unload Stefan Wahren
2018-11-11 20:23     ` Stefan Wahren
2018-11-11 20:23   ` [PATCH V2 5/7] mmc: bcm2835: Terminate timeout work synchronously Stefan Wahren
2018-11-11 20:23     ` Stefan Wahren
2018-12-05 14:23   ` [PATCH V2 0/7] mmc: Several fixes for bcm2835 driver Ulf Hansson
2018-12-05 14:23     ` Ulf Hansson
2018-11-11 20:23 ` [PATCH V2 6/7] mmc: bcm2835: Refactor dma_map_sg handling Stefan Wahren
2018-11-11 20:23   ` Stefan Wahren
2018-11-11 20:23 ` [PATCH V2 7/7] mmc: bcm2835: Properly handle dmaengine_prep_slave_sg Stefan Wahren
2018-11-11 20:23   ` Stefan Wahren
2018-11-28 17:27   ` Eric Anholt
2018-11-28 17:27     ` Eric Anholt
2018-12-04 18:20     ` Stefan Wahren
2018-12-04 18:20       ` Stefan Wahren
2019-03-21 20:03 ` [PATCH V2 0/7] mmc: Several fixes for bcm2835 driver Michal Suchánek
2019-03-21 20:03   ` Michal Suchánek
2019-03-22 14:45   ` Stefan Wahren
2019-03-22 16:06     ` Michal Suchánek
     [not found]       ` <20190322170643.2e56d220-yQW5Ri8AFK4NMLpHRKhSow@public.gmane.org>
2019-03-22 17:10         ` Stefan Wahren
2019-03-22 17:10           ` Stefan Wahren
2019-03-28 20:43           ` Michal Suchánek
2019-03-30 15:15             ` Stefan Wahren
     [not found]               ` <1920951985.237156.1553958914902-uEpKuDZ350hmhno068Nerg@public.gmane.org>
2019-04-02 18:58                 ` Michal Suchánek
2019-04-02 18:58                   ` Michal Suchánek
2019-04-08 14:55               ` Michal Suchánek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1541967839-2847-2-git-send-email-stefan.wahren@i2se.com \
    --to=stefan.wahren@i2se.com \
    --cc=eric@anholt.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=msuchanek@suse.de \
    --cc=phil@raspberrypi.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.