public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-scsi@vger.kernel.org
Cc: dave.jiang@intel.com, lukasz.dorau@intel.com,
	Jack Wang <jack_wang@usish.com>,
	Sangeetha Gnanasekaran <Sangeetha.Gnanasekaran@pmcs.com>,
	artur.paszkiewicz@intel.com, JBottomley@Parallels.com,
	Nikith Ganigarakoppal <Nikith.Ganigarakoppal@pmcs.com>,
	Anand Kumar Santhanam <AnandKumar.Santhanam@pmcs.com>,
	Xun Ni <xun.ni@intel.com>, Nelson Cheng <nelson.cheng@intel.com>
Subject: [PATCH 2/4] scsi, libsas: introduce scmd_dbg() to quiet false positive "timeout" messages
Date: Thu, 06 Feb 2014 12:23:07 -0800	[thread overview]
Message-ID: <20140206202307.5227.44096.stgit@viggo.jf.intel.com> (raw)
In-Reply-To: <20140206202151.5227.12582.stgit@viggo.jf.intel.com>

libsas sometimes short circuits timeouts to force commands into error
recovery.  It is misleading to log that the command timed-out in
sas_scsi_timed_out() when in fact it was just queued for error handling.
It's also redundant in the case of a true timeout as libata eh will
detect and report timeouts via it's AC_ERR_TIMEOUT facility.

Given that some environments consider "timeout" errors to be indicative
of impending device failure demote the sas_scsi_timed_out() timeout
message to be disabled by default.  This parallels ata_scsi_timed_out().

Cc: Jack Wang <jack_wang@usish.com>
Cc: Anand Kumar Santhanam <AnandKumar.Santhanam@pmcs.com>
Cc: Sangeetha Gnanasekaran <Sangeetha.Gnanasekaran@pmcs.com>
Cc: Nikith Ganigarakoppal <Nikith.Ganigarakoppal@pmcs.com>
Reported-by: Xun Ni <xun.ni@intel.com>
Tested-by: Nelson Cheng <nelson.cheng@intel.com>
Acked-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/scsi/libsas/sas_scsi_host.c |    2 +-
 include/scsi/scsi_device.h          |   12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index da3aee17faa5..25d0f127424d 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -862,7 +862,7 @@ out:
 
 enum blk_eh_timer_return sas_scsi_timed_out(struct scsi_cmnd *cmd)
 {
-	scmd_printk(KERN_DEBUG, cmd, "command %p timed out\n", cmd);
+	scmd_dbg(cmd, "command %p timed out\n", cmd);
 
 	return BLK_EH_NOT_HANDLED;
 }
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index d65fbec2533d..067ac9f1607c 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -235,12 +235,24 @@ struct scsi_dh_data {
 #define sdev_printk(prefix, sdev, fmt, a...)	\
 	dev_printk(prefix, &(sdev)->sdev_gendev, fmt, ##a)
 
+#define sdev_dbg(sdev, fmt, a...) \
+	dev_dbg(&(sdev)->sdev_gendev, fmt, ##a)
+
 #define scmd_printk(prefix, scmd, fmt, a...)				\
         (scmd)->request->rq_disk ?					\
 	sdev_printk(prefix, (scmd)->device, "[%s] " fmt,		\
 		    (scmd)->request->rq_disk->disk_name, ##a) :		\
 	sdev_printk(prefix, (scmd)->device, fmt, ##a)
 
+#define scmd_dbg(scmd, fmt, a...)					   \
+        do {								   \
+		if ((scmd)->request->rq_disk)				   \
+			sdev_dbg((scmd)->device, "[%s] " fmt,		   \
+				 (scmd)->request->rq_disk->disk_name, ##a);\
+		else							   \
+			sdev_dbg((scmd)->device, fmt, ##a);		   \
+	} while (0)
+
 enum scsi_target_state {
 	STARGET_CREATED = 1,
 	STARGET_RUNNING,


  parent reply	other threads:[~2014-02-06 20:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 20:22 [PATCH 0/4] isci, libsas fixes for 3.4-rc2 Dan Williams
2014-02-06 20:23 ` [PATCH 1/4] isci: fix reset timeout handling Dan Williams
2014-02-06 20:23 ` Dan Williams [this message]
2014-02-06 20:23 ` [PATCH 3/4] isci: fix needless ata reset escalations Dan Williams
2014-02-06 20:23 ` [PATCH 4/4] isci: correct erroneous for_each_isci_host macro Dan Williams
2014-02-23 20:12 ` [PATCH 0/4] isci, libsas fixes for 3.4-rc2 James Bottomley
2014-02-24 20:03   ` Dan Williams

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=20140206202307.5227.44096.stgit@viggo.jf.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=AnandKumar.Santhanam@pmcs.com \
    --cc=JBottomley@Parallels.com \
    --cc=Nikith.Ganigarakoppal@pmcs.com \
    --cc=Sangeetha.Gnanasekaran@pmcs.com \
    --cc=artur.paszkiewicz@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=jack_wang@usish.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lukasz.dorau@intel.com \
    --cc=nelson.cheng@intel.com \
    --cc=xun.ni@intel.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