aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas/mpt2sas_scsih.c
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2009-09-23 08:06:52 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-10-29 13:03:16 -0400
commite7d59c17a70e59a052d29467bbefb23ce700dcd4 (patch)
tree11b4ef49035d38dfb3acaa0ec6905e56961de028 /drivers/scsi/mpt2sas/mpt2sas_scsih.c
parent744090d38b47ed8ead8f68b6f0c65866c0b9b17a (diff)
[SCSI] mpt2sas: No link rate change, do not call update links nor unblock device
(1) target resets are sending link change rate events with no link rate change -> thus said the driver was modified so when there is no link rate change, we don't need to call mpt2sas_transport_update_links nor _scsih_ublock_io_device. (2) There were changes made in _scsih_sas_topology_change_event_debug to change the debug strings so they are more clear. Also the link rate change information was added to display the new and previous link rate. for the MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST event when the ExpStatus is set to zero, display "responding" instead of "unknown status". Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: Eric Moore <Eric.moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_scsih.c')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c52
1 files changed, 27 insertions, 25 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 5916bddf3551..8dc682f00fd2 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -2380,7 +2380,6 @@ _scsih_block_io_to_children_attached_directly(struct MPT2SAS_ADAPTER *ioc,
2380 u16 handle; 2380 u16 handle;
2381 u16 reason_code; 2381 u16 reason_code;
2382 u8 phy_number; 2382 u8 phy_number;
2383 u8 link_rate;
2384 2383
2385 for (i = 0; i < event_data->NumEntries; i++) { 2384 for (i = 0; i < event_data->NumEntries; i++) {
2386 handle = le16_to_cpu(event_data->PHY[i].AttachedDevHandle); 2385 handle = le16_to_cpu(event_data->PHY[i].AttachedDevHandle);
@@ -2391,11 +2390,6 @@ _scsih_block_io_to_children_attached_directly(struct MPT2SAS_ADAPTER *ioc,
2391 MPI2_EVENT_SAS_TOPO_RC_MASK; 2390 MPI2_EVENT_SAS_TOPO_RC_MASK;
2392 if (reason_code == MPI2_EVENT_SAS_TOPO_RC_DELAY_NOT_RESPONDING) 2391 if (reason_code == MPI2_EVENT_SAS_TOPO_RC_DELAY_NOT_RESPONDING)
2393 _scsih_block_io_device(ioc, handle); 2392 _scsih_block_io_device(ioc, handle);
2394 if (reason_code == MPI2_EVENT_SAS_TOPO_RC_PHY_CHANGED) {
2395 link_rate = event_data->PHY[i].LinkRate >> 4;
2396 if (link_rate >= MPI2_SAS_NEG_LINK_RATE_1_5)
2397 _scsih_ublock_io_device(ioc, handle);
2398 }
2399 } 2393 }
2400} 2394}
2401 2395
@@ -4084,7 +4078,7 @@ _scsih_sas_topology_change_event_debug(struct MPT2SAS_ADAPTER *ioc,
4084 u16 reason_code; 4078 u16 reason_code;
4085 u8 phy_number; 4079 u8 phy_number;
4086 char *status_str = NULL; 4080 char *status_str = NULL;
4087 char link_rate[25]; 4081 u8 link_rate, prev_link_rate;
4088 4082
4089 switch (event_data->ExpStatus) { 4083 switch (event_data->ExpStatus) {
4090 case MPI2_EVENT_SAS_TOPO_ES_ADDED: 4084 case MPI2_EVENT_SAS_TOPO_ES_ADDED:
@@ -4094,6 +4088,7 @@ _scsih_sas_topology_change_event_debug(struct MPT2SAS_ADAPTER *ioc,
4094 status_str = "remove"; 4088 status_str = "remove";
4095 break; 4089 break;
4096 case MPI2_EVENT_SAS_TOPO_ES_RESPONDING: 4090 case MPI2_EVENT_SAS_TOPO_ES_RESPONDING:
4091 case 0:
4097 status_str = "responding"; 4092 status_str = "responding";
4098 break; 4093 break;
4099 case MPI2_EVENT_SAS_TOPO_ES_DELAY_NOT_RESPONDING: 4094 case MPI2_EVENT_SAS_TOPO_ES_DELAY_NOT_RESPONDING:
@@ -4119,30 +4114,30 @@ _scsih_sas_topology_change_event_debug(struct MPT2SAS_ADAPTER *ioc,
4119 MPI2_EVENT_SAS_TOPO_RC_MASK; 4114 MPI2_EVENT_SAS_TOPO_RC_MASK;
4120 switch (reason_code) { 4115 switch (reason_code) {
4121 case MPI2_EVENT_SAS_TOPO_RC_TARG_ADDED: 4116 case MPI2_EVENT_SAS_TOPO_RC_TARG_ADDED:
4122 snprintf(link_rate, 25, ": add, link(0x%02x)", 4117 status_str = "target add";
4123 (event_data->PHY[i].LinkRate >> 4));
4124 status_str = link_rate;
4125 break; 4118 break;
4126 case MPI2_EVENT_SAS_TOPO_RC_TARG_NOT_RESPONDING: 4119 case MPI2_EVENT_SAS_TOPO_RC_TARG_NOT_RESPONDING:
4127 status_str = ": remove"; 4120 status_str = "target remove";
4128 break; 4121 break;
4129 case MPI2_EVENT_SAS_TOPO_RC_DELAY_NOT_RESPONDING: 4122 case MPI2_EVENT_SAS_TOPO_RC_DELAY_NOT_RESPONDING:
4130 status_str = ": remove_delay"; 4123 status_str = "delay target remove";
4131 break; 4124 break;
4132 case MPI2_EVENT_SAS_TOPO_RC_PHY_CHANGED: 4125 case MPI2_EVENT_SAS_TOPO_RC_PHY_CHANGED:
4133 snprintf(link_rate, 25, ": link(0x%02x)", 4126 status_str = "link rate change";
4134 (event_data->PHY[i].LinkRate >> 4));
4135 status_str = link_rate;
4136 break; 4127 break;
4137 case MPI2_EVENT_SAS_TOPO_RC_NO_CHANGE: 4128 case MPI2_EVENT_SAS_TOPO_RC_NO_CHANGE:
4138 status_str = ": responding"; 4129 status_str = "target responding";
4139 break; 4130 break;
4140 default: 4131 default:
4141 status_str = ": unknown"; 4132 status_str = "unknown";
4142 break; 4133 break;
4143 } 4134 }
4144 printk(KERN_DEBUG "\tphy(%02d), attached_handle(0x%04x)%s\n", 4135 link_rate = event_data->PHY[i].LinkRate >> 4;
4145 phy_number, handle, status_str); 4136 prev_link_rate = event_data->PHY[i].LinkRate & 0xF;
4137 printk(KERN_DEBUG "\tphy(%02d), attached_handle(0x%04x): %s:"
4138 " link rate: new(0x%02x), old(0x%02x)\n", phy_number,
4139 handle, status_str, link_rate, prev_link_rate);
4140
4146 } 4141 }
4147} 4142}
4148#endif 4143#endif
@@ -4166,7 +4161,7 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc,
4166 struct _sas_device *sas_device; 4161 struct _sas_device *sas_device;
4167 u64 sas_address; 4162 u64 sas_address;
4168 unsigned long flags; 4163 unsigned long flags;
4169 u8 link_rate; 4164 u8 link_rate, prev_link_rate;
4170 Mpi2EventDataSasTopologyChangeList_t *event_data = fw_event->event_data; 4165 Mpi2EventDataSasTopologyChangeList_t *event_data = fw_event->event_data;
4171 4166
4172#ifdef CONFIG_SCSI_MPT2SAS_LOGGING 4167#ifdef CONFIG_SCSI_MPT2SAS_LOGGING
@@ -4226,18 +4221,25 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc,
4226 if (!handle) 4221 if (!handle)
4227 continue; 4222 continue;
4228 link_rate = event_data->PHY[i].LinkRate >> 4; 4223 link_rate = event_data->PHY[i].LinkRate >> 4;
4224 prev_link_rate = event_data->PHY[i].LinkRate & 0xF;
4229 switch (reason_code) { 4225 switch (reason_code) {
4230 case MPI2_EVENT_SAS_TOPO_RC_PHY_CHANGED: 4226 case MPI2_EVENT_SAS_TOPO_RC_PHY_CHANGED:
4227
4228 if (link_rate == prev_link_rate)
4229 break;
4230
4231 mpt2sas_transport_update_links(ioc, sas_address,
4232 handle, phy_number, link_rate);
4233
4234 if (link_rate >= MPI2_SAS_NEG_LINK_RATE_1_5)
4235 _scsih_ublock_io_device(ioc, handle);
4236 break;
4231 case MPI2_EVENT_SAS_TOPO_RC_TARG_ADDED: 4237 case MPI2_EVENT_SAS_TOPO_RC_TARG_ADDED:
4232 4238
4233 mpt2sas_transport_update_links(ioc, sas_address, 4239 mpt2sas_transport_update_links(ioc, sas_address,
4234 handle, phy_number, link_rate); 4240 handle, phy_number, link_rate);
4235 4241
4236 if (link_rate < MPI2_SAS_NEG_LINK_RATE_1_5) 4242 _scsih_add_device(ioc, handle, phy_number, 0);
4237 break;
4238 if (reason_code == MPI2_EVENT_SAS_TOPO_RC_TARG_ADDED) {
4239 _scsih_add_device(ioc, handle, phy_number, 0);
4240 }
4241 break; 4243 break;
4242 case MPI2_EVENT_SAS_TOPO_RC_TARG_NOT_RESPONDING: 4244 case MPI2_EVENT_SAS_TOPO_RC_TARG_NOT_RESPONDING:
4243 4245