Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Re: SCSI driver times out on UDB?
@ 1996-10-27 19:31 Matthew Jacob
  0 siblings, 0 replies; 10+ messages in thread
From: Matthew Jacob @ 1996-10-27 19:31 UTC (permalink / raw)


From eric@sub2317.jic.com Sun Oct 27 11:11:55 1996
>
>	This part of it would work, but the scenario that I had in mind
>was something that even can come up with single initiator machines.
>
>	Consider a block read request for sectors 100000-100010, followed by a
>...

This is a good point. The non-t'qing case is unfixable, but the t-qing
case can be handled (albeit with great difficulty) by issuing an ABORT
TAG for the unservice requests and reissuing the command with a HEAD of
QUEUE tag.

Note that this case is unlikely to happen since disk drive vendors
probably do their f/w to try and ensure that a command doesn't hang
out forever. Note that the SCSI specification doesn't say diddly
about whether commands can constipate because new tags keep arriving
that can be satisfied w/o moving the  heads.

>
>	The ultimate solution is that the error detection/recovery system
>needs to be redone anyways.  
>....

Uh huh- this is an area that really always is needing work. Continously.
Are you working on this now, or is this a future thing?

>
>>Yes, I ran into this case, which is why sent the patch to the AIC7770 list-
>>a change made in August broke that which had been a pretty multi-initiator
>>environment for some time (bouncing BUSY conditions (setting DID_ERROR)
>>instead of letting them retry).
>
>	Yes, for a 0th order solution, this would seem like a reasonable
>thing to do.
>

Oooh. *SMACK*. Ow. Okay, so it's not the tablet-from-the-mount sol'n.

>...
>	I know, I know.  I said I didn't like the idea myself :-).  My
>main objection is the additional overhead of putting those commands on
>the bus, and as you say, you would have to use it for each and every command
>that goes out.  Another SCSI-1 feature that sounded good when they first came
>up with it....
 
Yeah, like sub-luns.....

-matt

p.s.: didn't mean to sound argumentative- I do have a fatal weakness
for the galileo-like proof-by-existence statemnet.... sorry...

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: SCSI driver times out on UDB?
@ 1996-10-27 22:04 Eric Youngdale
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Youngdale @ 1996-10-27 22:04 UTC (permalink / raw)


>Note that this case is unlikely to happen since disk drive vendors
>probably do their f/w to try and ensure that a command doesn't hang
>out forever. Note that the SCSI specification doesn't say diddly
>about whether commands can constipate because new tags keep arriving
>that can be satisfied w/o moving the  heads.

	Leonard was finding that the commands were haning long enough to
become troublesome.  That's why the special stuff for BusLogic ended up
in there.

>Uh huh- this is an area that really always is needing work. Continously.
>Are you working on this now, or is this a future thing?

	I don't have that much time at the moment.  There was some talk about
improvements prior to the 2.0 release, but then again we were at code freeze.
There are a few other places that needed fixing too, but I think error
detection/recovery is probably the most serious, and probably the hardest.

	The general ideas that we came up with was that each low-level driver
should have it's own handling routine for timeouts.  Older drivers would be
able to use a default driver of some sort, but the general principle is that
the top level timeout handler in scsi.c essentially would use a single clock to
time out individual devices (instead of individual commands), and the low-level
driver could call into the middle layer to perform specific actions.  This was
the general plan anyways.  The way the top level was going to be restructured,
all it would really know is that different low-level drivers require timeouts
at certain times, so the mid-layer really doesn't know whether it is a command
or device that has timed out, and it would be up to the low-level driver
to handle it in one consistent way or another.

>>	Yes, for a 0th order solution, this would seem like a reasonable
>>thing to do.
>>
>
>Oooh. *SMACK*. Ow. Okay, so it's not the tablet-from-the-mount sol'n.

	Oh, no offense intended :-).  It is a nice solution in that it would
take about an hour to implement and test, so from that perspective it would
be a real win.  Even if we rewrite error handling, it is still a reasonable
thing to do.

-Eric

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: SCSI driver times out on UDB?
@ 1996-10-27 19:11 Eric Youngdale
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Youngdale @ 1996-10-27 19:11 UTC (permalink / raw)


>Well, actually, not quite true. The key issue here is that the
>two machines have to have different initiator IDs. Even non-tagged
>q'ing capable devices can keep track of different (single) commands
>from different initiators. There are notable buggy implementations
>of this (for example, the old CDC Wren IV, would get confused over
>which command came from which initiator).

	This part of it would work, but the scenario that I had in mind
was something that even can come up with single initiator machines.

	Consider a block read request for sectors 100000-100010, followed by a
block read request for sector 0, and then a bunch more reads for sectors near
100000.  The devices are capable of reordering requests, and thus the read
for sector 0 could keep getting deferred as long as requests around 100000
keep coming in.  Eventually the request at block 0 times out, and this causes
a problem.  In the single initiator case, the device driver can detect this
situation, and simply tell the device to complete all previous outstanding
commands before starting the next one (i.e. the Buslogic driver does this.
See Buslogic.c:2560 for example).

	In the multi-initiator case, the problem is a bit more complicated.
You can have a similar situation but if the read from block 0 comes from
machine A and the rest from machine B, then all machine A knows is that
a single command is timing out, but it doesn't know why.  Since that
host isn't issuing any more commands, it cannot use the same strategy that
the Buslogic driver does (i.e. it cannot force an Ordered Queue Tag on the
next request), and we cannot count upon machine B to even notice that anything
is amiss.

	The ultimate solution is that the error detection/recovery system
needs to be redone anyways.  It needs to be made tagged queueing aware so that
it works better for these cases.  It may be capable of handling a case like
what I have described, but I still am unsure what an appropriate stragegy
to detect and deal with the above case would be.  There is probably some
command that could be forced out there to order the queues, but ideally
the strategy would depend upon whether or not the device/system has multiple
initiators or not.

>Yes, I ran into this case, which is why sent the patch to the AIC7770 list-
>a change made in August broke that which had been a pretty multi-initiator
>environment for some time (bouncing BUSY conditions (setting DID_ERROR)
>instead of letting them retry).

	Yes, for a 0th order solution, this would seem like a reasonable
thing to do.

>I've certainly done the latter, but it really isn't necessary to do the
>former when you have a stable system that:
>
>	a) Has patchable timeouts (fixed compile time timeouts are a bad
>	idea- any number that you pick will certainly be wrong in the future).

	I know.  This is something which could in principle be set on a device
by device basis.  Doing something via the /proc filesystem would be the easiest
way to do this, I guess.  To me this has the feel of a band-aid, but it
would alleviate the immediate problem.

>	b) Truly handles command timeouts, with increasing backoff.
>
>Even with the above being not entirely the case, I've made a pretty
>stable multi-initiator system (with the latest && greatest, after I
>fixed the aic 'fixes'). I ran for a 4 hour burn in beating the
>crap of the same disk from both systems.

	I think everyone agrees that timeout handling definitely needs to be
rethought and redone.  I didn't realize it when I first got into SCSI, but
that is probably the hardest part of the whole thing, especially when you have
so many different types of drivers out there, so many different types of
peripherals.  I had the misfourtune of starting out with a 1542, for which
there are really very few effective strategies for dealing with hung devices
or busses.

>No. No. No. RESERVE/RELEASE is not the answer. You'd have to do it on
>a per-command basis if you're actually sharing peripherals completely.
>RESERVE/RELEASE is only really for the HA/Cluster type systems, and even

	I know, I know.  I said I didn't like the idea myself :-).  My
main objection is the additional overhead of putting those commands on
the bus, and as you say, you would have to use it for each and every command
that goes out.  Another SCSI-1 feature that sounded good when they first came
up with it....

