Skip to contentSkip to conversation

OPTi 621, chipset revision 18, hangs with enabled DMA

BUG Ognyan Kulev 1 participant 3 messages Jul 31, 2004 – Aug 1, 2004 libata

lore
Share & tools
lore
#0 lore raw

Hi,

I'm resending here my non-replied post to lkml. I hope this time to get some kind of response.

On my laptop (Compaq Armada 4120), I've used for a long time a Linux 2.4.20 kernel just because newer kernels hang on partition checks. The error was something like the following and it always appeared at partition check (this is taken from Internet, but it was similar in my case):

Jan 8 22:14:15 darkstar kernel: hda: dma_timer_expiry: dma status == 0x21
Jan 8 22:14:25 darkstar kernel: hda: error waiting for DMA
Jan 8 22:14:25 darkstar kernel: hda: dma timeout retry: status=0x58 { DriveReady SeekComplete DataRequest }

After adding "ide=nodma", everything works fine. I see that code in 2.6 hasn't changed since 2.4 (except because of the API changes in 2.6, of course).

So I would like by default DMA to be disabled for OPTi 621 or there to be some other resolution. Probably removing the following lines will do the work, but I haven't tested it:

if (!noautodma)

	hwif->autodma = 1;

(Some lines above, there is "hwif->autodma=0;".)

BTW In Linux 2.4.19 source, "grep dma drivers/ide/opti621.c" gives nothing.

Regards,
ogi

#1 lore raw
Quoted 1 line · Ognyan Kulev

After adding "ide=nodma", everything works fine.

Alexander Atanasov replied to me privately and said it seems that OPTi621 doesn't support DMA. But after searching in Google, it looks that there is some OPTi621 that supports DMA, although not 100% confirmed:

http://seclists.org/lists/linux-kernel/2002/Sep/2187.html
http://seclists.org/lists/linux-kernel/2002/Sep/2428.html

Is there reliable way to test if IDE controller suports DMA? I can test patches, but after some weeks, because I don't have the laptop right now.

BTW My problem is that same as described in http://www.mail-archive.com/[email protected]/msg82172.html (revision 18 too!)

Regards,
ogi

#2 lore raw
Quoted 1 line · Ognyan Kulev

Alexander Atanasov replied to me privately and said it seems that OPTi621 doesn't support DMA. But after searching in Google, it looks that there is some OPTi621 that supports DMA, although not 100% confirmed:

I've found the following code in NetBSD's src/sys/dev/pci/optiide.c:

	aprint_normal("%s: bus-master DMA support present",
	    sc->sc_wdcdev.sc_dev.dv_xname);

	/*
	 * XXXSCW:
	 * There seem to be a couple of buggy revisions/implementations
	 * of the OPTi pciide chipset. This kludge seems to fix one of
	 * the reported problems (PR/11644) but still fails for the
	 * other (PR/13151), although the latter may be due to other
	 * issues too...
	 */
	if (PCI_REVISION(pa->pa_class) <= 0x12) {
		aprint_normal(" but disabled due to chip rev. <= 0x12");
		sc->sc_dma_ok = 0;
	} else
		pciide_mapreg_dma(sc, pa);

The relevant PRs are:

http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=11644
http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=13151

Notice that revision of my OPTi is 18 (0x12, which is <= 0x12). As scw@netbsd says in PR/13151, he developed the driver on revision 0x30, so I guess this "revision <= 0x12" check is the best we've got for now.

FreeBSD doesn't have anything special for this IDE: http://www.freebsd.org/releases/5.2.1R/hardware-i386.html#AEN65

Regards,
ogi