Dell CERC support for megaraid_mbox
Subsystems (2)
PATCH 23/23 Dell CERC support for megaraid_mbox
From: Hannes Reinecke <[email protected]>
Newer Dell CERC firmware (>= 6.62) implement a random deletion handling compatible with the legacy megaraid driver. The legacy handling shifted the target ID by 0x80 only for I/O commands (READ/WRITE/etc), whereas megaraid_mbox shifts the target ID always if random deletion is supported. The resulted in megaraid_mbox sending an INQUIRY to the wrong channel, and not finding any devices, obviously.
So we disable the random deletion support if the offending firmware is found.
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=6695
---
drivers/scsi/megaraid/megaraid_mbox.c | 17 +++++++++++++++++ drivers/scsi/megaraid/megaraid_mbox.h | 1 + 2 files changed, 18 insertions(+)
drivers/scsi/megaraid/megaraid_mbox.c renamed from drivers/scsi/megaraid/megaraid_mbox.c~dell-cerc-support-for-megaraid_mbox +17 -0
@@ -3169,6 +3169,23 @@ megaraid_mbox_support_random_del(adapteruint8_t raw_mbox[sizeof (mbox_t)];int rval; +/* +* Newer firmware on Dell CERC expect a different +* random deletion handling, so disable it. +*/ +if (adapter->pdev->vendor ==PCI_VENDOR_ID_AMI && + adapter->pdev->device ==PCI_DEVICE_ID_AMI_MEGARAID3 && + adapter->pdev->subsystem_vendor ==PCI_VENDOR_ID_DELL && + adapter->pdev->subsystem_device ==PCI_SUBSYS_ID_CERC_ATA100_4CH && + (adapter->fw_version[0 ] >'6' || + (adapter->fw_version[0 ] =='6' && + adapter->fw_version[2 ] >'6' ) || + (adapter->fw_version[0 ] =='6' + && adapter->fw_version[2 ] =='6' + && adapter->fw_version[3 ] >'1' ))) { +con_log (CL_DLEVEL1 , ("megaraid: disable random deletion\n" )); +return 0 ; + } mbox = (mbox_t *)raw_mbox;
drivers/scsi/megaraid/megaraid_mbox.h renamed from drivers/scsi/megaraid/megaraid_mbox.h~dell-cerc-support-for-megaraid_mbox +1 -0
@@ -88,6 +88,7 @@#define PCI_SUBSYS_ID_PERC3_QC 0x0471#define PCI_SUBSYS_ID_PERC3_DC 0x0493#define PCI_SUBSYS_ID_PERC3_SC 0x0475 +#define PCI_SUBSYS_ID_CERC_ATA100_4CH 0x0511#define MBOX_MAX_SCSI_CMDS 128 // number of cmds reserved for kernel
_
Hannes,
Thanks for the patch and the details on the issue. With this patch we will be blocking a feature that is now being
used by the users with the legacy driver. The applications may still allow random delete and that could create more issue if we just block it/change the required behavior from the driver. As now we know the possible reason on the issue, I will see if I can come up with a implementation that will allow the random delete feature and still make the LDs available.
So, for now I don't want this patch to be added. Will submit a
separate patch to address the issue.
Regards,
Sumant
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Wednesday, November 21, 2007 3:13 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Patro, Sumant
Subject: [patch 23/23] Dell CERC support for megaraid_mbox
From: Hannes Reinecke <[email protected]>
Newer Dell CERC firmware (>= 6.62) implement a random deletion handling compatible with the legacy megaraid driver. The legacy handling shifted the target ID by 0x80 only for I/O commands (READ/WRITE/etc), whereas megaraid_mbox shifts the target ID always if random deletion is supported.
The resulted in megaraid_mbox sending an INQUIRY to the wrong channel, and not finding any devices, obviously.
So we disable the random deletion support if the offending firmware is found.
Addresses http://bugzilla.kernel.org/show_bug.cgi?id=6695
---
drivers/scsi/megaraid/megaraid_mbox.c | 17 +++++++++++++++++ drivers/scsi/megaraid/megaraid_mbox.h | 1 + 2 files changed, 18 insertions(+)
diff -puN drivers/scsi/megaraid/megaraid_mbox.c~dell-cerc-support-for-megaraid_mbo x drivers/scsi/megaraid/megaraid_mbox.c
---
a/drivers/scsi/megaraid/megaraid_mbox.c~dell-cerc-support-for-megaraid_m box
+++ a/drivers/scsi/megaraid/megaraid_mbox.c
@@ -3169,6 +3169,23 @@ megaraid_mbox_support_random_del(adapter
uint8_t raw_mbox[sizeof(mbox_t)];
int rval;
+ /*
+ * Newer firmware on Dell CERC expect a different
+ * random deletion handling, so disable it.
+ */
+ if (adapter->pdev->vendor == PCI_VENDOR_ID_AMI &&
+ adapter->pdev->device == PCI_DEVICE_ID_AMI_MEGARAID3 && + adapter->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL && + adapter->pdev->subsystem_device ==
PCI_SUBSYS_ID_CERC_ATA100_4CH &&
+ (adapter->fw_version[0] > '6' ||
+ (adapter->fw_version[0] == '6' &&
+ adapter->fw_version[2] > '6') ||
+ (adapter->fw_version[0] == '6'
+ && adapter->fw_version[2] == '6'
+ && adapter->fw_version[3] > '1'))) {
+ con_log(CL_DLEVEL1, ("megaraid: disable random
deletion\n"));
+ return 0;
+ }
mbox = (mbox_t *)raw_mbox;
diff -puN drivers/scsi/megaraid/megaraid_mbox.h~dell-cerc-support-for-megaraid_mbo x drivers/scsi/megaraid/megaraid_mbox.h
---
a/drivers/scsi/megaraid/megaraid_mbox.h~dell-cerc-support-for-megaraid_m box
+++ a/drivers/scsi/megaraid/megaraid_mbox.h
@@ -88,6 +88,7 @@
#define PCI_SUBSYS_ID_PERC3_QC 0x0471
#define PCI_SUBSYS_ID_PERC3_DC 0x0493
#define PCI_SUBSYS_ID_PERC3_SC 0x0475
+#define PCI_SUBSYS_ID_CERC_ATA100_4CH 0x0511
#define MBOX_MAX_SCSI_CMDS 128 // number of cmds reserved for
kernel
_