Bug 60709 - IDE-DMA might be a cause for kernel crash.
IDE-DMA might be a cause for kernel crash.
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
7.2
ia64 Linux
medium Severity high
: ---
: ---
Assigned To: Arjan van de Ven
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-03-05 00:17 EST by Shinya Narahara
Modified: 2008-08-01 12:22 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-09-30 11:39:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Shinya Narahara 2002-03-05 00:17:10 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.75 [ja] (WinNT; U)

Description of problem:
When we enable the ide-dma on IA-64 machine, the kernel may crash
because of bad dma implementation in kernel 2.4.9-21.


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


How reproducible:
Sometimes

Steps to Reproduce:
1. Put 8GB memory onto your IA-64 machine.
2. boot with ide-dma enabled.
3. mount ide-cdrom, ide-floppy and read any data.
	

Actual Results:  Some data are broken, and sometime kernel crashes.

Expected Results:  Nothing's occured, read any data normally.

Additional info:

We think this is dma logic missimplementation.
If the machine has 4GB memory or lower, this issue never occur.
But our machine has 8GB...
We suppose this is not only for 2.4.9-21, but also 2.4.9-31.
We can avoid this to specify kernel option "ide=nodma", however this
can't solve all problems.

The quick hack below:

--- linux/drivers/block/ll_rw_blk.c.orig	Tue Mar  5 07:22:08 2002
+++ linux/drivers/block/ll_rw_blk.c	Tue Mar  5 06:34:36 2002
@@ -1464,6 +1464,12 @@
 
 	blk_max_low_pfn = max_low_pfn;
 
+#ifdef __ia64__
+	if(max_low_pfn * PAGE_SIZE >= 0x100000000UL)
+	  blk_max_low_pfn = (0x100000000UL >> PAGE_SHIFT) - 1;
+#endif
+	 
+
 #ifdef CONFIG_AMIGA_Z2RAM
 	z2_init();
 #endif
Comment 1 Arjan van de Ven 2002-03-05 05:48:26 EST
Which IDE controller does your machine have ?
There are per-controller maximum dma addresses already,
which looks like one is wrong (we did test with 32Gb on our ia64)
Comment 2 Shinya Narahara 2002-03-06 06:21:39 EST
We tested ide-dma on HITACHI CF-1, which has IDE Controller similar to Intel Lion.
The "lspci" command outputs below:
  00:03.0 ISA bridge: Intel Corporation 82372FB PCI to ISA Bridge (rev 01)
  00:03.1 IDE interface: Intel Corporation 82372FB PIIX4 IDE (rev 01) (prog-if 80 [Master])
  00:03.2 USB Controller: Intel Corporation 82372FB [PCI-to-USB UHCI] (rev 01) (prog-if 00 [UHCI])
  00:03.3 SMBus: Intel Corporation 82372FB System Management Bus Controller (rev 01)

We suppose this is not a IDE Controller issue, but ide-dma driver's.
IDE Controller can move data by using 64bit dma. But
IDE driver(and others) has many 32bit pointer in itself  like below:

linux/drivers/ide/ide-dma.c: ide_build_dmatable()
    while (i) {
                u32 cur_addr;
                u32 cur_len;

                cur_addr = sg_dma_address(sg);
                cur_len = sg_dma_len(sg);
                   :
                           *table++ = cpu_to_le32(cur_addr);

sg_dma_address(sg) is defined unsigned long and dma_addr_t in
linux/include/asm-ia64/machvec.h and linux/include/asm-ia64/types.h.
And cpu_to_le32 is 32bit data however it should be 64bit.

The basic issue may be DMA implementation for each devices. Some devices
have 64bit DMA, but others don't. For 32bit DMA, kernel alloc buffer below
4GB limit. 
kernel-2.4.3-12 doesn't have this issue, because this kernel uses old way
Software I/O TLB. The patches below change this method, and they may
cause this issue.
        linux-2.4.9-ia64-fancyswiommu.patch
        linux-2.4.9-blockhighmem.patch

In the file linux/drivers/block/ll_rw_blk.c, the variable max_low_pfn specifies
"Max page number of system memory", however it should be "Max page
number of  memory area that DMAC can reach". So, the condition in 
somewhere which dicides if the kernel allocates dma buffer below 4GB limit,
           dma_buffer_address > max_low_pfn * PAGE_SIZE
sometime false although the dma_buffer_address is above 4GB.

And more, we doubt your ide-dma test on IA64 machine with 32GB memory.
We have some Intel Lions, they all can't be switched into ide-dma enabled
however specifing kernel parameter or using /proc/ide/hdx/settings:using_dma.
Comment 3 Bugzilla owner 2004-09-30 11:39:24 EDT
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.