aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/aachba.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/aacraid/aachba.c')
-rw-r--r--drivers/scsi/aacraid/aachba.c60
1 files changed, 45 insertions, 15 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 83b5c7d085f2..ac108f9e2674 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -169,13 +169,17 @@ MODULE_PARM_DESC(numacb, "Request a limit to the number of adapter control block
169int acbsize = -1; 169int acbsize = -1;
170module_param(acbsize, int, S_IRUGO|S_IWUSR); 170module_param(acbsize, int, S_IRUGO|S_IWUSR);
171MODULE_PARM_DESC(acbsize, "Request a specific adapter control block (FIB) size. Valid values are 512, 2048, 4096 and 8192. Default is to use suggestion from Firmware."); 171MODULE_PARM_DESC(acbsize, "Request a specific adapter control block (FIB) size. Valid values are 512, 2048, 4096 and 8192. Default is to use suggestion from Firmware.");
172
173int expose_physicals = 0;
174module_param(expose_physicals, int, S_IRUGO|S_IWUSR);
175MODULE_PARM_DESC(expose_physicals, "Expose physical components of the arrays. 0=off, 1=on");
172/** 176/**
173 * aac_get_config_status - check the adapter configuration 177 * aac_get_config_status - check the adapter configuration
174 * @common: adapter to query 178 * @common: adapter to query
175 * 179 *
176 * Query config status, and commit the configuration if needed. 180 * Query config status, and commit the configuration if needed.
177 */ 181 */
178int aac_get_config_status(struct aac_dev *dev) 182int aac_get_config_status(struct aac_dev *dev, int commit_flag)
179{ 183{
180 int status = 0; 184 int status = 0;
181 struct fib * fibptr; 185 struct fib * fibptr;
@@ -219,7 +223,7 @@ int aac_get_config_status(struct aac_dev *dev)
219 aac_fib_complete(fibptr); 223 aac_fib_complete(fibptr);
220 /* Send a CT_COMMIT_CONFIG to enable discovery of devices */ 224 /* Send a CT_COMMIT_CONFIG to enable discovery of devices */
221 if (status >= 0) { 225 if (status >= 0) {
222 if (commit == 1) { 226 if ((commit == 1) || commit_flag) {
223 struct aac_commit_config * dinfo; 227 struct aac_commit_config * dinfo;
224 aac_fib_init(fibptr); 228 aac_fib_init(fibptr);
225 dinfo = (struct aac_commit_config *) fib_data(fibptr); 229 dinfo = (struct aac_commit_config *) fib_data(fibptr);
@@ -489,6 +493,8 @@ int aac_probe_container(struct aac_dev *dev, int cid)
489 unsigned instance; 493 unsigned instance;
490 494
491 fsa_dev_ptr = dev->fsa_dev; 495 fsa_dev_ptr = dev->fsa_dev;
496 if (!fsa_dev_ptr)
497 return -ENOMEM;
492 instance = dev->scsi_host_ptr->unique_id; 498 instance = dev->scsi_host_ptr->unique_id;
493 499
494 if (!(fibptr = aac_fib_alloc(dev))) 500 if (!(fibptr = aac_fib_alloc(dev)))
@@ -782,8 +788,9 @@ int aac_get_adapter_info(struct aac_dev* dev)
782 dev->maximum_num_channels = le32_to_cpu(bus_info->BusCount); 788 dev->maximum_num_channels = le32_to_cpu(bus_info->BusCount);
783 } 789 }
784 790
785 tmp = le32_to_cpu(dev->adapter_info.kernelrev); 791 if (!dev->in_reset) {
786 printk(KERN_INFO "%s%d: kernel %d.%d-%d[%d] %.*s\n", 792 tmp = le32_to_cpu(dev->adapter_info.kernelrev);
793 printk(KERN_INFO "%s%d: kernel %d.%d-%d[%d] %.*s\n",
787 dev->name, 794 dev->name,
788 dev->id, 795 dev->id,
789 tmp>>24, 796 tmp>>24,
@@ -792,20 +799,21 @@ int aac_get_adapter_info(struct aac_dev* dev)
792 le32_to_cpu(dev->adapter_info.kernelbuild), 799 le32_to_cpu(dev->adapter_info.kernelbuild),
793 (int)sizeof(dev->supplement_adapter_info.BuildDate), 800 (int)sizeof(dev->supplement_adapter_info.BuildDate),
794 dev->supplement_adapter_info.BuildDate); 801 dev->supplement_adapter_info.BuildDate);
795 tmp = le32_to_cpu(dev->adapter_info.monitorrev); 802 tmp = le32_to_cpu(dev->adapter_info.monitorrev);
796 printk(KERN_INFO "%s%d: monitor %d.%d-%d[%d]\n", 803 printk(KERN_INFO "%s%d: monitor %d.%d-%d[%d]\n",
797 dev->name, dev->id, 804 dev->name, dev->id,
798 tmp>>24,(tmp>>16)&0xff,tmp&0xff, 805 tmp>>24,(tmp>>16)&0xff,tmp&0xff,
799 le32_to_cpu(dev->adapter_info.monitorbuild)); 806 le32_to_cpu(dev->adapter_info.monitorbuild));
800 tmp = le32_to_cpu(dev->adapter_info.biosrev); 807 tmp = le32_to_cpu(dev->adapter_info.biosrev);
801 printk(KERN_INFO "%s%d: bios %d.%d-%d[%d]\n", 808 printk(KERN_INFO "%s%d: bios %d.%d-%d[%d]\n",
802 dev->name, dev->id, 809 dev->name, dev->id,
803 tmp>>24,(tmp>>16)&0xff,tmp&0xff, 810 tmp>>24,(tmp>>16)&0xff,tmp&0xff,
804 le32_to_cpu(dev->adapter_info.biosbuild)); 811 le32_to_cpu(dev->adapter_info.biosbuild));
805 if (le32_to_cpu(dev->adapter_info.serial[0]) != 0xBAD0) 812 if (le32_to_cpu(dev->adapter_info.serial[0]) != 0xBAD0)
806 printk(KERN_INFO "%s%d: serial %x\n", 813 printk(KERN_INFO "%s%d: serial %x\n",
807 dev->name, dev->id, 814 dev->name, dev->id,
808 le32_to_cpu(dev->adapter_info.serial[0])); 815 le32_to_cpu(dev->adapter_info.serial[0]));
816 }
809 817
810 dev->nondasd_support = 0; 818 dev->nondasd_support = 0;
811 dev->raid_scsi_mode = 0; 819 dev->raid_scsi_mode = 0;
@@ -1392,6 +1400,7 @@ static int aac_synchronize(struct scsi_cmnd *scsicmd, int cid)
1392 struct scsi_cmnd *cmd; 1400 struct scsi_cmnd *cmd;
1393 struct scsi_device *sdev = scsicmd->device; 1401 struct scsi_device *sdev = scsicmd->device;
1394 int active = 0; 1402 int active = 0;
1403 struct aac_dev *aac;
1395 unsigned long flags; 1404 unsigned long flags;
1396 1405
1397 /* 1406 /*
@@ -1413,11 +1422,14 @@ static int aac_synchronize(struct scsi_cmnd *scsicmd, int cid)
1413 if (active) 1422 if (active)
1414 return SCSI_MLQUEUE_DEVICE_BUSY; 1423 return SCSI_MLQUEUE_DEVICE_BUSY;
1415 1424
1425 aac = (struct aac_dev *)scsicmd->device->host->hostdata;
1426 if (aac->in_reset)
1427 return SCSI_MLQUEUE_HOST_BUSY;
1428
1416 /* 1429 /*
1417 * Allocate and initialize a Fib 1430 * Allocate and initialize a Fib
1418 */ 1431 */
1419 if (!(cmd_fibcontext = 1432 if (!(cmd_fibcontext = aac_fib_alloc(aac)))
1420 aac_fib_alloc((struct aac_dev *)scsicmd->device->host->hostdata)))
1421 return SCSI_MLQUEUE_HOST_BUSY; 1433 return SCSI_MLQUEUE_HOST_BUSY;
1422 1434
1423 aac_fib_init(cmd_fibcontext); 1435 aac_fib_init(cmd_fibcontext);
@@ -1470,6 +1482,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1470 struct aac_dev *dev = (struct aac_dev *)host->hostdata; 1482 struct aac_dev *dev = (struct aac_dev *)host->hostdata;
1471 struct fsa_dev_info *fsa_dev_ptr = dev->fsa_dev; 1483 struct fsa_dev_info *fsa_dev_ptr = dev->fsa_dev;
1472 1484
1485 if (fsa_dev_ptr == NULL)
1486 return -1;
1473 /* 1487 /*
1474 * If the bus, id or lun is out of range, return fail 1488 * If the bus, id or lun is out of range, return fail
1475 * Test does not apply to ID 16, the pseudo id for the controller 1489 * Test does not apply to ID 16, the pseudo id for the controller
@@ -1499,6 +1513,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1499 case INQUIRY: 1513 case INQUIRY:
1500 case READ_CAPACITY: 1514 case READ_CAPACITY:
1501 case TEST_UNIT_READY: 1515 case TEST_UNIT_READY:
1516 if (dev->in_reset)
1517 return -1;
1502 spin_unlock_irq(host->host_lock); 1518 spin_unlock_irq(host->host_lock);
1503 aac_probe_container(dev, cid); 1519 aac_probe_container(dev, cid);
1504 if ((fsa_dev_ptr[cid].valid & 1) == 0) 1520 if ((fsa_dev_ptr[cid].valid & 1) == 0)
@@ -1523,7 +1539,9 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1523 return 0; 1539 return 0;
1524 } 1540 }
1525 } else { /* check for physical non-dasd devices */ 1541 } else { /* check for physical non-dasd devices */
1526 if(dev->nondasd_support == 1){ 1542 if ((dev->nondasd_support == 1) || expose_physicals) {
1543 if (dev->in_reset)
1544 return -1;
1527 return aac_send_srb_fib(scsicmd); 1545 return aac_send_srb_fib(scsicmd);
1528 } else { 1546 } else {
1529 scsicmd->result = DID_NO_CONNECT << 16; 1547 scsicmd->result = DID_NO_CONNECT << 16;
@@ -1579,6 +1597,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1579 scsicmd->scsi_done(scsicmd); 1597 scsicmd->scsi_done(scsicmd);
1580 return 0; 1598 return 0;
1581 } 1599 }
1600 if (dev->in_reset)
1601 return -1;
1582 setinqstr(dev, (void *) (inq_data.inqd_vid), fsa_dev_ptr[cid].type); 1602 setinqstr(dev, (void *) (inq_data.inqd_vid), fsa_dev_ptr[cid].type);
1583 inq_data.inqd_pdt = INQD_PDT_DA; /* Direct/random access device */ 1603 inq_data.inqd_pdt = INQD_PDT_DA; /* Direct/random access device */
1584 aac_internal_transfer(scsicmd, &inq_data, 0, sizeof(inq_data)); 1604 aac_internal_transfer(scsicmd, &inq_data, 0, sizeof(inq_data));
@@ -1734,6 +1754,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1734 case READ_10: 1754 case READ_10:
1735 case READ_12: 1755 case READ_12:
1736 case READ_16: 1756 case READ_16:
1757 if (dev->in_reset)
1758 return -1;
1737 /* 1759 /*
1738 * Hack to keep track of ordinal number of the device that 1760 * Hack to keep track of ordinal number of the device that
1739 * corresponds to a container. Needed to convert 1761 * corresponds to a container. Needed to convert
@@ -1752,6 +1774,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1752 case WRITE_10: 1774 case WRITE_10:
1753 case WRITE_12: 1775 case WRITE_12:
1754 case WRITE_16: 1776 case WRITE_16:
1777 if (dev->in_reset)
1778 return -1;
1755 return aac_write(scsicmd, cid); 1779 return aac_write(scsicmd, cid);
1756 1780
1757 case SYNCHRONIZE_CACHE: 1781 case SYNCHRONIZE_CACHE:
@@ -1782,6 +1806,8 @@ static int query_disk(struct aac_dev *dev, void __user *arg)
1782 struct fsa_dev_info *fsa_dev_ptr; 1806 struct fsa_dev_info *fsa_dev_ptr;
1783 1807
1784 fsa_dev_ptr = dev->fsa_dev; 1808 fsa_dev_ptr = dev->fsa_dev;
1809 if (!fsa_dev_ptr)
1810 return -EBUSY;
1785 if (copy_from_user(&qd, arg, sizeof (struct aac_query_disk))) 1811 if (copy_from_user(&qd, arg, sizeof (struct aac_query_disk)))
1786 return -EFAULT; 1812 return -EFAULT;
1787 if (qd.cnum == -1) 1813 if (qd.cnum == -1)
@@ -1820,6 +1846,8 @@ static int force_delete_disk(struct aac_dev *dev, void __user *arg)
1820 struct fsa_dev_info *fsa_dev_ptr; 1846 struct fsa_dev_info *fsa_dev_ptr;
1821 1847
1822 fsa_dev_ptr = dev->fsa_dev; 1848 fsa_dev_ptr = dev->fsa_dev;
1849 if (!fsa_dev_ptr)
1850 return -EBUSY;
1823 1851
1824 if (copy_from_user(&dd, arg, sizeof (struct aac_delete_disk))) 1852 if (copy_from_user(&dd, arg, sizeof (struct aac_delete_disk)))
1825 return -EFAULT; 1853 return -EFAULT;
@@ -1843,6 +1871,8 @@ static int delete_disk(struct aac_dev *dev, void __user *arg)
1843 struct fsa_dev_info *fsa_dev_ptr; 1871 struct fsa_dev_info *fsa_dev_ptr;
1844 1872
1845 fsa_dev_ptr = dev->fsa_dev; 1873 fsa_dev_ptr = dev->fsa_dev;
1874 if (!fsa_dev_ptr)
1875 return -EBUSY;
1846 1876
1847 if (copy_from_user(&dd, arg, sizeof (struct aac_delete_disk))) 1877 if (copy_from_user(&dd, arg, sizeof (struct aac_delete_disk)))
1848 return -EFAULT; 1878 return -EFAULT;