Bug 1232

Summary: Wont build without DMA support enabled
Product: IO/Storage Reporter: P (pliden)
Component: IDEAssignee: Bartlomiej Zolnierkiewicz (bzolnier)
Status: CLOSED PATCH_ALREADY_AVAILABLE    
Severity: normal CC: Reimar.Doeffinger
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.0-test5 Subsystem:
Regression: --- Bisected commit-id:
Attachments: The .config used for this compilation
patch for drivers/ide/setup-ide.c
patch for drivers/ide/pci/generic.c

Description P 2003-09-14 15:14:10 UTC
Distribution: Debian testing
Hardware Environment:
ASUS P4C800 Deluxe, i875 chipset
2.80 GHz P4 CPU
hda: quantum fireball lct08
hdc: plextor cd-writer
hde: Seagate Barracuda V S-ATA, 120GB (ST3120023AS)
Software Environment:
glibc 2.3.1
gcc 3.3 (but kernel compiled with gcc 2.95
Problem Description:
I'm unable to compile the kernel if I dont select generic PCI bus-master DMA
support, BLK_DEV_IDEDMA_PCI. If that's not selected, on the line after
  LD      .tmp_vmlinux1
I get this error message:
drivers/built-in.o(.text+0x1f52d): In function `init_dma_generic':
: undefined reference to `ide_setup_dma'
drivers/built-in.o(.text+0x2b5a5): In function `ide_hwif_setup_dma':
: undefined reference to `ide_setup_dma'
make: *** [.tmp_vmlinux1] Error 1

Steps to reproduce:
configure the kernel without BLK_DEV_IDEDMA_PCI and execute make
Comment 1 P 2003-09-14 15:16:47 UTC
Created attachment 890 [details]
The .config used for this compilation
Comment 2 Reimar D 2003-10-01 02:58:14 UTC
I had the same problem with kernel 2.6.0-test6 when enabling RZ1000 chipset 
drivers but disabling BLK_DEV_IDEDMA_PCI.
This seems to be because drivers/ide/setup-ide.c and drivers/ide/pci/generic.c 
call ide_setup_dma, which is defined in drivers/ide/ide-dma.c. This file is of 
course not linked in when DMA support is disabled.
I made a patch that fixes the problem (it removes anything that has to do with 
DMA from setup-ide.c and generic.c when CONFIG_BLK_DEV_IDEDMA_PCI isn't set), 
but I'm not absolutely sure it won't break anything, especially the generic 
driver with a DMA-capable chipset (but DMA support disabled during kernel 
compile) I think should be tested...
Comment 3 Reimar D 2003-10-01 03:00:00 UTC
Created attachment 966 [details]
patch for drivers/ide/setup-ide.c
Comment 4 Reimar D 2003-10-01 03:00:54 UTC
Created attachment 967 [details]
patch for drivers/ide/pci/generic.c
Comment 5 Alexander Nyberg 2004-12-09 04:37:00 UTC
Just tried with 2.6.10-rc3 and it builds, closing.