public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Hans J. Koch" <hjk@linutronix.de>
To: "Herrera-Bendezu, Luis" <lherrera@harris.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: UIO: uio_mem does not handle devices above 4 GB address
Date: Wed, 1 Apr 2009 22:10:45 +0200	[thread overview]
Message-ID: <20090401201045.GB3734@bluebox.local> (raw)
In-Reply-To: <6FCCA913376DD7488F4139A4D11B8F48AC8CDE@troe2k1.cs.myharris.net>

On Wed, Apr 01, 2009 at 01:20:49PM -0400, Herrera-Bendezu, Luis wrote:
> I am working on a PPC440EPx board with some FPGAs located at
> addresses above 4 GB

That's not exactly a good idea on a 32-bit processor. Can't you remap
that chip select to a decent address?

> and kernel version 2.6.28.7. The UIO driver is
> used to access the FPGAs. I get following error when trying to read
> FPGA registers:
> Machine check in kernel mode.
> Data Read PLB Error
> 
> The problem is traced to member addr in struct uio_mem:
> struct uio_mem {
>     unsigned long     addr;
>     unsigned long     size;
>     int               memtype;
>     void __iomem      *internal_addr;
>     struct uio_map    *map;
> };
> 
> When UIO_MEM_PHYS is used with device address > 32-bit then
> uio_mmap_physical() remaps address using idev->info->mem[mi].addr
> thus loosing high address bits.
> 
> One way to solve this problem is to change addr member to:
>     phys_addr_t       addr;

That alone won't solve the problem.

> 
> and modify corresponding attributes in uio.c. Only concern is that
> uio_vma_fault() calls virt_to_page() and vmalloc_to_page() where both
> have addr arg (unsigned long) and (const void *) respectively for
> powerpc. But these functions are only used for UIO_MEM_LOGICAL and
> UIO_MEM_VIRTUAL.

That probably won't work without large modifications.

> 
> Any alternative approach?

Yes, fix your hardware design.

Thanks,
Hans


  reply	other threads:[~2009-04-01 20:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-01 17:20 UIO: uio_mem does not handle devices above 4 GB address Herrera-Bendezu, Luis
2009-04-01 20:10 ` Hans J. Koch [this message]
2009-04-01 21:01   ` Herrera-Bendezu, Luis
2009-04-01 21:54     ` Hans J. Koch
  -- strict thread matches above, loose matches on Subject: below --
2009-04-02 13:20 Steven A. Falco
2009-06-16  3:25 ` Benjamin Herrenschmidt

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=20090401201045.GB3734@bluebox.local \
    --to=hjk@linutronix.de \
    --cc=lherrera@harris.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox