platform: msm_shared: Fix the response type for SSR & error handling

The sdcard status command has R1 response and R2 is for serial interface
only. Also look for controller errors interrupts along with command or
transfer complete. The controller sets errors if any immidiately after
the command issued fails, the current driver keeps looking for command
or data complete even though the error interrupt is set. To avoid busy
waiting even though error interrupt is set, look for both complete &
error interrupts together so the busy waiting in the driver can be
avoided.

CRs-Fixed: 714432
Change-Id: I149ed16bcff037d3ddae0f36c9e46ccc07a16d24
diff --git a/platform/msm_shared/sdhci.c b/platform/msm_shared/sdhci.c
index e9f4e0d..8f6a86e 100644
--- a/platform/msm_shared/sdhci.c
+++ b/platform/msm_shared/sdhci.c
@@ -438,10 +438,11 @@
 
 	do {
 		int_status = REG_READ16(host, SDHCI_NRML_INT_STS_REG);
-		int_status &= SDHCI_INT_STS_CMD_COMPLETE;
 
-		if (int_status == SDHCI_INT_STS_CMD_COMPLETE)
+		if (int_status  & SDHCI_INT_STS_CMD_COMPLETE)
 			break;
+		else if (int_status & SDHCI_ERR_INT_STAT_MASK && !host->tuning_in_progress)
+			goto err;
 
 		/*
 		 * If Tuning is in progress ignore cmd crc, cmd timeout & cmd end bit errors
@@ -497,13 +498,14 @@
 	if (cmd->data_present || cmd->resp_type == SDHCI_CMD_RESP_R1B) {
 		do {
 			int_status = REG_READ16(host, SDHCI_NRML_INT_STS_REG);
-			int_status &= SDHCI_INT_STS_TRANS_COMPLETE;
 
 			if (int_status & SDHCI_INT_STS_TRANS_COMPLETE)
 			{
 				trans_complete = 1;
 				break;
 			}
+			else if (int_status & SDHCI_ERR_INT_STAT_MASK && !host->tuning_in_progress)
+				goto err;
 
 			/*
 			 * If we are in tuning then we need to wait until Data timeout , Data end