On Thu, 16 Mar 2000, Eric Lee Green wrote:
> Kai Makisara wrote:
...
> > The new version is based on the principle that the length of the mode page
> > read from the drive is used also for writing it back to the drive.
>
> The problem is that this does not work with the Seagate DDS-4 drives, and
> probably not with other Seagate DDS[234] type drives. I quote from the Seagate
> DDS-4 technical documentation:
>
> "If no additional partition is to be defined or if going from a dual-partition
> format to a single-partition format, the Page Length field must be set to 6,
> which indicates that 6 parameter bytes follow the page length byte. If an
> additional partition is to be defined (dual-partition), this field is set to
> 8."
>
> If there is not a second partition, a length of 6 is reported by the mode
> sense. Feeding a length of 6 back into the mode select in order to create the
> partition obviously isn't going to work. The Seagate reports an error.
>
My HP C1533A returns always length 8.
> Similarly, when there is a second partition, and you want to zap it, the
> Seagate has reported a Page Length of 8. Trying to feed that back into the
> Seagate results in the Seagate reporting an error. (Yes, my initial effort
> tried that -- anything other than 6 causes the Seagate to barf).
>
This is what my HP C1533A did before I set the partition size to zero when
deleting the partition. After this it accepted feeding back the page
length returned by the drive.
> I assume that you're doing something a little more sophisticated than just
> feeding the length back, if your code still works with DDS drives. As soon as
> the 2.3.99pre1 kernel finishes coming down, I'll take a look.
>
> Whoops. Just took a look. Don't see any way that what you have will work with
> the Seagate. But I'll try it and see what happens.
>
> *****POSSIBILITY: from mode sense page 11h:
> page length==6 && additional partitions defined ==0: page_format=OLD_DDS
> page length==8 && additional partitions defined ==1: page_format=OLD_DDS
> otherwise:
> page_format=SCSI3
> *****
>
> If the page format is OLD_DDS, you stuff a 6 into the page_length field to zap
> partitions, and an 8 if you are creating/redefining the second partition.
> Otherwise you do not touch it.
>
Yes, this is one way to solve the problem.
> Similarly, if OLD_DDS, you stuff the length into Partition Size Descriptor 0.
> Otherwise
> you stuff 0xffff into Partition Size Descriptor 0, and stuff the size of the
> new partition 1 into Partition Size Descriptor 1.
>
This is already being done. The difference to your suggestion is that the
OLD_DDS functionality is determined by comparing the number of partition
size descriptors to the maximum number or partitions: if the number of
descriptors is greater than maximum number of additional partitions, we
have a non-OLD_DDS drive.
The following patch might solve the problem with old DATs (compiles but
not tested):
------------------------------------------------------------------------------
--- linux-2.3/drivers/scsi/st.c.99p1 Thu Mar 16 22:40:10 2000
+++ linux-2.3/drivers/scsi/st.c Thu Mar 16 22:44:35 2000
@@ -2707,12 +2707,16 @@
if (size <= 0) {
bp[pgo + PP_OFF_NBR_ADD_PARTS] = 0;
+ if (psd_cnt <= bp[pgo + PP_OFF_MAX_ADD_PARTS])
+ bp[pgo + MP_OFF_PAGE_LENGTH] = 6;
DEBC(printk(ST_DEB_MSG "st%d: Formatting tape with one partition.\n",
dev));
} else {
bp[psdo] = (size >> 8) & 0xff;
bp[psdo + 1] = size & 0xff;
bp[pgo + 3] = 1;
+ if (bp[pgo + MP_OFF_PAGE_LENGTH] < 8)
+ bp[pgo + MP_OFF_PAGE_LENGTH] = 8;
DEBC(printk(ST_DEB_MSG
"st%d: Formatting tape with two partitions (1 = %d
MB).\n",
dev, size));
------------------------------------------------------------------------------
> I was not aware of the SDT-7000 using the new-style commands. Do you happen to
> know off-hand whether the SDT-7000 reports a length greater than six for a
> medium partition page mode sense where there is no second partition?
> Unfortunately I do not have access to an SDT-7000 for testing purposes. Sony
> does not appear to have any SCSI-level documentation for the drive on their
> web site either.
>
Michael Schaefer has STD-7000 and the old code did not work with his
drive. His findings and suggestions started the changes.
...
> I verified this morning that your approach (the 0xffff for the first
> partition, the size for the second partition) will work with the SLR/MLR. I
> will have to re-validate later today whether that works with the Exabyte
> Mammoth. I suspect it will. Yep, it works. We have an AIT drive somewhere
> around here, I'll see whether that works too. The Seagate AIT document isn't
> clear on that, but it should. But I fed the VXA the old-style DAT parameters
> and successfully partitioned the tape, so I'm not sure whether the new method
> will work with the VXA. I don't have it hooked to my machine at the moment
The Ecrix web site has a page containing the definitions for the mode
pages. The medium partition page seemed to be SCSI-3 compatible.
Thanks for your input to the driver development. I will be waiting with
interest for your new test results.
Kai