linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: omap2-mcspi: Fix the below warning
@ 2012-07-19 17:46 Shubhrajyoti D
  2012-07-20 10:10 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Shubhrajyoti D @ 2012-07-19 17:46 UTC (permalink / raw)
  To: spi-devel-general; +Cc: broonie, linux-kernel, Shubhrajyoti D

The dma_map and dma_unmap should have same parameter
passed otherwise we get the below warn.

ks8851 spi1.0: DMA-API: device driver tries to free DMA memory it has not allocated [device address=0x000000009f22]

[    2.066925] Modules linked in:
[    2.070312]
[    2.071929] [<c001c250>] (unwind_backtrace+0x0/0x130) from [<c0043d84>] (warn_slowpath_common+0x4c/0x64)
[    2.081909] [<c0043d84>] (warn_slowpath_common+0x4c/0x64) from [<c0043e30>] (warn_slowpath_fmt+0x30/0x40)
[    2.091949] [<c0043e30>] (warn_slowpath_fmt+0x30/0x40) from [<c0293824>] (check_unmap+0x6d0/0x7b0)
[    2.101348] [<c0293824>] (check_unmap+0x6d0/0x7b0) from [<c02939cc>] (debug_dma_unmap_page+0x64/0x70)
[    2.111053] [<c02939cc>] (debug_dma_unmap_page+0x64/0x70) from [<c03519a4>] (omap2_mcspi_txrx_dma+0x2d8/0x4fc)
[    2.121582] [<c03519a4>] (omap2_mcspi_txrx_dma+0x2d8/0x4fc) from [<c03524d8>] (omap2_mcspi_work.clone.4+0xf0/0x290)
[    2.132537] [<c03524d8>] (omap2_mcspi_work.clone.4+0xf0/0x290) from [<c0352900>] (omap2_mcspi_transfer_one_message+0x288/0x438)
[    2.144592] [<c0352900>] (omap2_mcspi_transfer_one_message+0x288/0x438) from [<c03503bc>] (spi_pump_messages+0x100/0x160)
[    2.156127] [<c03503bc>] (spi_pump_messages+0x100/0x160) from [<c006635c>] (kthread_worker_fn+0xac/0x180)
[    2.166168] [<c006635c>] (kthread_worker_fn+0xac/0x180) from [<c0066578>] (kthread+0x90/0x9c)
[    2.175140] [<c0066578>] (kthread+0x90/0x9c) from [<c00157fc>] (kernel_thread_exit+0x0/0x8)
[    2.183898] ---[ end trace d1830ce6e44292f2 ]---

Fix the warn by changing the unmap parameter.

Reported-by: Russell King - ARM Linux <linux@arm.linux.org.uk>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
 drivers/spi/spi-omap2-mcspi.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 0c73dd4..37ccdb7 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -388,7 +388,8 @@ omap2_mcspi_txrx_dma(struct spi_device *spi, struct spi_transfer *xfer)
 
 	if (tx != NULL) {
 		wait_for_completion(&mcspi_dma->dma_tx_completion);
-		dma_unmap_single(&spi->dev, xfer->tx_dma, count, DMA_TO_DEVICE);
+		dma_unmap_single(mcspi->dev, xfer->tx_dma, count,
+				 DMA_TO_DEVICE);
 
 		/* for TX_ONLY mode, be sure all words have shifted out */
 		if (rx == NULL) {
@@ -403,7 +404,8 @@ omap2_mcspi_txrx_dma(struct spi_device *spi, struct spi_transfer *xfer)
 
 	if (rx != NULL) {
 		wait_for_completion(&mcspi_dma->dma_rx_completion);
-		dma_unmap_single(&spi->dev, xfer->rx_dma, count, DMA_FROM_DEVICE);
+		dma_unmap_single(mcspi->dev, xfer->rx_dma, count,
+				 DMA_FROM_DEVICE);
 		omap2_mcspi_set_enable(spi, 0);
 
 		if (l & OMAP2_MCSPI_CHCONF_TURBO) {
-- 
1.7.5.4


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

* Re: [PATCH] spi: omap2-mcspi: Fix the below warning
  2012-07-19 17:46 [PATCH] spi: omap2-mcspi: Fix the below warning Shubhrajyoti D
@ 2012-07-20 10:10 ` Mark Brown
  2012-07-21 15:10   ` Shubhrajyoti Datta
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2012-07-20 10:10 UTC (permalink / raw)
  To: Shubhrajyoti D; +Cc: spi-devel-general, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 179 bytes --]

On Thu, Jul 19, 2012 at 11:16:52PM +0530, Shubhrajyoti D wrote:
> The dma_map and dma_unmap should have same parameter
> passed otherwise we get the below warn.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] spi: omap2-mcspi: Fix the below warning
  2012-07-20 10:10 ` Mark Brown
@ 2012-07-21 15:10   ` Shubhrajyoti Datta
  0 siblings, 0 replies; 3+ messages in thread
From: Shubhrajyoti Datta @ 2012-07-21 15:10 UTC (permalink / raw)
  To: Mark Brown; +Cc: Shubhrajyoti D, spi-devel-general, linux-kernel

On Fri, Jul 20, 2012 at 3:40 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Thu, Jul 19, 2012 at 11:16:52PM +0530, Shubhrajyoti D wrote:
>> The dma_map and dma_unmap should have same parameter
>> passed otherwise we get the below warn.
>
> Applied, thanks.
thanks,

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

end of thread, other threads:[~2012-07-21 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-19 17:46 [PATCH] spi: omap2-mcspi: Fix the below warning Shubhrajyoti D
2012-07-20 10:10 ` Mark Brown
2012-07-21 15:10   ` Shubhrajyoti Datta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).