Skip to contentSkip to conversation

mtip32xx: Print exact time when an internal command is interrupted

PATCH Superseded Asai Thambi SP 1 participant 1 message Feb 23, 2016 Block layer

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 4/10 mtip32xx: Print exact time when an internal command is interrupted

Print exact time when an internal command is interrupted.

---
 drivers/block/mtip32xx/mtip32xx.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/block/mtip32xx/mtip32xx.c +6 -2
index 30f8246..ca9d35a 100644
@@ -1127,6 +1127,7 @@ static int mtip_exec_internal_command(struct mtip_port *port,
     struct mtip_cmd *int_cmd;
     struct driver_data *dd = port->dd;
     int rv = 0;
+    unsigned long start;
 
     /* Make sure the buffer is 8 byte aligned. This is asic specific. */
     if (buffer & 0x00000007) {
@@ -1207,6 +1208,8 @@ static int mtip_exec_internal_command(struct mtip_port *port,
     /* Populate the command header */
     int_cmd->command_header->byte_count = 0;
 
+    start = jiffies;
+
     /* Issue the command to the hardware */
     mtip_issue_non_ncq_command(port, MTIP_TAG_INTERNAL);
 
@@ -1217,8 +1220,9 @@ static int mtip_exec_internal_command(struct mtip_port *port,
                 msecs_to_jiffies(timeout))) <= 0) {
             if (rv == -ERESTARTSYS) { /* interrupted */
                 dev_err(&dd->pdev->dev,
-                    "Internal command [%02X] was interrupted after %lu ms\n",
-                    fis->command, timeout);
+                    "Internal command [%02X] was interrupted after %u ms\n",
+                    fis->command,
+                    jiffies_to_msecs(jiffies - start));
                 rv = -EINTR;
                 goto exec_ic_exit;
             } else if (rv == 0) /* timeout */
Signature · 1 line
1.7.1