2011/12/1 Kumar Gala <ga...@kernel.crashing.org>: > > On Dec 1, 2011, at 11:52 AM, Jean-Michel Hautbois wrote: > >> 2011/12/1 Jean-Michel Hautbois <jhautb...@gmail.com>: >>> 2011/12/1 Tabi Timur-B04825 <b04...@freescale.com>: >>>> On Thu, Dec 1, 2011 at 9:04 AM, Jean-Michel Hautbois >>>> <jhautb...@gmail.com> wrote: >>>>> >>>>> Any idea on how to debug this ? I am using a 2.6.35 kernel. >>>> >>>> There are a ton of Kconfig options for debugging various locking bugs. >>>> Try turning them on. >>>> >> >> All Kconfig options do not help me with cache coherency problems, though. >> Or, I didn't find any option related. >> Any idea ? >> >> JM > > Nope, if you can't describe the code in any more detail we can't help. >
Here is what I can tell, I hope this will help you. I have a userland process, which reads and writes data to a character device thanks to ioctl. Reads and Writes are performed with this scheme : Lock Access -> ioctl -> down_interruptible(semaphore) Read (or Write) -> ioctl -> ioread32 Unlock Access -> ioctl -> up(semaphore) It reads (or writes) 4 bytes by 4 bytes, in a loop in the process which will eventually get several bytes from the PCIe device. The read (write) ioctl is really simple (and in fact, may be rewritten) : - kmalloc a structure, then copy_from_user - ioread32 using adress and offset from the structure copied previously - copy_to_user and free the structure. The userland process is currently doing a loop in order to read or writes with a 4bytes step. I am neither the writer of the driver nor the userland process, this is why I can't give you the code. Here is what I would do, at least : 1/ rewrite the read/write part of the ioctl in order to user a per_cpu structure and not a "dynamically allocated at each call" structure 2/ rewrite the userland part in order to ask the driver for n bytes, leaving the loop on ioread32/iowrite32 inside the ioctl Thanks for your help. JM _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev