linux-mips
[Top] [All Lists]

Re: troubles writing to a mmapped PCI BAR

To: linux-mips@linux-mips.org
Subject: Re: troubles writing to a mmapped PCI BAR
From: Clem Taylor <clem.taylor@gmail.com>
Date: Fri, 22 Apr 2005 16:22:53 -0400
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jgOv23GgDYzMVoBt9g3jg7KUPuNsdZI0z9UhZgjN3kGWAP96OkDO6UUngbicHrGBID1tl9hyS/3aIayDsmuPSpUAS6kJzODhhrc77YoYzE95DtgBJsuOy8Tf2XWSplFAVrMAMC64RoVMiIKX3eyrClx8gAfYwl3+YSoYihTmJ2c=
In-reply-to: <ecb4efd10504211231748d2525@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <ecb4efd10504211231748d2525@mail.gmail.com>
Reply-to: Clem Taylor <clem.taylor@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
On 4/21/05, Clem Taylor <clem.taylor@gmail.com> wrote:
> I'm working on a Au1550 driver for a PCI based co-processor. The
> driver provides mmap() that allows the mapping of a PCI BAR. From
> userspace I can happily read from the mmaped region, but writes just
> hang the user space program. gdb shows that the user program is
> sitting at the write statement. The read() and write() system calls
> work just fine as well.

I saw in drivers/video/epson1356fb.c it was doing:
        // FIXME: shouldn't have to do this. If the pages are marked writeable,
        // the TLB fault handlers should set these.
        pgprot_val(vma->vm_page_prot) |= (_PAGE_DIRTY | _PAGE_VALID);

So I tried adding this before my io_remap_page_range() and it seems to
have fixed my problem. My mmap() write to a PCI device is working now.
I tried setting just the _PAGE_DIRTY bit and that seems to be the
trick. Any ideas why I would need do to this or what is going on?

                        --Clem

<Prev in Thread] Current Thread [Next in Thread>