linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix mmc hang during boot on socfpga
@ 2014-09-09 12:19 Pavel Machek
  2014-09-09 17:32 ` Olof Johansson
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2014-09-09 12:19 UTC (permalink / raw)
  To: tgih.jun, jh80.chung, chris, linux-mmc, linux-kernel; +Cc: marex


Without this patch, boot hangs when trying to mount root filesystem on
socfpga platform in about 50% cases.

Signed-off-by: Pavel Machek <pavel@denx.de>

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 8f216ed..739ba78 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -42,8 +42,8 @@
 
 /* Common flag combinations */
 #define DW_MCI_DATA_ERROR_FLAGS	(SDMMC_INT_DRTO | SDMMC_INT_DCRC | \
-				 SDMMC_INT_HTO | SDMMC_INT_SBE  | \
-				 SDMMC_INT_EBE)
+				 SDMMC_INT_HTO | SDMMC_INT_FRUN | \
+				 SDMMC_INT_SBE  | SDMMC_INT_EBE)
 #define DW_MCI_CMD_ERROR_FLAGS	(SDMMC_INT_RTO | SDMMC_INT_RCRC | \
 				 SDMMC_INT_RESP_ERR)
 #define DW_MCI_ERROR_FLAGS	(DW_MCI_DATA_ERROR_FLAGS | \
@@ -1302,7 +1302,8 @@ static void dw_mci_tasklet_func(unsigned long priv)
 			if (test_and_clear_bit(EVENT_DATA_ERROR,
 					       &host->pending_events)) {
 				dw_mci_stop_dma(host);
-				send_stop_abort(host, data);
+				if (data->stop)
+					send_stop_abort(host, data);
 				state = STATE_DATA_ERROR;
 				break;
 			}
@@ -1324,6 +1325,11 @@ static void dw_mci_tasklet_func(unsigned long priv)
 			set_bit(EVENT_DATA_COMPLETE, &host->completed_events);
 			err = dw_mci_data_complete(host, data);
 
+			if (!data->stop) {
+				dw_mci_request_end(host, host->mrq);
+				goto unlock;
+			}
+
 			if (!err) {
 				if (!data->stop || mrq->sbc) {
 					if (mrq->sbc && data->stop)
@@ -1872,6 +1878,9 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
 			queue_work(host->card_workqueue, &host->card_work);
 		}
 
+		if (pending & SDMMC_INT_HLE)
+			mci_writel(host, RINTSTS, SDMMC_INT_HLE);
+
 		/* Handle SDIO Interrupts */
 		for (i = 0; i < host->num_slots; i++) {
 			struct dw_mci_slot *slot = host->slot[i];
@@ -2361,8 +2370,7 @@ int dw_mci_probe(struct dw_mci *host)
 	}
 
 	if (host->pdata->num_slots > 1) {
-		dev_err(host->dev,
-			"Platform data must supply num_slots.\n");
+		dev_err(host->dev, "Platform data must supply num_slots.\n");
 		return -ENODEV;
 	}
 
@@ -2399,8 +2407,7 @@ int dw_mci_probe(struct dw_mci *host)
 	}
 
 	if (!host->bus_hz) {
-		dev_err(host->dev,
-			"Platform data must supply bus speed\n");
+		dev_err(host->dev, "Platform data must supply bus speed\n");
 		ret = -ENODEV;
 		goto err_clk_ciu;
 	}

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix mmc hang during boot on socfpga
  2014-09-09 12:19 [PATCH] fix mmc hang during boot on socfpga Pavel Machek
@ 2014-09-09 17:32 ` Olof Johansson
  2014-09-09 18:57   ` Marek Vasut
  2014-09-09 20:56   ` Pavel Machek
  0 siblings, 2 replies; 5+ messages in thread
From: Olof Johansson @ 2014-09-09 17:32 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Seungwon Jeon, Jaehoon Chung, Chris Ball, linux-mmc,
	linux-kernel, Marek Vašut

On Tue, Sep 9, 2014 at 5:19 AM, Pavel Machek <pavel@ucw.cz> wrote:
>
> Without this patch, boot hangs when trying to mount root filesystem on
> socfpga platform in about 50% cases.

