aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptbase.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2006-03-01 10:02:49 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-03-01 10:44:04 -0500
commitc92f222e1f14588171e63b550ca8c85fa9130061 (patch)
tree83db58755951518865324ac880fc321e516755b9 /drivers/message/fusion/mptbase.c
parent3ef0b47ee498ea183bffd9b3b4a1eef757fef4ba (diff)
[SCSI] mptspi: Add transport class Domain Validation
This is the first half of a patch to add the generic domain validation to mptspi. It also creates a secondary "virtual" channel for raid component devices since these are now exported with no_uld_attach. What Eric and I would have really liked is to export all physical components on channel 0 and all raid components on channel 1. Unfortunately, this would result in device renumbering on platforms with mixed RAID/Physical devices which was considered unacceptable for userland stability reasons. Still to be done is to plug back the extra parameter setting and DV pieces on reset and hotplug. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r--drivers/message/fusion/mptbase.c72
1 files changed, 2 insertions, 70 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 642a61b6d0a4..f2721ea30aa7 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1120,65 +1120,6 @@ mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp)
1120 return -1; 1120 return -1;
1121} 1121}
1122 1122
1123int
1124mpt_alt_ioc_wait(MPT_ADAPTER *ioc)
1125{
1126 int loop_count = 30 * 4; /* Wait 30 seconds */
1127 int status = -1; /* -1 means failed to get board READY */
1128
1129 do {
1130 spin_lock(&ioc->initializing_hba_lock);
1131 if (ioc->initializing_hba_lock_flag == 0) {
1132 ioc->initializing_hba_lock_flag=1;
1133 spin_unlock(&ioc->initializing_hba_lock);
1134 status = 0;
1135 break;
1136 }
1137 spin_unlock(&ioc->initializing_hba_lock);
1138 set_current_state(TASK_INTERRUPTIBLE);
1139 schedule_timeout(HZ/4);
1140 } while (--loop_count);
1141
1142 return status;
1143}
1144
1145/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1146/*
1147 * mpt_bringup_adapter - This is a wrapper function for mpt_do_ioc_recovery
1148 * @ioc: Pointer to MPT adapter structure
1149 * @sleepFlag: Use schedule if CAN_SLEEP else use udelay.
1150 *
1151 * This routine performs all the steps necessary to bring the IOC
1152 * to a OPERATIONAL state.
1153 *
1154 * Special Note: This function was added with spin lock's so as to allow
1155 * the dv(domain validation) work thread to succeed on the other channel
1156 * that maybe occuring at the same time when this function is called.
1157 * Without this lock, the dv would fail when message frames were
1158 * requested during hba bringup on the alternate ioc.
1159 */
1160static int
1161mpt_bringup_adapter(MPT_ADAPTER *ioc, int sleepFlag)
1162{
1163 int r;
1164
1165 if(ioc->alt_ioc) {
1166 if((r=mpt_alt_ioc_wait(ioc->alt_ioc)!=0))
1167 return r;
1168 }
1169
1170 r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP,
1171 CAN_SLEEP);
1172
1173 if(ioc->alt_ioc) {
1174 spin_lock(&ioc->alt_ioc->initializing_hba_lock);
1175 ioc->alt_ioc->initializing_hba_lock_flag=0;
1176 spin_unlock(&ioc->alt_ioc->initializing_hba_lock);
1177 }
1178
1179return r;
1180}
1181
1182/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1123/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1183/* 1124/*
1184 * mpt_attach - Install a PCI intelligent MPT adapter. 1125 * mpt_attach - Install a PCI intelligent MPT adapter.
@@ -1482,7 +1423,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1482 */ 1423 */
1483 mpt_detect_bound_ports(ioc, pdev); 1424 mpt_detect_bound_ports(ioc, pdev);
1484 1425
1485 if ((r = mpt_bringup_adapter(ioc, CAN_SLEEP)) != 0){ 1426 if ((r = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_BRINGUP,
1427 CAN_SLEEP)) != 0){
1486 printk(KERN_WARNING MYNAM 1428 printk(KERN_WARNING MYNAM
1487 ": WARNING - %s did not initialize properly! (%d)\n", 1429 ": WARNING - %s did not initialize properly! (%d)\n",
1488 ioc->name, r); 1430 ioc->name, r);
@@ -1629,7 +1571,6 @@ mpt_resume(struct pci_dev *pdev)
1629 MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 1571 MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
1630 u32 device_state = pdev->current_state; 1572 u32 device_state = pdev->current_state;
1631 int recovery_state; 1573 int recovery_state;
1632 int ii;
1633 1574
1634 printk(MYIOC_s_INFO_FMT 1575 printk(MYIOC_s_INFO_FMT
1635 "pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n", 1576 "pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n",
@@ -1643,14 +1584,6 @@ mpt_resume(struct pci_dev *pdev)
1643 CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM); 1584 CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM);
1644 ioc->active = 1; 1585 ioc->active = 1;
1645 1586
1646 /* F/W not running */
1647 if(!CHIPREG_READ32(&ioc->chip->Doorbell)) {
1648 /* enable domain validation flags */
1649 for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) {
1650 ioc->spi_data.dvStatus[ii] |= MPT_SCSICFG_NEED_DV;
1651 }
1652 }
1653
1654 printk(MYIOC_s_INFO_FMT 1587 printk(MYIOC_s_INFO_FMT
1655 "pci-resume: ioc-state=0x%x,doorbell=0x%x\n", 1588 "pci-resume: ioc-state=0x%x,doorbell=0x%x\n",
1656 ioc->name, 1589 ioc->name,
@@ -6435,7 +6368,6 @@ EXPORT_SYMBOL(mpt_read_ioc_pg_3);
6435EXPORT_SYMBOL(mpt_alloc_fw_memory); 6368EXPORT_SYMBOL(mpt_alloc_fw_memory);
6436EXPORT_SYMBOL(mpt_free_fw_memory); 6369EXPORT_SYMBOL(mpt_free_fw_memory);
6437EXPORT_SYMBOL(mptbase_sas_persist_operation); 6370EXPORT_SYMBOL(mptbase_sas_persist_operation);
6438EXPORT_SYMBOL(mpt_alt_ioc_wait);
6439EXPORT_SYMBOL(mptbase_GetFcPortPage0); 6371EXPORT_SYMBOL(mptbase_GetFcPortPage0);
6440 6372
6441 6373