Seagate ST340824A and (un)clipping max LBA: 2.2.19+ide04092001 patch

From: Alexander Stavitsky (
Date: Fri Apr 27 2001 - 12:13:20 EST

Disk capacity unclipping routines in ide. do not unclip
Seagate ST340824A.

I have to use the jumper on the drive to make system boot.
I tried "setmax" program and it is able to unclip the capacity,
kernel however does not.

I digged a little and I think the problem is that ST340824A does not follow
the ATA standard - it does support both READ NATIVE MAX ADDRESS
and SET MAX ADDRESS, but does not advertise support for
Host Protected Area feature set.

drive->id->command_set_1 = 0x306b for the this drive.

The unclipping routines compare
drive->id->command_set_1 and 0x0400 (Host Protected Feature set)
The earlier version of the patch compared
drive->id->command_set_1 and 0x000a (Security Mode & Power Managment ???)

When I changed it back to 0x000a, it unclipped the capacity just fine.
But 0x000a doesn't make any sense to me.
What is the correct solution?

Also the idedisk_supports_host_protected_area is there, but not used and
the printk's notifying of unclipping are commented out???

I attach the diff to show what I'm talking about.

Also a related question: when I use "setmax", the drive reports full
capacity through "hdparm -I /dev/hd*", but kernel still uses the old info.
How does one update the kernel info after using "setmax"?

--- ide-disk.c.orig Mon Apr 16 13:30:50 2001
+++ ide-disk.c Fri Apr 27 11:16:38 2001
@@ -546,7 +546,7 @@
         ide_task_t args;
         unsigned long addr = 0;
- if (!(drive->id->command_set_1 & 0x0400))
+ if (!(drive->id->command_set_1 & 0x000a))
 // if (!(drive->id->cfs_enable_1 & 0x0400))
                 return addr;
@@ -580,7 +580,7 @@
         ide_task_t args;
         unsigned long addr_set = 0;
-// printk("%s: (un)clipping max LBA...%lu\n", drive->name, addr_req);
+ printk("%s: (un)clipping max LBA...%lu\n", drive->name, addr_req);
         /* Create IDE/ATA command request structure */
@@ -603,7 +603,7 @@
                          | ((args.tfRegister[IDE_SECTOR_OFFSET] ));
-// printk("%s: max LBA (un)clipped to %lu\n", drive->name, addr_set);
+ printk("%s: max LBA (un)clipped to %lu\n", drive->name, addr_set);
         return addr_set;

=====	GPG Key 0xF7343C8B: 68DD 1E1B 2C98 D336 E31F  C87B 91B9 5244 F734 3C8B
  |_____Alexander Stavitsky 

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Apr 30 2001 - 21:00:18 EST