public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Frank Buss <fb@frank-buss.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Problems with dma_mmap_writecombine on mach-pxa
Date: Thu, 17 Feb 2005 18:12:41 +0000	[thread overview]
Message-ID: <20050217181241.A22752@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20050217175150.D8E015B874@frankbuss.de>; from fb@frank-buss.de on Thu, Feb 17, 2005 at 06:51:49PM +0100

On Thu, Feb 17, 2005 at 06:51:49PM +0100, Frank Buss wrote:
> I'm trying to use the pxafb driver on mach-pxa, but I can't mmap the
> framebuffer memory. I can access it from the driver, filling the entire
> screen, but when I access the pointer returned from mmap from a user space
> program, the following two things happens:
> 
> - the vm_pgoff is ignored and I get the start of the internal buffer, which
> caused writing to the palette and DMA descriptors
> 
> - when I change the location of the framebuffer to the start of the internal
> buffer, I can write to the screen, but only to the first 4 k; any write
> after this address is ignored, but no segfault is generated.
> 
> Any ideas what I can do to find the reason? I don't think that it is a
> kernel bug, but perhaps a wrong configuration for my platform.

Please try this (and revert your changes):

===== arch/arm/mm/consistent.c 1.27 vs edited =====
--- 1.27/arch/arm/mm/consistent.c	2005-01-21 05:02:14 +00:00
+++ edited/arch/arm/mm/consistent.c	2005-02-17 18:11:50 +00:00
@@ -284,13 +284,15 @@
 	spin_unlock_irqrestore(&consistent_lock, flags);
 
 	if (c) {
+		unsigned long off = vma->vm_pgoff;
+
 		kern_size = (c->vm_end - c->vm_start) >> PAGE_SHIFT;
 
-		if (vma->vm_pgoff < kern_size &&
-		    user_size <= (kern_size - vma->vm_pgoff)) {
+		if (off < kern_size &&
+		    user_size <= (kern_size - off)) {
 			vma->vm_flags |= VM_RESERVED;
 			ret = remap_pfn_range(vma, vma->vm_start,
-					      page_to_pfn(c->vm_pages),
+					      page_to_pfn(c->vm_pages) + off,
 					      user_size, vma->vm_page_prot);
 		}
 	}


-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

  reply	other threads:[~2005-02-17 18:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-17 17:51 Problems with dma_mmap_writecombine on mach-pxa Frank Buss
2005-02-17 18:12 ` Russell King [this message]
2005-02-17 19:14   ` Frank Buss
2005-02-17 19:58     ` Russell King
2005-02-18  9:30   ` [TTY] 2 points seems strange to me Franck Bui-Huu
2005-02-18 14:58     ` Paul Fulghum
2005-02-18 15:08       ` Paulo Marques
2005-02-18 15:15         ` Paul Fulghum
2005-02-18 15:24           ` Paulo Marques
2005-02-18 15:24           ` linux-os
2005-02-18 15:27             ` Paulo Marques
2005-02-18 16:14               ` Franck Bui-Huu
2005-02-18 15:19         ` linux-os
2005-02-18 16:29       ` Franck Bui-Huu
2005-02-18 16:41         ` Paul Fulghum
2005-02-18 18:07   ` Problems with dma_mmap_writecombine on mach-pxa Frank Buss
  -- strict thread matches above, loose matches on Subject: below --
2005-02-23  1:36 Frank Buss

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=20050217181241.A22752@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=fb@frank-buss.de \
    --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