All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hans J. Koch" <hjk@linutronix.de>
To: Johann Baudy <johaahn@gmail.com>
Cc: hjk@linutronix.de, gregkh@suse.de, linux-kernel@vger.kernel.org
Subject: Re: UIO: phys_mem_access_prot() miss?
Date: Tue, 13 May 2008 20:51:38 +0200	[thread overview]
Message-ID: <20080513185137.GA3342@local> (raw)
In-Reply-To: <7e0dd21a0805130655xd8b1c8ap9a329943e25fe6fb@mail.gmail.com>

On Tue, May 13, 2008 at 03:55:29PM +0200, Johann Baudy wrote:
> Hi Hans, Greg,
> 
> I need some help on UIO driver.
> I have to add this below workaround (in uio.c) to be able to access
> phys memory from user space.
> I'm currently using PPC arch.
> Am I wrong? or Is it a miss?
> 
> static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
> {
> 
> ...
> 	switch (idev->info->mem[mi].memtype) {
> 		case UIO_MEM_PHYS:
> +       	vma->vm_page_prot = phys_mem_access_prot(filep,
> +            idev->info->mem[mi].addr >> PAGE_SHIFT,
> +						 vma->vm_end - vma->vm_start,
> +						 vma->vm_page_prot);
> 			return uio_mmap_physical(vma);
> 		case UIO_MEM_LOGICAL:
> ...
> 
> }
> 
> FYI: I've copied those lines from mem char driver in mmap_mem().

Hi Johann,
what kernel are you using? Similar problems were reported before, and
we've already applied a patch that should fix it. I think it hit
mainline shortly before the 2.6.25 release. uio_mmap() should work with
kernels >= 2.6.25 for PPC.

Thanks,
Hans


  reply	other threads:[~2008-05-13 18:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-13 13:55 UIO: phys_mem_access_prot() miss? Johann Baudy
2008-05-13 18:51 ` Hans J. Koch [this message]
2008-05-15  7:45   ` Johann Baudy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080513185137.GA3342@local \
    --to=hjk@linutronix.de \
    --cc=gregkh@suse.de \
    --cc=johaahn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.