gdth driver on L2000
Hi all,
Forgive me if this is a FAQ. I read the website FAQ and did a little searching, but didn't turn up anything. I am not a kernel hacker-- that's why I'm posting here.
I am running Debian sid on a 2-way L2000-44 (rp5450). I have successfully built a 64-bit, SMP 2.4.25 kernel using Debian's source (I'd be happy to share my config if anyone is interested) and the kernel-patch-2.4.25-hppa patch.
I want to use an Intel SRCU RAID controller in this machine, so I modified my config to build the gdth driver into the kernel. It fails with an error about DMA_MODE_CASCADE being undeclared. Looking further, I note that this is normally declared in include/asm-$ARCH/dma.h, but it doesn't appear in include/asm-parisc/dma.h. Is it undeclared because it doesn't work or because no one has needed it before? Below is the build output.
Would I be better off with a 2.6 kernel? I have not yet attempted to build any 2.6 kernels on this machine. I took the lack of stock 2.6 kernels for hppa in sid to mean that there was a problem, but I'd love to be wrong about that. ;)
Thanks,
Eric
$ uname -a Linux parisc 2.4.25-64-smp #1 SMP Mon Mar 22 10:09:38 EST 2004 parisc64 GNU/Linux
gcc-3.3-hppa64 3.3.3-2
binutils-hppa64 2.14.90.0.7-5
hppa64-linux-gcc -D__KERNEL__ -I/usr/src/kernel-source-2.4.25/include
-Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
-fno-common -O2 -D__linux__ -pipe -fno-strength-reduce -mno-space-regs -mfast-indirect-calls -mdisable-fpregs -ffunction-sections -march=2.0
-mschedule=8000 -nostdinc -I/usr/lib/gcc-lib/hppa64-linux/3.3.3/include -DKBUILD_BASENAME=gdth -c
-o gdth.o gdth.cgdth.c: In function `gdth_init_isa':
gdth.c:1135: warning: passing arg 1 of memset_io' makes integer from pointer without a cast gdth.c: In function gdth_init_pci':
gdth.c:1292: warning: passing arg 1 of memset_io' makes integer from pointer without a cast gdth.c:1405: warning: passing arg 1 of memset_io' makes integer from pointer without a cast gdth.c:1560: warning: passing arg 1 of memset_io' makes integer from pointer without a cast gdth.c: In function gdth_copy_command':
gdth.c:1792: warning: passing arg 1 of memcpy_toio' makes integer from pointer without a cast gdth.c:1799: warning: passing arg 1 of memcpy_toio' makes integer from pointer without a cast gdth.c:1806: warning: passing arg 1 of memcpy_toio' makes integer from pointer without a cast gdth.c:1813: warning: passing arg 1 of memcpy_toio' makes integer from pointer without a cast gdth.c: In function `gdth_detect':
gdth.c:4066: error: `DMA_MODE_CASCADE' undeclared (first use in this function) gdth.c:4066: error: (Each undeclared identifier is reported only once gdth.c:4066: error: for each function it appears in.)
make[4]: *** [gdth.o] Error 1
make[4]: Leaving directory `/usr/src/kernel-source-2.4.25/drivers/scsi' make[3]: *** [first_rule] Error 2
make[3]: Leaving directory `/usr/src/kernel-source-2.4.25/drivers/scsi' make[2]: *** [_subdir_scsi] Error 2
make[2]: Leaving directory `/usr/src/kernel-source-2.4.25/drivers'
make[1]: *** [_dir_drivers] Error 2
make[1]: Leaving directory `/usr/src/kernel-source-2.4.25'
make: *** [stamp-build] Error 2
Quoted 1 line · Eric Sproul
Forgive me if this is a FAQ.
It's not - no problem
...
Quoted 6 lines
I want to use an Intel SRCU RAID controller in this machine, so I modified my config to build the gdth driver into the kernel. It fails with an error about
DMA_MODE_CASCADEbeing undeclared. Looking further, I note that this is normally declared ininclude/asm-$ARCH/dma.h, but it doesn't appear ininclude/asm-parisc/dma.h. Is it undeclared because it doesn't work or because no one has needed it before?
DMA_MODE_CASCADE is for ISA bus support (8237A chips). AFAIK, parisc doesn't support ISA.
And EISA support isn't fully working yet.
EISA support still needs some code written for the WAX chip IOMMU.
gdth is a "multi-bus" driver:
static int gdth_init_eisa(ushort eisa_adr,gdth_ha_str *ha); static int gdth_init_isa(ulong32 bios_adr,gdth_ha_str *ha); static int gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha);
The problem is the driver assumes EISA/ISA/PCI are all enabled.
The linux-2.6/drivers/scsi/Kconfig entry says only any one of those:
config SCSI_GDTH
tristate "Intel/ICP (former GDT SCSI Disk Array) RAID Controller support
"
depends on (ISA || EISA || PCI) && SCSI
In short, the driver needs to be mangled so it works with only PCI enabled. [ Actually, this driver violates Documentation/CodingStyle pretty seriously.
o too many "#if LINUX_VERSION_CODE" spread out all over the place.
o indentation is 4 spaces and nests too deep
]
Quoted 1 line
Would I be better off with a 2.6 kernel?
Not really. linux-2.6 shows the same problem:
grundler <507>fgrep DMA_MODE_CASCADE drivers/*/gdth*drivers/scsi/gdth.c: set_dma_mode(ha->drq,DMA_MODE_CASCADE);
I've hacked a quick patch together that lets this driver *build* without ISA/EISA support using linux-2.6/arch/parisc/configs/a500_defconfig. Just enable CONFIG_GDTH and apply this patch:
ftp://ftp.parisc-linux.org/patches/diff-2.6.5-gdth-01
If it "works for you", please submit the patch to linux-scsi mailing list ([email protected]) and cc parisc-linux mailing list.
Quoted 3 lines
I took the lack of stock 2.6
kernels for hppa in sid to mean that there was a problem, but I'd love to be wrong about that.
2.6 is working pretty well and I think it's just up to someone to package and upload a linux-2.6 kernel*hppa.deb.
Thanks to Paul Bame, prebuilt tar balls and .debs of nightly builds are available for both 2.4 and 2.6 hppa kernels:
http://cvs.parisc-linux.org/download/linux-2.4/ http://cvs.parisc-linux.org/download/linux-2.6/
For the L2000, you can run the "a500" flavor builds.
grant
Quoted 7 lines · Grant Grundler
I've hacked a quick patch together that lets this driver *build* without ISA/EISA support using linux-2.6/arch/parisc/configs/a500_defconfig. Just enable
CONFIG_GDTHand apply this patch:ftp://ftp.parisc-linux.org/patches/diff-2.6.5-gdth-01If it "works for you", please submit the patch to linux-scsi mailing list ([email protected]) and cc parisc-linux mailing list.
Grant,
I'm working with Debian's 2.6.4 sources, but the gdth driver must be unchanged since the patch applies cleanly. Thanks!
All,
Does anyone else who is running Debian have a working config I could use to start from? I've started with the stock Debian config (with changes applied from the parisc Kconfig) but I'm having ugly build problems and I know I've probably screwed up somewhere. When I built my 2.4.25 kernel, I started with the config from Debian's stock 2.4.20-64-smp kernel and made my adjustments from there. I don't have that luxury with 2.6.4 as there is no stock hppa kernel yet. If you have a working 2.6 config, please post it or email me off-list.
Thanks,
Eric
Quoted 5 lines · Eric Sproul
All,
Does anyone else who is running Debian have a working config I could use to start from? I've started with the stock Debian config (with changes applied from the pariscKconfig) but I'm having ugly build problems and I know I've probably screwed up somewhere.
Bad form replying to my own post, but I continue to have this problem and could use some extra eyes/brain cells. ;)
I put together what I thought was a sensible config for my L2000. However, I get a funky error where it claims the UTS Release is mismatched, but the stated values are identical. That may or may not be connected to the make error where cpu_present_map appears undefined but does appear in include/asm-parisc/smp.h. Maybe even though CONFIG_SMP=Y it is not including smp.h?
Could someone point me in the right direction to correct this error?
Thanks,
Eric
I am appending an extraversion of "-64-smp" because I am specifying the following config options:
CONFIG_PA8X00=yCONFIG_PA20=yCONFIG_PARISC64=yCONFIG_64BIT=yCONFIG_SMP=y
(configure step completes normally, then...)
/usr/bin/make EXTRAVERSION=-64-smp \
ARCH=parisc prepare
make[1]: Entering directory `/usr/src/kernel-source-2.6.4'
HOSTCC scripts/split-include HOSTCC scripts/conmakehash HOSTCC scripts/docproc HOSTCC scripts/kallsyms CC scripts/empty.o HOSTCC scripts/mk_elfconfig MKELF scripts/elfconfig.h HOSTCC scripts/file2alias.o HOSTCC scripts/modpost.o HOSTCC scripts/sumversion.o HOSTLD scripts/modpost HOSTCC scripts/pnmtologo HOSTCC scripts/bin2c SYMLINK include/asm -> include/asm-parisc CHK include/linux/version.h UPD include/linux/version.h SPLIT include/linux/autoconf.h -> include/config/* CC arch/parisc/kernel/asm-offsets.s CHK include/asm-parisc/offsets.h UPD include/asm-parisc/offsets.h
make[1]: Leaving directory `/usr/src/kernel-source-2.6.4' echo done > stamp-kernel-configure
echo done > stamp-configure
The UTS Release version in include/linux/version.h
"2.6.4-64-smp"
does not match current version
"2.6.4-64-smp"Reconfiguring.
touch Makefile
test -f stamp-configure || /usr/bin/make -f /usr/share/kernel-package/rules configure/usr/bin/make EXTRAVERSION=-64-smp ARCH=parisc \
vmlinux
make[1]: Entering directory `/usr/src/kernel-source-2.6.4'
CHK include/linux/version.h
make[2]: `arch/parisc/kernel/asm-offsets.s' is up to date.
CC init/main.o
In file included from init/main.c:35:include/linux/kernel_stat.h: In function `kstat_irqs':include/linux/kernel_stat.h:47: error: `cpu_present_map' undeclared (first use in this function)include/linux/kernel_stat.h:47: error: (Each undeclared identifier is reported only onceinclude/linux/kernel_stat.h:47: error: for each function it appears in.) init/main.c: In function `smp_init':init/main.c:362: error: `cpu_present_map' undeclared (first use in this function)
make[2]: *** [init/main.o] Error 1
make[1]: *** [init] Error 2
make[1]: Leaving directory `/usr/src/kernel-source-2.6.4'
make: *** [stamp-build] Error 2
Quoted 1 line · Eric Sproul
Maybe even though
CONFIG_SMP=Yit is not includingsmp.h?
Do not enable CONFIG_SMP on 2.6 kernels. It doesn't work.
grant
(should have replied to the list...)
Quoted 4 lines · Grant Grundler
Quoted 1 line · Eric Sproul
Maybe even though
CONFIG_SMP=Yit is not includingsmp.h?Do not enable
CONFIG_SMPon 2.6 kernels. It doesn't work.
Ah, OK. Well that's a deal-breaker for me. I really need SMP.
I'll see if I can adapt your gdth patch to 2.4.25 and I'll post my results. Thanks again for doing that. It's one more piece of the kernel I understand just a bit better now. :)
Thanks,
Eric
Quoted 3 lines · Eric Sproul
Grant,
I'm working with Debian's 2.6.4 sources, but the gdth driver must be unchanged since the patch applies cleanly. Thanks!
good
Quoted 3 lines
All,
Does anyone else who is running Debian have a working config I could use to start from?
Grab a500_defconfig from
http://cvs.parisc-linux.org/linux-2.6/arch/parisc/configs
that works.
grant
Quoted 6 lines · Grant Grundler
Quoted 3 lines · Eric Sproul
Grant,
I'm working with Debian's 2.6.4 sources, but the gdth driver must be unchanged since the patch applies cleanly. Thanks!good
I successfully ported Grant's patch to 2.4.25, and have attached a diff for gdth.c. All credit for this goes to Grant-- I just adjusted the line numbers. ;) I'll be submitting this patch as requested to linux-scsi.
The driver appears to work now in my 2.4.25-64-smp kernel:
GDT: Storage RAID Controller Driver. Version: 2.05
GDT: Found 1 PCI Storage RAID Controllers GDT CTR0: Configuring GDT-PCI HA at 32/0 IRQ 128
lspci:
20:00.0 RAID bus controller: Intel Corp. RAID Controller
I'm moving now to check out the RAID management utility from Intel that supposedly worked under Debian 2.2. I haven't even peeked at it yet.
Many thanks to Grant for getting me going.
Eric