mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Asai Thambi SP <asamymuthupa@micron.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: <linux-kernel@vger.kernel.org>,
	Sam Bradshaw <sbradshaw@micron.com>,
	Selvan Mani <smani@micron.com>,
	Rajesh Kumar Sambandam <rsambandam@micron.com>,
	Vignesh Gunasekaran <vgunasekaran@micron.com>
Subject: [PATCH 04/10] mtip32xx: Print exact time when an internal command is interrupted
Date: Mon, 22 Feb 2016 21:01:03 -0800	[thread overview]
Message-ID: <63700830-aa58-d0a0-50d4-ce3db0e2b25d@micron.com> (raw)


Print exact time when an internal command is interrupted.

Signed-off-by: Selvan Mani <smani@micron.com>
Signed-off-by: Rajesh Kumar Sambandam <rsambandam@micron.com>
Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com>
---
 drivers/block/mtip32xx/mtip32xx.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index 30f8246..ca9d35a 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -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 */
-- 
1.7.1

                 reply	other threads:[~2016-02-23  5:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63700830-aa58-d0a0-50d4-ce3db0e2b25d@micron.com \
    --to=asamymuthupa@micron.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rsambandam@micron.com \
    --cc=sbradshaw@micron.com \
    --cc=smani@micron.com \
    --cc=vgunasekaran@micron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®