Thread (9 messages) flat view 9 messages, 3 authors, 2011-09-12

Re: [PATCH 1/2] SPI: spi_sh_msiof: implement DMA support

From: Guennadi Liakhovetski <hidden>
Date: 2011-09-05 07:26:45
Also in: linux-spi

Hi Paul

On Mon, 5 Sep 2011, Paul Mundt wrote:
On Fri, Sep 02, 2011 at 05:13:31PM +0200, Guennadi Liakhovetski wrote:
quoted
Use the sh_dma dmaengine driver to support DMA on MSIOF.

Signed-off-by: Guennadi Liakhovetski <redacted>
No real opinion one way or the other, just a couple observations.
quoted
+static void sh_msiof_request_dma(struct sh_msiof_spi_priv *p)
+{
..
quoted
+	p->dummypage = alloc_page(GFP_KERNEL);
+	if (!p->dummypage)
+		return;
+
..
quoted
+echantx:
+	__free_pages(p->dummypage, 0);
+}
+
alloc_page() can be balanced out with __free_page().
Hm, indeed, wondering, how I missed it.
quoted
@@ -695,11 +1030,11 @@ static int sh_msiof_spi_remove(struct platform_device *pdev)
 
 	ret = spi_bitbang_stop(&p->bitbang);
 	if (!ret) {
+		sh_msiof_release_dma(p);
 		pm_runtime_disable(&pdev->dev);
 		free_irq(platform_get_irq(pdev, 0), p);
 		iounmap(p->mapbase);
 		clk_put(p->clk);
-		spi_master_put(p->bitbang.master);
 	}
 	return ret;
 }
You've also killed off the spi_master_put() here.
Yes, spi_bitbang_stop() does it all already.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help