diff options
author | Eric Moore <eric.moore@lsi.com> | 2007-01-29 11:44:54 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-02-02 21:53:14 -0500 |
commit | c6c727a1a0ff90c80425b7226557b2354e00cf7b (patch) | |
tree | 832e5b9505f8a4cc7e29c4f800b8f25fb14b1527 /drivers/message/fusion/mptscsih.c | |
parent | 873c82ed165a345fa381415b9734d26e9af4ec96 (diff) |
[SCSI] fusion - iocstatus, loginfo, and event debug updates
various string updates for iocstatus, logingo, and fw asyn events.
Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptscsih.c')
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 129 |
1 files changed, 115 insertions, 14 deletions
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index d5877316cbea..507aa08611d5 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -487,6 +487,90 @@ mptscsih_issue_sep_command(MPT_ADAPTER *ioc, VirtTarget *vtarget, | |||
487 | mpt_put_msg_frame(ioc->DoneCtx, ioc, mf); | 487 | mpt_put_msg_frame(ioc->DoneCtx, ioc, mf); |
488 | } | 488 | } |
489 | 489 | ||
490 | #ifdef MPT_DEBUG_REPLY | ||
491 | /** | ||
492 | * mptscsih_iocstatus_info_scsiio - IOCSTATUS information for SCSIIO | ||
493 | * @ioc: Pointer to MPT_ADAPTER structure | ||
494 | * @ioc_status: U32 IOCStatus word from IOC | ||
495 | * @scsi_status: U8 sam status from target | ||
496 | * @scsi_state: U8 scsi state | ||
497 | * @sc: original scsi cmnd pointer | ||
498 | * @mf: Pointer to MPT request frame | ||
499 | * | ||
500 | * Refer to lsi/mpi.h. | ||
501 | **/ | ||
502 | static void | ||
503 | mptscsih_iocstatus_info_scsiio(MPT_ADAPTER *ioc, u32 ioc_status, | ||
504 | u8 scsi_status, u8 scsi_state, struct scsi_cmnd *sc) | ||
505 | { | ||
506 | char extend_desc[EVENT_DESCR_STR_SZ]; | ||
507 | char *desc = NULL; | ||
508 | |||
509 | switch (ioc_status) { | ||
510 | |||
511 | case MPI_IOCSTATUS_SCSI_INVALID_BUS: /* 0x0041 */ | ||
512 | desc = "SCSI Invalid Bus"; | ||
513 | break; | ||
514 | |||
515 | case MPI_IOCSTATUS_SCSI_INVALID_TARGETID: /* 0x0042 */ | ||
516 | desc = "SCSI Invalid TargetID"; | ||
517 | break; | ||
518 | |||
519 | case MPI_IOCSTATUS_SCSI_DEVICE_NOT_THERE: /* 0x0043 */ | ||
520 | /* | ||
521 | * Inquiry is issued for device scanning | ||
522 | */ | ||
523 | if (sc->cmnd[0] != 0x12) | ||
524 | desc = "SCSI Device Not There"; | ||
525 | break; | ||
526 | |||
527 | case MPI_IOCSTATUS_SCSI_DATA_OVERRUN: /* 0x0044 */ | ||
528 | desc = "SCSI Data Overrun"; | ||
529 | break; | ||
530 | |||
531 | case MPI_IOCSTATUS_SCSI_IO_DATA_ERROR: /* 0x0046 */ | ||
532 | desc = "SCSI I/O Data Error"; | ||
533 | break; | ||
534 | |||
535 | case MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR: /* 0x0047 */ | ||
536 | desc = "SCSI Protocol Error"; | ||
537 | break; | ||
538 | |||
539 | case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: /* 0x0048 */ | ||
540 | desc = "SCSI Task Terminated"; | ||
541 | break; | ||
542 | |||
543 | case MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: /* 0x0049 */ | ||
544 | desc = "SCSI Residual Mismatch"; | ||
545 | break; | ||
546 | |||
547 | case MPI_IOCSTATUS_SCSI_TASK_MGMT_FAILED: /* 0x004A */ | ||
548 | desc = "SCSI Task Management Failed"; | ||
549 | break; | ||
550 | |||
551 | case MPI_IOCSTATUS_SCSI_IOC_TERMINATED: /* 0x004B */ | ||
552 | desc = "SCSI IOC Terminated"; | ||
553 | break; | ||
554 | |||
555 | case MPI_IOCSTATUS_SCSI_EXT_TERMINATED: /* 0x004C */ | ||
556 | desc = "SCSI Ext Terminated"; | ||
557 | break; | ||
558 | } | ||
559 | |||
560 | if (!desc) | ||
561 | return; | ||
562 | |||
563 | snprintf(extend_desc, EVENT_DESCR_STR_SZ, | ||
564 | "[%d:%d:%d:%d] cmd=%02Xh, sam_status=%02Xh state=%02Xh", | ||
565 | sc->device->host->host_no, | ||
566 | sc->device->channel, sc->device->id, sc->device->lun, | ||
567 | sc->cmnd[0], scsi_status, scsi_state); | ||
568 | |||
569 | printk(MYIOC_s_INFO_FMT "IOCStatus(0x%04X): %s: %s\n", | ||
570 | ioc->name, ioc_status, desc, extend_desc); | ||
571 | } | ||
572 | #endif | ||
573 | |||
490 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 574 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
491 | /* | 575 | /* |
492 | * mptscsih_io_done - Main SCSI IO callback routine registered to | 576 | * mptscsih_io_done - Main SCSI IO callback routine registered to |
@@ -573,12 +657,14 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | |||
573 | u32 xfer_cnt; | 657 | u32 xfer_cnt; |
574 | u16 status; | 658 | u16 status; |
575 | u8 scsi_state, scsi_status; | 659 | u8 scsi_state, scsi_status; |
660 | u32 log_info; | ||
576 | 661 | ||
577 | status = le16_to_cpu(pScsiReply->IOCStatus) & MPI_IOCSTATUS_MASK; | 662 | status = le16_to_cpu(pScsiReply->IOCStatus) & MPI_IOCSTATUS_MASK; |
578 | scsi_state = pScsiReply->SCSIState; | 663 | scsi_state = pScsiReply->SCSIState; |
579 | scsi_status = pScsiReply->SCSIStatus; | 664 | scsi_status = pScsiReply->SCSIStatus; |
580 | xfer_cnt = le32_to_cpu(pScsiReply->TransferCount); | 665 | xfer_cnt = le32_to_cpu(pScsiReply->TransferCount); |
581 | sc->resid = sc->request_bufflen - xfer_cnt; | 666 | sc->resid = sc->request_bufflen - xfer_cnt; |
667 | log_info = le32_to_cpu(pScsiReply->IOCLogInfo); | ||
582 | 668 | ||
583 | /* | 669 | /* |
584 | * if we get a data underrun indication, yet no data was | 670 | * if we get a data underrun indication, yet no data was |
@@ -593,13 +679,6 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | |||
593 | status = MPI_IOCSTATUS_SUCCESS; | 679 | status = MPI_IOCSTATUS_SUCCESS; |
594 | } | 680 | } |
595 | 681 | ||
596 | dreplyprintk((KERN_NOTICE "Reply ha=%d id=%d lun=%d:\n" | ||
597 | "IOCStatus=%04xh SCSIState=%02xh SCSIStatus=%02xh\n" | ||
598 | "resid=%d bufflen=%d xfer_cnt=%d\n", | ||
599 | ioc->id, sc->device->id, sc->device->lun, | ||
600 | status, scsi_state, scsi_status, sc->resid, | ||
601 | sc->request_bufflen, xfer_cnt)); | ||
602 | |||
603 | if (scsi_state & MPI_SCSI_STATE_AUTOSENSE_VALID) | 682 | if (scsi_state & MPI_SCSI_STATE_AUTOSENSE_VALID) |
604 | mptscsih_copy_sense_data(sc, hd, mf, pScsiReply); | 683 | mptscsih_copy_sense_data(sc, hd, mf, pScsiReply); |
605 | 684 | ||
@@ -608,9 +687,10 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | |||
608 | */ | 687 | */ |
609 | if (scsi_state & MPI_SCSI_STATE_RESPONSE_INFO_VALID && | 688 | if (scsi_state & MPI_SCSI_STATE_RESPONSE_INFO_VALID && |
610 | pScsiReply->ResponseInfo) { | 689 | pScsiReply->ResponseInfo) { |
611 | printk(KERN_NOTICE "ha=%d id=%d lun=%d: " | 690 | printk(KERN_NOTICE "[%d:%d:%d:%d] " |
612 | "FCP_ResponseInfo=%08xh\n", | 691 | "FCP_ResponseInfo=%08xh\n", |
613 | ioc->id, sc->device->id, sc->device->lun, | 692 | sc->device->host->host_no, sc->device->channel, |
693 | sc->device->id, sc->device->lun, | ||
614 | le32_to_cpu(pScsiReply->ResponseInfo)); | 694 | le32_to_cpu(pScsiReply->ResponseInfo)); |
615 | } | 695 | } |
616 | 696 | ||
@@ -655,9 +735,8 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | |||
655 | if ( ioc->bus_type == SAS ) { | 735 | if ( ioc->bus_type == SAS ) { |
656 | u16 ioc_status = le16_to_cpu(pScsiReply->IOCStatus); | 736 | u16 ioc_status = le16_to_cpu(pScsiReply->IOCStatus); |
657 | if (ioc_status & MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) { | 737 | if (ioc_status & MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) { |
658 | u32 log_info = le32_to_cpu(mr->u.reply.IOCLogInfo); | 738 | if ((log_info & SAS_LOGINFO_MASK) |
659 | log_info &=SAS_LOGINFO_MASK; | 739 | == SAS_LOGINFO_NEXUS_LOSS) { |
660 | if (log_info == SAS_LOGINFO_NEXUS_LOSS) { | ||
661 | sc->result = (DID_BUS_BUSY << 16); | 740 | sc->result = (DID_BUS_BUSY << 16); |
662 | break; | 741 | break; |
663 | } | 742 | } |
@@ -695,7 +774,8 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | |||
695 | else /* Sufficient data transfer occurred */ | 774 | else /* Sufficient data transfer occurred */ |
696 | sc->result = (DID_OK << 16) | scsi_status; | 775 | sc->result = (DID_OK << 16) | scsi_status; |
697 | dreplyprintk((KERN_NOTICE | 776 | dreplyprintk((KERN_NOTICE |
698 | "RESIDUAL_MISMATCH: result=%x on id=%d\n", sc->result, sc->device->id)); | 777 | "RESIDUAL_MISMATCH: result=%x on channel=%d id=%d\n", |
778 | sc->result, sc->device->channel, sc->device->id)); | ||
699 | break; | 779 | break; |
700 | 780 | ||
701 | case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ | 781 | case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ |
@@ -808,7 +888,28 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | |||
808 | 888 | ||
809 | } /* switch(status) */ | 889 | } /* switch(status) */ |
810 | 890 | ||
811 | dreplyprintk((KERN_NOTICE " sc->result is %08xh\n", sc->result)); | 891 | #ifdef MPT_DEBUG_REPLY |
892 | if (sc->result) { | ||
893 | |||
894 | mptscsih_iocstatus_info_scsiio(ioc, status, | ||
895 | scsi_status, scsi_state, sc); | ||
896 | |||
897 | dreplyprintk(("%s: [%d:%d:%d:%d] cmd=0x%02x " | ||
898 | "result=0x%08x\n\tiocstatus=0x%04X " | ||
899 | "scsi_state=0x%02X scsi_status=0x%02X " | ||
900 | "loginfo=0x%08X\n", __FUNCTION__, | ||
901 | sc->device->host->host_no, sc->device->channel, sc->device->id, | ||
902 | sc->device->lun, sc->cmnd[0], sc->result, status, | ||
903 | scsi_state, scsi_status, log_info)); | ||
904 | |||
905 | dreplyprintk(("%s: [%d:%d:%d:%d] resid=%d " | ||
906 | "bufflen=%d xfer_cnt=%d\n", __FUNCTION__, | ||
907 | sc->device->host->host_no, sc->device->channel, sc->device->id, | ||
908 | sc->device->lun, sc->resid, sc->request_bufflen, | ||
909 | xfer_cnt)); | ||
910 | } | ||
911 | #endif | ||
912 | |||
812 | } /* end of address reply case */ | 913 | } /* end of address reply case */ |
813 | 914 | ||
814 | /* Unmap the DMA buffers, if any. */ | 915 | /* Unmap the DMA buffers, if any. */ |