2003-05-30 22:32:46

by Jeffrey W. Baker

[permalink] [raw]
Subject: Different geometry settings for identical drives

I'm having some IDE troubles on 2.4.21-rc3 on amd64
platform. The problem is I've got these two drives:

hda: WDC WD1200JB-75CRA0, ATA DISK drive
blk: queue ffffffff80442aa0, no I/O memory limit
hdc: WDC WD1200JB-75CRA0, ATA DISK drive
hdd: MATSHITA CR-177, ATAPI CD/DVD-ROM drive
blk: queue ffffffff80443238, no I/O memory limit
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: attached ide-disk driver.
hda: host protected area => 1
hda: setmax LBA 234441648, native 234375000
hda: 234375000 sectors (120000 MB) w/8192KiB Cache, CHS=232514/16/63, UDMA(100)
hdc: attached ide-disk driver.
hdc: host protected area => 1
hdc: setmax LBA 234441648, native 234375000
hdc: 234375000 sectors (120000 MB) w/8192KiB Cache, CHS=232514/16/63, UDMA(100)
hdd: attached ide-cdrom driver.
hdd: ATAPI 24X CD-ROM drive, 128kB Cache, UDMA(33)

which are configured identically in the BIOS and recognized identically
at bootup, but the geometry is getting setup differently:

prime:~# hdparm /dev/hda /dev/hdc | grep geometry
geometry = 14589/255/63, sectors = 234375000, start = 0
geometry = 35906/16/63, sectors = 234375000, start = 0
prime:~# cat /proc/ide/ide0/hda/geometry
physical 232514/16/63
logical 14589/255/63
prime:~# cat /proc/ide/ide1/hdc/geometry
physical 232514/16/63
logical 232514/16/63

The result is that hda works fine but hdc doesn't. When I try to mke2fs
on the latter I see:

hdc: dma_intr: status=0x51 { DriveReady SeekComplete Error }
hdc: dma_intr: error=0x10 { SectorIdNotFound }, LBAsect=234441583, sector=232343808

You can see that LBAsect (234441583) is higher than the "native" sectors
quoted by the kernel (234375000, difference 66583 sectors). Why are
these two disks being addressed differently?

IDE controller is AMD 8111.

Cheers,
jwb


2003-05-30 23:07:43

by Petr Vandrovec

[permalink] [raw]
Subject: Re: Different geometry settings for identical drives

On 30 May 03 at 15:46, Jeffrey Baker wrote:

> hda: host protected area => 1
> hda: setmax LBA 234441648, native 234375000
> hda: 234375000 sectors (120000 MB) w/8192KiB Cache, CHS=232514/16/63, UDMA(100)
> hdc: attached ide-disk driver.
> hdc: host protected area => 1
> hdc: setmax LBA 234441648, native 234375000
> hdc: 234375000 sectors (120000 MB) w/8192KiB Cache, CHS=232514/16/63, UDMA(100)
> hdd: attached ide-cdrom driver.
> hdd: ATAPI 24X CD-ROM drive, 128kB Cache, UDMA(33)
>
> The result is that hda works fine but hdc doesn't. When I try to mke2fs
> on the latter I see:
>
> hdc: dma_intr: status=0x51 { DriveReady SeekComplete Error }
> hdc: dma_intr: error=0x10 { SectorIdNotFound }, LBAsect=234441583, sector=232343808
>
> You can see that LBAsect (234441583) is higher than the "native" sectors
> quoted by the kernel (234375000, difference 66583 sectors). Why are
> these two disks being addressed differently?

As far as I can tell, it has nothing to do with disk geometry.

Someone just cut couple of sectors at the end from disk, you compiled
your kernel without CONFIG_IDEDISK_STROKE, but still kernel for some
reason reports block size as if idedisk_set_max_address() was invoked.

I do not see how this could happen with 2.4.21-rc3... Can you recheck
that you are using 2.4.21-rc3 without any additional patches?
Petr Vandrovec
[email protected]


2003-05-30 23:24:55

by Jeffrey W. Baker

[permalink] [raw]
Subject: Re: Different geometry settings for identical drives

On Fri, 2003-05-30 at 16:20, Petr Vandrovec wrote:
> On 30 May 03 at 15:46, Jeffrey Baker wrote:
>
> > hda: host protected area => 1
> > hda: setmax LBA 234441648, native 234375000
> > hda: 234375000 sectors (120000 MB) w/8192KiB Cache, CHS=232514/16/63, UDMA(100)
> > hdc: attached ide-disk driver.
> > hdc: host protected area => 1
> > hdc: setmax LBA 234441648, native 234375000
> > hdc: 234375000 sectors (120000 MB) w/8192KiB Cache, CHS=232514/16/63, UDMA(100)
> > hdd: attached ide-cdrom driver.
> > hdd: ATAPI 24X CD-ROM drive, 128kB Cache, UDMA(33)
> >
> > The result is that hda works fine but hdc doesn't. When I try to mke2fs
> > on the latter I see:
> >
> > hdc: dma_intr: status=0x51 { DriveReady SeekComplete Error }
> > hdc: dma_intr: error=0x10 { SectorIdNotFound }, LBAsect=234441583, sector=232343808
> >
> > You can see that LBAsect (234441583) is higher than the "native" sectors
> > quoted by the kernel (234375000, difference 66583 sectors). Why are
> > these two disks being addressed differently?
>
> As far as I can tell, it has nothing to do with disk geometry.
>
> Someone just cut couple of sectors at the end from disk, you compiled
> your kernel without CONFIG_IDEDISK_STROKE, but still kernel for some
> reason reports block size as if idedisk_set_max_address() was invoked.
>
> I do not see how this could happen with 2.4.21-rc3... Can you recheck
> that you are using 2.4.21-rc3 without any additional patches?

