Subject: kern/13160: "scsictl format" fails with ahc and esp adapters
To: None <gnats-bugs@gnats.netbsd.org>
From: None <chuq@chuq.com>
List: netbsd-bugs
Date: 06/10/2001 18:01:45
>Number:         13160
>Category:       kern
>Synopsis:       "scsictl format" fails with ahc and esp adapters
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 10 18:00:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Chuck Silvers
>Release:        Fri Jun  8 00:09:46 PDT 2001
>Organization:
me
>Environment:
NetBSD pm2.chuq.com 1.5W NetBSD 1.5W (CHUQ.debug) #30: Fri Jun  8 00:09:46 PDT 2001     chs@spathi.chuq.com:/home/chs/netbsd/src/sys/arch/macppc/compile/CHUQ.debug macppc

>Description:

I'm trying to reformat a disk that has a few bad blocks,
but "scsictl format" completely fails on my powermac with an ahc card.
the card is:

ahc0 at pci0 dev 15 function 0
ahc0: interrupting at irq 25
ahc0: aic7870 Single Channel A, SCSI Id=7, 16/255 SCBs
scsibus2 at ahc0: 8 targets, 8 luns per target


the disk is:
sd2 at scsibus2 target 2 lun 0: <MICROP, 1991-27MZ  1020S, HT01> SCSI2 0/direct fixed
sd2: 8669 MB, 4476 cyl, 27 head, 146 sec, 512 bytes/sect x 17755792 sectors
sd2: sync (100.0ns offset 15), 8-bit (10.000MB/s) transfers, tagged queueing


the results of running "scsictl format" are:

<10 second pause>
/dev/rsd2c: SCSI command timed out
/dev/rsd2c: Check Condition on CDB: 1a 00 03 00 23 00
    SENSE KEY: No Additional Sense


on the console I see:

ahc0:A:2: no active SCB for reconnecting target - issuing BUS DEVICE RESET
SAVED_TCL == 0x20, ARG_1 == 0xff, SEQ_FLAGS == 0x40

<10 second pause>

sd2(ahc0:0:2:0): SCB 1d - timed out in Data-in phase, SEQADDR == 0x151
SCSIRATE == 0x0
sd2(ahc0:0:2:0): BDR message in message buffer
sd2(ahc0:0:2:0): SCB 1d - timed out in Data-in phase, SEQADDR == 0x151
SCSIRATE == 0x0
sd2(ahc0:0:2:0): no longer in timeout, status = 0
sd2: async, 8-bit transfers, tagged queueing
ahc0: Issued Channel A Bus Reset. 1 SCBs aborted



when I try "scsictl format" on the same disk hooked up to a sparc5,
I get the same output from scsictl, and I see this on the console
(immediately, no pause):

esp0: target didn't send tag: 15 bytes in fifo
[35] [0] [0] [8] [0] [14] [238] [144] [0] [0] [2] [0] [131] [22] [0] 

I ran "scsictl format" again at this point, and I got:

sd2(esp0:0:2:0): esp0: timed out [ecb 0xf087a380 (flags 0x101, dleft 0, stat 0)], <state 1, nexus 0x0, phase(l 10, c 100, p 7), resid 0, msg(q 0,o 0) >

and scsictl was stuck in disk wait.  after rebooting, etc, now the disk
appears to be unusable since I get this error for any i/o to the disk:

(from the macppc)

sd2(ahc0:0:2:0):  Check Condition on CDB: 0x35 00 00 00 00 00 00 00 00 00
    SENSE KEY:  Media Error
     ASC/ASCQ:  Medium Format Corrupted

(or from the sparc)

sd2(esp0:0:2:0):  Check Condition on CDB: 0x08 00 00 00 01 00
    SENSE KEY:  Media Error
     ASC/ASCQ:  Medium Format Corrupted



>How-To-Repeat:

run "scsictl format" on a disk you don't mind destroying.

>Fix:

unknown.
>Release-Note:
>Audit-Trail:
>Unformatted: