Re: HPA and failed opcode was: 0x37 ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

Steven Scholz wrote:

How could one then explain

current capacity is 78140160 sectors would be           0x000004A85300
native  capacity is 185074430006016 sectors would be    0xA852FFA85300

? First three bytes ok, then the other three bytes rubbish?

  Note that they're not complete garbage but equal the value of the
lower 3 bytes minus 1. What is clear is that Read Native Max Address Ext
command must be mistreating the HOB bit... :-)

Well this results from

	addr++;	/* since the return value is (maxlba - 1), we add 1 */

in idedisk_read_native_max_address_ext().

Apparently on my system

		u32 high = (args.hobRegister[IDE_HCYL_OFFSET] << 16) |
			   (args.hobRegister[IDE_LCYL_OFFSET] <<  8) |
			    args.hobRegister[IDE_SECTOR_OFFSET];
		u32 low  = ((args.tfRegister[IDE_HCYL_OFFSET])<<16) |
			   ((args.tfRegister[IDE_LCYL_OFFSET])<<8) |
			    (args.tfRegister[IDE_SECTOR_OFFSET]);

high and low contain the same values! :-(

   Right.
I also have doubts about IDE_CONTROL_REG being properly decoded/handled in your FPGA.

I "hardcoded" set_max = capacity, now I get

hda: Host Protected Area detected.
        current capacity is 78140160 sectors (40007 MB)
        native  capacity is 78140160 sectors (40007 MB)
hda: Host Protected Area disabled.
hda: 4289221376 sectors (2196081 MB) w/8192KiB Cache, CHS=65535/255/63

;-)

But still something must go terribly wrong.

Erm, the resulting capacity still seems wrong, so you need to also change idedisk_set_max_address_ext().

smartctl shows

  7 Seek_Error_Rate         0x000f   061   060   030     -       1513926
195 Hardware_ECC_Recovered  0x001a   100   066   000     -       104721680

And after just doing a "mke2fs /dev/hda1" I see

  7 Seek_Error_Rate         0x000f   061   060   030     -       1516919
195 Hardware_ECC_Recovered  0x001a   095   066   000     -       104791382

:-(

I'm not sure smartctl names these attributes corectly -- they're vendor specific, after all... :-)

--
Steven

MBR, Sergei
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux