IDE disk and HPA

2005-07-22 Thread Oliver Tennert
Hello,

I have a question concerning the handling of HPA (Host-protected areas) in 
current Linux kernels.

Have a look at drivers/ide/ide-disk.c:


static inline void idedisk_check_hpa(ide_drive_t *drive)
{
unsigned long long capacity, set_max;
int lba48 = idedisk_supports_lba48(drive->id);

capacity = drive->capacity64;
if (lba48)
set_max = idedisk_read_native_max_address_ext(drive);
else
set_max = idedisk_read_native_max_address(drive);

if (set_max <= capacity)
return;

printk(KERN_INFO "%s: Host Protected Area detected.\n"
 "\tcurrent capacity is %llu sectors (%llu MB)\n"
 "\tnative  capacity is %llu sectors (%llu MB)\n",
 drive->name,
 capacity, sectors_to_MB(capacity),
 set_max, sectors_to_MB(set_max));

if (lba48)
set_max = idedisk_set_max_address_ext(drive, set_max);
else
set_max = idedisk_set_max_address(drive, set_max);
if (set_max) {
drive->capacity64 = set_max;
printk(KERN_INFO "%s: Host Protected Area disabled.\n",
 drive->name);
}
}

Do I interpret it right that the following is done in the above function:

1.) The current capacity of the disk is detected.
2.) The "native max. address size" of the disk is detected and stored in 
set_max.
3.) If capacity < set_max then it is rightly stated that an HPA is detected.
4.) If an HPA is detected, then that HPA is disabled, i.e. the maximum address 
size is set to the "native max. address size". Afterwards, the HPA is no 
more!

My question is now: why is an HPA disabled i.e. disprotected when detected? 
Why not let the HPA alone, because a certain set of disk sectors shall not be 
accessible by the OS?

Best regards

Oliver
-- 

Acid -- better living through chemistry.
--
__
creating IT solutions

Dr. Oliver Tennert
Senior Solutions Engineer
CAx Professional Services
science + computing ag
phone   +49(0)7071 9457-598 Hagellocher Weg 71-75   
fax +49(0)7071 9457-411 D-72070 Tuebingen, Germany
[EMAIL PROTECTED]  www.science-computing.de


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: IDE disk and HPA

2005-08-04 Thread Oliver Tennert
On Friday, 22. July 2005 16:47, Alan Cox wrote:
> > Do I interpret it right that the following is done in the above function:
>
> Aside from the version in most kernels being buggy yes
>
> > My question is now: why is an HPA disabled i.e. disprotected when
> > detected? Why not let the HPA alone, because a certain set of disk
> > sectors shall not be accessible by the OS?
>
> Because the HPA is most commonly used to hide all but a fraction of a
> disk to work with older BIOSes.

But as to my knowledge, the HPA was had been introduced to allow HW vendors to 
store things like diagnostic programs in a part of the disk protected from 
partitioning and filesystems. The point is, IF there is an HPA, there MIGHT 
be a partitioning scheme and some filesystems on the disk which rely on the 
size of disk being the native size MINUS the HPA.

Also there might be some contents in the HPA which is vulnerable to deletion 
if exposed to the OS in such a transparent way.

So unconditionally disabling the HPA seems not an unconditionally good idea to 
me.

Why is the HPA not just left alone?

Best regards

Oliver

-- 
"She said, `I know you ... you cannot sing'.  I said, `That's nothing,
you should hear me play piano.'"
-- Morrisey
--
__
________creating IT solutions

Dr. Oliver Tennert
Senior Solutions Engineer
CAx Professional Services
science + computing ag
phone   +49(0)7071 9457-598 Hagellocher Weg 71-75   
fax +49(0)7071 9457-411 D-72070 Tuebingen, Germany
[EMAIL PROTECTED]  www.science-computing.de


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


DVD+-R[W] regression in 2.6.12/13

2005-09-05 Thread Oliver Tennert
Hello together,

with my machine, an

"hdparm -I /dev/dvdrecorder" leads to the output:

/dev/dvdrecorder:
 HDIO_DRIVE_CMD(identify) failed: Input/output error

The kernel tells me:

[4296893.262000] hdd: drive_cmd: status=0x51 { DriveReady SeekComplete Error }
[4296893.262000] hdd: drive_cmd: error=0x04 { AbortedCommand }
[4296893.262000] ide: failed opcode was: 0xec

This happens with 2.6.12 and 2.6.13. DMA works fine, though. And burning 
CDs/DVDs seems to work fine, too.

The same hdparm command to a "normal" CD or DVD ROM drive (no writer) does not 
produces any error messages, though.

So what does this strange opcode do, and why does it fail in the latest 
kernels?

/dev/dvdrecorder is a Plextor 708A, the error also occurs with a Plextor 716A.

Best regards

Oliver

-- 
The problem with engineers is that they tend to cheat in order to get
results.

The problem with mathematicians is that they tend to work on toy
problems in order to get results.

The problem with program verifiers is that they tend to cheat at toy
problems in order to get results.
--
__
creating IT solutions

Dr. Oliver Tennert
Senior Solutions Engineer
CAx Professional Services
science + computing ag
phone   +49(0)7071 9457-598 Hagellocher Weg 71-75   
fax +49(0)7071 9457-411 D-72070 Tuebingen, Germany
[EMAIL PROTECTED]  www.science-computing.de


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: DVD+-R[W] regression in 2.6.12/13

2005-09-05 Thread Oliver Tennert
On Monday, 5. September 2005 18:27, Mark Lord wrote:
> Oh, you *should* be able to get the results you
> are looking for (hdparm -I) by trying it this way:
>
> hdparm --Istdin 
> Cheers

Oh yes, you are right! It works. But what is the reason behind this new 
behaviour?

Best regards

Oliver

-- 
I used to work in a fire hydrant factory.  You couldn't park anywhere
near the place.
-- Steven Wright
--
__
creating IT solutions

Dr. Oliver Tennert
Senior Solutions Engineer
CAx Professional Services
science + computing ag
phone   +49(0)7071 9457-598 Hagellocher Weg 71-75   
fax +49(0)7071 9457-411 D-72070 Tuebingen, Germany
[EMAIL PROTECTED]  www.science-computing.de


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/