Re: What's going on with my IDE devices ?

From: Peter T. Breuer (ptb_at_lab.it.uc3m.es)
Date: 11/24/04


Date: Wed, 24 Nov 2004 11:41:43 +0100

Jay <jay@free.fr> wrote:
> Peter T. Breuer wrote:
> > Jay <jay@free.fr> wrote:
> >
> >>My question is : I know my hdb is certainly dying but why does the
> >>kernel disable DMA on my hda since it's my hdb which has errors ! It'd
> >>be more logical to disable DMA on the faulty disk, not on the other one,
> >> wouldn't it ?
> >
> > It's disabled on your controller, I suppose. I don't know why you think
> > it's disk oriented - what evidence do you have in support of that idea?
>
> Right after boot, hdparm -d /dev/hda tells me DMA is off while hdparm -d
> /dev/hdb tells me it's on.
>
> Also the /var/log/syslog lines :
>
> Nov 23 22:15:46 xp kernel: hdb: dma_intr: error=0x84 { DriveStatusError BadCRC }
> Nov 23 22:15:46 xp kernel: hda: DMA disabled
> Nov 23 22:15:46 xp kernel: ide0: reset: success

OK. I'm not clear myself on whether dma is per-controller, per-bus, or
per-disk. Logically it is per-controller, since the dma in question is
between the cpu and _something_, and the cpu can talk to the controller
at the other end of the data bus using the mobo circuits, but the disks
are just not on the mobo to be talked to.

However, maybe controllers have a pass-through mode in which dma
somehow gets to the disk from the cpu? Then what on earth is their ide
bus for?

At any rate, it seems completely the correct response programmatically
to me, when a dma failure is observed, to disable dma on the controller.

The relevant code is in ide-dma.c. It says:

 * DMA is supported for all IDE devices (disk drives, cdroms, tapes,
 * floppies).
 *
 * By default, DMA support is prepared for use, but is currently enabled only
 * for drives which already have DMA enabled (UltraDMA or mode 2 multi/single),
 * or which are recognized as "good" (see table below). Drives with only mode0
 * or mode1 (multi/single) DMA should also work with this chipset/driver
 * (eg. MC2112A) but are not enabled by default.
 *

...

 * To enable DMA, use "hdparm -d1 /dev/hd?" on a per-drive basis after booting.
 * If problems arise, ide.c will disable DMA operation after a few retries.
 * This error recovery mechanism works and has been extremely well exercised.

...

 *
 * Keep an eye on /var/adm/messages for "DMA disabled" messages.
 *
 * Some people have reported trouble with Intel Zappa motherboards.
  ...

Now the actual code allows switching off dma on a drive per drive
basis:

/**
 * __ide_dma_off - disable DMA on a device
 * @drive: drive to disable DMA on
 *
 * Disable IDE DMA for a device on this IDE controller.
 * Inform the user that DMA has been disabled.
 */

int __ide_dma_off (ide_drive_t *drive)
{
        printk(KERN_INFO "%s: DMA disabled\n", drive->name);
        return HWIF(drive)->ide_dma_off_quietly(drive);
}

EXPORT_SYMBOL(__ide_dma_off);

I can't see that this is called on every drive. So it looks ike
dma to your drive really did fail. It only turns dma off after several
tries.

Peter



Relevant Pages

  • [BK PATCHES] ide-2.6 update
    ... small IDE cleanups ... and it works just fine with DMA enabled. ... struct request *rq; ... /* Seagate Barracuda ATA IV Family drives in UDMA mode 5 ...
    (Linux-Kernel)
  • Re: drive has continual errors found.....
    ... Every option on the first page of CMOS about drives is alreadyset for ... the printer there was an option about DMA modes. ... Double-click the controller for which you want to restore the typical DMA transfer mode. ... dont use one of those stupid round cables. ...
    (alt.comp.hardware.pc-homebuilt)
  • Re: drive speed
    ... Is the drive set to run in Ultra DMA or DMA mode or in POI ... uninstall the IDE controller for the burner (either IDE 1 ...
    (microsoft.public.windowsxp.general)
  • dma problems with 2.6 kernel and vt8233A southbridge
    ... I have a problem activating dma on my vt8233A southbridge. ... I have identical disks on the vt8233A controller and a HPT372 ... * signifies the current active mode ... motherboard, with 1GB RAM, and the following drives Western Digital ...
    (comp.os.linux.hardware)
  • Re: XP Wont Use DMA With My Hard Drive
    ... Let BIOS select transfer mode - not selected ... Transfer mode Ultra DMA 5 - Ultra 100 ... Manager) and open up IDE ATA/ATAPI Devices. ... look at the back of the CD/DVD drives. ...
    (microsoft.public.windowsxp.help_and_support)