Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Jul 2001 13:32:02 -0700 (PDT)
From:      Matthew Jacob <mjacob@feral.com>
To:        Stephen McKay <mckay@thehub.com.au>
Cc:        <freebsd-scsi@FreeBSD.ORG>, Norman Czarczinski <Norman.Czarczinski@t-online.de>
Subject:   Re: Trouble with SCSI Streamer 
Message-ID:  <20010710132824.C99370-100000@wonky.feral.com>
In-Reply-To: <200107101252.f6ACqMF26033@dungeon.home>

next in thread | previous in thread | raw e-mail | index | archive | help

On Tue, 10 Jul 2001, Stephen McKay wrote:

> On Wednesday, 4th July 2001, Matthew Jacob wrote:
>
> >On Wed, 4 Jul 2001, Norman Czarczinski wrote:
> >
> >> On Wednesday 04 July 2001 19:34, you wrote:
> >> > Well, that's one theory shot down. Can you explicitly try changing the
> >> > blocksize to 1k, test, back to 512 and test again?
> >>
> >> That was it. With 1k it works. After switching back to 512 the problem came
> >> back.
> >
> >Okay- sounds like a bug in sa(4) then- and wierdness in the drive. It
> >shouldn't allow you to set it to 512 bytes if that doesn't work.
>
> This is deja vu time!  We had this discussion a couple of years ago,
> if I recall correctly.  QIC tapes in fixed block mode at densities of
> QIC-320 and above are in 1k blocks, and below that they are 512 byte blocks.
> It is not linked to a drive type, but to the tape density.
>
> Instead of getting to the bottom of this and making the sa driver know
> everything there was to know about QIC drives, the resolution was to
> use variable length blocks on QIC-320 and above.  At the time, I had
> some philosophical quibbles with this approach, but it seems quite
> practical in retrospect.

No, I don't agree. A lot of QIC tape drives don't get emulated (it has to be
emulated because they cannot actually *do* variable blocksize) blocksizes
right.


> Indeed, checking the pre-cam st driver reveals the default is as I just
> described.  But checking the cam sa driver reveals quirks that set 1024
> byte fixed blocks on some drives, and more code that sets 512 byte
> blocks for lots of densities, including ones that it shouldn't.  That's
> not right.

Yes, this probably is true. Currently, if this code is exercised (which is
rarer than it should be):

                        switch (softc->media_density) {
                        case SCSI_DENSITY_QIC_11_4TRK:
                        case SCSI_DENSITY_QIC_11_9TRK:
                        case SCSI_DENSITY_QIC_24:
                        case SCSI_DENSITY_QIC_120:
                        case SCSI_DENSITY_QIC_150:
                        case SCSI_DENSITY_QIC_525_320:
                        case SCSI_DENSITY_QIC_1320:
                        case SCSI_DENSITY_QIC_3080:
                                softc->quirks &= ~SA_QUIRK_2FM;
                                softc->quirks |= SA_QUIRK_FIXED|SA_QUIRK_1FM;
                                softc->last_media_blksize = 512;
                                break;
                        case SCSI_DENSITY_QIC_4GB:
                        case SCSI_DENSITY_QIC_2GB:
                                softc->quirks &= ~SA_QUIRK_2FM;
                                softc->quirks |= SA_QUIRK_FIXED|SA_QUIRK_1FM;
                                softc->last_media_blksize = 1024;
                                break;

This should probably be:

                        switch (softc->media_density) {
                        case SCSI_DENSITY_QIC_11_4TRK:
                        case SCSI_DENSITY_QIC_11_9TRK:
                        case SCSI_DENSITY_QIC_24:
                        case SCSI_DENSITY_QIC_120:
                        case SCSI_DENSITY_QIC_150:
                                softc->quirks &= ~SA_QUIRK_2FM;
                                softc->quirks |= SA_QUIRK_FIXED|SA_QUIRK_1FM;
                                softc->last_media_blksize = 512;
                                break;
                        case SCSI_DENSITY_QIC_525_320:
                        case SCSI_DENSITY_QIC_1320:
                        case SCSI_DENSITY_QIC_3080:
                        case SCSI_DENSITY_QIC_4GB:
                        case SCSI_DENSITY_QIC_2GB:
                                softc->quirks &= ~SA_QUIRK_2FM;
                                softc->quirks |= SA_QUIRK_FIXED|SA_QUIRK_1FM;
                                softc->last_media_blksize = 1024;
                                break;


It turns out, though, that this code path is rarely exercised because our
beloved QIC manufactures often just report 'default' density (0).

>
> I think a useful exercise would be to copy more of the QIC heuristics from
> the old st driver into the sa driver.

Got patches?

-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?20010710132824.C99370-100000>