I'm running 2.4.21-rc3 with the latest patch from ftp.x86-64.org:

prime:/usr/src# uname -r
2.4.21-rc3

The x86-64.org patch doesn't touch much outside of arch/x86_64. You are
right that CONFIG_IDE_STROKE is off:

prime:/usr/src/linux# grep IDE .config | sort | tac
CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_IDEDMA_AUTO=y
CONFIG_IDE=y
CONFIG_BLK_DEV_IDE_MODES=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_BLK_DEV_IDEFLOPPY=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_BLK_DEV_IDEDMA=y
CONFIG_BLK_DEV_IDEDISK=y
CONFIG_BLK_DEV_IDECD=y
CONFIG_BLK_DEV_IDE=y
# IDE, ATA and ATAPI Block devices
# CONFIG_VIDEO_SELECT is not set
# CONFIG_VIDEO_DEV is not set
# CONFIG_PARIDE is not set
# CONFIG_IDE_TASK_IOCTL is not set
# CONFIG_IDE_CHIPSETS is not set
# CONFIG_IDEPCI_SHARE_IRQ is not set
# CONFIG_IDEDMA_PCI_WIP is not set
# CONFIG_IDEDMA_ONLYDISK is not set
# CONFIG_IDEDMA_IVB is not set
# CONFIG_IDEDISK_STROKE is not set
# CONFIG_IDEDISK_MULTI_MODE is not set
# CONFIG_BLK_DEV_IDETAPE is not set
# CONFIG_BLK_DEV_IDESCSI is not set
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
# CONFIG_BLK_DEV_IDECS is not set
# CONFIG_BLK_DEV_HD_IDE is not set
# CONFIG_AMD74XX_OVERRIDE is not set
# ATA/IDE/MFM/RLL support

-jwb

2003-05-30 23:37:01

by Andries Brouwer

[permalink] [raw]
Subject: Re: Different geometry settings for identical drives

On Fri, May 30, 2003 at 03:46:03PM -0700, Jeffrey Baker wrote:

> I'm having some IDE troubles on 2.4.21-rc3 on amd64
> platform. The problem is I've got these two drives:
>
> hda: WDC WD1200JB-75CRA0, ATA DISK drive
> hdc: WDC WD1200JB-75CRA0, ATA DISK drive
> hda: setmax LBA 234441648, native 234375000
> hda: 234375000 sectors (120000 MB) w/8192KiB Cache, CHS=232514/16/63, UDMA(100)
> hdc: setmax LBA 234441648, native 234375000
> hdc: 234375000 sectors (120000 MB) w/8192KiB Cache, CHS=232514/16/63, UDMA(100)
>
> which are configured identically in the BIOS and recognized identically
> at bootup, but the geometry is getting setup differently:

A FAQ. Nothing wrong about that.
See http://www.win.tue.nl/~aeb/linux/Large-Disk-14.html#ss14.2
"Nonproblem: Identical disks have different geometry?"

> prime:~# hdparm /dev/hda /dev/hdc | grep geometry
> geometry = 14589/255/63, sectors = 234375000, start = 0
> geometry = 35906/16/63, sectors = 234375000, start = 0
> prime:~# cat /proc/ide/ide0/hda/geometry
> physical 232514/16/63
> logical 14589/255/63
> prime:~# cat /proc/ide/ide1/hdc/geometry
> physical 232514/16/63
> logical 232514/16/63

All this output is rather nonsensical. Geometry does not exist, and
various pieces of software print various meaningless numbers.
It would be better if /proc/.../geometry were removed.
Every microsecond spent looking at its contents is wasted.

> The result is that hda works fine but hdc doesn't.

I think you incorrectly blame your problems on disk geometry.
But I don't know the actual cause.

> When I try to mke2fs on the latter I see:
>
> hdc: dma_intr: status=0x51 { DriveReady SeekComplete Error }
> hdc: dma_intr: error=0x10 { SectorIdNotFound }, LBAsect=234441583, sector=232343808
>
> You can see that LBAsect (234441583) is higher than the "native" sectors
> quoted by the kernel (234375000, difference 66583 sectors). Why are
> these two disks being addressed differently?

