Re: Big Fix for 2.2.1

Linus Torvalds (torvalds@transmeta.com)
Wed, 27 Jan 1999 10:30:23 -0800 (PST)


On Wed, 27 Jan 1999, MOLNAR Ingo wrote:
>
> the attached patch works for me, but i guess it's definitely too ugly to
> live in the stock kernel. Anyway, if anyone wants to have non-power-2
> -PAGE_OFFSET, this patch might help...

It's definitely too ugly.

What you can do, is just something silly like this at bootup:

global void * isa_legacy_region;

pci_setup() or whatever {
isa_legacy_region = ioremap(0xA0000, 0x60000);
}

and then change everybody who uses "readX/writeX" to legacy addresses to
do read_ISA_X/write_ISA_X and then have something like

static inline unsigned char read_ISA_b(unsigned int legacy_address)
{
return readb(legacy_address+isa_legacy_region);
}

and after you've done all that (note that the above is all "portable"
code as long as you have a PCI-like bus, it's only the actual
implementation of "readb()" that needs to be architecture-specific), THEN
can you just simplify the readb() code to _not_ do the phys/bus_to_virt()
translation on x86, and after you do that, then you can make the virtual
mapping functions use add/sub instead of logical and/or.

Basically, I will NOT ever accept any other patches, because patches like
the one Ingo sent out are not just ugly, they are conceptually simply
WRONG, and will bite us eventually.

In short: the current 2.2.0 code is correct. Patches like the ones I've
seen just make it less correct. The only acceptable solution is to
actually change the rules, and force people to use "ioremap()" and
document the fact that readX/writeX no longer accepts legacy region
addresses.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/