lkml.org 
[lkml]   [1999]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: kmalloc
Linus Torvalds <torvalds@transmeta.com> wrote during last night (21:15 GMT):
>>> Add to that Alan's mistake this morning about phys_to_virt() etc. and I
>>> think we have a clear pattern: these people aren't dummies, so we can't
>>> blame them, there just isn't adequate documentation.
> Actually, all of this (including the special case of not needing
> ioremap() for the legacy ISA area) _is_ documented.
> See
> linux/Documentation/IO-mapping.txt
> which has all this explained (and expressly _does_ mention that you
> should _never_ care about physical addresses in any normal case).
> So this time we can't blame the documentation: this is one of the few
> things I _did_ sit down and write documentation for (it's probably just
> about the only file in the Documentation subdirectory that is actually
> written by me).
Hello Linus,
unfortunately, I must admit that this is not true. There are four
problems:
At first, ioremap does not exist on sparc32, if I did not
critically miss something (I'm not sure whether sparc32 can have PCI,
but there should be one interface, for SBUS too). And I'm not sure, whether
ioremap works correctly on PReP. When writting matroxfb, I tried
ioremap(vga_base, 16MB), ioremap(vga_base+0xC0000000, 16MB) and
ioremap(vga_base+0x80000000, 16MB). Some of them died with
`invalid value written into msr2', some did not return from ioremap
(FYI, PowerStack I, 32MB RAM). I found only one working way:
`virt = vga_base + _ISA_MEM_BASE' - because of whole PCI MMIO space is
mapped at _ISA_MEM_BASE on PReP (sorry, do not ask me for patches for PPC,
I do not understand neither that architecture nor their assembly language).
At second, on some (all?) big endian archs, readl/writel stores data
in little-endian format. I do not know, whether this idea is correct
and I'm sure that it is not documented.
And at third, in structure pci_device, there is array with addresses
of PCI devices. It should contain CPU view of device address, i.e.
something suitable for ioremap(). It contains PCI bus view... So another
case.
And fourth, minor problem, document does not state that `virtual' address
should be `unsigned long' and not `anything *'.
Of course, I can say that on i386 and Alpha everything works fine when
done by IO-mapping document, but I was not able to get my driver work
on PPC without (a) PPC box on the table and (b) looking for long hours
into PPC code. But maybe that I'm just too stupid and I should not program
for live :-(
So, Linus, if you read to this point, I wish you everything best, keep
up good work, sorry for your wasted time and I hope, that there are no more
showstoppers hidden in 2.2.0.
Best regards,
Petr Vandrovec
vandrove@vc.cvut.cz

P.S.: Sorry to PPC peoples, but I did not port matroxfb into sparc, mips,
m68k or arm yet, so I cannot comment on these architectures.

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.073 / U:21.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site