public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Krzysztof Błaszkowski" <kb@sysmikro.com.pl>
To: eric@andante.org, linux-scsi@vger.kernel.org
Cc: Krzysztof.b@id-7.com
Subject: does scsi_io_completion need to dump sense data for ata pass through (ck_cond = 1) ?
Date: Tue, 22 Dec 2009 19:17:36 +0100	[thread overview]
Message-ID: <200912221917.36495.kb@sysmikro.com.pl> (raw)

Hello Eric,

I think it is not necessary and current behavior of kernel like 2.6.31 
confuses QA people. 
They need explanation that message like below:

sd 5:0:1:0: [sdb] Sense Key : Recovered Error [current] [descriptor]
Descriptor sense data with sense descriptors (in hex):
        72 01 00 1d 00 00 00 0e 09 0c 00 00 00 00 00 00
        00 00 00 00 00 50
sd 5:0:1:0: [sdb] Add. Sense: ATA pass through information available

stands for that sense data contains ata registers file and the command was 
executed properly.

Here is additional condition i used in scsi_io_completion() which suppresses 
this message. Is it okay ?

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index f3c4089..7e8555a 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -774,8 +774,18 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned 
int good_bytes)
 	 * is what gets returned to the user
 	 */
 	if (sense_valid && sshdr.sense_key == RECOVERED_ERROR) {
-		if (!(req->cmd_flags & REQ_QUIET))
-			scsi_print_sense("", cmd);
+		if (!(req->cmd_flags & REQ_QUIET) && 
+		    !((req->cmd[0] == ATA_16 || req->cmd[0] == ATA_12) 
+			&& (req->cmd[2] & (1 << 5))) ) {
+				/* skip reporting sense data for satl
+					ATA_12/16 if CK_COND bit is set
+					because:
+					- sense is delivered to app,
+					- by default cmd ends up with
+					    0x50 status byte
+				*/
+				scsi_print_sense("", cmd);
+			}
 		result = 0;
 		/* BLOCK_PC may have set error */
 		error = 0;



This is something offtopic but i don't know yet where to look for answer to 
following issue with native 2.6.31.5.  I noticed that very often there is 
used oom killer on a box with xeon (dual core), 2G ram during e.g. make -j2 
modules so make can be killed but also e.g. ssh, hald (saw in dmesg). Anyway 
make modules  (! without j2 !)somewhat works also this issue doesn't happen 
with kernel like 2.6.27.19 (Suse patches) - no matter make forks any time it 
wants.

Any ideas ?


Regards,
Krzysztof Blaszkowski




--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2009-12-22 18:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-22 18:17 Krzysztof Błaszkowski [this message]
2009-12-22 19:44 ` does scsi_io_completion need to dump sense data for ata pass through (ck_cond = 1) ? Douglas Gilbert
2009-12-22 23:11   ` Krzysztof Błaszkowski
2009-12-23  5:45     ` Douglas Gilbert
2009-12-23 11:16       ` Krzysztof Błaszkowski
2009-12-27 19:56       ` Eric Youngdale

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=200912221917.36495.kb@sysmikro.com.pl \
    --to=kb@sysmikro.com.pl \
    --cc=Krzysztof.b@id-7.com \
    --cc=eric@andante.org \
    --cc=linux-scsi@vger.kernel.org \
    /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