-Eric

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: SCSI driver times out on UDB?
@ 1996-10-27 18:40 Matthew Jacob
  0 siblings, 0 replies; 10+ messages in thread
From: Matthew Jacob @ 1996-10-27 18:40 UTC (permalink / raw)


From eric@sub2317.jic.com Sun Oct 27 10:10:33 1996
>
>>>	I doubt that this will work.  None of the drivers currently support
>>>having more than one initiator on the bus at one time.
>>>
>>
>>Think again, billybob:
>
>	Since I wrote large parts of the scsi layer, I think I have a pretty
>good idea of what is going on :-).

Oh, yes, I know. I've been doing this stuff a while myself.

>
>	I believe the real problem would be if you were trying to heavily
>use the disk from both machines at the same time.  It depends a bit upon
>whether the devices support tagged queueing or not (i.e. multiple outstanding
>requests to the same device).  If not, one host will see the device is busy
>when the other one is using it.  With tagged queueing, I am not sure what
>would happen, as the queue could get filled in strange ways.

Well, actually, not quite true. The key issue here is that the
two machines have to have different initiator IDs. Even non-tagged
q'ing capable devices can keep track of different (single) commands
from different initiators. There are notable buggy implementations
of this (for example, the old CDC Wren IV, would get confused over
which command came from which initiator).

About t'qing: If a target is truly SCSI-2 compliant, it should sound
back a QFULL set in the status byte, but I haven't seen anything in
the current linux layer that deals with that.

>
>	If the queue is filled with requests from machine A, and machine B
>doesn't get it's requests satisfied in a timely fashion, machine B will assume
>the bus is locked up, and start trying to unjam it - typically this would
>involve either BUS DEVICE RESET or BUS RESET.  This is likely to severely screw
>up machine A, since it would appear to that machine like it's requests timed
>out (when in fact they were dropped if the reset used cleared the device), and
>then machine A would start trying to reset the bus in order to clear the
>condition...

Yes, I ran into this case, which is why sent the patch to the AIC7770 list-
a change made in August broke that which had been a pretty multi-initiator
environment for some time (bouncing BUSY conditions (setting DID_ERROR)
instead of letting them retry).

>
>	To eliminate this possibility, one would need to fix things so that
>each host had knowledge of the other one, so that it could make allowances
>for the problems.  Ideally the two hosts could communicate (provided that
>you could put them in target mode), to swap notes about what devices are
>in use and what devices are busy, but this would require a fairly complicated
>interaction.

I've certainly done the latter, but it really isn't necessary to do the
former when you have a stable system that:

	a) Has patchable timeouts (fixed compile time timeouts are a bad
	idea- any number that you pick will certainly be wrong in the future).

	b) Truly handles command timeouts, with increasing backoff.

Even with the above being not entirely the case, I've made a pretty
stable multi-initiator system (with the latest && greatest, after I
fixed the aic 'fixes'). I ran for a 4 hour burn in beating the
crap of the same disk from both systems.

>
>	A simpler solution would be to make use of a feature of SCSI that was
>designed for exactly this case.  You can 'reserve' a device, such that any
>other hosts on the bus would find out that the device is busy.  I would
>hesitate to use this in the normal case because it adds additional overhead to
>command processing, but it would probably be the easiest solution to implement.
>

No. No. No. RESERVE/RELEASE is not the answer. You'd have to do it on
a per-command basis if you're actually sharing peripherals completely.
RESERVE/RELEASE is only really for the HA/Cluster type systems, and even
then you have to really do things like 3rd party reservation to make
them reliable (some fella up back east has done some modified reserve/release
f/w case where the reservation times out: this allows a really cheap DFS
implemntation... but I really don't like modified f/w...)

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: SCSI driver times out on UDB?
@ 1996-10-27 18:09 Eric Youngdale
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Youngdale @ 1996-10-27 18:09 UTC (permalink / raw)


>>	I doubt that this will work.  None of the drivers currently support
>>having more than one initiator on the bus at one time.
>>
>
>Think again, billybob:

	Since I wrote large parts of the scsi layer, I think I have a pretty
good idea of what is going on :-).

	I believe the real problem would be if you were trying to heavily
