lkml.org 
[lkml]   [2008]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sparc/staging compile error
J.R. Mauro wrote:
> On Thu, Nov 6, 2008 at 12:32 PM, Christoph Hellwig <hch@infradead.org> wrote:
>> On Thu, Nov 06, 2008 at 09:06:36AM -0500, J.R. Mauro wrote:
>>> static int poch_ioctl(struct inode *inode, struct file *filp,
>>> unsigned int cmd, unsigned long arg)
>>> {
>>> /* ---snip---*/
>>> case POCH_IOC_SYNC_GROUP_FOR_USER:
>>> case POCH_IOC_SYNC_GROUP_FOR_DEVICE:
>>> vms = find_vma(current->mm, arg);
>>> if (!vms)
>>> /* Address not mapped. */
>>> return -EINVAL;
>>> if (vms->vm_file != filp)
>>> /* Address mapped from different device/file. */
>>> return -EINVAL;
>>>
>>> flush_cache_range(vms, arg, arg + channel->group_size);
>> This doesn't look like something a driver should ever do. Could someone
>> explain what it's trying to do from a high level point of view?
>
> CC'd driver maintainers mentioned in the README

May be the code is not doing what is supposed to do, but here is what the
driver is trying to achieve:

The driver allocates a set of buffers for DMA. These buffers are mapped
into user space, when the user does an mmap. In transmit, when the user
space writes to these buffers, the data has to reach physical memory so
that the device can access them. For receive, the cache has to be
invalidated before the user space reads the buffer.

Do let me know if further clarification is required. Any inputs and
suggestions are welcome.

BTW, please do send in the compiler error message.

Regards,
Vijay


\
 
 \ /
  Last update: 2008-11-07 10:05    [W:0.052 / U:0.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site