Geometry does not influence addressing mode. Moreover, mke2fs is a user space
utility. You mention 2.4.21-rc3, and the ide code including this stuff
changes quite a lot from version to version. What happens under 2.4.N
for N=18,19,20? Both geometries given multiply out to 234372285 and
234374112 sectors, both below 234375000.

Does mke2fs actually ask for an access of sector 234441583?
What size does *fdisk think the disk has?

Can it be that this was an attempted 48-bit command?
(Sorry - no time to read 2.4.21-rc3.)

Andries

2003-05-31 00:06:31

by Petr Vandrovec

[permalink] [raw]
Subject: Re: Different geometry settings for identical drives

On 30 May 03 at 16:38, Jeffrey W. Baker wrote:
> On Fri, 2003-05-30 at 16:20, Petr Vandrovec wrote:
> > On 30 May 03 at 15:46, Jeffrey Baker wrote:
> >
> > > hda: host protected area => 1
> > > hda: setmax LBA 234441648, native 234375000
> > > hda: 234375000 sectors (120000 MB) w/8192KiB Cache, CHS=232514/16/63, UDMA(100)
> > > hdc: attached ide-disk driver.
> > > hdc: host protected area => 1
> > > hdc: setmax LBA 234441648, native 234375000
> > > hdc: 234375000 sectors (120000 MB) w/8192KiB Cache, CHS=232514/16/63, UDMA(100)
> > > hdd: attached ide-cdrom driver.
> > > hdd: ATAPI 24X CD-ROM drive, 128kB Cache, UDMA(33)
> > >
> > > The result is that hda works fine but hdc doesn't. When I try to mke2fs
> > > on the latter I see:
> > >
> > > hdc: dma_intr: status=0x51 { DriveReady SeekComplete Error }
> > > hdc: dma_intr: error=0x10 { SectorIdNotFound }, LBAsect=234441583, sector=232343808

> The x86-64.org patch doesn't touch much outside of arch/x86_64. You are
> right that CONFIG_IDE_STROKE is off:

Ok, after looking at your kernel output more, it seems like that there is
something strange with your drive: we asked for sector 232343808 (0xDD94900),
but your drive reports SectorIdNotFound on sector 234441583 (0xDF94B6F),
which is 2097775 (0x020026F) sectors away from sector we requested...
As with LBA largest transfer length is 256 sectors, there is something
wrong with your disk firmware... Which points to the dead disk
together with some bug in the disk firmware (maybe drive wanted to
report bug in sector DD9496F, but got it somehow wrong?). Can you
try running Western's drive diagnostics on that drive?
Petr Vandrovec
[email protected]


2003-06-02 18:00:33

by Jeffrey W. Baker

[permalink] [raw]
Subject: Re: Different geometry settings for identical drives

On Fri, 2003-05-30 at 17:19, Petr Vandrovec wrote:
> On 30 May 03 at 16:38, Jeffrey W. Baker wrote:
> > On Fri, 2003-05-30 at 16:20, Petr Vandrovec wrote:
> > > On 30 May 03 at 15:46, Jeffrey Baker wrote:
> > >
> > > > hda: host protected area => 1
> > > > hda: setmax LBA 234441648, native 234375000
> > > > hda: 234375000 sectors (120000 MB) w/8192KiB Cache, CHS=232514/16/63, UDMA(100)
> > > > hdc: attached ide-disk driver.
> > > > hdc: host protected area => 1
> > > > hdc: setmax LBA 234441648, native 234375000
> > > > hdc: 234375000 sectors (120000 MB) w/8192KiB Cache, CHS=232514/16/63, UDMA(100)
> > > > hdd: attached ide-cdrom driver.
> > > > hdd: ATAPI 24X CD-ROM drive, 128kB Cache, UDMA(33)
> > > >
> > > > The result is that hda works fine but hdc doesn't. When I try to mke2fs
> > > > on the latter I see:
> > > >
> > > > hdc: dma_intr: status=0x51 { DriveReady SeekComplete Error }
> > > > hdc: dma_intr: error=0x10 { SectorIdNotFound }, LBAsect=234441583, sector=232343808
>
> > The x86-64.org patch doesn't touch much outside of arch/x86_64. You are
> > right that CONFIG_IDE_STROKE is off:
>
> Ok, after looking at your kernel output more, it seems like that there is
> something strange with your drive: we asked for sector 232343808 (0xDD94900),
> but your drive reports SectorIdNotFound on sector 234441583 (0xDF94B6F),
> which is 2097775 (0x020026F) sectors away from sector we requested...
> As with LBA largest transfer length is 256 sectors, there is something
> wrong with your disk firmware... Which points to the dead disk
> together with some bug in the disk firmware (maybe drive wanted to
> report bug in sector DD9496F, but got it somehow wrong?). Can you
> try running Western's drive diagnostics on that drive?

I rebooted with the same drive but added hdc=14589,255,63, and now I can
make the filesystem perfectly well. So it does seem to be an issue with
the way the disk is addressed. Or I could just be fooling myself.

Later I can try swapping in identical hardware and see if the problem
persists. All these disks are brand new and were burned in and
qualified by the vendor.

-jwb