# SCSI Tape Drive --> Kernel Panic

## flickerfly

I get this:

"Kernel Panic: for safety

In interrupt handler -- not syncing"

When running this script:

```
#!/bin/sh

# Write copies until we run off the EOT.

master_file="/var/tmp/usr.tar"

tape="/dev/nst0"

count=1

while time dd if=$master_file of=$tape obs=32k ; do

    echo tape file $count written

    count=`expr $count + 1`

done

echo There are $count copies on tape, rewind.

mt -f $tape rewind
```

My SCSI Bus looks like this (pretty simple):

Adaptec 2940 SCSI adapter - ID 1 - auto termination

SDT-9000 - ID 0 - no termination - term power on

terminator built into cable 

Here's the info from dmesg when the modules (aic7xxx and st) get loaded 

```
scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.33

        <Adaptec 2940 SCSI adapter>

        aic7870: Single Channel A, SCSI Id=1, 16/253 SCBs

(scsi0:A:0): 10.000MB/s transfers (10.000MHz, offset 15)

  Vendor: COMPAQ    Model: SDT-9000          Rev: 4.05

  Type:   Sequential-Access                  ANSI SCSI revision: 02

st: Version 20020805, bufsize 32768, wrt 30720, max init. bufs 4, s/g segs 16

Attached scsi tape st0 at scsi0, channel 0, id 0, lun 0

svc: unknown version (3)

st0: Block limits 1 - 16777215 bytes.
```

I'm wondering what is causing the kernel panic. It works fine until then. I don't have any other SCSI cards to swap out, but I'm thinking that the card is the culprit. I can not confirm this. Is there other information that may be helpful in tracking this down? This tape drive was just installed and the script above was part of testing it to make sure it was ok. (which it obviously wasn't) The entire bus was new for the system which is IDE other than the tape and card.

There is an HPT IDE Raid card in the system wich isn't currently doing anything.

Anyway, how do I resolve the issue causing the kernel panic, or perhaps more pertinent, how do I track it down?

----------

## flickerfly

The following from dmesg on another, I assume related, error when writing to the disk with tar. /dev/nst0 and any tape device files are gone now.

```
scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.33

        <Adaptec 2940 SCSI adapter>

        aic7870: Single Channel A, SCSI Id=1, 16/253 SCBs

(scsi0:A:0): 10.000MB/s transfers (10.000MHz, offset 15)

  Vendor: COMPAQ    Model: SDT-9000          Rev: 4.05

  Type:   Sequential-Access                  ANSI SCSI revision: 02

st: Version 20020805, bufsize 32768, wrt 30720, max init. bufs 4, s/g segs 16

Attached scsi tape st0 at scsi0, channel 0, id 0, lun 0

svc: unknown version (3)

st0: Block limits 1 - 16777215 bytes.

scsi0:0:0:0: Attempting to queue an ABORT message

CDB: 0xa 0x0 0x0 0x80 0x0 0x0

not : At time of recovery, card was <NULL>paused

>>>>>>>>>>>>>>>>>> Dump Card State Begins <<<<<<<<<<<<<<<<<

scsi0: Dumping Card State in Data-out phase, at SEQADDR 0x7a

Card was paused

ACCUM = 0x0, SINDEX = 0xb8, DINDEX = 0xa8, ARG_2 = 0xff

HCNT = 0x0 SCBPTR = 0x0

SCSISIGI[0x4] ERROR[0x0] SCSIBUSL[0x6f] LASTPHASE[0x0] 

SCSISEQ[0x12] SBLKCTL[0x0] SCSIRATE[0xf] SEQCTL[0x10] 

SEQ_FLAGS[0x20] SSTAT0[0x0] SSTAT1[0x3] SSTAT2[0x0] 

SSTAT3[0xf] SIMODE0[0x0] SIMODE1[0xac] SXFRCTL0[0x80] 

DFCNTRL[0x3c] DFSTATUS[0x6d] 

STACK: 0x0 0x162 0x192 0x6c

SCB count = 5

Kernel NEXTQSCB = 4

Card NEXTQSCB = 4

QINFIFO entries: 

Waiting Queue entries: 

Disconnected Queue entries: 

QOUTFIFO entries: 

Sequencer Free SCB List: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 

Sequencer SCB Info: 

  0 SCB_CONTROL[0x40] SCB_SCSIID[0x1] SCB_LUN[0x0] SCB_TAG[0x3] 

  1 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

  2 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

  3 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

  4 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

  5 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

  6 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

  7 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

  8 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

  9 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

 10 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

 11 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

 12 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

 13 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

 14 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

 15 SCB_CONTROL[0x0] SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff] 

Pending list: 

  3 SCB_CONTROL[0x40] SCB_SCSIID[0x1] SCB_LUN[0x0] 

Kernel Free SCB list: 2 1 0 

Untagged Q(0): 3 

DevQ(0:0:0): 0 waiting

<<<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>>

scsi0:0:0:0: Device is active, asserting ATN

Recovery code sleeping

Recovery code awake

Timer Expired

aic7xxx_abort returns 0x2003

scsi0:0:0:0: Attempting to queue a TARGET RESET message

CDB: 0xa 0x0 0x0 0x80 0x0 0x0

aic7xxx_dev_reset returns 0x2003

Recovery SCB completes

(scsi0:A:0:0): Unexpected busfree in Message-in phase

SEQADDR == 0x168

scsi: device set offline - not ready or command retry failed after bus reset: host 0 channel 0 id 0 lun 0

st0: Error 10000 (sugg. bt 0x0, driver bt 0x0, host bt 0x1).

st0: Error 10000 (sugg. bt 0x0, driver bt 0x0, host bt 0x1).

st0: Error on write filemark.

```

----------

## flickerfly

After the above message I rmmod'd st and aic7xxx then when I try to modprobe aic7xxx I get 

```
/lib/modules/2.4.20-Dec3.03/kernel/drivers/scsi/aic7xxx/aic7xxx.o: unresolved symbol scsi_partsize_Rb173b627

/lib/modules/2.4.20-Dec3.03/kernel/drivers/scsi/aic7xxx/aic7xxx.o: unresolved symbol scsi_delete_timer_Rc63b6185

/lib/modules/2.4.20-Dec3.03/kernel/drivers/scsi/aic7xxx/aic7xxx.o: unresolved symbol bread_R5ff18530

/lib/modules/2.4.20-Dec3.03/kernel/drivers/scsi/aic7xxx/aic7xxx.o: unresolved symbol scsi_unregister_Rc6e6f949

/lib/modules/2.4.20-Dec3.03/kernel/drivers/scsi/aic7xxx/aic7xxx.o: unresolved symbol scsi_add_timer_R7b116b88

/lib/modules/2.4.20-Dec3.03/kernel/drivers/scsi/aic7xxx/aic7xxx.o: unresolved symbol scsi_report_bus_reset_R1d7ee095

/lib/modules/2.4.20-Dec3.03/kernel/drivers/scsi/aic7xxx/aic7xxx.o: unresolved symbol scsi_unblock_requests_R63421c2e

/lib/modules/2.4.20-Dec3.03/kernel/drivers/scsi/aic7xxx/aic7xxx.o: unresolved symbol scsi_block_requests_Rd51b3783

/lib/modules/2.4.20-Dec3.03/kernel/drivers/scsi/aic7xxx/aic7xxx.o: unresolved symbol mem_map_Rb7b7bf61

/lib/modules/2.4.20-Dec3.03/kernel/drivers/scsi/aic7xxx/aic7xxx.o: unresolved symbol scsi_register_R0c63fe5c

/lib/modules/2.4.20-Dec3.03/kernel/drivers/scsi/aic7xxx/aic7xxx.o: unresolved symbol __brelse_Rd51f6605

/lib/modules/2.4.20-Dec3.03/kernel/drivers/scsi/aic7xxx/aic7xxx.o: insmod /lib/modules/2.4.20-Dec3.03/kernel/drivers/scsi/aic7xxx/aic7xxx.o failed

/lib/modules/2.4.20-Dec3.03/kernel/drivers/scsi/aic7xxx/aic7xxx.o: insmod aic7xxx failed
```

# cat /proc/version 

Linux version 2.4.20-Dec3.03 (user@host.company.com) (gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice)) #2 Wed Dec 3 04:31:30 EST 2003

----------

