Skip to contentSkip to conversation

mmc: dw_mmc: fixed compile error when disable CONFIG_MMC_DW_IDMAC

PATCH Jaehoon Chung 5 participants 6 messages Feb 16, 2012 – Feb 20, 2012

Subsystems (2)
lore
Share & tools
lore

Jaehoon Chung

author maintainer
#0 lore raw

When disable CONFIG_MMC_DW_IDMAC, can see the compiler error. Because in dw_mci_post_req(), called the dw_mci_get_dma_dir(). But that function is in #ifdef CONFIG_MMC_DW_IDMAC.

I think that function is generic function.
Not need the CONFIG_MMC_DW_IDMAC.

---
 drivers/mmc/host/dw_mmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/host/dw_mmc.c +1 -1
index f9457e5..692c3ba 100644
@@ -295,7 +295,6 @@ static void dw_mci_stop_dma(struct dw_mci *host)
 	}
 }
 
-#ifdef CONFIG_MMC_DW_IDMAC
 static int dw_mci_get_dma_dir(struct mmc_data *data)
 {
 	if (data->flags & MMC_DATA_WRITE)
@@ -304,6 +303,7 @@ static int dw_mci_get_dma_dir(struct mmc_data *data)
 		return DMA_FROM_DEVICE;
 }
 
+#ifdef CONFIG_MMC_DW_IDMAC
 static void dw_mci_dma_cleanup(struct dw_mci *host)
 {
 	struct mmc_data *data = host->data;
Acked-by
#1 lore raw

RE: dw_mmc: fixed compile error when disable CONFIG_MMC_DW_IDMAC

Quoted 9 lines · Jaehoon Chung

When disable CONFIG_MMC_DW_IDMAC, can see the compiler error. Because in dw_mci_post_req(), called the dw_mci_get_dma_dir(). But that function is in #ifdef CONFIG_MMC_DW_IDMAC.

I think that function is generic function.
Not need the CONFIG_MMC_DW_IDMAC.

I tested it. Looks ok to me.

#2 lore raw
In reply to Jaehoon Chung
Quoted 9 lines · Jaehoon Chung

When disable CONFIG_MMC_DW_IDMAC, can see the compiler error. Because in dw_mci_post_req(), called the dw_mci_get_dma_dir(). But that function is in #ifdef CONFIG_MMC_DW_IDMAC.

I think that function is generic function.
Not need the CONFIG_MMC_DW_IDMAC.

I've also tested and confirmed that this fixes a compiler error introduced in 3ec7699d3bb1b0ee7f6e8588974a209d47fc64b2 ("mmc: dw_mmc:
Add support for pre_req and post_req"), however that patch also seems to have regressed by disabled DMA when not using the internal DMAC.

Specifically dw_mci_pre_dma_transfer() returns -ENOSYS when not using internal DMAC, which makes dw_mci_submit_data_dma() now return early:

+ sg_len = dw_mci_pre_dma_transfer(host, data, 0);
+ if (sg_len < 0)
+ return sg_len;

I think that 3ec7699d3bb1b0ee7f6e8588974a209d47fc64b2 should be removed/reverted until it is fixed.

Regards
James

Quoted 28 lines
---
 drivers/mmc/host/dw_mmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/host/dw_mmc.c +1 -2
index f9457e5..692c3ba 100644
@@ -295,7 +295,6 @@ static void dw_mci_stop_dma(struct dw_mci *host)
 	}
 }
 
-#ifdef CONFIG_MMC_DW_IDMAC
 static int dw_mci_get_dma_dir(struct mmc_data *data)
 {
 	if (data->flags & MMC_DATA_WRITE)
@@ -304,6 +303,7 @@ static int dw_mci_get_dma_dir(struct mmc_data *data)
 		return DMA_FROM_DEVICE;
 }
 
+#ifdef CONFIG_MMC_DW_IDMAC
 static void dw_mci_dma_cleanup(struct dw_mci *host)
 {
 	struct mmc_data *data = host->data;
--

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

#3 lore raw
Quoted 23 lines · James Hogan
Quoted 9 lines · Jaehoon Chung

When disable CONFIG_MMC_DW_IDMAC, can see the compiler error. Because in dw_mci_post_req(), called the dw_mci_get_dma_dir(). But that function is in #ifdef CONFIG_MMC_DW_IDMAC.

I think that function is generic function.
Not need the CONFIG_MMC_DW_IDMAC.

I've also tested and confirmed that this fixes a compiler error introduced in 3ec7699d3bb1b0ee7f6e8588974a209d47fc64b2 ("mmc: dw_mmc:
Add support for pre_req and post_req"), however that patch also seems to have regressed by disabled DMA when not using the internal DMAC.

Specifically dw_mci_pre_dma_transfer() returns -ENOSYS when not using internal DMAC, which makes dw_mci_submit_data_dma() now return early:

(quoted diff) +3 -0
+       sg_len = dw_mci_pre_dma_transfer(host, data, 0);
+       if (sg_len < 0)
+               return sg_len;
Quoted 2 lines

I think that 3ec7699d3bb1b0ee7f6e8588974a209d47fc64b2 should be removed/reverted until it is fixed.

Thank you for investigation.
It could be fixed.

Best regards,
Seungwon Jeon.

Quoted 36 lines

Regards
James

Quoted 25 lines
---
 drivers/mmc/host/dw_mmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/host/dw_mmc.c +1 -2
index f9457e5..692c3ba 100644
@@ -295,7 +295,6 @@ static void dw_mci_stop_dma(struct dw_mci *host)
 	}
 }
 
-#ifdef CONFIG_MMC_DW_IDMAC
 static int dw_mci_get_dma_dir(struct mmc_data *data)
 {
 	if (data->flags & MMC_DATA_WRITE)
@@ -304,6 +303,7 @@ static int dw_mci_get_dma_dir(struct mmc_data *data)
 		return DMA_FROM_DEVICE;
 }
 
+#ifdef CONFIG_MMC_DW_IDMAC
 static void dw_mci_dma_cleanup(struct dw_mci *host)
 {
 	struct mmc_data *data = host->data;
--
Quoted 3 lines

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

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

Acked-by
#4 lore raw
In reply to Jaehoon Chung
Quoted 9 lines · Jaehoon Chung

When disable CONFIG_MMC_DW_IDMAC, can see the compiler error. Because in dw_mci_post_req(), called the dw_mci_get_dma_dir(). But that function is in #ifdef CONFIG_MMC_DW_IDMAC.

I think that function is generic function.
Not need the CONFIG_MMC_DW_IDMAC.

Quoted 24 lines
---
 drivers/mmc/host/dw_mmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mmc/host/dw_mmc.c +1 -1
index f9457e5..692c3ba 100644
@@ -295,7 +295,6 @@ static void dw_mci_stop_dma(struct dw_mci *host)
 	}
 }
 
-#ifdef CONFIG_MMC_DW_IDMAC
 static int dw_mci_get_dma_dir(struct mmc_data *data)
 {
 	if (data->flags & MMC_DATA_WRITE)
@@ -304,6 +303,7 @@ static int dw_mci_get_dma_dir(struct mmc_data *data)
 		return DMA_FROM_DEVICE;
 }
 
+#ifdef CONFIG_MMC_DW_IDMAC
 static void dw_mci_dma_cleanup(struct dw_mci *host)
 {
 	struct mmc_data *data = host->data;
#5 lore raw

Hi,

Quoted 5 lines · James Hogan
Quoted 4 lines · Jaehoon Chung

When disable CONFIG_MMC_DW_IDMAC, can see the compiler error. Because in dw_mci_post_req(), called the dw_mci_get_dma_dir(). But that function is in #ifdef CONFIG_MMC_DW_IDMAC.

Quoted 7 lines
Quoted 5 lines

I think that function is generic function.
Not need the CONFIG_MMC_DW_IDMAC.

Thanks, pushed to mmc-next for 3.3. (And I'll take the second patch to fix the no IDMAC regression too.)

- Chris.

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