Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Namjae Jeon <linkinjeon@gmail.com>
To: JBottomley@parallels.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Namjae Jeon <linkinjeon@gmail.com>,
	Namjae Jeon <namjae.jeon@samsung.com>,
	Amit Sahrawat <a.sahrawat@samsung.com>
Subject: [PATCH] [SCSI]: print the msgbytes and statusbyte from scsi result
Date: Sun, 17 Mar 2013 17:29:11 +0900	[thread overview]
Message-ID: <1363508951-3011-1-git-send-email-linkinjeon@gmail.com> (raw)

From: Namjae Jeon <namjae.jeon@samsung.com>

Introduce msgbyte and statusbyte in the prints as part of the
result which is returned by the lower layer driver in response to
SCSI command issued, in case of any error conditions.

Purpose of adding these prints is to convey, during any I/O
error case, which condition exactly has happened in lower device and
from the prints we can directly deduce, what is the status of command
issued. This will help to quickly debug the scenario and also making
a test case to create new scenarios.

Also change the printk to more appropriate pr_* macro.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
---
 drivers/scsi/constants.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index 76e4c03..77bb1dc 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -1445,8 +1445,10 @@ void scsi_show_result(int result)
 
 void scsi_show_result(int result)
 {
-	printk("Result: hostbyte=0x%02x driverbyte=0x%02x\n",
-	       host_byte(result), driver_byte(result));
+	pr_info("Result: hostbyte=0x%02x driverbyte=0x%02x"
+			"msgbyte=0x%02x statusbyte=0x%02x\n",
+	       host_byte(result), driver_byte(result), msg_byte(result),
+							status_byte(result));
 }
 
 #endif
-- 
1.7.9.5

             reply	other threads:[~2013-03-17  8:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-17  8:29 Namjae Jeon [this message]
2013-03-18 10:14 ` [PATCH] [SCSI]: print the msgbytes and statusbyte from scsi result James Bottomley
2013-03-18 11:57   ` Namjae Jeon

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=1363508951-3011-1-git-send-email-linkinjeon@gmail.com \
    --to=linkinjeon@gmail.com \
    --cc=JBottomley@parallels.com \
    --cc=a.sahrawat@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=namjae.jeon@samsung.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