diff options
author | Eric Moore <eric.moore@lsi.com> | 2007-01-29 11:44:06 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-02-02 21:50:25 -0500 |
commit | 873c82ed165a345fa381415b9734d26e9af4ec96 (patch) | |
tree | 62bb559f2768e887987c1f7dffeef126908b0cbf /drivers/message | |
parent | 5a9c47b1344b514758d5d7f193c672850390cc36 (diff) |
[SCSI] fusion - added mptspi debug
helpful debug for mptspi module
Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message')
-rw-r--r-- | drivers/message/fusion/Makefile | 3 | ||||
-rw-r--r-- | drivers/message/fusion/mptbase.h | 6 | ||||
-rw-r--r-- | drivers/message/fusion/mptspi.c | 66 |
3 files changed, 67 insertions, 8 deletions
diff --git a/drivers/message/fusion/Makefile b/drivers/message/fusion/Makefile index 3217076b40f4..6171783f0007 100644 --- a/drivers/message/fusion/Makefile +++ b/drivers/message/fusion/Makefile | |||
@@ -8,6 +8,7 @@ | |||
8 | #EXTRA_CFLAGS += -DMPT_DEBUG_INIT | 8 | #EXTRA_CFLAGS += -DMPT_DEBUG_INIT |
9 | #EXTRA_CFLAGS += -DMPT_DEBUG_EXIT | 9 | #EXTRA_CFLAGS += -DMPT_DEBUG_EXIT |
10 | #EXTRA_CFLAGS += -DMPT_DEBUG_FAIL | 10 | #EXTRA_CFLAGS += -DMPT_DEBUG_FAIL |
11 | #EXTRA_CFLAGS += -DMPT_DEBUG_DV | ||
11 | #EXTRA_CFLAGS += -DMPT_DEBUG_TM | 12 | #EXTRA_CFLAGS += -DMPT_DEBUG_TM |
12 | 13 | ||
13 | # | 14 | # |
@@ -21,8 +22,6 @@ | |||
21 | #CFLAGS_mptbase.o += -DMPT_DEBUG_RESET | 22 | #CFLAGS_mptbase.o += -DMPT_DEBUG_RESET |
22 | # | 23 | # |
23 | # For mptscsih: | 24 | # For mptscsih: |
24 | #CFLAGS_mptscsih.o += -DMPT_DEBUG_DV | ||
25 | #CFLAGS_mptscsih.o += -DMPT_DEBUG_NEGO | ||
26 | #CFLAGS_mptscsih.o += -DMPT_DEBUG_SCSI | 25 | #CFLAGS_mptscsih.o += -DMPT_DEBUG_SCSI |
27 | #CFLAGS_mptscsih.o += -DMPT_DEBUG_REPLY | 26 | #CFLAGS_mptscsih.o += -DMPT_DEBUG_REPLY |
28 | # | 27 | # |
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index f82a817de81f..a0ce2f4e33f9 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h | |||
@@ -791,12 +791,6 @@ typedef struct _mpt_sge { | |||
791 | #define ddvprintk(x) | 791 | #define ddvprintk(x) |
792 | #endif | 792 | #endif |
793 | 793 | ||
794 | #ifdef MPT_DEBUG_NEGO | ||
795 | #define dnegoprintk(x) printk x | ||
796 | #else | ||
797 | #define dnegoprintk(x) | ||
798 | #endif | ||
799 | |||
800 | #if defined(MPT_DEBUG_DV) || defined(MPT_DEBUG_DV_TINY) | 794 | #if defined(MPT_DEBUG_DV) || defined(MPT_DEBUG_DV_TINY) |
801 | #define ddvtprintk(x) printk x | 795 | #define ddvtprintk(x) printk x |
802 | #else | 796 | #else |
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 4896d7cc681a..06a7b86f5f23 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c | |||
@@ -65,6 +65,7 @@ | |||
65 | #include <scsi/scsi_tcq.h> | 65 | #include <scsi/scsi_tcq.h> |
66 | #include <scsi/scsi_transport.h> | 66 | #include <scsi/scsi_transport.h> |
67 | #include <scsi/scsi_transport_spi.h> | 67 | #include <scsi/scsi_transport_spi.h> |
68 | #include <scsi/scsi_dbg.h> | ||
68 | 69 | ||
69 | #include "mptbase.h" | 70 | #include "mptbase.h" |
70 | #include "mptscsih.h" | 71 | #include "mptscsih.h" |
@@ -454,6 +455,56 @@ mptspi_target_destroy(struct scsi_target *starget) | |||
454 | starget->hostdata = NULL; | 455 | starget->hostdata = NULL; |
455 | } | 456 | } |
456 | 457 | ||
458 | /** | ||
459 | * mptspi_print_write_nego - negotiation parameters debug info that is being sent | ||
460 | * @hd: Pointer to a SCSI HOST structure | ||
461 | * @starget: SCSI target | ||
462 | * @ii: negotiation parameters | ||
463 | * | ||
464 | */ | ||
465 | static void | ||
466 | mptspi_print_write_nego(struct _MPT_SCSI_HOST *hd, struct scsi_target *starget, u32 ii) | ||
467 | { | ||
468 | ddvprintk((MYIOC_s_INFO_FMT "id=%d Requested = 0x%08x" | ||
469 | " ( %s factor = 0x%02x @ offset = 0x%02x %s%s%s%s%s%s%s%s)\n", | ||
470 | hd->ioc->name, starget->id, ii, | ||
471 | ii & MPI_SCSIDEVPAGE0_NP_WIDE ? "Wide ": "", | ||
472 | ((ii >> 8) & 0xFF), ((ii >> 16) & 0xFF), | ||
473 | ii & MPI_SCSIDEVPAGE0_NP_IU ? "IU ": "", | ||
474 | ii & MPI_SCSIDEVPAGE0_NP_DT ? "DT ": "", | ||
475 | ii & MPI_SCSIDEVPAGE0_NP_QAS ? "QAS ": "", | ||
476 | ii & MPI_SCSIDEVPAGE0_NP_HOLD_MCS ? "HOLDMCS ": "", | ||
477 | ii & MPI_SCSIDEVPAGE0_NP_WR_FLOW ? "WRFLOW ": "", | ||
478 | ii & MPI_SCSIDEVPAGE0_NP_RD_STRM ? "RDSTRM ": "", | ||
479 | ii & MPI_SCSIDEVPAGE0_NP_RTI ? "RTI ": "", | ||
480 | ii & MPI_SCSIDEVPAGE0_NP_PCOMP_EN ? "PCOMP ": "")); | ||
481 | } | ||
482 | |||
483 | /** | ||
484 | * mptspi_print_read_nego - negotiation parameters debug info that is being read | ||
485 | * @hd: Pointer to a SCSI HOST structure | ||
486 | * @starget: SCSI target | ||
487 | * @ii: negotiation parameters | ||
488 | * | ||
489 | */ | ||
490 | static void | ||
491 | mptspi_print_read_nego(struct _MPT_SCSI_HOST *hd, struct scsi_target *starget, u32 ii) | ||
492 | { | ||
493 | ddvprintk((MYIOC_s_INFO_FMT "id=%d Read = 0x%08x" | ||
494 | " ( %s factor = 0x%02x @ offset = 0x%02x %s%s%s%s%s%s%s%s)\n", | ||
495 | hd->ioc->name, starget->id, ii, | ||
496 | ii & MPI_SCSIDEVPAGE0_NP_WIDE ? "Wide ": "", | ||
497 | ((ii >> 8) & 0xFF), ((ii >> 16) & 0xFF), | ||
498 | ii & MPI_SCSIDEVPAGE0_NP_IU ? "IU ": "", | ||
499 | ii & MPI_SCSIDEVPAGE0_NP_DT ? "DT ": "", | ||
500 | ii & MPI_SCSIDEVPAGE0_NP_QAS ? "QAS ": "", | ||
501 | ii & MPI_SCSIDEVPAGE0_NP_HOLD_MCS ? "HOLDMCS ": "", | ||
502 | ii & MPI_SCSIDEVPAGE0_NP_WR_FLOW ? "WRFLOW ": "", | ||
503 | ii & MPI_SCSIDEVPAGE0_NP_RD_STRM ? "RDSTRM ": "", | ||
504 | ii & MPI_SCSIDEVPAGE0_NP_RTI ? "RTI ": "", | ||
505 | ii & MPI_SCSIDEVPAGE0_NP_PCOMP_EN ? "PCOMP ": "")); | ||
506 | } | ||
507 | |||
457 | static int mptspi_read_spi_device_pg0(struct scsi_target *starget, | 508 | static int mptspi_read_spi_device_pg0(struct scsi_target *starget, |
458 | struct _CONFIG_PAGE_SCSI_DEVICE_0 *pass_pg0) | 509 | struct _CONFIG_PAGE_SCSI_DEVICE_0 *pass_pg0) |
459 | { | 510 | { |
@@ -507,6 +558,8 @@ static int mptspi_read_spi_device_pg0(struct scsi_target *starget, | |||
507 | err = 0; | 558 | err = 0; |
508 | memcpy(pass_pg0, pg0, size); | 559 | memcpy(pass_pg0, pg0, size); |
509 | 560 | ||
561 | mptspi_print_read_nego(hd, starget, le32_to_cpu(pg0->NegotiatedParameters)); | ||
562 | |||
510 | out_free: | 563 | out_free: |
511 | dma_free_coherent(&ioc->pcidev->dev, size, pg0, pg0_dma); | 564 | dma_free_coherent(&ioc->pcidev->dev, size, pg0, pg0_dma); |
512 | return err; | 565 | return err; |
@@ -681,6 +734,12 @@ static int mptspi_slave_configure(struct scsi_device *sdev) | |||
681 | 734 | ||
682 | mptspi_initTarget(hd, vtarget, sdev); | 735 | mptspi_initTarget(hd, vtarget, sdev); |
683 | 736 | ||
737 | ddvprintk((MYIOC_s_INFO_FMT "id=%d min_period=0x%02x" | ||
738 | " max_offset=0x%02x max_width=%d\n", hd->ioc->name, | ||
739 | sdev->id, spi_min_period(scsi_target(sdev)), | ||
740 | spi_max_offset(scsi_target(sdev)), | ||
741 | spi_max_width(scsi_target(sdev)))); | ||
742 | |||
684 | if ((sdev->channel == 1 || | 743 | if ((sdev->channel == 1 || |
685 | !(mptspi_is_raid(hd, sdev->id))) && | 744 | !(mptspi_is_raid(hd, sdev->id))) && |
686 | !spi_initial_dv(sdev->sdev_target)) | 745 | !spi_initial_dv(sdev->sdev_target)) |
@@ -708,6 +767,11 @@ mptspi_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
708 | return 0; | 767 | return 0; |
709 | } | 768 | } |
710 | 769 | ||
770 | #ifdef MPT_DEBUG_DV | ||
771 | if (spi_dv_pending(scsi_target(SCpnt->device))) | ||
772 | scsi_print_command(SCpnt); | ||
773 | #endif | ||
774 | |||
711 | return mptscsih_qcmd(SCpnt,done); | 775 | return mptscsih_qcmd(SCpnt,done); |
712 | } | 776 | } |
713 | 777 | ||
@@ -806,6 +870,8 @@ static int mptspi_write_spi_device_pg1(struct scsi_target *starget, | |||
806 | pg1->Header.PageNumber = hdr.PageNumber; | 870 | pg1->Header.PageNumber = hdr.PageNumber; |
807 | pg1->Header.PageType = hdr.PageType; | 871 | pg1->Header.PageType = hdr.PageType; |
808 | 872 | ||
873 | mptspi_print_write_nego(hd, starget, le32_to_cpu(pg1->RequestedParameters)); | ||
874 | |||
809 | if (mpt_config(ioc, &cfg)) { | 875 | if (mpt_config(ioc, &cfg)) { |
810 | starget_printk(KERN_ERR, starget, "mpt_config failed\n"); | 876 | starget_printk(KERN_ERR, starget, "mpt_config failed\n"); |
811 | goto out_free; | 877 | goto out_free; |