virt_to_phys bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Maybe the wrong function is being used here, I'm not sure.  I ran into
a problem with using virt_to_phys.  The acacia driver for the IDT
rc32438 chip uses virt_to_phys to convert from a KSEG1 address to a
physical address.  Somehow this works on their 2.4.18 kernel but does
not in the 2.4.22 tree.  After changing virt_to_phys to this:

	return (unsigned long)address - KSEGX(address);

everything worked just fine.  I guess what I'm wondering is, is this
the correct way to get a physical address for use with DMA?  The note
in io.h above the function says no but fails to tell me what should be
used.  My guess is virt_to_bus is correct but they are identical
functions.  Since I didn't write this driver, I can only assume that
address for the rung descriptors are accessed via KSEG1 so that they
are uncached and don't require flushing after each access.  I had a
lot of dropped packets when I failed to access the ring descriptors
via KSEG1.


BAPper


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux