All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: dw_mmc: Fix switch from DMA to PIO
@ 2012-04-10  0:53 Seungwon Jeon
  2012-04-10  9:54 ` Will Newton
  0 siblings, 1 reply; 3+ messages in thread
From: Seungwon Jeon @ 2012-04-10  0:53 UTC (permalink / raw)
  To: linux-mmc
  Cc: 'Chris Ball', 'Will Newton', 'James Hogan'

When dw_mci_pre_dma_transfer returns failure in some reasons,
dw_mci_submit_data will prepare to switch the PIO mode from DMA.
After switching to PIO mode, DMA(IDMAC in particular) is still
enabled. This makes the corruption in handling interrupt and
the driver lock-up.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
---
 drivers/mmc/host/dw_mmc.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index bf3c9b4..f3b0fcd 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -526,8 +526,10 @@ static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data)
 		return -ENODEV;
 
 	sg_len = dw_mci_pre_dma_transfer(host, data, 0);
-	if (sg_len < 0)
+	if (sg_len < 0) {
+		host->dma_ops->stop(host);
 		return sg_len;
+	}
 
 	host->using_dma = 1;
 
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: dw_mmc: Fix switch from DMA to PIO
  2012-04-10  0:53 [PATCH] mmc: dw_mmc: Fix switch from DMA to PIO Seungwon Jeon
@ 2012-04-10  9:54 ` Will Newton
  2012-04-10 14:18   ` Chris Ball
  0 siblings, 1 reply; 3+ messages in thread
From: Will Newton @ 2012-04-10  9:54 UTC (permalink / raw)
  To: Seungwon Jeon; +Cc: linux-mmc, Chris Ball, James Hogan

On Tue, Apr 10, 2012 at 1:53 AM, Seungwon Jeon <tgih.jun@samsung.com> wrote:
> When dw_mci_pre_dma_transfer returns failure in some reasons,
> dw_mci_submit_data will prepare to switch the PIO mode from DMA.
> After switching to PIO mode, DMA(IDMAC in particular) is still
> enabled. This makes the corruption in handling interrupt and
> the driver lock-up.
>
> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>

This looks ok to me.

Acked-by: Will Newton <will.newton@imgtec.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: dw_mmc: Fix switch from DMA to PIO
  2012-04-10  9:54 ` Will Newton
@ 2012-04-10 14:18   ` Chris Ball
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Ball @ 2012-04-10 14:18 UTC (permalink / raw)
  To: Will Newton; +Cc: Seungwon Jeon, linux-mmc, James Hogan

Hi,

On Tue, Apr 10 2012, Will Newton wrote:
> On Tue, Apr 10, 2012 at 1:53 AM, Seungwon Jeon <tgih.jun@samsung.com> wrote:
>> When dw_mci_pre_dma_transfer returns failure in some reasons,
>> dw_mci_submit_data will prepare to switch the PIO mode from DMA.
>> After switching to PIO mode, DMA(IDMAC in particular) is still
>> enabled. This makes the corruption in handling interrupt and
>> the driver lock-up.
>>
>> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
>
> This looks ok to me.
>
> Acked-by: Will Newton <will.newton@imgtec.com>

Thanks, pushed to mmc-next for 3.4.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-10 14:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-10  0:53 [PATCH] mmc: dw_mmc: Fix switch from DMA to PIO Seungwon Jeon
2012-04-10  9:54 ` Will Newton
2012-04-10 14:18   ` Chris Ball

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.