public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: Overlapped command error handling
Date: Fri, 03 Feb 2006 10:34:50 +0100	[thread overview]
Message-ID: <43E323BA.8010604@suse.de> (raw)
In-Reply-To: <1138893147.3363.3.camel@mulgrave>

[-- Attachment #1: Type: text/plain, Size: 2089 bytes --]

James Bottomley wrote:
> On Thu, 2006-02-02 at 14:00 +0100, Hannes Reinecke wrote:
>> It looks to me as if the device has aborted _both_ commands when
>> returning the 'overlapped commands attempted' sense.
>> Is that conformant behaviour?
>>
>> SCSI-2 states in section 7.5.2:
>> A target that detects an incorrect initiator connection shall abort all
>> I/O processes for the initiator on the logical unit or target routine
>> and shall return CHECK CONDITION status. The sense key shall be set to
>> ABORTED COMMAND and the additional sense code shall be set to OVERLAPPED
>> COMMANDS ATTEMPTED.
> 
> Actually, I think it's probably complaining about tag reuse in the sense
> of SAM-3 section 5.9.3.  You return this sense if an initiator attempts
> to use a duplicate tag.  Since the aic79xx manges its own tags, then
> it's probably a driver error.  You could verify this by having the
> aic79xx print out the tag as it sends the command out on the wire.  (The
> device does support TCQ, doesn't it?)
> 
Argl. Been bitten by the classical 'I know better than thou' attitude.

drivers/scsi/aic7xx/aic79xx_osm.c:ahd_platform_set_tags()
	default:
		/*
		 * We allow the OS to queue 2 untagged transactions to
		 * us at any time even though we can only execute them
		 * serially on the controller/device.  This should
		 * remove some latency.
		 */

but as we also removed the aic7xxx internal timeout handling this means
that the queue_depth is always '2', hence the midlayer might attempt to
send two command simultaneously to the device.
Which is what it did in my case. And, surprisingly enough, setting the
queue depth for the non-TCQ case to '1' fixed the issue.

Can someone explain to my how having a queue depth of '2' in the non-TCQ
case can be correct?
If not, please apply the following patch. Oh, and aic7xxx suffers from
the same problem, naturally.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare@suse.de
SuSE Linux Products GmbH		S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de

[-- Attachment #2: aic79xx-disable-tcq-fix --]
[-- Type: text/plain, Size: 1138 bytes --]

diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 78c8338..b9e3776 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -1346,25 +1346,15 @@ ahd_platform_set_tags(struct ahd_softc *
 
 	switch ((dev->flags & (AHD_DEV_Q_BASIC|AHD_DEV_Q_TAGGED))) {
 	case AHD_DEV_Q_BASIC:
-		scsi_adjust_queue_depth(sdev,
-					MSG_SIMPLE_TASK,
-					dev->openings + dev->active);
+		scsi_set_tag_type(sdev, MSG_SIMPLE_TASK);
+		scsi_activate_tcq(sdev, dev->openings + dev->active);
 		break;
 	case AHD_DEV_Q_TAGGED:
-		scsi_adjust_queue_depth(sdev,
-					MSG_ORDERED_TASK,
-					dev->openings + dev->active);
+		scsi_set_tag_type(sdev, MSG_ORDERED_TASK);
+		scsi_activate_tcq(sdev, dev->openings + dev->active);
 		break;
 	default:
-		/*
-		 * We allow the OS to queue 2 untagged transactions to
-		 * us at any time even though we can only execute them
-		 * serially on the controller/device.  This should
-		 * remove some latency.
-		 */
-		scsi_adjust_queue_depth(sdev,
-					/*NON-TAGGED*/0,
-					/*queue depth*/2);
+		scsi_deactivate_tcq(sdev, 1);
 		break;
 	}
 }

  reply	other threads:[~2006-02-03  9:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-02 13:00 Overlapped command error handling Hannes Reinecke
2006-02-02 15:12 ` James Bottomley
2006-02-03  9:34   ` Hannes Reinecke [this message]
2006-02-03 15:31     ` James Bottomley
  -- strict thread matches above, loose matches on Subject: below --
2006-02-03 11:00 Emmanuel Fusté
2006-02-03 11:13 Emmanuel Fusté
2006-02-04 17:01 Emmanuel Fusté

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=43E323BA.8010604@suse.de \
    --to=hare@suse.de \
    --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