* [PATCH] mtd: omap2: fix resource leak in prefetch-busy path
@ 2012-04-11 1:04 Grazvydas Ignotas
2012-04-22 12:45 ` Artem Bityutskiy
0 siblings, 1 reply; 2+ messages in thread
From: Grazvydas Ignotas @ 2012-04-11 1:04 UTC (permalink / raw)
To: linux-mtd
Cc: David Woodhouse, Artem Bityutskiy, linux-omap, Grazvydas Ignotas
If prefetch engine is busy, current code "forgets" to call
dma_unmap_single(), which results in a deadlock later, so add it.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
---
drivers/mtd/nand/omap2.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index f745f00..7feb274 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -402,7 +402,7 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
PREFETCH_FIFOTHRESHOLD_MAX, 0x1, len, is_write);
if (ret)
/* PFPW engine is busy, use cpu copy method */
- goto out_copy;
+ goto out_copy_unmap;
init_completion(&info->comp);
@@ -421,6 +421,8 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
dma_unmap_single(&info->pdev->dev, dma_addr, len, dir);
return 0;
+out_copy_unmap:
+ dma_unmap_single(&info->pdev->dev, dma_addr, len, dir);
out_copy:
if (info->nand.options & NAND_BUSWIDTH_16)
is_write == 0 ? omap_read_buf16(mtd, (u_char *) addr, len)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mtd: omap2: fix resource leak in prefetch-busy path
2012-04-11 1:04 [PATCH] mtd: omap2: fix resource leak in prefetch-busy path Grazvydas Ignotas
@ 2012-04-22 12:45 ` Artem Bityutskiy
0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2012-04-22 12:45 UTC (permalink / raw)
To: Grazvydas Ignotas; +Cc: linux-mtd, linux-omap, David Woodhouse
[-- Attachment #1: Type: text/plain, Size: 325 bytes --]
On Wed, 2012-04-11 at 04:04 +0300, Grazvydas Ignotas wrote:
> If prefetch engine is busy, current code "forgets" to call
> dma_unmap_single(), which results in a deadlock later, so add it.
>
> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Pushed to l2-mtd.git, thanks!
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-22 12:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-11 1:04 [PATCH] mtd: omap2: fix resource leak in prefetch-busy path Grazvydas Ignotas
2012-04-22 12:45 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox