Thread (32 messages) 32 messages, 5 authors, 2011-02-17
STALE5597d
Revisions (25)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v1 [diff vs current]
  4. v1 [diff vs current]
  5. v1 [diff vs current]
  6. v1 [diff vs current]
  7. v1 [diff vs current]
  8. v1 [diff vs current]
  9. v1 [diff vs current]
  10. v1 [diff vs current]
  11. v1 [diff vs current]
  12. v2 [diff vs current]
  13. v2 [diff vs current]
  14. v2 [diff vs current]
  15. v2 [diff vs current]
  16. v2 [diff vs current]
  17. v2 [diff vs current]
  18. v2 [diff vs current]
  19. v2 [diff vs current]
  20. v2 [diff vs current]
  21. v2 [diff vs current]
  22. v2 [diff vs current]
  23. v2 [diff vs current]
  24. v2 current
  25. v2 [diff vs current]

[PATCH v2 1/7] mmc: mxs-mmc: add mmc host driver for i.MX23/28

From: Shawn Guo <hidden>
Date: 2011-02-15 22:03:12
Also in: linux-mmc

On Mon, Feb 14, 2011 at 04:59:59PM +0000, Russell King - ARM Linux wrote:
On Mon, Feb 14, 2011 at 10:32:20AM +0800, Shawn Guo wrote:
quoted
+	switch (mmc_resp_type(cmd)) {
+	case MMC_RSP_NONE:
+		break;
+	case MMC_RSP_R1:
+	case MMC_RSP_R1B:
+	case MMC_RSP_R3:
+		cmd->resp[0] = readl(host->base + HW_SSP_SDRESP0);
+		break;
+	case MMC_RSP_R2:
+		cmd->resp[3] = readl(host->base + HW_SSP_SDRESP0);
+		cmd->resp[2] = readl(host->base + HW_SSP_SDRESP1);
+		cmd->resp[1] = readl(host->base + HW_SSP_SDRESP2);
+		cmd->resp[0] = readl(host->base + HW_SSP_SDRESP3);
You really should be testing for MMC_RSP_PRESENT and MMC_RSP_136
here.  The response types are made up of a bitfield which allows
you to detect what's required rather than having to decode the
response type itself.
Please review the update.

        if (mmc_resp_type(cmd) & MMC_RSP_PRESENT) {
                if (mmc_resp_type(cmd) & MMC_RSP_136) {
                        cmd->resp[3] = readl(host->base + HW_SSP_SDRESP0);
                        cmd->resp[2] = readl(host->base + HW_SSP_SDRESP1);
                        cmd->resp[1] = readl(host->base + HW_SSP_SDRESP2);
                        cmd->resp[0] = readl(host->base + HW_SSP_SDRESP3);
                } else {
                        cmd->resp[0] = readl(host->base + HW_SSP_SDRESP0);
                }
        }
quoted
+		else if (stat & BM_SSP_CTRL1_FIFO_UNDERRUN_IRQ)
+			data->error = -ENODATA;
+		else if (stat & BM_SSP_CTRL1_FIFO_OVERRUN_IRQ)
+			data->error = -EOVERFLOW;
Both of these have a common error code - -EIO.
OK.  Thanks for teaching.

Regards,
Shawn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help