use the disk from both machines at the same time.  It depends a bit upon
whether the devices support tagged queueing or not (i.e. multiple outstanding
requests to the same device).  If not, one host will see the device is busy
when the other one is using it.  With tagged queueing, I am not sure what
would happen, as the queue could get filled in strange ways.

	If the queue is filled with requests from machine A, and machine B
doesn't get it's requests satisfied in a timely fashion, machine B will assume
the bus is locked up, and start trying to unjam it - typically this would
involve either BUS DEVICE RESET or BUS RESET.  This is likely to severely screw
up machine A, since it would appear to that machine like it's requests timed
out (when in fact they were dropped if the reset used cleared the device), and
then machine A would start trying to reset the bus in order to clear the
condition...

	To eliminate this possibility, one would need to fix things so that
each host had knowledge of the other one, so that it could make allowances
for the problems.  Ideally the two hosts could communicate (provided that
you could put them in target mode), to swap notes about what devices are
in use and what devices are busy, but this would require a fairly complicated
interaction.

	A simpler solution would be to make use of a feature of SCSI that was
designed for exactly this case.  You can 'reserve' a device, such that any
other hosts on the bus would find out that the device is busy.  I would
hesitate to use this in the normal case because it adds additional overhead to
command processing, but it would probably be the easiest solution to implement.

-Eric

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: SCSI driver times out on UDB?
@ 1996-10-27 17:36 Matthew Jacob
  0 siblings, 0 replies; 10+ messages in thread
From: Matthew Jacob @ 1996-10-27 17:36 UTC (permalink / raw)


----------
X-Sun-Data-Type: text
X-Sun-Data-Description: text
X-Sun-Data-Name: text
X-Sun-Content-Lines: 86

From axp-list-request@redhat.com Sun Oct 27 06:27:20 1996
>
>
>> So, my idea was to share the SCSI disk in my PC with the UDB. The setup
>> would be something like
>> 
>>  
>>     _________________ ____________________
>>     I                V                    I
>>    NCR              NCR                 disk
>>    UDB            Pentium                 
>
>	I doubt that this will work.  None of the drivers currently support
>having more than one initiator on the bus at one time.
>

Think again, billybob:

----- Begin Included Message -----

From mjacob Sat Oct 26 17:50:56 1996
To: aic7xxx@freebsd.org
Subject: AIC7XXX: 2 problems (solved?) with latest set (4.0/3.2/4.0)
Bcc: emartini@dvsystems.com
reply-to: mjacob@feral.com
Content-Type: X-sun-attachment
Content-Length: 4509

Two issues came up for me- I don't know if anyone else had seen it.

1. Recent change that made BUSY status an error.

Actually, in multi-initiator environments, BUSY is quite common,
so I've made command-line patch to turn the behaviour back to the
old behaviour (infinite retry). This seemed easier than having
to dork with sd.c.

2. Wierdness with USE_DEFAULT && Ultra (2940AU) board.

I was quite startled to see that the brand new board I had
just bought (2940 Ultra PCI kit) didn't have disconnects
turned on.

I looked and saw that USE_DEFAULT is set for this particular
chip type, but it isn't ever cleared in the case that the
board has an SEEPROM. This allows sync mode to be negotiated
but not disconnect. Bizaare.

At any rate, I think that if a board has an SEEPROM *and* BIOS
enabled, it seems reasonable to turn off the USE_DEFAULTS flag.

(patched attached below)

--------------------------------------------------------------
So, with the above changes made, I'm happily beating on the same
disk from two systems w/o each other getting hot and bothered
like they had been:

	System A				System B
	2940 Ultra				2940A Ultra
	Initiator ID 7				Initiator ID 6
		|					|
		|					|
		Seagate @ ID 1				CDROM@ ID 5
		CDROM @ ID 2				|
		DAT @ ID 4				|
		|					|
		----------------- DEC DSP 3150 @ID 0 ----

System A has (hand selected lilo boot):
	Extended Partitions 5 && 6
System B has (hand selected lilo boot):
	Extended Partitions 7 && 8

Cool... anyone have a suggestion as to how to modify lilo so that
one system will have a root on one partition and one system have
a root on another?

----- End Included Message -----

----------
X-Sun-Data-Type: default
X-Sun-Data-Description: default
X-Sun-Data-Name: aic7xxx.c.patch
X-Sun-Content-Lines: 80

*** aic7xxx.c.save	Sat Oct 26 14:54:23 1996
--- aic7xxx.c	Sat Oct 26 17:19:09 1996
***************
*** 950,955 ****
--- 950,956 ----
   */
  static unsigned int aic7xxx_extended = 0;    /* extended translation on? */
  static unsigned int aic7xxx_no_reset = 0;    /* no resetting of SCSI bus */
+ static unsigned int aic7xxx_bsyretry = 0;    /* infinite busy retries */
  static int aic7xxx_irq_trigger = -1;         /*
                                                * -1 use board setting
                                                *  0 use edge triggered
***************
*** 980,985 ****
--- 981,987 ----
      { "no_reset",    &aic7xxx_no_reset },
      { "irq_trigger", &aic7xxx_irq_trigger },
      { "ultra",       &aic7xxx_enable_ultra },
+     { "bsyretry",    &aic7xxx_bsyretry },
      { NULL,          NULL }
    };
  
***************
*** 2843,2850 ****
  	      break;
  
  	    case BUSY:
- 	      printk(KERN_WARNING "scsi%d: Target busy, TCL=0x%x.\n",
-                      p->host_no, scb->target_channel_lun);
  	      if (!aic7xxx_error(cmd))
  	      {
                  /* The error code here used to be DID_BUS_BUSY,
--- 2845,2850 ----
***************
*** 2857,2863 ****
                   * that will eventually lead to a reset or abort of some
                   * sort instead of an endless loop.
                   */
! 	        aic7xxx_error(cmd) = DID_RETRY_COMMAND;
  	      }
  	      break;
  
--- 2857,2878 ----
                   * that will eventually lead to a reset or abort of some
                   * sort instead of an endless loop.
                   */
! 		/*
! 		 * Umm- mjacob@feral.com disputes this notion- actually
! 		 * in many multi-initiator environments you *want*
! 		 * to both infinitely retry BUSY *AND* not get too
! 		 * chatty about it.
! 		 */
! 		if (aic7xxx_bsyretry) {
! 		  aic7xxx_error(cmd) = DID_BUS_BUSY;
! 		} else {
! 	          aic7xxx_error(cmd) = DID_RETRY_COMMAND;
! 		  printk(KERN_WARNING "scsi%d: Target Busy, TCL=0x%x.\n",
! 			p->host_no, scb->target_channel_lun);
! 		}
! 	      } else {
! 		  printk(KERN_WARNING "scsi%d: Target Busy, TCL=0x%x.\n",
! 			p->host_no, scb->target_channel_lun);
  	      }
  	      break;
  
***************
*** 4138,4143 ****
--- 4153,4164 ----
          }
          else
          {
+ 	  /*
+ 	   * If we've got an SEEPROM and the BIOS isn't
+ 	   * disabled we can figure out what, we can
+ 	   * figure out what settings to use.
+ 	   */
+ 	  config->flags &= ~USE_DEFAULTS;
            scsi_conf = 0;
            if (sc.adapter_control & CFRESETB)
              scsi_conf |= RESET_SCSI;

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: SCSI driver times out on UDB?
@ 1996-10-27 14:25 Eric Youngdale
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Youngdale @ 1996-10-27 14:25 UTC (permalink / raw)


> So, my idea was to share the SCSI disk in my PC with the UDB. The setup
> would be something like
> 
>  
>     _________________ ____________________
>     I                V                    I
>    NCR              NCR                 disk
>    UDB            Pentium                 

	I doubt that this will work.  None of the drivers currently support
having more than one initiator on the bus at one time.

-Eric

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 10+ messages in thread
* SCSI driver times out on UDB?
@ 1996-10-25 13:27 Bernd
  1996-10-25 18:32 ` Marc Singer
  1996-10-25 22:16 ` Gerard Roudier
  0 siblings, 2 replies; 10+ messages in thread
From: Bernd @ 1996-10-25 13:27 UTC (permalink / raw)


Hi there,

My UDB's disk drive has recently stopped working (it doesn't even spin
up anymore). No problem, I thought, it was crap, anyway, I will just get
some decent disk in there. Of course, no can do --- the power supply is
too weak.

So, my idea was to share the SCSI disk in my PC with the UDB. The setup
would be something like

 
    _________________ ____________________
    I                V                    I
   NCR              NCR                 disk
   UDB            Pentium                 

with termination on the UDB NCR and on the disk. The UDB's NCR is supposed
to get SCSI id 5, the Pentium will grab 7, and the disk is at 0. Of course,
the UDB and the Pentium will use seperate partitions on the disk, otherwise
it would be sure to end in disaster.

Well, after unsuccessfully trying to convince the ARC console to leave alone
SCSI ID 7, I switched to SRM (and boy, I like it :-), and SRM has no problems
doing as it is told.

I managed to install a (minimal) RedHat 4.0 on the UDB's partition (while
the Pentium was sitting at the CMOS setup screen, thus leaving alone the
SCSI bus).

I _can_ boot both and use both machines at the same time (the Pentium gets 
slightly annoyed at the SCSI bus being reset when the UDB boots, but 
nothing bad happens). BUT:

Every now and again, the UDB will stop working with a message to the effect
of (from memory) 

ncr53c8xx: aborting command due to timeout

and then a PID and some more info that doesn't seem to helpful. Unfortunately,
not only will it not recover from such a timeout, but it also seems to kill
the SCSI bus --- the Pentium can't access the disk anymore, either. BAD!

OK, I _do_ have an idea --- if I understand it correctly, the Pentium has
higher priority on the bus than the UDB. So it might happen that the UDB
wants to talk to the disk, and as the Pentium is using the bus at the
time, won't get through. This is probably unanticipated by the driver
writers, and might in extreme cases lead to a timeout. Does that sound
reasonable?

Now, my questions: 

a) Any idea where I could change the timeout period to some really high
   value? And why does a timeout hang the SCSI bus?
b) Is the suggested setup possible at all, using the cheap NCRs?
c) I am using the 2.0.21 kernel with the BSD-53c8xx driver on the Pentium,
   and the default RedHat 4.0 Noname kernel on the UDB. Any known 
   problems with the SCSI drivers in either (if so, I can recompile
   kernels for both platforms without trouble).
d) On a related note --- is there a way to make the SRM console autoboot
   my MILO?

Any help appreciated --- that UDB is waiting to go into action again!

TIA

    Bernie

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~1996-10-27 22:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-10-27 19:31 SCSI driver times out on UDB? Matthew Jacob
  -- strict thread matches above, loose matches on Subject: below --
1996-10-27 22:04 Eric Youngdale
1996-10-27 19:11 Eric Youngdale
1996-10-27 18:40 Matthew Jacob
1996-10-27 18:09 Eric Youngdale
1996-10-27 17:36 Matthew Jacob
1996-10-27 14:25 Eric Youngdale
1996-10-25 13:27 Bernd
1996-10-25 18:32 ` Marc Singer
1996-10-25 22:16 ` Gerard Roudier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox