Re: Constants and kmallocs passed to DMA engine

Gerard Roudier (groudier@club-internet.fr)
Thu, 16 Apr 1998 22:57:26 +0200 (MET DST)


On Thu, 16 Apr 1998, Marc SCHAEFER wrote:

> Hi,
>
> in a device driver, I have declared:
> static const unsigned char buffer[] = { 'a', 'b', 'c', 'd' };
>
> If I pass virt_to_bus(buffer) to a PCI DMA, I get garbage. If
> I kmalloc() and memcpy() the const buffer to that kmalloc()ed
> memory, and pass do virt_to_bus(kmalloced_memory) to the PCI
> DMA, it works like a charm (ix86 architecture).

Just my 0.02 EURO.
If your driver is loaded as a module then I would think your buffer
space is allocated using vmalloc().
Since I never used vir_to_bus() for vmallocced memory and I never
got problems using such an address translation, this could well be
the cause of the problem.

Just a very cheap idea. :-)

Gerard.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu