diff options
author | nagalakshmi.nandigama@lsi.com <nagalakshmi.nandigama@lsi.com> | 2011-10-19 06:07:37 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-10-30 04:55:23 -0400 |
commit | 6faace2a0e418b45728bcea6d3626922cf16b14b (patch) | |
tree | f34acdf94a9ab5d540c43305a116cc064579cc20 /drivers/scsi | |
parent | 918134efe9893629407af04adf242ee3095bea4a (diff) |
[SCSI] mpt2sas: Fix for issue Port Reset taking long time(around 5 mins) to complete while issued during creating a volume
This is due to the slave_configuration routine is getting called when
host reset is active, and config page reads are failing, and driver
attempts to added device with stale config data.
To fix the issue, added error checking in slave_configure to check
for configuration pages failing, and return "1" so the device is
not configured. The config pages are failing if raid volume is
configured while issuing a host reset, thus driver is reading stale
data and proceeding to attempt to add. The fix is to return error
so the volume is not configured.
Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_scsih.c | 62 |
1 files changed, 45 insertions, 17 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index 1f289882a298..a8cb57723ff4 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | |||
@@ -1621,8 +1621,10 @@ _scsih_set_level(struct scsi_device *sdev, struct _raid_device *raid_device) | |||
1621 | * _scsih_get_volume_capabilities - volume capabilities | 1621 | * _scsih_get_volume_capabilities - volume capabilities |
1622 | * @ioc: per adapter object | 1622 | * @ioc: per adapter object |
1623 | * @sas_device: the raid_device object | 1623 | * @sas_device: the raid_device object |
1624 | * | ||
1625 | * Returns 0 for success, else 1 | ||
1624 | */ | 1626 | */ |
1625 | static void | 1627 | static int |
1626 | _scsih_get_volume_capabilities(struct MPT2SAS_ADAPTER *ioc, | 1628 | _scsih_get_volume_capabilities(struct MPT2SAS_ADAPTER *ioc, |
1627 | struct _raid_device *raid_device) | 1629 | struct _raid_device *raid_device) |
1628 | { | 1630 | { |
@@ -1635,9 +1637,10 @@ _scsih_get_volume_capabilities(struct MPT2SAS_ADAPTER *ioc, | |||
1635 | 1637 | ||
1636 | if ((mpt2sas_config_get_number_pds(ioc, raid_device->handle, | 1638 | if ((mpt2sas_config_get_number_pds(ioc, raid_device->handle, |
1637 | &num_pds)) || !num_pds) { | 1639 | &num_pds)) || !num_pds) { |
1638 | printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", | 1640 | dfailprintk(ioc, printk(MPT2SAS_WARN_FMT |
1639 | ioc->name, __FILE__, __LINE__, __func__); | 1641 | "failure at %s:%d/%s()!\n", ioc->name, __FILE__, __LINE__, |
1640 | return; | 1642 | __func__)); |
1643 | return 1; | ||
1641 | } | 1644 | } |
1642 | 1645 | ||
1643 | raid_device->num_pds = num_pds; | 1646 | raid_device->num_pds = num_pds; |
@@ -1645,17 +1648,19 @@ _scsih_get_volume_capabilities(struct MPT2SAS_ADAPTER *ioc, | |||
1645 | sizeof(Mpi2RaidVol0PhysDisk_t)); | 1648 | sizeof(Mpi2RaidVol0PhysDisk_t)); |
1646 | vol_pg0 = kzalloc(sz, GFP_KERNEL); | 1649 | vol_pg0 = kzalloc(sz, GFP_KERNEL); |
1647 | if (!vol_pg0) { | 1650 | if (!vol_pg0) { |
1648 | printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", | 1651 | dfailprintk(ioc, printk(MPT2SAS_WARN_FMT |
1649 | ioc->name, __FILE__, __LINE__, __func__); | 1652 | "failure at %s:%d/%s()!\n", ioc->name, __FILE__, __LINE__, |
1650 | return; | 1653 | __func__)); |
1654 | return 1; | ||
1651 | } | 1655 | } |
1652 | 1656 | ||
1653 | if ((mpt2sas_config_get_raid_volume_pg0(ioc, &mpi_reply, vol_pg0, | 1657 | if ((mpt2sas_config_get_raid_volume_pg0(ioc, &mpi_reply, vol_pg0, |
1654 | MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, raid_device->handle, sz))) { | 1658 | MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, raid_device->handle, sz))) { |
1655 | printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", | 1659 | dfailprintk(ioc, printk(MPT2SAS_WARN_FMT |
1656 | ioc->name, __FILE__, __LINE__, __func__); | 1660 | "failure at %s:%d/%s()!\n", ioc->name, __FILE__, __LINE__, |
1661 | __func__)); | ||
1657 | kfree(vol_pg0); | 1662 | kfree(vol_pg0); |
1658 | return; | 1663 | return 1; |
1659 | } | 1664 | } |
1660 | 1665 | ||
1661 | raid_device->volume_type = vol_pg0->VolumeType; | 1666 | raid_device->volume_type = vol_pg0->VolumeType; |
@@ -1675,6 +1680,7 @@ _scsih_get_volume_capabilities(struct MPT2SAS_ADAPTER *ioc, | |||
1675 | } | 1680 | } |
1676 | 1681 | ||
1677 | kfree(vol_pg0); | 1682 | kfree(vol_pg0); |
1683 | return 0; | ||
1678 | } | 1684 | } |
1679 | /** | 1685 | /** |
1680 | * _scsih_disable_ddio - Disable direct I/O for all the volumes | 1686 | * _scsih_disable_ddio - Disable direct I/O for all the volumes |
@@ -1945,13 +1951,20 @@ _scsih_slave_configure(struct scsi_device *sdev) | |||
1945 | sas_target_priv_data->handle); | 1951 | sas_target_priv_data->handle); |
1946 | spin_unlock_irqrestore(&ioc->raid_device_lock, flags); | 1952 | spin_unlock_irqrestore(&ioc->raid_device_lock, flags); |
1947 | if (!raid_device) { | 1953 | if (!raid_device) { |
1948 | printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", | 1954 | dfailprintk(ioc, printk(MPT2SAS_WARN_FMT |
1949 | ioc->name, __FILE__, __LINE__, __func__); | 1955 | "failure at %s:%d/%s()!\n", ioc->name, __FILE__, |
1950 | return 0; | 1956 | __LINE__, __func__)); |
1957 | return 1; | ||
1951 | } | 1958 | } |
1952 | 1959 | ||
1953 | _scsih_get_volume_capabilities(ioc, raid_device); | 1960 | _scsih_get_volume_capabilities(ioc, raid_device); |
1954 | 1961 | ||
1962 | if (_scsih_get_volume_capabilities(ioc, raid_device)) { | ||
1963 | dfailprintk(ioc, printk(MPT2SAS_WARN_FMT | ||
1964 | "failure at %s:%d/%s()!\n", ioc->name, __FILE__, | ||
1965 | __LINE__, __func__)); | ||
1966 | return 1; | ||
1967 | } | ||
1955 | /* | 1968 | /* |
1956 | * WARPDRIVE: Initialize the required data for Direct IO | 1969 | * WARPDRIVE: Initialize the required data for Direct IO |
1957 | */ | 1970 | */ |
@@ -2025,11 +2038,21 @@ _scsih_slave_configure(struct scsi_device *sdev) | |||
2025 | if (sas_device) { | 2038 | if (sas_device) { |
2026 | if (sas_target_priv_data->flags & | 2039 | if (sas_target_priv_data->flags & |
2027 | MPT_TARGET_FLAGS_RAID_COMPONENT) { | 2040 | MPT_TARGET_FLAGS_RAID_COMPONENT) { |
2028 | mpt2sas_config_get_volume_handle(ioc, | 2041 | if (mpt2sas_config_get_volume_handle(ioc, |
2029 | sas_device->handle, &sas_device->volume_handle); | 2042 | sas_device->handle, &sas_device->volume_handle)) { |
2030 | mpt2sas_config_get_volume_wwid(ioc, | 2043 | dfailprintk(ioc, printk(MPT2SAS_WARN_FMT |
2044 | "failure at %s:%d/%s()!\n", ioc->name, | ||
2045 | __FILE__, __LINE__, __func__)); | ||
2046 | return 1; | ||
2047 | } | ||
2048 | if (mpt2sas_config_get_volume_wwid(ioc, | ||
2031 | sas_device->volume_handle, | 2049 | sas_device->volume_handle, |
2032 | &sas_device->volume_wwid); | 2050 | &sas_device->volume_wwid)) { |
2051 | dfailprintk(ioc, printk(MPT2SAS_WARN_FMT | ||
2052 | "failure at %s:%d/%s()!\n", ioc->name, | ||
2053 | __FILE__, __LINE__, __func__)); | ||
2054 | return 1; | ||
2055 | } | ||
2033 | } | 2056 | } |
2034 | if (sas_device->device_info & MPI2_SAS_DEVICE_INFO_SSP_TARGET) { | 2057 | if (sas_device->device_info & MPI2_SAS_DEVICE_INFO_SSP_TARGET) { |
2035 | qdepth = MPT2SAS_SAS_QUEUE_DEPTH; | 2058 | qdepth = MPT2SAS_SAS_QUEUE_DEPTH; |
@@ -2058,6 +2081,11 @@ _scsih_slave_configure(struct scsi_device *sdev) | |||
2058 | 2081 | ||
2059 | if (!ssp_target) | 2082 | if (!ssp_target) |
2060 | _scsih_display_sata_capabilities(ioc, sas_device, sdev); | 2083 | _scsih_display_sata_capabilities(ioc, sas_device, sdev); |
2084 | } else { | ||
2085 | dfailprintk(ioc, printk(MPT2SAS_WARN_FMT | ||
2086 | "failure at %s:%d/%s()!\n", ioc->name, __FILE__, __LINE__, | ||
2087 | __func__)); | ||
2088 | return 1; | ||
2061 | } | 2089 | } |
2062 | 2090 | ||
2063 | _scsih_change_queue_depth(sdev, qdepth, SCSI_QDEPTH_DEFAULT); | 2091 | _scsih_change_queue_depth(sdev, qdepth, SCSI_QDEPTH_DEFAULT); |