public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] scsi : megaraid_{mm,mbox}: a fix on 64-bit DMA capability check
@ 2006-05-19 15:09 Ju, Seokmann
  2006-05-19 21:28 ` James Bottomley
  2006-06-20 13:53 ` Vasily Averin
  0 siblings, 2 replies; 4+ messages in thread
From: Ju, Seokmann @ 2006-05-19 15:09 UTC (permalink / raw)
  To: Vasily Averin, James Bottomley, Andrew Morton; +Cc: linux-scsi, linux-kernel

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

Hi,

This patch contains a fix for 64-bit DMA capability check in
megaraid_{mm,mbox} driver. With patch, the driver access PCI
configuration space with dedicated offset to read a signature. If the
signature read, it means that the controller has capability to handle
64-bit DMA. Before this patch, the driver blindly claimed the capability
without checking with controller.
The issue has been reported by Vasily Averin [vvs@sw.ru]. Thank you
Vasily for the reporting.

Thank you,

Seokmann

Signed-Off By: Seokmann Ju <seokmann.ju@lsil.com>
---
diff -Naur old/Documentation/scsi/ChangeLog.megaraid
new/Documentation/scsi/ChangeLog.megaraid
--- old/Documentation/scsi/ChangeLog.megaraid	2006-05-19
08:58:26.000000000 -0400
+++ new/Documentation/scsi/ChangeLog.megaraid	2006-05-19
09:22:48.000000000 -0400
@@ -1,3 +1,64 @@
+Release Date	: Fri May 19 09:31:45 EST 2006 - Seokmann Ju
<sju@lsil.com>
+Current Version : 2.20.4.9 (scsi module), 2.20.2.6 (cmm module)
+Older Version	: 2.20.4.8 (scsi module), 2.20.2.6 (cmm module)
+
+1.	Fixed a bug in megaraid_init_mbox().
+	Customer reported "garbage in file on x86_64 platform".
+	Root Cause: the driver registered controllers as 64-bit DMA
capable
+	for those which are not support it.
+	Fix: Made change in the function inserting identification
machanism
+	identifying 64-bit DMA capable controllers.
+
+	> -----Original Message-----
+	> From: Vasily Averin [mailto:vvs@sw.ru] 
+	> Sent: Thursday, May 04, 2006 2:49 PM
+	> To: linux-scsi@vger.kernel.org; Kolli, Neela; Mukker, Atul; 
+	> Ju, Seokmann; Bagalkote, Sreenivas; 
+	> James.Bottomley@SteelEye.com; devel@openvz.org
+	> Subject: megaraid_mbox: garbage in file
+	> 
+	> Hello all,
+	> 
+	> I've investigated customers claim on the unstable work of 
+	> their node and found a
+	> strange effect: reading from some files leads to the
+	>  "attempt to access beyond end of device" messages.
+	> 
+	> I've checked filesystem, memory on the node, motherboard BIOS 
+	> version, but it
+	> does not help and issue still has been reproduced by simple 
+	> file reading.
+	> 
+	> Reproducer is simple:
+	> 
+	> echo 0xffffffff >/proc/sys/dev/scsi/logging_level ;
+	> cat /vz/private/101/root/etc/ld.so.cache >/tmp/ttt  ;
+	> echo 0 >/proc/sys/dev/scsi/logging
+	> 
+	> It leads to the following messages in dmesg
+	> 
+	> sd_init_command: disk=sda, block=871769260, count=26
+	> sda : block=871769260
+	> sda : reading 26/26 512 byte blocks.
+	> scsi_add_timer: scmd: f79ed980, time: 7500, (c02b1420)
+	> sd 0:1:0:0: send 0xf79ed980                  sd 0:1:0:0:
+	>         command: Read (10): 28 00 33 f6 24 ac 00 00 1a 00
+	> buffer = 0xf7cfb540, bufflen = 13312, done = 0xc0366b40, 
+	> queuecommand 0xc0344010
+	> leaving scsi_dispatch_cmnd()
+	> scsi_delete_timer: scmd: f79ed980, rtn: 1
+	> sd 0:1:0:0: done 0xf79ed980 SUCCESS        0 sd 0:1:0:0:
+	>         command: Read (10): 28 00 33 f6 24 ac 00 00 1a 00
+	> scsi host busy 1 failed 0
+	> sd 0:1:0:0: Notifying upper driver of completion (result 0)
+	> sd_rw_intr: sda: res=0x0
+	> 26 sectors total, 13312 bytes done.
+	> use_sg is 4
+	> attempt to access beyond end of device
+	> sda6: rw=0, want=1044134458, limit=951401367
+	> Buffer I/O error on device sda6, logical block 522067228
+	> attempt to access beyond end of device
+
 Release Date	: Mon Apr 11 12:27:22 EST 2006 - Seokmann Ju
