Skip to contentSkip to conversation

mmc: dw_mmc: Fix disableing DMA in Non-IDMAC

PATCH In review Seungwon Jeon 4 participants 4 messages Feb 20, 2012 1 message not in the archive

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

PATCH 1/1 mmc: dw_mmc: Fix disableing DMA in Non-IDMAC

dw_mci_pre_dma_transfer() is valid only if internal DMA. In case of using other DMA it returns -ENOSYS. It prevents the DMA operations. This patch makes dw_mci_pre_dma_transfer() effective in all DMA case.

---
 drivers/mmc/host/dw_mmc.c |   25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)
drivers/mmc/host/dw_mmc.c +9 -16
index 692c3ba..bf3c9b4 100644
@@ -429,6 +429,15 @@ static int dw_mci_idmac_init(struct dw_mci *host)
 	return 0;
 }
 
+static struct dw_mci_dma_ops dw_mci_idmac_ops = {
+	.init = dw_mci_idmac_init,
+	.start = dw_mci_idmac_start_dma,
+	.stop = dw_mci_idmac_stop_dma,
+	.complete = dw_mci_idmac_complete_dma,
+	.cleanup = dw_mci_dma_cleanup,
+};
+#endif /* CONFIG_MMC_DW_IDMAC */
+
 static int dw_mci_pre_dma_transfer(struct dw_mci *host,
 				   struct mmc_data *data,
 				   bool next)
@@ -468,22 +477,6 @@ static int dw_mci_pre_dma_transfer(struct dw_mci *host,
 	return sg_len;
 }
 
-static struct dw_mci_dma_ops dw_mci_idmac_ops = {
-	.init = dw_mci_idmac_init,
-	.start = dw_mci_idmac_start_dma,
-	.stop = dw_mci_idmac_stop_dma,
-	.complete = dw_mci_idmac_complete_dma,
-	.cleanup = dw_mci_dma_cleanup,
-};
-#else
-static int dw_mci_pre_dma_transfer(struct dw_mci *host,
-				   struct mmc_data *data,
-				   bool next)
-{
-	return -ENOSYS;
-}
-#endif /* CONFIG_MMC_DW_IDMAC */
-
 static void dw_mci_pre_req(struct mmc_host *mmc,
 			   struct mmc_request *mrq,
 			   bool is_first_req)
Signature · 1 line
1.7.0.4
Reviewed-by on v1 1/1
#1 lore raw

2012/2/20 Seungwon Jeon <[email protected]>:

Quoted 6 lines

dw_mci_pre_dma_transfer() is valid only if internal DMA. In case of using other DMA it returns -ENOSYS. It prevents the DMA operations. This patch makes dw_mci_pre_dma_transfer() effective in all DMA case.

Hi. Seungwon.
This patch make sense.

Quoted 55 lines

---
 drivers/mmc/host/dw_mmc.c |   25 +++++++++----------------

 1 files changed, 9 insertions(+), 16 deletions(-)
drivers/mmc/host/dw_mmc.c +9 -17
index 692c3ba..bf3c9b4 100644
@@ -429,6 +429,15 @@ static int dw_mci_idmac_init(struct dw_mci *host)
        return 0;
  }
 
+static struct dw_mci_dma_ops dw_mci_idmac_ops = {
+       .init = dw_mci_idmac_init,
+       .start = dw_mci_idmac_start_dma,
+       .stop = dw_mci_idmac_stop_dma,
+       .complete = dw_mci_idmac_complete_dma,
+       .cleanup = dw_mci_dma_cleanup,
+};
+#endif /* CONFIG_MMC_DW_IDMAC */
+
  static int dw_mci_pre_dma_transfer(struct dw_mci *host,
                                   struct mmc_data *data,
                                   bool next)
@@ -468,22 +477,6 @@ static int dw_mci_pre_dma_transfer(struct dw_mci *host,
        return sg_len;
  }
 
-static struct dw_mci_dma_ops dw_mci_idmac_ops = {
-       .init = dw_mci_idmac_init,
-       .start = dw_mci_idmac_start_dma,
-       .stop = dw_mci_idmac_stop_dma,
-       .complete = dw_mci_idmac_complete_dma,
-       .cleanup = dw_mci_dma_cleanup,
-};
-#else
-static int dw_mci_pre_dma_transfer(struct dw_mci *host,
-                                  struct mmc_data *data,
-                                  bool next)
-{
-       return -ENOSYS;
-}
-#endif /* CONFIG_MMC_DW_IDMAC */
-
  static void dw_mci_pre_req(struct mmc_host *mmc,
                           struct mmc_request *mrq,
                           bool is_first_req)
--

1.7.0.4

--
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

A message that is not in the archive (sent off-list or not yet received): CAAG0J9-wRLj29=LztT4Ppi7q6Q=4dm29vHODk9KdVAGWKMJgUw@mail.gmail.com

#3 lore raw

Hi,

Quoted 6 lines · Seungwon Jeon

dw_mci_pre_dma_transfer() is valid only if internal DMA. In case of using other DMA it returns -ENOSYS. It prevents the DMA operations. This patch makes dw_mci_pre_dma_transfer() effective in all DMA case.

I've tested, and this seems to work for me (no IDMAC) as long as your other patch is applied first of course ("fixed compile error when disable CONFIG_MMC_DW_IDMAC").

Probably worth fixing the typo in the subject too (s/disableing/disabling/).

Otherwise, Acked-by: James Hogan <[email protected]>

Thanks
James

Quoted 47 lines
---
 drivers/mmc/host/dw_mmc.c |   25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)
drivers/mmc/host/dw_mmc.c +9 -16
index 692c3ba..bf3c9b4 100644
@@ -429,6 +429,15 @@ static int dw_mci_idmac_init(struct dw_mci *host)
 	return 0;
 }
 
+static struct dw_mci_dma_ops dw_mci_idmac_ops = {
+	.init = dw_mci_idmac_init,
+	.start = dw_mci_idmac_start_dma,
+	.stop = dw_mci_idmac_stop_dma,
+	.complete = dw_mci_idmac_complete_dma,
+	.cleanup = dw_mci_dma_cleanup,
+};
+#endif /* CONFIG_MMC_DW_IDMAC */
+
 static int dw_mci_pre_dma_transfer(struct dw_mci *host,
 				   struct mmc_data *data,
 				   bool next)
@@ -468,22 +477,6 @@ static int dw_mci_pre_dma_transfer(struct dw_mci *host,
 	return sg_len;
 }
 
-static struct dw_mci_dma_ops dw_mci_idmac_ops = {
-	.init = dw_mci_idmac_init,
-	.start = dw_mci_idmac_start_dma,
-	.stop = dw_mci_idmac_stop_dma,
-	.complete = dw_mci_idmac_complete_dma,
-	.cleanup = dw_mci_dma_cleanup,
-};
-#else
-static int dw_mci_pre_dma_transfer(struct dw_mci *host,
-				   struct mmc_data *data,
-				   bool next)
-{
-	return -ENOSYS;
-}
-#endif /* CONFIG_MMC_DW_IDMAC */
-
 static void dw_mci_pre_req(struct mmc_host *mmc,
 			   struct mmc_request *mrq,
 			   bool is_first_req)
#4 lore raw

Hi,

Quoted 10 lines · James Hogan

Hi,

Quoted 6 lines · Seungwon Jeon

dw_mci_pre_dma_transfer() is valid only if internal DMA. In case of using other DMA it returns -ENOSYS. It prevents the DMA operations. This patch makes dw_mci_pre_dma_transfer() effective in all DMA case.

Quoted 7 lines

I've tested, and this seems to work for me (no IDMAC) as long as your other patch is applied first of course ("fixed compile error when disable CONFIG_MMC_DW_IDMAC").

Probably worth fixing the typo in the subject too (s/disableing/disabling/).

Otherwise, Acked-by: James Hogan <[email protected]>

Thanks, pushed to mmc-next for 3.3 with the subject line fix, and with explicit mention of the regression and the patch that caused it.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child