sibyte patch for 2.6 ide.h
PATCH 1/1 sibyte patch for 2.6 ide.h
Folks,
Any objection to the following patch, which lets IDE work on 2.6 for SiByte platforms? Before getting it checked in, I'm willing to hear style comments. I need extra work to happen in ide_init_default_hwifs, but that code doesn't fit well in <asm/ide.h> because most of the useful declarations in <linux/ide.h> haven't been made yet. With this patch, I hoist the code into a C file, but can call back into the existing code (avoiding maintaining a duplicate).
Kip
Index: include/asm-mips/ide.h
===================================================================
RCS file: /home/cvs/linux/include/asm-mips/ide.h,v retrieving revision 1.22
asm-mips/ide.h 3 Sep 2003 23:42:16 -0000 renamed from asm-mips/ide.h 21 Jun 2003 14:08:28 -0000 1.22 +5 -0
@@ -50,7 +50,12 @@ ide_ops->ide_init_hwif_ports(hw, data_port, ctrl_port, irq); } +#ifdef CONFIG_SIBYTE_SB1xxx_SOC +extern void ide_init_default_hwifs(void); +static __inline__ void mips_ide_init_default_hwifs(void) +#else static __inline__ void ide_init_default_hwifs(void) +#endif { #ifndef CONFIG_PCI hw_regs_t hw;
Quoted 7 lines · Kip Walker
Any objection to the following patch, which lets IDE work on 2.6 for SiByte platforms? Before getting it checked in, I'm willing to hear style comments. I need extra work to happen in
ide_init_default_hwifs, but that code doesn't fit well in <asm/ide.h> because most of the useful declarations in <linux/ide.h> haven't been made yet. With this patch, I hoist the code into a C file, but can call back into the existing code (avoiding maintaining a duplicate).
Hmm, dumb question -- can't your extra work be done in code specific to
the host-adapter? The ide_init_default_hwifs() function looks like ISA legacy.
Signature · 3 lines
+ Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: [email protected], PGP key available +
Quoted 11 lines · Maciej W. Rozycki
Quoted 7 lines · Kip Walker
Any objection to the following patch, which lets IDE work on 2.6 for SiByte platforms? Before getting it checked in, I'm willing to hear style comments. I need extra work to happen in
ide_init_default_hwifs, but that code doesn't fit well in <asm/ide.h> because most of the useful declarations in <linux/ide.h> haven't been made yet. With this patch, I hoist the code into a C file, but can call back into the existing code (avoiding maintaining a duplicate).
Quoted 3 lines
Hmm, dumb question -- can't your extra work be done in code specific to
the host-adapter? Theide_init_default_hwifs()function looks like ISA legacy.
Well, I'm not sure. First, the only "special" host adaptor is the so-called Generic Bus IDE, which is probed in drivers/ide/mips/swarm.c. And I used to simply setup the ops in there. But on my platform, PCI-IDE adaptors need my special non-swapping ops too. If I wait until my host adaptor is setup, it's too late because in 2.6 the pci-ide code has already tried to identify the drive using the swapping ops (my experiments indicated that this was NOT the case in 2.4).
This routine is conveniently called AFTER default ops are setup for all hwifs and before the PCI probing is done. It seemed like a nice place fix things up.
I'm happy to hear any alternatives that I can make work. All that IDE code gives me chills.
Kip