I think this should have a better description than this -- this is too
vague. Did it use to always work, is this a new failure? You enable
some more error checking and improved stop handling, why was the
previous one inadequate on this platform?


-Olof

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix mmc hang during boot on socfpga
  2014-09-09 17:32 ` Olof Johansson
@ 2014-09-09 18:57   ` Marek Vasut
  2014-09-09 20:56   ` Pavel Machek
  1 sibling, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2014-09-09 18:57 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Pavel Machek, Seungwon Jeon, Jaehoon Chung, Chris Ball,
	linux-mmc, linux-kernel

On Tuesday, September 09, 2014 at 07:32:14 PM, Olof Johansson wrote:
> On Tue, Sep 9, 2014 at 5:19 AM, Pavel Machek <pavel@ucw.cz> wrote:
> > Without this patch, boot hangs when trying to mount root filesystem on
> > socfpga platform in about 50% cases.
> 
> I think this should have a better description than this -- this is too
> vague. Did it use to always work, is this a new failure? You enable
> some more error checking and improved stop handling, why was the
> previous one inadequate on this platform?

+1

nit: It would also be nice if this patch contained proper mmc: tag in the 
Subject line (which applies to all other socfpga patches across all MLs).

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix mmc hang during boot on socfpga
  2014-09-09 17:32 ` Olof Johansson
  2014-09-09 18:57   ` Marek Vasut
@ 2014-09-09 20:56   ` Pavel Machek
  2014-09-11  2:14     ` Jaehoon Chung
  1 sibling, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2014-09-09 20:56 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Seungwon Jeon, Jaehoon Chung, Chris Ball, linux-mmc,
	linux-kernel, Marek Vašut

On Tue 2014-09-09 10:32:14, Olof Johansson wrote:
> On Tue, Sep 9, 2014 at 5:19 AM, Pavel Machek <pavel@ucw.cz> wrote:
> >
> > Without this patch, boot hangs when trying to mount root filesystem on
> > socfpga platform in about 50% cases.
> 
> I think this should have a better description than this -- this is too
> vague. Did it use to always work, is this a new failure? You enable
> some more error checking and improved stop handling, why was the
> previous one inadequate on this platform?

I don't think it ever worked reliably. I don't know what is different
for socfpga, or if it is broken on other platforms, too. I have two
socfpga boards here, but no other dw_mmc board.

Patch was separated from rocketboards.org repository.

Hope this helps,

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix mmc hang during boot on socfpga
  2014-09-09 20:56   ` Pavel Machek
@ 2014-09-11  2:14     ` Jaehoon Chung
  0 siblings, 0 replies; 5+ messages in thread
From: Jaehoon Chung @ 2014-09-11  2:14 UTC (permalink / raw)
  To: Pavel Machek, Olof Johansson
  Cc: Seungwon Jeon, Chris Ball, linux-mmc, linux-kernel, Marek Vašut

Hi, Pavel.

On 09/10/2014 05:56 AM, Pavel Machek wrote:
> On Tue 2014-09-09 10:32:14, Olof Johansson wrote:
>> On Tue, Sep 9, 2014 at 5:19 AM, Pavel Machek <pavel@ucw.cz> wrote:
>>>
>>> Without this patch, boot hangs when trying to mount root filesystem on
>>> socfpga platform in about 50% cases.
>>
>> I think this should have a better description than this -- this is too
>> vague. Did it use to always work, is this a new failure? You enable
>> some more error checking and improved stop handling, why was the
>> previous one inadequate on this platform?
> 
> I don't think it ever worked reliably. I don't know what is different
> for socfpga, or if it is broken on other platforms, too. I have two
> socfpga boards here, but no other dw_mmc board.

I didn't know what error is occurred at your board. But i guess it looks like HLE error, right?
Or you can share how booting is failed. than i think we can discuss more detailedly about your problem.


Best Regards,
Jaehoon Chung

> 
> Patch was separated from rocketboards.org repository.
> 
> Hope this helps,
> 
> 									Pavel
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-11  2:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-09 12:19 [PATCH] fix mmc hang during boot on socfpga Pavel Machek
2014-09-09 17:32 ` Olof Johansson
2014-09-09 18:57   ` Marek Vasut
2014-09-09 20:56   ` Pavel Machek
2014-09-11  2:14     ` Jaehoon Chung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).