summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/NCR5380.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2016-01-03 00:05:55 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2016-01-06 21:43:06 -0500
commit0d3d9a423cd9a4007908a7ec36bf1261e4e5b773 (patch)
treedd62c42a19f768b2eb98b942f9e0b5fe8c811cb1 /drivers/scsi/NCR5380.c
parente8a601444297e336a7c4355f07b4bb386962894c (diff)
ncr5380: Use dsprintk() for queue debugging
Print the command pointers in the log messages for debugging queue data structures. The LIST and REMOVE macros can then be removed. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Hannes Reinecke <hare@suse.com> Tested-by: Ondrej Zary <linux@rainbow-software.org> Tested-by: Michael Schmitz <schmitzmic@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/NCR5380.c')
-rw-r--r--drivers/scsi/NCR5380.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 3774adb3e75a..41bd2e9055f5 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -828,8 +828,9 @@ static void NCR5380_main(struct work_struct *work)
828 */ 828 */
829 for (tmp = (struct scsi_cmnd *) hostdata->issue_queue, prev = NULL; tmp; prev = tmp, tmp = (struct scsi_cmnd *) tmp->host_scribble) 829 for (tmp = (struct scsi_cmnd *) hostdata->issue_queue, prev = NULL; tmp; prev = tmp, tmp = (struct scsi_cmnd *) tmp->host_scribble)
830 { 830 {
831 if (prev != tmp) 831 dsprintk(NDEBUG_QUEUES, instance, "main: tmp=%p target=%d busy=%d lun=%llu\n",
832 dprintk(NDEBUG_LISTS, "MAIN tmp=%p target=%d busy=%d lun=%llu\n", tmp, tmp->device->id, hostdata->busy[tmp->device->id], tmp->device->lun); 832 tmp, scmd_id(tmp), hostdata->busy[scmd_id(tmp)],
833 tmp->device->lun);
833 /* When we find one, remove it from the issue queue. */ 834 /* When we find one, remove it from the issue queue. */
834 if (!(hostdata->busy[tmp->device->id] & 835 if (!(hostdata->busy[tmp->device->id] &
835 (1 << (u8)(tmp->device->lun & 0xff)))) { 836 (1 << (u8)(tmp->device->lun & 0xff)))) {
@@ -841,6 +842,9 @@ static void NCR5380_main(struct work_struct *work)
841 hostdata->issue_queue = (struct scsi_cmnd *) tmp->host_scribble; 842 hostdata->issue_queue = (struct scsi_cmnd *) tmp->host_scribble;
842 } 843 }
843 tmp->host_scribble = NULL; 844 tmp->host_scribble = NULL;
845 dsprintk(NDEBUG_MAIN | NDEBUG_QUEUES,
846 instance, "main: removed %p from issue queue %p\n",
847 tmp, prev);
844 848
845 /* 849 /*
846 * Attempt to establish an I_T_L nexus here. 850 * Attempt to establish an I_T_L nexus here.
@@ -848,8 +852,6 @@ static void NCR5380_main(struct work_struct *work)
848 * On failure, we must add the command back to the 852 * On failure, we must add the command back to the
849 * issue queue so we can keep trying. 853 * issue queue so we can keep trying.
850 */ 854 */
851 dprintk(NDEBUG_MAIN|NDEBUG_QUEUES, "scsi%d : main() : command for target %d lun %llu removed from issue_queue\n", instance->host_no, tmp->device->id, tmp->device->lun);
852
853 /* 855 /*
854 * REQUEST SENSE commands are issued without tagged 856 * REQUEST SENSE commands are issued without tagged
855 * queueing, even on SCSI-II devices because the 857 * queueing, even on SCSI-II devices because the
@@ -864,8 +866,10 @@ static void NCR5380_main(struct work_struct *work)
864 LIST(tmp, hostdata->issue_queue); 866 LIST(tmp, hostdata->issue_queue);
865 tmp->host_scribble = (unsigned char *) hostdata->issue_queue; 867 tmp->host_scribble = (unsigned char *) hostdata->issue_queue;
866 hostdata->issue_queue = tmp; 868 hostdata->issue_queue = tmp;
869 dsprintk(NDEBUG_MAIN | NDEBUG_QUEUES,
870 instance, "main: select() failed, %p returned to issue queue\n",
871 tmp);
867 done = 0; 872 done = 0;
868 dprintk(NDEBUG_MAIN|NDEBUG_QUEUES, "scsi%d : main(): select() failed, returned to issue_queue\n", instance->host_no);
869 } 873 }
870 if (hostdata->connected) 874 if (hostdata->connected)
871 break; 875 break;
@@ -1847,8 +1851,11 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
1847 /* Accept message by clearing ACK */ 1851 /* Accept message by clearing ACK */
1848 sink = 1; 1852 sink = 1;
1849 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 1853 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
1854 dsprintk(NDEBUG_QUEUES, instance,
1855 "COMMAND COMPLETE %p target %d lun %llu\n",
1856 cmd, scmd_id(cmd), cmd->device->lun);
1857
1850 hostdata->connected = NULL; 1858 hostdata->connected = NULL;
1851 dprintk(NDEBUG_QUEUES, "scsi%d : command for target %d, lun %llu completed\n", instance->host_no, cmd->device->id, cmd->device->lun);
1852 hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xFF)); 1859 hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xFF));
1853 1860
1854 /* 1861 /*
@@ -1881,14 +1888,12 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
1881 if ((cmd->cmnd[0] != REQUEST_SENSE) && (status_byte(cmd->SCp.Status) == CHECK_CONDITION)) { 1888 if ((cmd->cmnd[0] != REQUEST_SENSE) && (status_byte(cmd->SCp.Status) == CHECK_CONDITION)) {
1882 scsi_eh_prep_cmnd(cmd, &hostdata->ses, NULL, 0, ~0); 1889 scsi_eh_prep_cmnd(cmd, &hostdata->ses, NULL, 0, ~0);
1883 1890
1884 dprintk(NDEBUG_AUTOSENSE, "scsi%d : performing request sense\n", instance->host_no);
1885
1886 LIST(cmd, hostdata->issue_queue); 1891 LIST(cmd, hostdata->issue_queue);
1887 cmd->host_scribble = (unsigned char *) 1892 cmd->host_scribble = (unsigned char *)
1888 hostdata->issue_queue; 1893 hostdata->issue_queue;
1889 hostdata->issue_queue = (struct scsi_cmnd *) cmd; 1894 hostdata->issue_queue = (struct scsi_cmnd *) cmd;
1890 dsprintk(NDEBUG_QUEUES, instance, 1895 dsprintk(NDEBUG_AUTOSENSE | NDEBUG_QUEUES,
1891 "REQUEST SENSE cmd %p added to head of issue queue\n", 1896 instance, "REQUEST SENSE cmd %p added to head of issue queue\n",
1892 cmd); 1897 cmd);
1893 } else { 1898 } else {
1894 cmd->scsi_done(cmd); 1899 cmd->scsi_done(cmd);
@@ -1925,7 +1930,10 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
1925 hostdata->disconnected_queue; 1930 hostdata->disconnected_queue;
1926 hostdata->connected = NULL; 1931 hostdata->connected = NULL;
1927 hostdata->disconnected_queue = cmd; 1932 hostdata->disconnected_queue = cmd;
1928 dprintk(NDEBUG_QUEUES, "scsi%d : command for target %d lun %llu was moved from connected to" " the disconnected_queue\n", instance->host_no, cmd->device->id, cmd->device->lun); 1933 dsprintk(NDEBUG_INFORMATION | NDEBUG_QUEUES,
1934 instance, "connected command %p for target %d lun %llu moved to disconnected queue\n",
1935 cmd, scmd_id(cmd), cmd->device->lun);
1936
1929 /* 1937 /*
1930 * Restore phase bits to 0 so an interrupted selection, 1938 * Restore phase bits to 0 so an interrupted selection,
1931 * arbitration can resume. 1939 * arbitration can resume.
@@ -2178,7 +2186,11 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
2178 break; 2186 break;
2179 } 2187 }
2180 } 2188 }
2181 if (!tmp) { 2189
2190 if (tmp) {
2191 dsprintk(NDEBUG_RESELECTION | NDEBUG_QUEUES, instance,
2192 "reselect: removed %p from disconnected queue\n", tmp);
2193 } else {
2182 shost_printk(KERN_ERR, instance, "target bitmask 0x%02x lun %d not in disconnected queue.\n", 2194 shost_printk(KERN_ERR, instance, "target bitmask 0x%02x lun %d not in disconnected queue.\n",
2183 target_mask, lun); 2195 target_mask, lun);
2184 /* 2196 /*