Re: [PATCH] ibmvscsis: add DRC indices to debug statements

2017-12-04 Thread Martin K. Petersen

Bryant,

> Where applicable, changes pr_debug, pr_info, pr_err, etc. calls
> to the dev_* versions.  This adds the DRC index of the device to the
> corresponding trace statement.

Applied to 4.16/scsi-queue, thank you!

-- 
Martin K. Petersen  Oracle Linux Engineering


[PATCH] ibmvscsis: add DRC indices to debug statements

2017-12-04 Thread Bryant G. Ly
Where applicable, changes pr_debug, pr_info, pr_err, etc. calls
to the dev_* versions.  This adds the DRC index of the device to the
corresponding trace statement.

Signed-off-by: Bryant G. Ly 
Signed-off-by: Brad Warrum 
---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 320 ---
 1 file changed, 170 insertions(+), 150 deletions(-)

diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 
b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
index 2799a6b08f736..c3a76af9f5fa9 100644
--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
@@ -122,7 +122,7 @@ static bool connection_broken(struct scsi_info *vscsi)
   cpu_to_be64(buffer[MSG_HI]),
   cpu_to_be64(buffer[MSG_LOW]));
 
-   pr_debug("connection_broken: rc %ld\n", h_return_code);
+   dev_dbg(&vscsi->dev, "Connection_broken: rc %ld\n", h_return_code);
 
if (h_return_code == H_CLOSED)
rc = true;
@@ -210,7 +210,7 @@ static long ibmvscsis_unregister_command_q(struct scsi_info 
*vscsi)
}
} while (qrc != H_SUCCESS && rc == ADAPT_SUCCESS);
 
-   pr_debug("Freeing CRQ: phyp rc %ld, rc %ld\n", qrc, rc);
+   dev_dbg(&vscsi->dev, "Freeing CRQ: phyp rc %ld, rc %ld\n", qrc, rc);
 
return rc;
 }
@@ -291,9 +291,9 @@ static long ibmvscsis_free_command_q(struct scsi_info 
*vscsi)
ibmvscsis_delete_client_info(vscsi, false);
}
 
-   pr_debug("free_command_q: flags 0x%x, state 0x%hx, acr_flags 
0x%x, acr_state 0x%hx\n",
-vscsi->flags, vscsi->state, vscsi->phyp_acr_flags,
-vscsi->phyp_acr_state);
+   dev_dbg(&vscsi->dev, "free_command_q: flags 0x%x, state 0x%hx, 
acr_flags 0x%x, acr_state 0x%hx\n",
+   vscsi->flags, vscsi->state, vscsi->phyp_acr_flags,
+   vscsi->phyp_acr_state);
}
return rc;
 }
@@ -428,8 +428,8 @@ static void ibmvscsis_disconnect(struct work_struct *work)
vscsi->flags |= DISCONNECT_SCHEDULED;
vscsi->flags &= ~SCHEDULE_DISCONNECT;
 
-   pr_debug("disconnect: flags 0x%x, state 0x%hx\n", vscsi->flags,
-vscsi->state);
+   dev_dbg(&vscsi->dev, "disconnect: flags 0x%x, state 0x%hx\n",
+   vscsi->flags, vscsi->state);
 
/*
 * check which state we are in and see if we
@@ -540,13 +540,14 @@ static void ibmvscsis_disconnect(struct work_struct *work)
}
 
if (wait_idle) {
-   pr_debug("disconnect start wait, active %d, sched %d\n",
-(int)list_empty(&vscsi->active_q),
-(int)list_empty(&vscsi->schedule_q));
+   dev_dbg(&vscsi->dev, "disconnect start wait, active %d, sched 
%d\n",
+   (int)list_empty(&vscsi->active_q),
+   (int)list_empty(&vscsi->schedule_q));
if (!list_empty(&vscsi->active_q) ||
!list_empty(&vscsi->schedule_q)) {
vscsi->flags |= WAIT_FOR_IDLE;
-   pr_debug("disconnect flags 0x%x\n", vscsi->flags);
+   dev_dbg(&vscsi->dev, "disconnect flags 0x%x\n",
+   vscsi->flags);
/*
 * This routine is can not be called with the interrupt
 * lock held.
@@ -555,7 +556,7 @@ static void ibmvscsis_disconnect(struct work_struct *work)
wait_for_completion(&vscsi->wait_idle);
spin_lock_bh(&vscsi->intr_lock);
}
-   pr_debug("disconnect stop wait\n");
+   dev_dbg(&vscsi->dev, "disconnect stop wait\n");
 
ibmvscsis_adapter_idle(vscsi);
}
@@ -597,8 +598,8 @@ static void ibmvscsis_post_disconnect(struct scsi_info 
*vscsi, uint new_state,
 
vscsi->flags |= flag_bits;
 
-   pr_debug("post_disconnect: new_state 0x%x, flag_bits 0x%x, vscsi->flags 
0x%x, state %hx\n",
-new_state, flag_bits, vscsi->flags, vscsi->state);
+   dev_dbg(&vscsi->dev, "post_disconnect: new_state 0x%x, flag_bits 0x%x, 
vscsi->flags 0x%x, state %hx\n",
+   new_state, flag_bits, vscsi->flags, vscsi->state);
 
if (!(vscsi->flags & (DISCONNECT_SCHEDULED | SCHEDULE_DISCONNECT))) {
vscsi->flags |= SCHEDULE_DISCONNECT;
@@ -648,8 +649,8 @@ static void ibmvscsis_post_disconnect(struct scsi_info 
*vscsi, uint new_state,
}
}
 
-   pr_debug("Leaving post_disconnect: flags 0x%x, new_state 0x%x\n",
-vscsi->flags, vscsi->new_state);
+   dev_dbg(&vscsi->dev, "Leaving post_disconnect: flags 0x%x, new_state 
0x%x\n",
+   vscsi->flags, vscsi->new_state);
 }
 
 /**
@@ -724,7 +725,8 @@ static long ibmvscsis_handle_init_msg(struct scsi_info 
*vscsi)