aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2010-06-17 04:18:46 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:02:23 -0400
commit8e864a81e30ab996d3245ebd16a741b3614e6581 (patch)
treeee10f86fa765f6c53375111eb27120e5b60e1d66
parentd417d1c3a3c3b4d89a285f82a4e7710372e40a24 (diff)
[SCSI] mpt2sas: Adding additional message to error escalation callback
Adding additional messages to the error escallation callbacks which displays the wwid, sas address, handle, phy number, enclosure logical id, and slot. In the same eh callbacks, routines, the printks were converted to sdev_printks, which displays the bus target mapping. These additional modifications help better identify the device which is in recovery. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c143
1 files changed, 104 insertions, 39 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 228961b94a68..854cc91e7aac 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -2123,8 +2123,59 @@ mpt2sas_scsih_issue_tm(struct MPT2SAS_ADAPTER *ioc, u16 handle, uint channel,
2123} 2123}
2124 2124
2125/** 2125/**
2126 * _scsih_tm_display_info - displays info about the device
2127 * @ioc: per adapter struct
2128 * @scmd: pointer to scsi command object
2129 *
2130 * Called by task management callback handlers.
2131 */
2132static void
2133_scsih_tm_display_info(struct MPT2SAS_ADAPTER *ioc, struct scsi_cmnd *scmd)
2134{
2135 struct scsi_target *starget = scmd->device->sdev_target;
2136 struct MPT2SAS_TARGET *priv_target = starget->hostdata;
2137 struct _sas_device *sas_device = NULL;
2138 unsigned long flags;
2139
2140 if (!priv_target)
2141 return;
2142
2143 scsi_print_command(scmd);
2144 if (priv_target->flags & MPT_TARGET_FLAGS_VOLUME) {
2145 starget_printk(KERN_INFO, starget, "volume handle(0x%04x), "
2146 "volume wwid(0x%016llx)\n",
2147 priv_target->handle,
2148 (unsigned long long)priv_target->sas_address);
2149 } else {
2150 spin_lock_irqsave(&ioc->sas_device_lock, flags);
2151 sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc,
2152 priv_target->sas_address);
2153 if (sas_device) {
2154 if (priv_target->flags &
2155 MPT_TARGET_FLAGS_RAID_COMPONENT) {
2156 starget_printk(KERN_INFO, starget,
2157 "volume handle(0x%04x), "
2158 "volume wwid(0x%016llx)\n",
2159 sas_device->volume_handle,
2160 (unsigned long long)sas_device->volume_wwid);
2161 }
2162 starget_printk(KERN_INFO, starget,
2163 "handle(0x%04x), sas_address(0x%016llx), phy(%d)\n",
2164 sas_device->handle,
2165 (unsigned long long)sas_device->sas_address,
2166 sas_device->phy);
2167 starget_printk(KERN_INFO, starget,
2168 "enclosure_logical_id(0x%016llx), slot(%d)\n",
2169 (unsigned long long)sas_device->enclosure_logical_id,
2170 sas_device->slot);
2171 }
2172 spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
2173 }
2174}
2175
2176/**
2126 * _scsih_abort - eh threads main abort routine 2177 * _scsih_abort - eh threads main abort routine
2127 * @sdev: scsi device struct 2178 * @scmd: pointer to scsi command object
2128 * 2179 *
2129 * Returns SUCCESS if command aborted else FAILED 2180 * Returns SUCCESS if command aborted else FAILED
2130 */ 2181 */
@@ -2137,14 +2188,14 @@ _scsih_abort(struct scsi_cmnd *scmd)
2137 u16 handle; 2188 u16 handle;
2138 int r; 2189 int r;
2139 2190
2140 printk(MPT2SAS_INFO_FMT "attempting task abort! scmd(%p)\n", 2191 sdev_printk(KERN_INFO, scmd->device, "attempting task abort! "
2141 ioc->name, scmd); 2192 "scmd(%p)\n", scmd);
2142 scsi_print_command(scmd); 2193 _scsih_tm_display_info(ioc, scmd);
2143 2194
2144 sas_device_priv_data = scmd->device->hostdata; 2195 sas_device_priv_data = scmd->device->hostdata;
2145 if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { 2196 if (!sas_device_priv_data || !sas_device_priv_data->sas_target) {
2146 printk(MPT2SAS_INFO_FMT "device been deleted! scmd(%p)\n", 2197 sdev_printk(KERN_INFO, scmd->device, "device been deleted! "
2147 ioc->name, scmd); 2198 "scmd(%p)\n", scmd);
2148 scmd->result = DID_NO_CONNECT << 16; 2199 scmd->result = DID_NO_CONNECT << 16;
2149 scmd->scsi_done(scmd); 2200 scmd->scsi_done(scmd);
2150 r = SUCCESS; 2201 r = SUCCESS;
@@ -2176,14 +2227,14 @@ _scsih_abort(struct scsi_cmnd *scmd)
2176 MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK, smid, 30, scmd); 2227 MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK, smid, 30, scmd);
2177 2228
2178 out: 2229 out:
2179 printk(MPT2SAS_INFO_FMT "task abort: %s scmd(%p)\n", 2230 sdev_printk(KERN_INFO, scmd->device, "task abort: %s scmd(%p)\n",
2180 ioc->name, ((r == SUCCESS) ? "SUCCESS" : "FAILED"), scmd); 2231 ((r == SUCCESS) ? "SUCCESS" : "FAILED"), scmd);
2181 return r; 2232 return r;
2182} 2233}
2183 2234
2184/** 2235/**
2185 * _scsih_dev_reset - eh threads main device reset routine 2236 * _scsih_dev_reset - eh threads main device reset routine
2186 * @sdev: scsi device struct 2237 * @scmd: pointer to scsi command object
2187 * 2238 *
2188 * Returns SUCCESS if command aborted else FAILED 2239 * Returns SUCCESS if command aborted else FAILED
2189 */ 2240 */
@@ -2197,14 +2248,16 @@ _scsih_dev_reset(struct scsi_cmnd *scmd)
2197 u16 handle; 2248 u16 handle;
2198 int r; 2249 int r;
2199 2250
2200 printk(MPT2SAS_INFO_FMT "attempting device reset! scmd(%p)\n", 2251 struct scsi_target *starget = scmd->device->sdev_target;
2201 ioc->name, scmd); 2252
2202 scsi_print_command(scmd); 2253 starget_printk(KERN_INFO, starget, "attempting target reset! "
2254 "scmd(%p)\n", scmd);
2255 _scsih_tm_display_info(ioc, scmd);
2203 2256
2204 sas_device_priv_data = scmd->device->hostdata; 2257 sas_device_priv_data = scmd->device->hostdata;
2205 if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { 2258 if (!sas_device_priv_data || !sas_device_priv_data->sas_target) {
2206 printk(MPT2SAS_INFO_FMT "device been deleted! scmd(%p)\n", 2259 starget_printk(KERN_INFO, starget, "target been deleted! "
2207 ioc->name, scmd); 2260 "scmd(%p)\n", scmd);
2208 scmd->result = DID_NO_CONNECT << 16; 2261 scmd->result = DID_NO_CONNECT << 16;
2209 scmd->scsi_done(scmd); 2262 scmd->scsi_done(scmd);
2210 r = SUCCESS; 2263 r = SUCCESS;
@@ -2235,14 +2288,14 @@ _scsih_dev_reset(struct scsi_cmnd *scmd)
2235 MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET, 0, 30, scmd); 2288 MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET, 0, 30, scmd);
2236 2289
2237 out: 2290 out:
2238 printk(MPT2SAS_INFO_FMT "device reset: %s scmd(%p)\n", 2291 sdev_printk(KERN_INFO, scmd->device, "device reset: %s scmd(%p)\n",
2239 ioc->name, ((r == SUCCESS) ? "SUCCESS" : "FAILED"), scmd); 2292 ((r == SUCCESS) ? "SUCCESS" : "FAILED"), scmd);
2240 return r; 2293 return r;
2241} 2294}
2242 2295
2243/** 2296/**
2244 * _scsih_target_reset - eh threads main target reset routine 2297 * _scsih_target_reset - eh threads main target reset routine
2245 * @sdev: scsi device struct 2298 * @scmd: pointer to scsi command object
2246 * 2299 *
2247 * Returns SUCCESS if command aborted else FAILED 2300 * Returns SUCCESS if command aborted else FAILED
2248 */ 2301 */
@@ -2255,15 +2308,16 @@ _scsih_target_reset(struct scsi_cmnd *scmd)
2255 unsigned long flags; 2308 unsigned long flags;
2256 u16 handle; 2309 u16 handle;
2257 int r; 2310 int r;
2311 struct scsi_target *starget = scmd->device->sdev_target;
2258 2312
2259 printk(MPT2SAS_INFO_FMT "attempting target reset! scmd(%p)\n", 2313 starget_printk(KERN_INFO, starget, "attempting target reset! "
2260 ioc->name, scmd); 2314 "scmd(%p)\n", scmd);
2261 scsi_print_command(scmd); 2315 _scsih_tm_display_info(ioc, scmd);
2262 2316
2263 sas_device_priv_data = scmd->device->hostdata; 2317 sas_device_priv_data = scmd->device->hostdata;
2264 if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { 2318 if (!sas_device_priv_data || !sas_device_priv_data->sas_target) {
2265 printk(MPT2SAS_INFO_FMT "target been deleted! scmd(%p)\n", 2319 starget_printk(KERN_INFO, starget, "target been deleted! "
2266 ioc->name, scmd); 2320 "scmd(%p)\n", scmd);
2267 scmd->result = DID_NO_CONNECT << 16; 2321 scmd->result = DID_NO_CONNECT << 16;
2268 scmd->scsi_done(scmd); 2322 scmd->scsi_done(scmd);
2269 r = SUCCESS; 2323 r = SUCCESS;
@@ -2294,14 +2348,14 @@ _scsih_target_reset(struct scsi_cmnd *scmd)
2294 30, scmd); 2348 30, scmd);
2295 2349
2296 out: 2350 out:
2297 printk(MPT2SAS_INFO_FMT "target reset: %s scmd(%p)\n", 2351 starget_printk(KERN_INFO, starget, "target reset: %s scmd(%p)\n",
2298 ioc->name, ((r == SUCCESS) ? "SUCCESS" : "FAILED"), scmd); 2352 ((r == SUCCESS) ? "SUCCESS" : "FAILED"), scmd);
2299 return r; 2353 return r;
2300} 2354}
2301 2355
2302/** 2356/**
2303 * _scsih_host_reset - eh threads main host reset routine 2357 * _scsih_host_reset - eh threads main host reset routine
2304 * @sdev: scsi device struct 2358 * @scmd: pointer to scsi command object
2305 * 2359 *
2306 * Returns SUCCESS if command aborted else FAILED 2360 * Returns SUCCESS if command aborted else FAILED
2307 */ 2361 */
@@ -3425,6 +3479,11 @@ _scsih_scsi_ioc_info(struct MPT2SAS_ADAPTER *ioc, struct scsi_cmnd *scmd,
3425 u32 log_info = le32_to_cpu(mpi_reply->IOCLogInfo); 3479 u32 log_info = le32_to_cpu(mpi_reply->IOCLogInfo);
3426 struct _sas_device *sas_device = NULL; 3480 struct _sas_device *sas_device = NULL;
3427 unsigned long flags; 3481 unsigned long flags;
3482 struct scsi_target *starget = scmd->device->sdev_target;
3483 struct MPT2SAS_TARGET *priv_target = starget->hostdata;
3484
3485 if (!priv_target)
3486 return;
3428 3487
3429 if (log_info == 0x31170000) 3488 if (log_info == 0x31170000)
3430 return; 3489 return;
@@ -3541,22 +3600,28 @@ _scsih_scsi_ioc_info(struct MPT2SAS_ADAPTER *ioc, struct scsi_cmnd *scmd,
3541 3600
3542 scsi_print_command(scmd); 3601 scsi_print_command(scmd);
3543 3602
3544 spin_lock_irqsave(&ioc->sas_device_lock, flags); 3603 if (priv_target->flags & MPT_TARGET_FLAGS_VOLUME) {
3545 sas_device = _scsih_sas_device_find_by_handle(ioc, 3604 printk(MPT2SAS_WARN_FMT "\tvolume wwid(0x%016llx)\n", ioc->name,
3546 le16_to_cpu(mpi_reply->DevHandle)); 3605 (unsigned long long)priv_target->sas_address);
3547 if (sas_device) { 3606 } else {
3548 printk(MPT2SAS_WARN_FMT "\tsas_address(0x%016llx), phy(%d)\n", 3607 spin_lock_irqsave(&ioc->sas_device_lock, flags);
3549 ioc->name, sas_device->sas_address, sas_device->phy); 3608 sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc,
3550 printk(MPT2SAS_WARN_FMT "\tenclosure_logical_id(0x%016llx), " 3609 priv_target->sas_address);
3551 "slot(%d)\n", ioc->name, sas_device->enclosure_logical_id, 3610 if (sas_device) {
3552 sas_device->slot); 3611 printk(MPT2SAS_WARN_FMT "\tsas_address(0x%016llx), "
3612 "phy(%d)\n", ioc->name, sas_device->sas_address,
3613 sas_device->phy);
3614 printk(MPT2SAS_WARN_FMT
3615 "\tenclosure_logical_id(0x%016llx), slot(%d)\n",
3616 ioc->name, sas_device->enclosure_logical_id,
3617 sas_device->slot);
3618 }
3619 spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
3553 } 3620 }
3554 spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
3555 3621
3556 printk(MPT2SAS_WARN_FMT "\tdev handle(0x%04x), " 3622 printk(MPT2SAS_WARN_FMT "\thandle(0x%04x), ioc_status(%s)(0x%04x), "
3557 "ioc_status(%s)(0x%04x), smid(%d)\n", ioc->name, 3623 "smid(%d)\n", ioc->name, le16_to_cpu(mpi_reply->DevHandle),
3558 le16_to_cpu(mpi_reply->DevHandle), desc_ioc_state, 3624 desc_ioc_state, ioc_status, smid);
3559 ioc_status, smid);
3560 printk(MPT2SAS_WARN_FMT "\trequest_len(%d), underflow(%d), " 3625 printk(MPT2SAS_WARN_FMT "\trequest_len(%d), underflow(%d), "
3561 "resid(%d)\n", ioc->name, scsi_bufflen(scmd), scmd->underflow, 3626 "resid(%d)\n", ioc->name, scsi_bufflen(scmd), scmd->underflow,
3562 scsi_get_resid(scmd)); 3627 scsi_get_resid(scmd));