Bug 103923 - Can't disable DMA for CompactFlash-IDE
Summary: Can't disable DMA for CompactFlash-IDE
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kernel
Version: 9
Hardware: i586
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Arjan van de Ven
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-09-07 17:20 UTC by Kazutoshi Morioka
Modified: 2007-04-18 16:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-09-30 15:41:31 UTC
Embargoed:


Attachments (Terms of Use)

Description Kazutoshi Morioka 2003-09-07 17:20:49 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686) Gecko/20030610 Galeon/1.3.7

Description of problem:
I want to use CompactFlash with CF-IDE interface adapter.
My CF-card was probed as CFA DISK

> hdc: TOSHIBA THNCF128MMA, CFA DISK drive

But I got this message after IDE-probe.

>hdc: attached ide-disk driver.
>hdc: task_no_data_intr: status=0x51 { DriveReady SeekComplete Error }
>hdc: task_no_data_intr: error=0x04 { DriveStatusError }
>hdc: 250368 sectors (128 MB) w/2KiB Cache, CHS=978/8/32, BUG
... snip ...
>Partition check:
> hda: hda1 hda2 hda3 hda4
> hdc:<4>hdc: dma_timer_expiry: dma status == 0x21
>hdc: error waiting for DMA
>hdc: dma timeout retry: status=0x51 { DriveReady SeekComplete Error }
>hdc: dma timeout retry: error=0x04 { DriveStatusError }
> hdc1

So, I try to disable DMA with hdparm, and I got this error

># /sbin/hdparm -d0 /dev/hdc
>/dev/hdc:
> setting using_dma to 0 (off)
> HDIO_SET_DMA failed: Operation not permitted
> using_dma    =  1 (on)

Then, I try to use /proc/ide interface, but it's ignored.

># grep using_dma /proc/ide/hdc/settings
>using_dma        1        0       1        rw
># echo "using_dma:0" >/proc/ide/hdc/settings
># grep using_dma /proc/ide/hdc/settings
>using_dma        1        0       1        rw

I put kernel parameter "ide=nodma", but it made no effect; same problem.
I can't disable IDE-DMA in any way. This is very stupid situation.

Version-Release number of selected component (if applicable):
kernel-2.4.20-20.9

How reproducible:
Always

Steps to Reproduce:
1. Use CompactFlash-IDE adapter.
2. Set CompactFlash card to the adapter.
3. Boot Linux.
    

Actual Results:  CompactFlash makes DMA error, and is not work.

Expected Results:  CompactFlash will work as IDE-disk.
If DMA related problem is occur, DMA can be disabled as workaround.

Additional info:

# /sbin/lspci
00:00.0 Host bridge: Intel Corp. 430HX - 82439HX TXC [Triton II] (rev 01)
00:07.0 ISA bridge: Intel Corp. 82371SB PIIX3 ISA [Natoma/Triton II]
00:07.1 IDE interface: Intel Corp. 82371SB PIIX3 IDE [Natoma/Triton II]

# /sbin/hdparm /dev/hdc

/dev/hdc:
 multcount    =  0 (off)
 IO_support   =  0 (default 16-bit)
 unmaskirq    =  0 (off)
 using_dma    =  1 (on)
 keepsettings =  0 (off)
 readonly     =  0 (off)
 readahead    =  8 (on)
 geometry     = 978/8/32, sectors = 250368, start = 0

# /sbin/hdparm -i /dev/hdc
 
/dev/hdc:
 
 Model=TOSHIBA THNCF128MMA, FwRev=3.10, SerialNo=STCB21M83007R95414A8
 Config={ HardSect NotMFM Removeable DTR>10Mbs nonMagnetic }
 RawCHS=978/8/32, TrkSize=16896, SectSize=528, ECCbytes=4
 BuffType=1Sect, BuffSize=2kB, MaxMultSect=1, MultSect=off
 CurCHS=978/8/32, CurSects=250368, LBA=yes, LBAsects=250368
 IORDY=no
 PIO modes:  pio0 pio1 pio2
 AdvancedPM=no

Each time I use hdparm, "dma timeout retry" was occur.

Comment 1 Kazutoshi Morioka 2003-09-13 15:14:48 UTC
This patch works for me.

--- ide-probe.c.orig    2003-09-14 00:12:15.000000000 +0900
+++ ide-probe.c 2003-09-13 20:12:07.000000000 +0900
@@ -880,6 +880,8 @@
                        if (drive->media != ide_disk)
                                enable_dma = 0;
 #endif
+                       if (drive->is_flash || drive->ata_flash)
+                               enable_dma = 0;
                        /*
                         * MAJOR HACK BARF :-/
                         *


Comment 2 Alan Cox 2003-09-13 15:37:55 UTC
Can you attach /proc/ide/hdc/identify for me to look at. I'm not sure what is
going on here but it should always be allowing you to disable DMA.

Comment 3 Kazutoshi Morioka 2003-09-19 09:36:23 UTC
Thanks. This is /proc/ide/hdc/identify.
848a 03d2 0000 0008 4200 0210 0020 0003
d200 0000 5354 4342 3231 4d38 3330 3037
5239 3534 3134 4138 0001 0004 0004 332e
3130 2020 2020 544f 5348 4942 4120 5448
4e43 4631 3238 4d4d 4120 2020 2020 2020
2020 2020 2020 2020 2020 2020 2020 0001
0000 0200 0000 0200 0000 0001 03d2 0008
0020 d200 0003 0101 d200 0003 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000

Comment 4 Kazutoshi Morioka 2004-02-21 03:28:54 UTC
It may be a hardware specific problem.
I moved my harddisk and CF-card and CF-adapter to new machine,
then, the problem is gone.
New machine has Celeron and VIA PLE133 chipset.
$ /sbin/lspci
00:00.0 Host bridge: VIA Technologies, Inc. VT8601 [Apollo ProMedia]
(rev 05)
00:01.0 PCI bridge: VIA Technologies, Inc. VT8601 [Apollo ProMedia AGP]
00:07.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super
South] (rev 40)
00:07.1 IDE interface: VIA Technologies, Inc.
VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE (rev 06)
00:07.4 Bridge: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI]
(rev 40)

Comment 5 Bugzilla owner 2004-09-30 15:41:31 UTC
Thanks for the bug report. However, Red Hat no longer maintains this version of
the product. Please upgrade to the latest version and open a new bug if the problem
persists.

The Fedora Legacy project (http://fedoralegacy.org/) maintains some older releases, 
and if you believe this bug is interesting to them, please report the problem in
the bug tracker at: http://bugzilla.fedora.us/



Note You need to log in before you can comment on or make changes to this bug.