PATCH: 64 bit support for dpt_i2o driver
I've been running supermicro hardware with the Adaptec 2005/2010/2015 zero channel raid controllers for a long while. The dpt_i2o driver in the kernel doesn't support 64-bit mode, yet I wanted to run a 64-bit system. The i2o_block driver wasn't 64-bit capable either. Mark Salyzyn from Adaptec kindly provided me with a 64-bit version of the dpt_i2o driver, unfortunately it never made its way to the upstream kernel.
In my experience, the dpt_i2o driver is rock-stable for the Adaptec ZCR hardware, while the i2o_block driver isn't. Because the dpt_i2o driver is still in the kernel and actively being used, I decided to merge the essential 64 bits parts of the alternative driver into the current kernel dpt_i2o driver.
# --------- dpt_i2o-64bit-2.6.25.patch ----------------
This patch is an update for drivers/scsi/dpt_i2o.c. It applies to both 2.6.24.4 and 2.6.25
It contains the following changes:
* 64 bit code based on unofficial Adaptec 64 bit driver
* removes scsi_module.c dependency, adds module_init / module_exit this is needed because we need to pass the proper device to scsi_add_host(), and the scsi_module.c passes NULL. With NULL, code like arch/x64/kernel/pci-gart_64.c::need_iommu() crashes because the dev pointer it is passed is NULL.
* adds sysfs entry for /sys/class/dpt_i2o/dptiX so that udev can create /dev/dptiX dynamically
Obviously there are more cleanups that can be done to this code, but we need to start somewhere. Patch has been tested heavily on both 32 and 64 bit x86 platforms.
drivers/scsi/Kconfig renamed from linux-2.6.25/drivers/scsi/Kconfig +1 -2
@@ -504,10 +504,9 @@ source "drivers/scsi/aic7xxx/Kconfig.aic79xx" source "drivers/scsi/aic94xx/Kconfig" -# All the I2O code and drivers do not seem to be 64bit safe. config SCSI_DPT_I2O tristate "Adaptec I2O RAID support " - depends on !64BIT && SCSI && PCI && VIRT_TO_BUS + depends on SCSI && PCI && VIRT_TO_BUS help This driver supports all of Adaptec's I2O based RAID controllers as well as the DPT SmartRaid V cards. This is an Adaptec maintained
drivers/scsi/dpt/dptsig.h renamed from linux-2.6.25/drivers/scsi/dpt/dptsig.h +2 -0
@@ -35,6 +35,8 @@typedef unsigned short sigWORD ;#if (defined(_MULTI_DATAMODEL) && defined(sun) && !defined(_ILP32))typedef uint32_t sigLONG ; +#elif defined(__linux__) +typedef u32 sigLONG ;#else typedef unsigned long sigLONG ;#endif
drivers/scsi/dpt/osd_util.h renamed from linux-2.6.25/drivers/scsi/dpt/osd_util.h +4 -0
@@ -185,7 +185,11 @@typedef unsigned char uCHAR ;typedef unsigned short uSHORT ;typedef unsigned int uINT ; +#if defined(__linux__) +typedef u32 uLONG ; +#else typedef unsigned long uLONG ; +#endif typedef union { uCHAR u8[4];
drivers/scsi/dpt_i2o.c renamed from linux-2.6.25/drivers/scsi/dpt_i2o.c +456 -109
1,063 lines not on this page · raw message
drivers/scsi/dpti.h renamed from linux-2.6.25/drivers/scsi/dpti.h +9 -2
@@ -229,14 +229,19 @@u32 post_fifo_size;u32 reply_fifo_size;u32 * reply_pool; +dma_addr_t reply_pool_pa;u32 sg_tablesize;// Scatter/Gather List Size. u8 top_scsi_channel;u8 top_scsi_id;u8 top_scsi_lun; +u8 dma64;i2o_status_block * status_block; +dma_addr_t status_block_pa;i2o_hrt * hrt; +dma_addr_t hrt_pa;i2o_lct * lct; +dma_addr_t lct_pa;uint lct_size;struct i2o_device * devices;struct adpt_channel channel[MAX_CHANNEL ];
@@ -249,6 +254,7 @@void __iomem *FwDebugBLEDflag_P;// Virtual Addr Of FW Debug BLED void __iomem *FwDebugBLEDvalue_P;// Virtual Addr Of FW Debug BLED u32 FwDebugFlags; +u32 *ioctl_reply_context[4 ]; } adpt_hba;struct sg_simple_element {
@@ -275,7 +281,8 @@static const char *adpt_i2o_get_class_name (int class);#endif static int adpt_i2o_issue_params (int cmd,adpt_hba * pHba,int tid, -void *opblk,int oplen,void *resblk,int reslen); +void *opblk,dma_addr_t opblk_pa,int oplen, +void *resblk,dma_addr_t resblk_pa,int reslen);static int adpt_i2o_post_wait (adpt_hba * pHba,u32 * msg,int len,int timeout);static int adpt_i2o_lct_get (adpt_hba * pHba);static int adpt_i2o_parse_lct (adpt_hba * pHba);
@@ -289,7 +296,7 @@static s32 adpt_i2o_hrt_get (adpt_hba * pHba);static s32 adpt_scsi_to_i2o (adpt_hba * pHba,struct scsi_cmnd * cmd,struct adpt_device * dptdevice);static s32 adpt_i2o_to_scsi (void __iomem *reply,struct scsi_cmnd * cmd); -static s32 adpt_scsi_register (adpt_hba * pHba,struct scsi_host_template * sht); +static s32 adpt_scsi_host_alloc (adpt_hba * pHba,struct scsi_host_template * sht);static s32 adpt_hba_reset (adpt_hba * pHba);static s32 adpt_i2o_reset_hba (adpt_hba * pHba);static s32 adpt_rescan (adpt_hba * pHba);
PATCH: 64 bit support for dpt_i2o driver (take 2)
This is an update for the patch I sent two days ago. It appears that on some hardware the debug registers are not mapped into the same range as the standard registers, so we need an extra ioremap() call for them.
Please consider this for 2.6.26.
# --
I've been running supermicro hardware with the Adaptec 2005/2010/2015 zero channel raid controllers for a long while. The dpt_i2o driver in the kernel doesn't support 64-bit mode, yet I wanted to run a 64-bit system. The i2o_block driver wasn't 64-bit capable either. Mark Salyzyn from Adaptec kindly provided me with a 64-bit version of the dpt_i2o driver, unfortunately it never made its way to the upstream kernel.
In my experience, the dpt_i2o driver is rock-stable for the Adaptec ZCR hardware, while the i2o_block driver isn't. Because the dpt_i2o driver is still in the kernel and actively being used, I decided to merge the essential 64 bits parts of the alternative driver into the current kernel dpt_i2o driver.
# --------- dpt_i2o-64bit-2.6.25.patch ----------------
This patch is an update for drivers/scsi/dpt_i2o.c. It applies to both 2.6.24.4 and 2.6.25
It contains the following changes:
* 64 bit code based on unofficial Adaptec 64 bit driver
* removes scsi_module.c dependency, adds module_init / module_exit this is needed because we need to pass the proper device to scsi_add_host(), and the scsi_module.c passes NULL. With NULL, code like arch/x64/kernel/pci-gart_64.c::need_iommu() crashes because the dev pointer it is passed is NULL.
* adds sysfs entry for /sys/class/dpt_i2o/dptiX so that udev can create /dev/dptiX dynamically
Obviously there are more cleanups that can be done to this code, but we need to start somewhere. Patch has been tested heavily on both 32 and 64 bit x86 platforms.
drivers/scsi/Kconfig renamed from linux-2.6.25/drivers/scsi/Kconfig +1 -2
@@ -504,10 +504,9 @@ source "drivers/scsi/aic7xxx/Kconfig.aic79xx" source "drivers/scsi/aic94xx/Kconfig" -# All the I2O code and drivers do not seem to be 64bit safe. config SCSI_DPT_I2O tristate "Adaptec I2O RAID support " - depends on !64BIT && SCSI && PCI && VIRT_TO_BUS + depends on SCSI && PCI && VIRT_TO_BUS help This driver supports all of Adaptec's I2O based RAID controllers as well as the DPT SmartRaid V cards. This is an Adaptec maintained
drivers/scsi/dpt/dptsig.h renamed from linux-2.6.25/drivers/scsi/dpt/dptsig.h +2 -0
@@ -35,6 +35,8 @@typedef unsigned short sigWORD ;#if (defined(_MULTI_DATAMODEL) && defined(sun) && !defined(_ILP32))typedef uint32_t sigLONG ; +#elif defined(__linux__) +typedef u32 sigLONG ;#else typedef unsigned long sigLONG ;#endif
drivers/scsi/dpt/osd_util.h renamed from linux-2.6.25/drivers/scsi/dpt/osd_util.h +4 -0
@@ -185,7 +185,11 @@typedef unsigned char uCHAR ;typedef unsigned short uSHORT ;typedef unsigned int uINT ; +#if defined(__linux__) +typedef u32 uLONG ; +#else typedef unsigned long uLONG ; +#endif typedef union { uCHAR u8[4];
drivers/scsi/dpt_i2o.c renamed from linux-2.6.25/drivers/scsi/dpt_i2o.c +471 -116
1,091 lines not on this page · raw message
drivers/scsi/dpti.h renamed from linux-2.6.25/drivers/scsi/dpti.h +9 -2
@@ -229,14 +229,19 @@u32 post_fifo_size;u32 reply_fifo_size;u32 * reply_pool; +dma_addr_t reply_pool_pa;u32 sg_tablesize;// Scatter/Gather List Size. u8 top_scsi_channel;u8 top_scsi_id;u8 top_scsi_lun; +u8 dma64;i2o_status_block * status_block; +dma_addr_t status_block_pa;i2o_hrt * hrt; +dma_addr_t hrt_pa;i2o_lct * lct; +dma_addr_t lct_pa;uint lct_size;struct i2o_device * devices;struct adpt_channel channel[MAX_CHANNEL ];
@@ -249,6 +254,7 @@void __iomem *FwDebugBLEDflag_P;// Virtual Addr Of FW Debug BLED void __iomem *FwDebugBLEDvalue_P;// Virtual Addr Of FW Debug BLED u32 FwDebugFlags; +u32 *ioctl_reply_context[4 ]; } adpt_hba;struct sg_simple_element {
@@ -275,7 +281,8 @@static const char *adpt_i2o_get_class_name (int class);#endif static int adpt_i2o_issue_params (int cmd,adpt_hba * pHba,int tid, -void *opblk,int oplen,void *resblk,int reslen); +void *opblk,dma_addr_t opblk_pa,int oplen, +void *resblk,dma_addr_t resblk_pa,int reslen);static int adpt_i2o_post_wait (adpt_hba * pHba,u32 * msg,int len,int timeout);static int adpt_i2o_lct_get (adpt_hba * pHba);static int adpt_i2o_parse_lct (adpt_hba * pHba);
@@ -289,7 +296,7 @@static s32 adpt_i2o_hrt_get (adpt_hba * pHba);static s32 adpt_scsi_to_i2o (adpt_hba * pHba,struct scsi_cmnd * cmd,struct adpt_device * dptdevice);static s32 adpt_i2o_to_scsi (void __iomem *reply,struct scsi_cmnd * cmd); -static s32 adpt_scsi_register (adpt_hba * pHba,struct scsi_host_template * sht); +static s32 adpt_scsi_host_alloc (adpt_hba * pHba,struct scsi_host_template * sht);static s32 adpt_hba_reset (adpt_hba * pHba);static s32 adpt_i2o_reset_hba (adpt_hba * pHba);static s32 adpt_rescan (adpt_hba * pHba);
Quoted 30 lines · Miquel van Smoorenburg
I've been running supermicro hardware with the Adaptec 2005/2010/2015 zero channel raid controllers for a long while. The
dpt_i2odriver in the kernel doesn't support 64-bit mode, yet I wanted to run a 64-bit system. Thei2o_blockdriver wasn't 64-bit capable either. Mark Salyzyn from Adaptec kindly provided me with a 64-bit version of thedpt_i2odriver, unfortunately it never made its way to the upstream kernel.In my experience, the
dpt_i2odriver is rock-stable for the Adaptec ZCR hardware, while thei2o_blockdriver isn't. Because thedpt_i2odriver is still in the kernel and actively being used, I decided to merge the essential 64 bits parts of the alternative driver into the current kerneldpt_i2odriver.# --------- dpt_i2o-64bit-2.6.25.patch ----------------
This patch is an update for
drivers/scsi/dpt_i2o.c. It applies to both 2.6.24.4 and 2.6.25It contains the following changes:
* 64 bit code based on unofficial Adaptec 64 bit driver
* removesscsi_module.cdependency, addsmodule_init/module_exitthis is needed because we need to pass the proper device toscsi_add_host(), and thescsi_module.cpasses NULL. With NULL, code like arch/x64/kernel/pci-gart_64.c::need_iommu() crashes because the dev pointer it is passed is NULL.
* adds sysfs entry for/sys/class/dpt_i2o/dptiXso that udev can create/dev/dptiXdynamically
Quoted 3 lines
Obviously there are more cleanups that can be done to this code, but we need to start somewhere. Patch has been tested heavily on both 32 and 64 bit x86 platforms.
Is there any chance that you could split this into (at least) 2 patches, one for the 64 bit stuff and one for the driver model stuff? This patch is huge, the review (and the chances for this getting merged) will be higher if it is in small pieces.
Greetings,
Eike