Re: [PATCH] meye: correct printk of dma_addr_t

From: Randy.Dunlap
Date: Wed Feb 04 2004 - 11:12:31 EST


On Wed, 4 Feb 2004 09:44:37 +0100 Stelian Pop <stelian@xxxxxxxxxx> wrote:

| On Tue, Feb 03, 2004 at 04:28:22PM -0800, Randy.Dunlap wrote:
|
| > | mchip_ptable[] just contains pointers to kernel memory. It doesn't seem
| > | appropriate to be casting these to dma_addr_t's
| >
| >
| > Ugh... if I am reading this correcly, what I see is that
| > mchip_table[] is mostly used for kernel pointers, like you say.
|
| Yep. The meye driver uses 256 PAGE_SIZE buffers. The kernel virtual
| pointers to these buffers are stored in mchip_ptable[]. The
| "toc" containing the dma pointers to these buffers must be given
| to the device as a table having 256 entries, each being 32 bits in length.
|
| In the code I used the last entry of mchip_ptable to store the toc,
| but I could as well construct a different data structure.
|
| Anyway, the device expects a dma_addr to be 32 bits in length, so this
| will not work anyway with HIGHMEM32 (moreover, this is a driver for the
| motion eye camera which is found only in C1 Vaio Sony laptops, which
| motherboard is limited to 384 MB...).
|
| I can see only two solutions:
| *) put the toc in a different, dma_addr_t[] structure, so the
| driver will compile even with HIGHMEM32 (but won't work...)
|
| *) exclude meye from kernel config when HIGHMEM32 is set.

for (HIGHMEM64G=y)

| Which one do you prefer ?


Well, both. :)

The toc of dma_addr_t's should be in its own array/structure.

Adding some comments or help text about the highmem limitation
would also be good.

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