<sju@lsil.com>
 Current Version : 2.20.4.8 (scsi module), 2.20.2.6 (cmm module)
 Older Version	: 2.20.4.7 (scsi module), 2.20.2.6 (cmm module)
diff -Naur old/drivers/scsi/megaraid/mega_common.h
new/drivers/scsi/megaraid/mega_common.h
--- old/drivers/scsi/megaraid/mega_common.h	2006-05-19
08:58:59.000000000 -0400
+++ new/drivers/scsi/megaraid/mega_common.h	2006-05-19
09:51:48.000000000 -0400
@@ -37,7 +37,8 @@
 #define LSI_MAX_CHANNELS		16
 #define LSI_MAX_LOGICAL_DRIVES_64LD	(64+1)
 
-
+#define HBA_SIGNATURE_64BIT		0x0299
+#define PCI_CONF_AMISIG64		0xa4
 /**
  * scb_t - scsi command control block
  * @param ccb		: command control block for individual driver
diff -Naur old/drivers/scsi/megaraid/megaraid_mbox.c
new/drivers/scsi/megaraid/megaraid_mbox.c
--- old/drivers/scsi/megaraid/megaraid_mbox.c	2006-05-19
08:58:59.000000000 -0400
+++ new/drivers/scsi/megaraid/megaraid_mbox.c	2006-05-19
10:52:11.000000000 -0400
@@ -10,7 +10,7 @@
  *	   2 of the License, or (at your option) any later version.
  *
  * FILE		: megaraid_mbox.c
- * Version	: v2.20.4.8 (Apr 11 2006)
+ * Version	: v2.20.4.9 (May 19 2006)
  *
  * Authors:
  * 	Atul Mukker		<Atul.Mukker@lsil.com>
@@ -720,7 +720,7 @@
 	struct pci_dev		*pdev;
 	mraid_device_t		*raid_dev;
 	int			i;
-
+	unsigned int		magic64;
 
 	adapter->ito	= MBOX_TIMEOUT;
 	pdev		= adapter->pdev;
@@ -863,12 +863,25 @@
 
 	// Set the DMA mask to 64-bit. All supported controllers as
capable of
 	// DMA in this range
-	if (pci_set_dma_mask(adapter->pdev, DMA_64BIT_MASK) != 0) {
+	pci_read_config_dword(adapter->pdev, PCI_CONF_AMISIG64,
&magic64);
 
-		con_log(CL_ANN, (KERN_WARNING
-			"megaraid: could not set DMA mask for
64-bit.\n"));
+	if ((magic64 == HBA_SIGNATURE_64BIT) || 
+		(adapter->pdev->vendor == PCI_VENDOR_ID_DELL &&
+		adapter->pdev->device ==
PCI_DEVICE_ID_PERC4_DI_EVERGLADES) ||
+		(adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
+		adapter->pdev->device == PCI_DEVICE_ID_VERDE) ||
+		(adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
+		adapter->pdev->device == PCI_DEVICE_ID_DOBSON) ||
+		(adapter->pdev->vendor == PCI_VENDOR_ID_DELL &&
+		adapter->pdev->device == PCI_DEVICE_ID_PERC4E_DI_KOBUK)
||
+		(adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
+		adapter->pdev->device == PCI_DEVICE_ID_LINDSAY)) {
+		if (pci_set_dma_mask(adapter->pdev, DMA_64BIT_MASK) !=
0) {
+			con_log(CL_ANN, (KERN_WARNING
+				"megaraid: could not set DMA mask for
64-bit.\n"));
 
-		goto out_free_sysfs_res;
+			goto out_free_sysfs_res;
+		}
 	}
 
 	// setup tasklet for DPC
diff -Naur old/drivers/scsi/megaraid/megaraid_mbox.h
new/drivers/scsi/megaraid/megaraid_mbox.h
--- old/drivers/scsi/megaraid/megaraid_mbox.h	2006-05-19
08:58:59.000000000 -0400
+++ new/drivers/scsi/megaraid/megaraid_mbox.h	2006-05-19
10:22:13.000000000 -0400
@@ -21,8 +21,8 @@
 #include "megaraid_ioctl.h"
 
 
-#define MEGARAID_VERSION	"2.20.4.8"
-#define MEGARAID_EXT_VERSION	"(Release Date: Mon Apr 11 12:27:22 EST
2006)"
+#define MEGARAID_VERSION	"2.20.4.9"
+#define MEGARAID_EXT_VERSION	"(Release Date: Fri May 19 09:45:22 EST
2006)"
 
 
 /*
---

[-- Attachment #2: megaraid_mm_mbox_64bit_dma_check.patch --]
[-- Type: application/octet-stream, Size: 5888 bytes --]

diff -Naur old/Documentation/scsi/ChangeLog.megaraid new/Documentation/scsi/ChangeLog.megaraid
--- old/Documentation/scsi/ChangeLog.megaraid	2006-05-19 08:58:26.000000000 -0400
+++ new/Documentation/scsi/ChangeLog.megaraid	2006-05-19 09:22:48.000000000 -0400
@@ -1,3 +1,64 @@
+Release Date	: Fri May 19 09:31:45 EST 2006 - Seokmann Ju <sju@lsil.com>
+Current Version : 2.20.4.9 (scsi module), 2.20.2.6 (cmm module)
+Older Version	: 2.20.4.8 (scsi module), 2.20.2.6 (cmm module)
+
+1.	Fixed a bug in megaraid_init_mbox().
+	Customer reported "garbage in file on x86_64 platform".
+	Root Cause: the driver registered controllers as 64-bit DMA capable
+	for those which are not support it.
+	Fix: Made change in the function inserting identification machanism
+	identifying 64-bit DMA capable controllers.
+
+	> -----Original Message-----
+	> From: Vasily Averin [mailto:vvs@sw.ru] 
+	> Sent: Thursday, May 04, 2006 2:49 PM
+	> To: linux-scsi@vger.kernel.org; Kolli, Neela; Mukker, Atul; 
+	> Ju, Seokmann; Bagalkote, Sreenivas; 
+	> James.Bottomley@SteelEye.com; devel@openvz.org
+	> Subject: megaraid_mbox: garbage in file
+	> 
+	> Hello all,
+	> 
+	> I've investigated customers claim on the unstable work of 
+	> their node and found a
+	> strange effect: reading from some files leads to the
+	>  "attempt to access beyond end of device" messages.
+	> 
+	> I've checked filesystem, memory on the node, motherboard BIOS 
+	> version, but it
+	> does not help and issue still has been reproduced by simple 
+	> file reading.
+	> 
+	> Reproducer is simple:
+	> 
+	> echo 0xffffffff >/proc/sys/dev/scsi/logging_level ;
+	> cat /vz/private/101/root/etc/ld.so.cache >/tmp/ttt  ;
+	> echo 0 >/proc/sys/dev/scsi/logging
+	> 
+	> It leads to the following messages in dmesg
+	> 
+	> sd_init_command: disk=sda, block=871769260, count=26
+	> sda : block=871769260
+	> sda : reading 26/26 512 byte blocks.
+	> scsi_add_timer: scmd: f79ed980, time: 7500, (c02b1420)
+	> sd 0:1:0:0: send 0xf79ed980                  sd 0:1:0:0:
+	>         command: Read (10): 28 00 33 f6 24 ac 00 00 1a 00
+	> buffer = 0xf7cfb540, bufflen = 13312, done = 0xc0366b40, 
+	> queuecommand 0xc0344010
+	> leaving scsi_dispatch_cmnd()
+	> scsi_delete_timer: scmd: f79ed980, rtn: 1
+	> sd 0:1:0:0: done 0xf79ed980 SUCCESS        0 sd 0:1:0:0:
+	>         command: Read (10): 28 00 33 f6 24 ac 00 00 1a 00
+	> scsi host busy 1 failed 0
+	> sd 0:1:0:0: Notifying upper driver of completion (result 0)
+	> sd_rw_intr: sda: res=0x0
+	> 26 sectors total, 13312 bytes done.
+	> use_sg is 4
+	> attempt to access beyond end of device
+	> sda6: rw=0, want=1044134458, limit=951401367
+	> Buffer I/O error on device sda6, logical block 522067228
+	> attempt to access beyond end of device
+
 Release Date	: Mon Apr 11 12:27:22 EST 2006 - Seokmann Ju <sju@lsil.com>
 Current Version : 2.20.4.8 (scsi module), 2.20.2.6 (cmm module)
 Older Version	: 2.20.4.7 (scsi module), 2.20.2.6 (cmm module)
diff -Naur old/drivers/scsi/megaraid/mega_common.h new/drivers/scsi/megaraid/mega_common.h
--- old/drivers/scsi/megaraid/mega_common.h	2006-05-19 08:58:59.000000000 -0400
+++ new/drivers/scsi/megaraid/mega_common.h	2006-05-19 09:51:48.000000000 -0400
@@ -37,7 +37,8 @@
 #define LSI_MAX_CHANNELS		16
 #define LSI_MAX_LOGICAL_DRIVES_64LD	(64+1)
 
-
+#define HBA_SIGNATURE_64BIT		0x0299
+#define PCI_CONF_AMISIG64		0xa4
 /**
  * scb_t - scsi command control block
  * @param ccb		: command control block for individual driver
diff -Naur old/drivers/scsi/megaraid/megaraid_mbox.c new/drivers/scsi/megaraid/megaraid_mbox.c
--- old/drivers/scsi/megaraid/megaraid_mbox.c	2006-05-19 08:58:59.000000000 -0400
+++ new/drivers/scsi/megaraid/megaraid_mbox.c	2006-05-19 10:52:11.000000000 -0400
@@ -10,7 +10,7 @@
  *	   2 of the License, or (at your option) any later version.
  *
  * FILE		: megaraid_mbox.c
- * Version	: v2.20.4.8 (Apr 11 2006)
+ * Version	: v2.20.4.9 (May 19 2006)
  *
  * Authors:
  * 	Atul Mukker		<Atul.Mukker@lsil.com>
@@ -720,7 +720,7 @@
 	struct pci_dev		*pdev;
 	mraid_device_t		*raid_dev;
 	int			i;
-
+	unsigned int		magic64;
 
 	adapter->ito	= MBOX_TIMEOUT;
 	pdev		= adapter->pdev;
@@ -863,12 +863,25 @@
 
 	// Set the DMA mask to 64-bit. All supported controllers as capable of
 	// DMA in this range
-	if (pci_set_dma_mask(adapter->pdev, DMA_64BIT_MASK) != 0) {
+	pci_read_config_dword(adapter->pdev, PCI_CONF_AMISIG64, &magic64);
 
-		con_log(CL_ANN, (KERN_WARNING
-			"megaraid: could not set DMA mask for 64-bit.\n"));
+	if ((magic64 == HBA_SIGNATURE_64BIT) || 
+		(adapter->pdev->vendor == PCI_VENDOR_ID_DELL &&
+		adapter->pdev->device == PCI_DEVICE_ID_PERC4_DI_EVERGLADES) ||
+		(adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
+		adapter->pdev->device == PCI_DEVICE_ID_VERDE) ||
+		(adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
+		adapter->pdev->device == PCI_DEVICE_ID_DOBSON) ||
+		(adapter->pdev->vendor == PCI_VENDOR_ID_DELL &&
+		adapter->pdev->device == PCI_DEVICE_ID_PERC4E_DI_KOBUK) ||
+		(adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
+		adapter->pdev->device == PCI_DEVICE_ID_LINDSAY)) {
+		if (pci_set_dma_mask(adapter->pdev, DMA_64BIT_MASK) != 0) {
+			con_log(CL_ANN, (KERN_WARNING
+				"megaraid: could not set DMA mask for 64-bit.\n"));
 
-		goto out_free_sysfs_res;
+			goto out_free_sysfs_res;
+		}
 	}
 
 	// setup tasklet for DPC
diff -Naur old/drivers/scsi/megaraid/megaraid_mbox.h new/drivers/scsi/megaraid/megaraid_mbox.h
--- old/drivers/scsi/megaraid/megaraid_mbox.h	2006-05-19 08:58:59.000000000 -0400
+++ new/drivers/scsi/megaraid/megaraid_mbox.h	2006-05-19 10:22:13.000000000 -0400
@@ -21,8 +21,8 @@
 #include "megaraid_ioctl.h"
 
 
-#define MEGARAID_VERSION	"2.20.4.8"
-#define MEGARAID_EXT_VERSION	"(Release Date: Mon Apr 11 12:27:22 EST 2006)"
+#define MEGARAID_VERSION	"2.20.4.9"
+#define MEGARAID_EXT_VERSION	"(Release Date: Fri May 19 09:45:22 EST 2006)"
 
 
 /*

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

* Re: [PATCH 1/1] scsi : megaraid_{mm,mbox}: a fix on 64-bit DMA capability check
  2006-05-19 15:09 [PATCH 1/1] scsi : megaraid_{mm,mbox}: a fix on 64-bit DMA capability check Ju, Seokmann
@ 2006-05-19 21:28 ` James Bottomley
  2006-06-20 13:53 ` Vasily Averin
  1 sibling, 0 replies; 4+ messages in thread
From: James Bottomley @ 2006-05-19 21:28 UTC (permalink / raw)
  To: Ju, Seokmann; +Cc: Vasily Averin, Andrew Morton, linux-scsi, linux-kernel

On Fri, 2006-05-19 at 09:09 -0600, Ju, Seokmann wrote:

> +		adapter->pdev->device == PCI_DEVICE_ID_LINDSAY)) {
> +		if (pci_set_dma_mask(adapter->pdev, DMA_64BIT_MASK) !=
> 0) {
> +			con_log(CL_ANN, (KERN_WARNING
> +				"megaraid: could not set DMA mask for
> 64-bit.\n"));
>  
> -		goto out_free_sysfs_res;

Well, this really isn't quite right.  There are 32 bit platforms which
will refuse a 64 bit DMA mask on principle.  You need to retry with a 32
bit mask before erroring out, exactly like you've done in megaraid_sas.c

Also, it's a bit strange having a 32 bit mask set initially in probe_one
and then being reset in init_mbox.  Why not just consolidate all the PCI
register testing and mask setting in probe_one?

James



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

* Re: [PATCH 1/1] scsi : megaraid_{mm,mbox}: a fix on 64-bit DMA capability check
  2006-05-19 15:09 [PATCH 1/1] scsi : megaraid_{mm,mbox}: a fix on 64-bit DMA capability check Ju, Seokmann
  2006-05-19 21:28 ` James Bottomley
@ 2006-06-20 13:53 ` Vasily Averin
  1 sibling, 0 replies; 4+ messages in thread
From: Vasily Averin @ 2006-06-20 13:53 UTC (permalink / raw)
  To: Ju, Seokmann
  Cc: James Bottomley, Andrew Morton, linux-scsi, linux-kernel, devel

Hello Seokmann,

I would like to tell you that your patch is wrong, at least for
 MegaRAID SATA 150-4 RAID Controller

06:02.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID (rev 01)
        Subsystem: LSI Logic / Symbios Logic MegaRAID SATA 150-4 RAID Controller
00: 00 10 60 19 16 03 b0 04 01 00 04 01 08 20 00 00
10: 08 00 20 df 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 10 23 45
30: 00 00 00 00 80 00 00 00 00 00 00 00 0a 01 00 00
40: 00 00 ff ff 00 00 00 d0 08 00 00 fc 00 00 00 fc
50: 00 00 00 d0 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 88 1f 00 00 00 00 00 f8 00 00 00 00
70: 00 00 00 00 00 00 ff ff 00 00 f4 fe 00 00 00 00
80: 01 00 02 00 00 00 00 00 06 01 38 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 06 01 00 20 9c 00 00 00
a0: cc cc 00 00 99 02 00 00 00 06 00 80 00 00 00 00
b0: 00 00 00 6e 00 00 00 00 00 00 00 00 fd 01 00 00
c0: fd 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

As far as I see the 64-bit magic is set, pci(0xA4) == 0x0299 and driver tries to
enable 64-bit DMA. However the controller is not supported 64-bit DMA, and I
still have the same error messages.

Could you please check this issue and update your patch properly.

Thank you,
	Vasily Averin

SWsoft Virtuozzo/OpenVZ Linux kernel team

Ju, Seokmann wrote:
> Hi,
> 
> This patch contains a fix for 64-bit DMA capability check in
> megaraid_{mm,mbox} driver. With patch, the driver access PCI
> configuration space with dedicated offset to read a signature. If the
> signature read, it means that the controller has capability to handle
> 64-bit DMA. Before this patch, the driver blindly claimed the capability
> without checking with controller.
> The issue has been reported by Vasily Averin [vvs@sw.ru]. Thank you
> Vasily for the reporting.

> +#define HBA_SIGNATURE_64BIT		0x0299
> +#define PCI_CONF_AMISIG64		0xa4
...
> -	if (pci_set_dma_mask(adapter->pdev, DMA_64BIT_MASK) != 0) {
> +	pci_read_config_dword(adapter->pdev, PCI_CONF_AMISIG64,
> &magic64);
>  
> -		con_log(CL_ANN, (KERN_WARNING
> -			"megaraid: could not set DMA mask for
> 64-bit.\n"));
> +	if ((magic64 == HBA_SIGNATURE_64BIT) || 
> +		(adapter->pdev->vendor == PCI_VENDOR_ID_DELL &&
> +		adapter->pdev->device ==
> PCI_DEVICE_ID_PERC4_DI_EVERGLADES) ||
> +		(adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
> +		adapter->pdev->device == PCI_DEVICE_ID_VERDE) ||
> +		(adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
> +		adapter->pdev->device == PCI_DEVICE_ID_DOBSON) ||
> +		(adapter->pdev->vendor == PCI_VENDOR_ID_DELL &&
> +		adapter->pdev->device == PCI_DEVICE_ID_PERC4E_DI_KOBUK)
> ||
> +		(adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
> +		adapter->pdev->device == PCI_DEVICE_ID_LINDSAY)) {
> +		if (pci_set_dma_mask(adapter->pdev, DMA_64BIT_MASK) !=
> 0) {

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

* RE: [PATCH 1/1] scsi : megaraid_{mm,mbox}: a fix on 64-bit DMA capability check
@ 2006-06-20 14:06 Ju, Seokmann
  0 siblings, 0 replies; 4+ messages in thread
From: Ju, Seokmann @ 2006-06-20 14:06 UTC (permalink / raw)
  To: Vasily Averin
  Cc: James Bottomley, Andrew Morton, linux-scsi, linux-kernel, devel

Hi Vasily,

Tuesday, June 20, 2006 9:53 AM, Vasily Averin wrote:
> As far as I see the 64-bit magic is set, pci(0xA4) == 0x0299 
> and driver tries to
> enable 64-bit DMA. However the controller is not supported 
> 64-bit DMA, and I
> still have the same error messages.
> 
> Could you please check this issue and update your patch properly.
I'll double check with F/W team for further clarification and will submit updated patch, soon.
Thank you for pointing out and sorry for inconvenience.

Seokmann

> -----Original Message-----
> From: Vasily Averin [mailto:vvs@sw.ru] 
> Sent: Tuesday, June 20, 2006 9:53 AM
> To: Ju, Seokmann
> Cc: James Bottomley; Andrew Morton; 
> linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; 
> devel@openvz.org
> Subject: Re: [PATCH 1/1] scsi : megaraid_{mm,mbox}: a fix on 
> 64-bit DMA capability check
> 
> Hello Seokmann,
> 
> I would like to tell you that your patch is wrong, at least for
>  MegaRAID SATA 150-4 RAID Controller
> 
> 06:02.0 RAID bus controller: LSI Logic / Symbios Logic 
> MegaRAID (rev 01)
>         Subsystem: LSI Logic / Symbios Logic MegaRAID SATA 
> 150-4 RAID Controller
> 00: 00 10 60 19 16 03 b0 04 01 00 04 01 08 20 00 00
> 10: 08 00 20 df 00 00 00 00 00 00 00 00 00 00 00 00
> 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 10 23 45
> 30: 00 00 00 00 80 00 00 00 00 00 00 00 0a 01 00 00
> 40: 00 00 ff ff 00 00 00 d0 08 00 00 fc 00 00 00 fc
> 50: 00 00 00 d0 00 00 00 00 00 00 00 00 00 00 00 00
> 60: 00 00 00 00 88 1f 00 00 00 00 00 f8 00 00 00 00
> 70: 00 00 00 00 00 00 ff ff 00 00 f4 fe 00 00 00 00
> 80: 01 00 02 00 00 00 00 00 06 01 38 00 00 00 00 00
> 90: 00 00 00 00 00 00 00 00 06 01 00 20 9c 00 00 00
> a0: cc cc 00 00 99 02 00 00 00 06 00 80 00 00 00 00
> b0: 00 00 00 6e 00 00 00 00 00 00 00 00 fd 01 00 00
> c0: fd 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 
> As far as I see the 64-bit magic is set, pci(0xA4) == 0x0299 
> and driver tries to
> enable 64-bit DMA. However the controller is not supported 
> 64-bit DMA, and I
> still have the same error messages.
> 
> Could you please check this issue and update your patch properly.
> 
> Thank you,
> 	Vasily Averin
> 
> SWsoft Virtuozzo/OpenVZ Linux kernel team
> 
> Ju, Seokmann wrote:
> > Hi,
> > 
> > This patch contains a fix for 64-bit DMA capability check in
> > megaraid_{mm,mbox} driver. With patch, the driver access PCI
> > configuration space with dedicated offset to read a 
> signature. If the
> > signature read, it means that the controller has capability 
> to handle
> > 64-bit DMA. Before this patch, the driver blindly claimed 
> the capability
> > without checking with controller.
> > The issue has been reported by Vasily Averin [vvs@sw.ru]. Thank you
> > Vasily for the reporting.
> 
> > +#define HBA_SIGNATURE_64BIT		0x0299
> > +#define PCI_CONF_AMISIG64		0xa4
> ...
> > -	if (pci_set_dma_mask(adapter->pdev, DMA_64BIT_MASK) != 0) {
> > +	pci_read_config_dword(adapter->pdev, PCI_CONF_AMISIG64,
> > &magic64);
> >  
> > -		con_log(CL_ANN, (KERN_WARNING
> > -			"megaraid: could not set DMA mask for
> > 64-bit.\n"));
> > +	if ((magic64 == HBA_SIGNATURE_64BIT) || 
> > +		(adapter->pdev->vendor == PCI_VENDOR_ID_DELL &&
> > +		adapter->pdev->device ==
> > PCI_DEVICE_ID_PERC4_DI_EVERGLADES) ||
> > +		(adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
> > +		adapter->pdev->device == PCI_DEVICE_ID_VERDE) ||
> > +		(adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
> > +		adapter->pdev->device == PCI_DEVICE_ID_DOBSON) ||
> > +		(adapter->pdev->vendor == PCI_VENDOR_ID_DELL &&
> > +		adapter->pdev->device == PCI_DEVICE_ID_PERC4E_DI_KOBUK)
> > ||
> > +		(adapter->pdev->vendor == PCI_VENDOR_ID_LSI_LOGIC &&
> > +		adapter->pdev->device == PCI_DEVICE_ID_LINDSAY)) {
> > +		if (pci_set_dma_mask(adapter->pdev, DMA_64BIT_MASK) !=
> > 0) {
> 

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

end of thread, other threads:[~2006-06-20 14:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-19 15:09 [PATCH 1/1] scsi : megaraid_{mm,mbox}: a fix on 64-bit DMA capability check Ju, Seokmann
2006-05-19 21:28 ` James Bottomley
2006-06-20 13:53 ` Vasily Averin
  -- strict thread matches above, loose matches on Subject: below --
2006-06-20 14:06 Ju, Seokmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox