Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Mar 2004 08:13:50 -0800 (PST)
From:      Doug Ambrisko <ambrisko@ambrisko.com>
To:        =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= <des@des.no>
Cc:        stable@freebsd.org
Subject:   Re: Backporting S-ATA driver SiI 3112a to FreeBSD-STABLE?
Message-ID:  <200403171613.i2HGDomg064214@ambrisko.com>
In-Reply-To: <xzpvfl390n9.fsf@dwp.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
Dag-Erling Smørgrav writes:
| Doug Ambrisko <ambrisko@ambrisko.com> writes:
| > BTW a failure mode in the SATA spec. says freeze (ie. lock up the
| > system if you don't acknowledge SATA issues).
| 
| Huh?  Care to elaborate?

>From the Serial ATA Spec. 1.0a.  Section 11.1 for error handling:
  Error responses are generally classified into four categories
	Freeze
	Abort
	Retry
	Track/ignore
  The error handling responses described in this section are not 
  comprehensive and are included to cover specific known error scenarios 
  as well as to illustrate typical error control and recovery actions.
  This section is therefore descriptive and supplemental to the error 
  reporting interface defined in section 10 and implementations may vary 
  in their internal error recovery and control actions.  

  For the most severe error conditions in which state has been critically 
  perturbed in a way that it is not recoverable, the appropriate error 
  response is to freeze and rely on a reset or similar operation to restore 
  all necessary state to return to normal operation.

I have seen freeze result in system lock-ups in which an NMI can't break
into the debugger etc.  With the Promise SATA cards if I have interrupts
enabled and the interrupt handler checks whether or not a drive has
left then the system lock ups go away with the Promise controller.  For
the Intel 6300ESB I need to poll the SATA serror register to look for
SATA errors or the system will lock up.  The way I generate an error
is to either power off the SATA drive or pull the cable while the 
system is running.  I'm running with ata-raid.  Unfortunately the
Intel parts don't interrupt on a SATA condition so I have to poll it.
I need to put a timeout to check for drives coming or going then
it should work close how the Promise controller works.  The Intel
6300ESB does indeed have both sstatus and serror registers even
though they only claim the serror is there.  The sstatus register
says whether or not a drive is there.

Most of the existing ATA code will just bang on the controller and
if a SATA error happens it is ignored and eventually just doing
a inb or outb to the controller will lock up the system.  I did
initial instrumentation to that level of inb/outb.  This wasn't
a lot of fun to debug since if I messed up I'd get a system lock up.
Granted in normal operation this isn't a problem but during failure
recovery that I was testing system lock ups are not good.

Now I really like the SATA stuff since it is pretty easy to implement
kernel support for hot plug like USB drives etc. 

Doug A.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403171613.i2HGDomg064214>