[PATCH] old 3ware scsi_dma_unmap fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch for the old 3w-xxxx driver is for 2.6.30-rc6 and is similar
to the recent one I sent for the 3w-9xxx driver.

This patch fixes the following regression that occurred during the
scsi_dma_map()/unmap()
changes when compiling with CONFIG_DMA_API_DEBUG=y :

WARNING: at lib/dma-debug.c:496 check_unmap+0x142/0x542()
Hardware name:
3w-xxxx 0000:02:02.0: DMA-API: device driver tries to free DMA memory
it has not allocated [device address=0x0000000000000000] [size=36
bytes]

James, could you please apply this?

Thanks,

-Adam

Signed-off-by: Adam Radford <aradford@xxxxxxxxx>

Note: This patch is included in-line below and also as an attachment
in case Gmail hoses the patch.

diff -Naur linux-2.6.30-rc5/drivers/scsi/3w-xxxx.c
linux-2.6.30-rc5.new/drivers/scsi/3w-xxxx.c
--- linux-2.6.30-rc5/drivers/scsi/3w-xxxx.c	2009-03-23 16:12:14.000000000 -0700
+++ linux-2.6.30-rc5.new/drivers/scsi/3w-xxxx.c	2009-05-11
11:40:32.000000000 -0700
@@ -6,7 +6,7 @@
    		     Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxx>
                      Brad Strand <linux@xxxxxxxxx>

-   Copyright (C) 1999-2007 3ware Inc.
+   Copyright (C) 1999-2009 3ware Inc.

    Kernel compatiblity By: 	Andre Hedrick <andre@xxxxxxxx>
    Non-Copyright (C) 2000	Andre Hedrick <andre@xxxxxxxx>
@@ -1294,7 +1294,8 @@
 {
 	dprintk(KERN_WARNING "3w-xxxx: tw_unmap_scsi_data()\n");

-	scsi_dma_unmap(cmd);
+	if (cmd->SCp.phase == TW_PHASE_SGLIST)
+		scsi_dma_unmap(cmd);
 } /* End tw_unmap_scsi_data() */

 /* This function will reset a device extension */
diff -Naur linux-2.6.30-rc5/drivers/scsi/3w-xxxx.h
linux-2.6.30-rc5.new/drivers/scsi/3w-xxxx.h
--- linux-2.6.30-rc5/drivers/scsi/3w-xxxx.h	2009-05-11 11:25:33.000000000 -0700
+++ linux-2.6.30-rc5.new/drivers/scsi/3w-xxxx.h	2009-05-11
11:40:37.000000000 -0700
@@ -6,7 +6,7 @@
    		     Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxx>
                      Brad Strand <linux@xxxxxxxxx>

-   Copyright (C) 1999-2007 3ware Inc.
+   Copyright (C) 1999-2009 3ware Inc.

    Kernel compatiblity By:	Andre Hedrick <andre@xxxxxxxx>
    Non-Copyright (C) 2000	Andre Hedrick <andre@xxxxxxxx>
diff -Naur linux-2.6.30-rc5/drivers/scsi/3w-xxxx.c linux-2.6.30-rc5.new/drivers/scsi/3w-xxxx.c
--- linux-2.6.30-rc5/drivers/scsi/3w-xxxx.c	2009-03-23 16:12:14.000000000 -0700
+++ linux-2.6.30-rc5.new/drivers/scsi/3w-xxxx.c	2009-05-11 11:40:32.000000000 -0700
@@ -6,7 +6,7 @@
    		     Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxx>
                      Brad Strand <linux@xxxxxxxxx>
 
-   Copyright (C) 1999-2007 3ware Inc.
+   Copyright (C) 1999-2009 3ware Inc.
 
    Kernel compatiblity By: 	Andre Hedrick <andre@xxxxxxxx>
    Non-Copyright (C) 2000	Andre Hedrick <andre@xxxxxxxx>
@@ -1294,7 +1294,8 @@
 {
 	dprintk(KERN_WARNING "3w-xxxx: tw_unmap_scsi_data()\n");
 
-	scsi_dma_unmap(cmd);
+	if (cmd->SCp.phase == TW_PHASE_SGLIST)
+		scsi_dma_unmap(cmd);
 } /* End tw_unmap_scsi_data() */
 
 /* This function will reset a device extension */
diff -Naur linux-2.6.30-rc5/drivers/scsi/3w-xxxx.h linux-2.6.30-rc5.new/drivers/scsi/3w-xxxx.h
--- linux-2.6.30-rc5/drivers/scsi/3w-xxxx.h	2009-05-11 11:25:33.000000000 -0700
+++ linux-2.6.30-rc5.new/drivers/scsi/3w-xxxx.h	2009-05-11 11:40:37.000000000 -0700
@@ -6,7 +6,7 @@
    		     Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxx>
                      Brad Strand <linux@xxxxxxxxx>
 
-   Copyright (C) 1999-2007 3ware Inc.
+   Copyright (C) 1999-2009 3ware Inc.
 
    Kernel compatiblity By:	Andre Hedrick <andre@xxxxxxxx>
    Non-Copyright (C) 2000	Andre Hedrick <andre@xxxxxxxx>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux