Skip to contentSkip to conversation

aic79xx should be able to ignore HostRAID enabled adapters

PATCH In review Darrick J. Wong 4 participants 5 messages Dec 1, 2005 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aic79xx should be able to ignore HostRAID enabled adapters

Hi there,

I have an IBM x346 with some Adaptec 7902 SCSI controllers; one has HostRAID enabled in a RAID array, and the other does not. Upon bootup, the aic79xx driver will grab both controllers even though I'd prefer that Adaptec's a320raid driver grab the HostRAID controller. (When attached to the RAID array, the aic79xx driver presents each drive in the array as a separate SCSI device.) If HostRAID is turned on, the PCI class code is 0x0104 (RAID) and if it's turned off, the class code is 0x0100 (SCSI).

Unfortunately, there currently is no provision in the aic79xx driver to ignore RAID controllers--if the PCI device/vendor IDs match, the driver takes the controller. The attached patch modifies the PCI probe function to ignore RAID controllers and a module parameter "attach_HostRAID" to toggle this behavior. If one passes "attach_HostRAID=1" to insmod, the driver will take RAID controllers; "attach_HostRAID=0", it won't. The default is to set it to zero.

The patch should apply cleanly against 2.6.14 and I've verified that it works correctly on a x346 and a x226, both of which have a 7902b. I'd appreciate a few more eyes to look over it, and if there aren't any objections I'd like to submit this for inclusion in mainline.

--Darrick

--------------------------

diff -Naurp orig/drivers/scsi/aic7xxx/aic79xx_osm_pci.c linux-2.6.14.3/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
--- orig/drivers/scsi/aic7xxx/aic79xx_osm_pci.c 2005-11-24 14:10:21.000000000 -0800
+++ linux-2.6.14.3/drivers/scsi/aic7xxx/aic79xx_osm_pci.c 2005-11-29
16:54:30.000000000 -0800
@@ -43,6 +43,12 @@
#include "aic79xx_inline.h"
#include "aic79xx_pci.h"

+static int attach_HostRAID = 0; +module_param_named(attach_HostRAID, attach_HostRAID, int, S_IRUGO|S_IWUSR); +MODULE_PARM_DESC(attach_HostRAID, "\n"
+ "\tEnable(1) or disable(0) attaching to HostRAID enabled host "
+ "adapters.\n\tDefault: 0");
+
static int ahd_linux_pci_dev_probe(struct pci_dev *pdev,
const struct pci_device_id *ent);
static int ahd_linux_pci_reserve_io_regions(struct ahd_softc *ahd,
@@ -132,6 +138,14 @@ ahd_linux_pci_dev_probe(struct pci_dev *
char *name;
int error;

+ /* Ignore hostraid controllers unless the override is on. */
+ if (pdev->class == (PCI_CLASS_STORAGE_RAID << 8) && !attach_HostRAID) {
+ printk(KERN_INFO "aic79xx: will not attach to HostRAID enabled"
+ " device %s unless attach_HostRAID parameter is set\n",
+ pci_name(pdev));
+ return -ENODEV;
+ }
+
pci = pdev;
entry = ahd_find_pci_device(pci);
if (entry == NULL)

#1 lore raw
Quoted 10 lines · Darrick J. Wong

Hi there,

I have an IBM x346 with some Adaptec 7902 SCSI controllers; one has HostRAID enabled in a RAID array, and the other does not. Upon bootup, the aic79xx driver will grab both controllers even though I'd prefer that Adaptec's a320raid driver grab the HostRAID controller. (When attached to the RAID array, the aic79xx driver presents each drive in the array as a separate SCSI device.) If HostRAID is turned on, the PCI class code is 0x0104 (RAID) and if it's turned off, the class code is 0x0100 (SCSI).

Quoted 3 lines

Unfortunately, there currently is no provision in the aic79xx driver to ignore RAID controllers--if the PCI device/vendor IDs match, the driver takes the controller.

This is the correct behavior. Under Linux, the driver should export only the underlying hardware, and nothing more. This is how all the SATA controller drivers function, and this is how aic79xx functions.

Use a tool such as 'dmraid' for vendor-proprietary RAID solutions.

Your patch is therefore strongly NAK'd.

Jeff

#3 lore raw
In reply to Darrick J. Wong
Quoted 3 lines

Upon bootup, the aic79xx
driver will grab both controllers even though I'd prefer that Adaptec's a320raid driver grab the HostRAID controller.

where is the sourcecode for the a320raid driver?

afaik dmraid supports this format already, and if not I would urge you to help the dmraid project to support it instead..

#2 lore raw
In reply to Jeff Garzik

Jeff,

Good, this was the exact response that I was hoping for, as I've been told to convince Adaptec to drop the binary RAID drivers in favor of helping out dmraid development instead. That process will probably be difficult, but at least I now have incontrovertible proof that nobody will bend over backwards to support them and that dmraid is the way to go. Not that I'm terribly surprised by this.

I would, however, like to apologize for all this churlishness. Hopefully some day I won't have to deal with these binary modules altogether, and I won't have to resort to such methods to get vendors to Do the Right Thing(tm).

--D

(A pity that dmraid doesn't do hostraid right now, otherwise none of this would be necessary.)

Quoted 9 lines · Jeff Garzik

This is the correct behavior. Under Linux, the driver should export only the underlying hardware, and nothing more. This is how all the SATA controller drivers function, and this is how aic79xx functions.

Use a tool such as 'dmraid' for vendor-proprietary RAID solutions.

Your patch is therefore strongly NAK'd.

Jeff

#4 lore raw
In reply to Darrick J. Wong
Quoted 17 lines · Darrick J. Wong

Hi there,

I have an IBM x346 with some Adaptec 7902 SCSI controllers; one has HostRAID enabled in a RAID array, and the other does not. Upon bootup, the aic79xx driver will grab both controllers even though I'd prefer that Adaptec's a320raid driver grab the HostRAID controller. (When attached to the RAID array, the aic79xx driver presents each drive in the array as a separate SCSI device.) If HostRAID is turned on, the PCI class code is 0x0104 (RAID) and if it's turned off, the class code is 0x0100 (SCSI).

Unfortunately, there currently is no provision in the aic79xx driver to ignore RAID controllers--if the PCI device/vendor IDs match, the driver takes the controller. The attached patch modifies the PCI probe function to ignore RAID controllers and a module parameter "attach_HostRAID" to toggle this behavior. If one passes "attach_HostRAID=1" to insmod, the driver will take RAID controllers; "attach_HostRAID=0", it won't. The default is to set it to zero.

Quoted 4 lines

The patch should apply cleanly against 2.6.14 and I've verified that it works correctly on a x346 and a x226, both of which have a 7902b. I'd appreciate a few more eyes to look over it, and if there aren't any objections I'd like to submit this for inclusion in mainline.

NACK. We're not going to support attaching broken propritary drivers. Sepcially as these "HostRAID" cards are plain SCSI HBAs. If you care about botting from the bios softraid port the adaptec raid format support to dmraid.