Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Sep 1999 22:18:48 -0700 (PDT)
From:      Matthew Jacob <mjacob@feral.com>
To:        John and Jennifer Reynolds <jreynold@primenet.com>
Cc:        freebsd-scsi@FreeBSD.ORG
Subject:   Re: How to tell if a quirk "worked"?
Message-ID:  <Pine.BSF.4.05.9909192206440.43106-100000@semuta.feral.com>
In-Reply-To: <14309.49140.814045.451806@localhost.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> Hello all,
> 
> In -questions, I've been running a thread about my difficulties getting a
> TapeStor 8000 (TR4) to dump(8) properly. Here is a quick synopsys of my
> difficulties:

Some of us don't read -questions, so that's why I haven't seen this...
> 
>  o I cannot get multiple files onto a tape by issuing sequential dump(8)
>  commands (using /dev/nrsa0 of course) using the -a "auto-size" option to
>  dump(8). Yes, I've rewound, erased, retentioned my life away.
> 
>  o If I use "dump 0uBbf 4000000 10 /dev/nrsa0 filesystem" I can get multiple
>  dumps to run in a row but cannot "restore -i" any file except for the first
>  one. A "restore -b 10 -s 2 -i" to get to the second dump on the tape will fail
>  with a "tape read error: Undefined error: 0" and rewind. I can do restore -i
>  on the first dump file on the tape.

That one I don't know about.

> 
> In my /var/log/messages file, I received the following messages:
> 
> (sa0:ahc0:0:2:0): unable to backspace over one of double filemarks at end of tape
> (sa0:ahc0:0:2:0): it is possible that this device needs a SA_QUIRK_1FM quirk set for it

You can also, when the tape is loaded to BOT, do:

mt -f /dev/nrsa0 seteotmodel 1

See the mt(1) man page for this.
> 
> I did a "recursive" grep of every .h and .c in /usr/src looking for those error
> messages but couldn't find them. Notwithstanding that, I went and edited

in scsi_sa.c:sa_close:

        case SA_MODE_NOREWIND:
                /*
                 * If we're not rewinding/unloading the tape, find out
                 * whether we need to back up over one of two filemarks
                 * we wrote (if we wrote two filemarks) so that appends
                 * from this point on will be sane.
                 */
                if (error == 0 && writing && (softc->quirks & SA_QUIRK_2FM)) {
                        tmp = saspace(periph, -1, SS_FILEMARKS);
                        if (tmp) {
                                xpt_print_path(periph->path);
                                printf("unable to backspace over one of double"
                                   " filemarks at end of tape\n");
                                xpt_print_path(periph->path);
                                printf("it is possible that this device "
                                   " needs a SA_QUIRK_1FM quirk set for it\n");
                                softc->flags |= SA_FLAG_TAPE_FROZEN;
                        }
                }

I now see, much to my embarrassment, that I forgot to document a "FROZEN"
state- if the the driver thinks it has lost where things are on the tape,
it won't let you do anything but rewind, seek to end of tape, or unload
the tape. When any of these actions occur, normal tape operations consistent
with that state may resume.

> cam/scsi/scsi_sa.c and put the following quirk entry:
> 
>         {
>                 { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "SEAGATE",
>                   "Seagate STT8000*", "*"}, SA_QUIRK_FIXED|SA_QUIRK_1FM, 512
>         },
> 
> I'm just guessing that was correct from reading the header files, etc. I copied
> this from the HP T4000 tape entry so I don't know if the FIXED quirk needs to
> be there or if a good block size is 512. However, how does one know if a
> "quirk" is applied correctly? I'm assuming that the '*' in the product and
> revision fields are for wild carding. I'm asking this because after recompiling
> my kernel with this change in scsi_sa.c, I see no differences in tape drive
> behavior. How can I tell if CAM is "applying" the quirk (don't know the right
> terminology here) to my drive? My boot message for the drive is:
> 
>  sa0 at ahc0 bus 0 target 2 lun 0
>  sa0: <Seagate STT8000N 4.11> Removable Sequential Access SCSI-2 device 

If you set CAMDEBUG, a quirk match will trigger this code in saregister:

#ifdef  CAMDEBUG
                xpt_print_path(periph->path);
                printf("found quirk entry %d\n",
                    ((struct sa_quirk_entry *) match) - sa_quirk_table);
#endif

> 
> The truly strange part about this that I've gotten mail from Bryce Newall
> <data@dreamhaven.net> stating that his Seagate ST8000N works like a charm. The
> only difference is that he's got an older ROM onboard. His boot message shows 
> 
>  sa0 at ahc0 bus 0 target 5 lun 0
>  sa0: <Seagate STT8000N 3.16> Removable Sequential Access SCSI-2 device 

The above quirk likely should be:

         {
                 { T_SEQUENTIAL, SIP_MEDIA_REMOVABLE, "SEAGATE ",
                   "STT8000*", "*"}, SA_QUIRK_FIXED|SA_QUIRK_1FM, 512
         },
 

> 
> ps: the drive functions flawlessly under Ebola98 and their software, so I don't
> think I can blame hardware--except for possibily inducing stupidity into the
> equation between ROM 3.16 and 4.11 ....
> 

!$&!)%(&!)@(%!()@%_(!)@%)_(!@%!!!!!!!###!! :-}

-matt






To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9909192206440.43106-100000>