Skip to contentSkip to conversation

mmc: dw_mmc: release hardware lock error

PATCH Dongjin Kim 2 participants 5 messages Feb 28, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello,

I encountered the problem that my hardware is frozen while switching clock from 400kHz to others. This is caused that hardware locked error was triggered when CMD register was written and interrupt was pended. Tested IP version is 2.10a

Cheers,
Dongjin.

drivers/mmc/host/dw_mmc.c +0 -0
index 2f7f5ee..05ccee8 100644
@@ -520,15 +520,33 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 

cmd, u32 arg)
struct dw_mci *host = slot->host;
unsigned long timeout = jiffies + msecs_to_jiffies(500); unsigned int cmd_status = 0;
+ u32 ctrl;

+resend:
mci_writel(host, CMDARG, arg);
wmb();
mci_writel(host, CMD, SDMMC_CMD_START | cmd);
+
while (time_before(jiffies, timeout)) {
cmd_status = mci_readl(host, CMD);
if (!(cmd_status & SDMMC_CMD_START))
return;
+
+ if (host->cmd_status & SDMMC_INT_HLE) {
+ dev_err(&slot->mmc->class_dev,
+ "Hardware locked error (cmd %#x arg %#x)\n",
+ cmd, arg);
+
+ ctrl = mci_readl(host, CTRL);
+ ctrl |= SDMMC_CTRL_RESET;
+ mci_writel(host, CTRL, ctrl);
+
+ host->cmd_status &= ~SDMMC_INT_HLE;
+
+ goto resend;
+ }
}
+
dev_err(&slot->mmc->class_dev,
"Timeout sending command (cmd %#x arg %#x status %#x)\n", cmd, arg, cmd_status);
@@ -1429,6 +1447,12 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
if (!pending)
break;

+ if (pending & SDMMC_INT_HLE) {
+ mci_writel(host, RINTSTS, SDMMC_INT_HLE);
+ host->cmd_status = status;
+ smp_wmb();
+ }
+
if (pending & DW_MCI_CMD_ERROR_FLAGS) {
mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS); host->cmd_status = status;

maintainer
#1 lore raw
Quoted 6 lines · Dongjin Kim

Hello,

I encountered the problem that my hardware is frozen while switching clock from 400kHz to others. This is caused that hardware locked error was triggered when CMD register was written and interrupt was pended. Tested IP version is 2.10a

Hi Dongjin.

It seems like this problem. Can you check this patch?
http://www.spinics.net/lists/linux-mmc/msg09895.html

Best Regards,
Jaehoon Chung

Quoted 62 lines

Cheers,
Dongjin.

drivers/mmc/host/dw_mmc.c +18 -0
index 2f7f5ee..05ccee8 100644
@@ -520,15 +520,33 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 
 cmd, u32 arg)
 	struct dw_mci *host = slot->host;
 	unsigned long timeout = jiffies + msecs_to_jiffies(500);
 	unsigned int cmd_status = 0;
+	u32 ctrl;
 
+resend:
 	mci_writel(host, CMDARG, arg);
 	wmb();
 	mci_writel(host, CMD, SDMMC_CMD_START | cmd);
+
 	while (time_before(jiffies, timeout)) {
 		cmd_status = mci_readl(host, CMD);
 		if (!(cmd_status & SDMMC_CMD_START))
 			return;
+
+		if (host->cmd_status & SDMMC_INT_HLE) {
+			dev_err(&slot->mmc->class_dev,
+				"Hardware locked error (cmd %#x arg %#x)\n",
+				cmd, arg);
+
+			ctrl = mci_readl(host, CTRL);
+			ctrl |= SDMMC_CTRL_RESET;
+			mci_writel(host, CTRL, ctrl);
+
+			host->cmd_status &= ~SDMMC_INT_HLE;
+
+			goto resend;
+		}
 	}
+
 	dev_err(&slot->mmc->class_dev,
 		"Timeout sending command (cmd %#x arg %#x status %#x)\n",
drivers/mmc/host/dw_mmc.c +6 -0
 		cmd, arg, cmd_status);
@@ -1429,6 +1447,12 @@ static irqreturn_t dw_mci_interrupt(int irq, void 
 *dev_id)
 		if (!pending)
 			break;
 
+		if (pending & SDMMC_INT_HLE) {
+			mci_writel(host, RINTSTS, SDMMC_INT_HLE);
+			host->cmd_status = status;
+			smp_wmb();
+		}
+
 		if (pending & DW_MCI_CMD_ERROR_FLAGS) {
 			mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS);

host->cmd_status = status;

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 6 lines · Jaehoon Chung <jh80.chung <at> samsung.com> writes:
Quoted 3 lines · Dongjin Kim

Hello,

I encountered the problem that my hardware is frozen while switching clock

from

Quoted 1 line
Quoted 1 line

400kHz to others. This is caused that hardware locked error was triggered

when

Quoted 1 line
Quoted 1 line

CMD register was written and interrupt was pended. Tested IP version is

2.10a

Quoted 10 lines
Quoted 1 line

Hi Dongjin.

It seems like this problem. Can you check this patch?
http://www.spinics.net/lists/linux-mmc/msg09895.html

Best Regards,
Jaehoon Chung

Hi Jaehoon,

Thank you for your feedback.
I had tested the patch from the link but the result is same on my hardware.

This is the log message what I had before, the hardware hanged after this log when mmc card is inserted.

[   62.450000] end_request: I/O error, dev mmcblk0, sector 7585
[   62.460000] mmcblk0: error -123 sending read/write command, response 0x0, 
card status 0x0
[   62.470000] end_request: I/O error, dev mmcblk0, sector 7586
[   62.470000] mmcblk0: error -123 sending read/write command, response 0x0, 
card status 0x0
[   62.480000] end_request: I/O error, dev mmcblk0, sector 7587
[   62.490000] mmcblk0: error -123 sending read/write command, response 0x0, 
card status 0x0
[   62.490000] end_request: I/O error, dev mmcblk0, sector 7588
[   62.500000] mmcblk0: error -123 sending read/write command, response 0x0, 
card status 0x0
[   62.510000] end_request: I/O error, dev mmcblk0, sector 7589
[   62.510000] Buffer I/O error on device mmcblk0p1, logical block 940
[   63.770000] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 
400000Hz, actual 403225HZ div = 62)
[   64.270000] mmc_host mmc1: Timeout sending command (cmd 0x202000 arg 0x0 

status 0x80202000)

In normal case, the log message have to go through as below and usually it is, except on certain case.

[   80.620000] mmcblk0: error -123 sending read/write command, response 0x0, 
card status 0x0
[   80.620000] mmcblk0: error -123 requesting status
[   80.620000] end_request: I/O error, dev mmcblk0, sector 7614
[   82.930000] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 
400000Hz, actual 403225HZ div = 62)
[   83.730000] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 
50000000Hz, actual 25000000HZ div = 1)
[   83.750000] mmc1: new high speed SD card at address 0007
[   83.760000] mmcblk0: mmc1:0007 SD02G 1.84 GiB 
[   83.780000]  mmcblk0: p1

Below is the log message with my change to reset the bit, Hardware Locked Error. This error is not happening always, I was testing the driver removing mmc card without unmount.

[  118.310000] end_request: I/O error, dev mmcblk1, sector 1108
[  118.310000] mmcblk1: error -123 sending read/write command, response 0x0, 
card status 0x0
[  118.310000] end_request: I/O error, dev mmcblk1, sector 1109
[  124.190000] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 
400000Hz, actual 403225HZ div = 62)
[  124.690000] mmc_host mmc1: Timeout sending command (cmd 0x202000 arg 0x0 
status 0x80202000)
[  124.690000] mmc_host mmc1: Hardware locked error (cmd 0x202000 arg 0x0)
[  125.550000] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 
50000000Hz, actual 25000000HZ div = 1)
[  125.560000] mmc1: new high speed SD card at address 0007
[  125.560000] mmcblk0: mmc1:0007 SD02G 1.84 GiB 
[  125.570000]  mmcblk0: p1

Cheers,
Dongjin.

Quoted 69 lines
Quoted 57 lines

Cheers,
Dongjin.

drivers/mmc/host/dw_mmc.c +18 -0
index 2f7f5ee..05ccee8 100644
@@ -520,15 +520,33 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 
 cmd, u32 arg)
 	struct dw_mci *host = slot->host;
 	unsigned long timeout = jiffies + msecs_to_jiffies(500);
 	unsigned int cmd_status = 0;
+	u32 ctrl;
 
+resend:
 	mci_writel(host, CMDARG, arg);
 	wmb();
 	mci_writel(host, CMD, SDMMC_CMD_START | cmd);
+
 	while (time_before(jiffies, timeout)) {
 		cmd_status = mci_readl(host, CMD);
 		if (!(cmd_status & SDMMC_CMD_START))
 			return;
+
+		if (host->cmd_status & SDMMC_INT_HLE) {
+			dev_err(&slot->mmc->class_dev,
+				"Hardware locked error (cmd %#x arg %#x)\n",
+				cmd, arg);
+
+			ctrl = mci_readl(host, CTRL);
+			ctrl |= SDMMC_CTRL_RESET;
+			mci_writel(host, CTRL, ctrl);
+
+			host->cmd_status &= ~SDMMC_INT_HLE;
+
+			goto resend;
+		}
 	}
+
 	dev_err(&slot->mmc->class_dev,
 		"Timeout sending command (cmd %#x arg %#x status %#x)\n",
drivers/mmc/host/dw_mmc.c +6 -0
 		cmd, arg, cmd_status);
@@ -1429,6 +1447,12 @@ static irqreturn_t dw_mci_interrupt(int irq, void 
 *dev_id)
 		if (!pending)
 			break;
 
+		if (pending & SDMMC_INT_HLE) {
+			mci_writel(host, RINTSTS, SDMMC_INT_HLE);
+			host->cmd_status = status;
+			smp_wmb();
+		}
+
 		if (pending & DW_MCI_CMD_ERROR_FLAGS) {
 			mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS);

host->cmd_status = status;

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo <at> vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo <at> vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#3 lore raw

Hi Dongjin.

This patch is corrupt due to line-wrapping.

Best Regards,
Jaehoon Chung

Quoted 165 lines · Dongjin Kim
Quoted 6 lines · Jaehoon Chung <jh80.chung <at> samsung.com> writes:
Quoted 3 lines · Dongjin Kim

Hello,

I encountered the problem that my hardware is frozen while switching clock

from

Quoted 1 line
Quoted 1 line

400kHz to others. This is caused that hardware locked error was triggered

when

Quoted 1 line
Quoted 1 line

CMD register was written and interrupt was pended. Tested IP version is

2.10a

Quoted 10 lines
Quoted 1 line

Hi Dongjin.

It seems like this problem. Can you check this patch?
http://www.spinics.net/lists/linux-mmc/msg09895.html

Best Regards,
Jaehoon Chung

Hi Jaehoon,

Thank you for your feedback.
I had tested the patch from the link but the result is same on my hardware.

This is the log message what I had before, the hardware hanged after this log when mmc card is inserted.

[   62.450000] end_request: I/O error, dev mmcblk0, sector 7585
[   62.460000] mmcblk0: error -123 sending read/write command, response 0x0, 
card status 0x0
[   62.470000] end_request: I/O error, dev mmcblk0, sector 7586
[   62.470000] mmcblk0: error -123 sending read/write command, response 0x0, 
card status 0x0
[   62.480000] end_request: I/O error, dev mmcblk0, sector 7587
[   62.490000] mmcblk0: error -123 sending read/write command, response 0x0, 
card status 0x0
[   62.490000] end_request: I/O error, dev mmcblk0, sector 7588
[   62.500000] mmcblk0: error -123 sending read/write command, response 0x0, 
card status 0x0
[   62.510000] end_request: I/O error, dev mmcblk0, sector 7589
[   62.510000] Buffer I/O error on device mmcblk0p1, logical block 940
[   63.770000] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 
400000Hz, actual 403225HZ div = 62)
[   64.270000] mmc_host mmc1: Timeout sending command (cmd 0x202000 arg 0x0 

status 0x80202000)

In normal case, the log message have to go through as below and usually it is, except on certain case.

[   80.620000] mmcblk0: error -123 sending read/write command, response 0x0, 
card status 0x0
[   80.620000] mmcblk0: error -123 requesting status
[   80.620000] end_request: I/O error, dev mmcblk0, sector 7614
[   82.930000] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 
400000Hz, actual 403225HZ div = 62)
[   83.730000] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 
50000000Hz, actual 25000000HZ div = 1)
[   83.750000] mmc1: new high speed SD card at address 0007
[   83.760000] mmcblk0: mmc1:0007 SD02G 1.84 GiB 
[   83.780000]  mmcblk0: p1

Below is the log message with my change to reset the bit, Hardware Locked Error. This error is not happening always, I was testing the driver removing mmc card without unmount.

[  118.310000] end_request: I/O error, dev mmcblk1, sector 1108
[  118.310000] mmcblk1: error -123 sending read/write command, response 0x0, 
card status 0x0
[  118.310000] end_request: I/O error, dev mmcblk1, sector 1109
[  124.190000] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 
400000Hz, actual 403225HZ div = 62)
[  124.690000] mmc_host mmc1: Timeout sending command (cmd 0x202000 arg 0x0 
status 0x80202000)
[  124.690000] mmc_host mmc1: Hardware locked error (cmd 0x202000 arg 0x0)
[  125.550000] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 
50000000Hz, actual 25000000HZ div = 1)
[  125.560000] mmc1: new high speed SD card at address 0007
[  125.560000] mmcblk0: mmc1:0007 SD02G 1.84 GiB 
[  125.570000]  mmcblk0: p1

Cheers,
Dongjin.

Quoted 57 lines
Quoted 57 lines

Cheers,
Dongjin.

drivers/mmc/host/dw_mmc.c +18 -0
index 2f7f5ee..05ccee8 100644
@@ -520,15 +520,33 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 
 cmd, u32 arg)
 	struct dw_mci *host = slot->host;
 	unsigned long timeout = jiffies + msecs_to_jiffies(500);
 	unsigned int cmd_status = 0;
+	u32 ctrl;
 
+resend:
 	mci_writel(host, CMDARG, arg);
 	wmb();
 	mci_writel(host, CMD, SDMMC_CMD_START | cmd);
+
 	while (time_before(jiffies, timeout)) {
 		cmd_status = mci_readl(host, CMD);
 		if (!(cmd_status & SDMMC_CMD_START))
 			return;
+
+		if (host->cmd_status & SDMMC_INT_HLE) {
+			dev_err(&slot->mmc->class_dev,
+				"Hardware locked error (cmd %#x arg %#x)\n",
+				cmd, arg);
+
+			ctrl = mci_readl(host, CTRL);
+			ctrl |= SDMMC_CTRL_RESET;
+			mci_writel(host, CTRL, ctrl);
+
+			host->cmd_status &= ~SDMMC_INT_HLE;
+
+			goto resend;
+		}
 	}
+
 	dev_err(&slot->mmc->class_dev,
 		"Timeout sending command (cmd %#x arg %#x status %#x)\n",
drivers/mmc/host/dw_mmc.c +6 -0
 		cmd, arg, cmd_status);
@@ -1429,6 +1447,12 @@ static irqreturn_t dw_mci_interrupt(int irq, void 
 *dev_id)
 		if (!pending)
 			break;
 
+		if (pending & SDMMC_INT_HLE) {
+			mci_writel(host, RINTSTS, SDMMC_INT_HLE);
+			host->cmd_status = status;
+			smp_wmb();
+		}
+
 		if (pending & DW_MCI_CMD_ERROR_FLAGS) {
 			mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS);

host->cmd_status = status;

Quoted 12 lines
Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo <at> vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo <at> vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

Hi Jaehoon,

Sorry for the inconvenience, here is the patch line-wrapping fixed.

-------------------->8-------------------->8--------------------

drivers/mmc/host/dw_mmc.c +24 -0
index 2f7f5ee..05ccee8 100644
@@ -520,15 +520,33 @@ static void mci_send_cmd(struct dw_mci_slot *slot,
 	struct dw_mci *host = slot->host;
 	unsigned long timeout = jiffies + msecs_to_jiffies(500);
 	unsigned int cmd_status = 0;
+	u32 ctrl;
 
+resend:
 	mci_writel(host, CMDARG, arg);
 	wmb();
 	mci_writel(host, CMD, SDMMC_CMD_START | cmd);
+
 	while (time_before(jiffies, timeout)) {
 		cmd_status = mci_readl(host, CMD);
 		if (!(cmd_status & SDMMC_CMD_START))
 			return;
+
+		if (host->cmd_status & SDMMC_INT_HLE) {
+			dev_err(&slot->mmc->class_dev,
+			"Hardware locked error (cmd %#x arg %#x)\n",
+			cmd, arg);
+
+			ctrl = mci_readl(host, CTRL);
+			ctrl |= SDMMC_CTRL_RESET;
+			mci_writel(host, CTRL, ctrl);
+
+			host->cmd_status &= ~SDMMC_INT_HLE;
+
+			goto resend;
+		}
 	}
+
 	dev_err(&slot->mmc->class_dev,
 		"Timeout sending command (cmd %#x arg %#x status %#x)\n",
 		cmd, arg, cmd_status);
@@ -1429,6 +1447,12 @@ static irqreturn_t dw_mci_interrupt(int irq, void
 		if (!pending)
 			break;
 
+		if (pending & SDMMC_INT_HLE) {
+			mci_writel(host, RINTSTS, SDMMC_INT_HLE);
+			host->cmd_status = status;
+			smp_wmb();
+		}
+
 		if (pending & DW_MCI_CMD_ERROR_FLAGS) {
 			mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS);
 			host->cmd_status = status;

-------------------->8-------------------->8--------------------

Quoted 112 lines · Jaehoon Chung

Hi Dongjin.

This patch is corrupt due to line-wrapping.

Best Regards,
Jaehoon Chung

Quoted 103 lines · Dongjin Kim
Quoted 6 lines · Jaehoon Chung <jh80.chung <at> samsung.com> writes:
Quoted 4 lines · Dongjin Kim

Hello,

I encountered the problem that my hardware is frozen while switching clock

from

Quoted 2 lines
Quoted 2 lines

400kHz to others. This is caused that hardware locked error was triggered

when

Quoted 2 lines
Quoted 2 lines

CMD register was written and interrupt was pended. Tested IP version is

2.10a

Quoted 10 lines
Quoted 2 lines

Hi Dongjin.

It seems like this problem. Can you check this patch?
http://www.spinics.net/lists/linux-mmc/msg09895.html

Best Regards,
Jaehoon Chung

Hi Jaehoon,

Thank you for your feedback.
I had tested the patch from the link but the result is same on my hardware.

This is the log message what I had before, the hardware hanged after this log when mmc card is inserted.

[   62.450000] end_request: I/O error, dev mmcblk0, sector 7585 [  
62.460000] mmcblk0: error -123 sending read/write command, response
0x0, card status 0x0
[   62.470000] end_request: I/O error, dev mmcblk0, sector 7586 [  
62.470000] mmcblk0: error -123 sending read/write command, response
0x0, card status 0x0
[   62.480000] end_request: I/O error, dev mmcblk0, sector 7587 [  
62.490000] mmcblk0: error -123 sending read/write command, response
0x0, card status 0x0
[   62.490000] end_request: I/O error, dev mmcblk0, sector 7588 [  
62.500000] mmcblk0: error -123 sending read/write command, response
0x0, card status 0x0
[   62.510000] end_request: I/O error, dev mmcblk0, sector 7589 [  
62.510000] Buffer I/O error on device mmcblk0p1, logical block 940 [  
63.770000] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req
400000Hz, actual 403225HZ div = 62)
[   64.270000] mmc_host mmc1: Timeout sending command (cmd 0x202000 arg

0x0 status 0x80202000)

In normal case, the log message have to go through as below and usually it is, except on certain case.

[   80.620000] mmcblk0: error -123 sending read/write command, response
0x0, card status 0x0
[   80.620000] mmcblk0: error -123 requesting status [   80.620000]
end_request: I/O error, dev mmcblk0, sector 7614 [   82.930000]
mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 400000Hz,
actual 403225HZ div = 62)
[   83.730000] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req

50000000Hz, actual 25000000HZ div = 1) [ 83.750000] mmc1: new high
speed SD card at address 0007 [ 83.760000] mmcblk0: mmc1:0007 SD02G
1.84 GiB [ 83.780000] mmcblk0: p1

Below is the log message with my change to reset the bit, Hardware Locked Error. This error is not happening always, I was testing the driver removing mmc card without unmount.

[  118.310000] end_request: I/O error, dev mmcblk1, sector 1108 [ 
118.310000] mmcblk1: error -123 sending read/write command, response
0x0, card status 0x0
[  118.310000] end_request: I/O error, dev mmcblk1, sector 1109 [ 
124.190000] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req
400000Hz, actual 403225HZ div = 62)
[  124.690000] mmc_host mmc1: Timeout sending command (cmd 0x202000 arg
0x0 status 0x80202000)
[  124.690000] mmc_host mmc1: Hardware locked error (cmd 0x202000 arg

0x0) [ 125.550000] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 25000000HZ div = 1) [ 125.560000] mmc1:
new high speed SD card at address 0007 [ 125.560000] mmcblk0:
mmc1:0007 SD02G 1.84 GiB [ 125.570000] mmcblk0: p1

Cheers,
Dongjin.

Quoted 14 lines
Quoted 14 lines

Cheers,
Dongjin.

drivers/mmc/host/dw_mmc.c +1 -0
index 2f7f5ee..05ccee8 100644
@@ -520,15 +520,33 @@ static void mci_send_cmd(struct dw_mci_slot
 *slot, u32 cmd, u32 arg)
 	struct dw_mci *host = slot->host;
 	unsigned long timeout = jiffies + msecs_to_jiffies(500); unsigned
 	int cmd_status = 0;
+	u32 ctrl;
 
Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/mmc/host/dw_mmc.c +2 -0
+resend:
 	mci_writel(host, CMDARG, arg);
 	wmb();
 	mci_writel(host, CMD, SDMMC_CMD_START | cmd);
+
Quoted 8 lines
Quoted 8 lines

drivers/mmc/host/dw_mmc.c static void mci_send_cmd(struct dw_mci_slot · line 538

Quoted 8 lines
drivers/mmc/host/dw_mmc.c +3 -0
 	while (time_before(jiffies, timeout)) {
 		cmd_status = mci_readl(host, CMD);
 		if (!(cmd_status & SDMMC_CMD_START))
 			return;
+
+		if (host->cmd_status & SDMMC_INT_HLE) { +		
 dev_err(&slot->mmc->class_dev,
+				"Hardware locked error (cmd %#x arg %#x)

\n", + cmd, arg);

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
drivers/mmc/host/dw_mmc.c +4 -0
+
+			ctrl = mci_readl(host, CTRL);
+			ctrl |= SDMMC_CTRL_RESET;
+			mci_writel(host, CTRL, ctrl);
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

drivers/mmc/host/dw_mmc.c static void mci_send_cmd(struct dw_mci_slot

Quoted 8 lines
drivers/mmc/host/dw_mmc.c +5 -0
+
+			host->cmd_status &= ~SDMMC_INT_HLE; +
+			goto resend;
+		}
 	}
+
 	dev_err(&slot->mmc->class_dev,
 		"Timeout sending command (cmd %#x arg %#x status %#x)\n", 

cmd,

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

drivers/mmc/host/dw_mmc.c static irqreturn_t dw_mci_interrupt(int irq, · line 1452

Quoted 8 lines
drivers/mmc/host/dw_mmc.c +2 -0
 		arg, cmd_status);
@@ -1429,6 +1447,12 @@ static irqreturn_t dw_mci_interrupt(int irq,
 void *dev_id)
 		if (!pending)
 			break;
 
+		if (pending & SDMMC_INT_HLE) {
+			mci_writel(host, RINTSTS, SDMMC_INT_HLE); 

+ host->cmd_status =

Quoted 29 lines
Quoted 29 lines
Quoted 8 lines
Quoted 8 lines
drivers/mmc/host/dw_mmc.c +3 -0
 status;
+			smp_wmb();
+		}
+
 		if (pending & DW_MCI_CMD_ERROR_FLAGS) {
 			mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS);
 			host->cmd_status = status;
Quoted 13 lines
Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo <at> vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo <at> vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html