public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Nickolay <nickolay@protei.ru>
Cc: linux-kernel@vger.kernel.org
Subject: Re: uncachable access to physical pages(ARM, xScale)
Date: Tue, 14 Mar 2006 22:10:20 +0000	[thread overview]
Message-ID: <20060314221020.GA3166@flint.arm.linux.org.uk> (raw)
In-Reply-To: <4417364C.6020609@protei.ru>

On Wed, Mar 15, 2006 at 12:31:56AM +0300, Nickolay wrote:
> I was trying directly unset L_PTE_CACHEABLE | L_PTE_BUFFERABLE flags from
> pte(see below), but it doesn't working, and i has problem with cache 
> cogerency between userland and kernelspace:
> 
> pgd_t *pgd;
> pmd_t *pmd;
> pte_t *pte;
> 
> /* find pte */
> addr = page_address(my_page);
> pgd = pgd_offset_k(addr & PAGE_MASK);
> pmd = pmd_offset(pgd, addr & PAGE_MASK);
> pte = pte_offset_kernel(pmd, addr & PAGE_MASK);
> 
> /* ok, we get pte, now unset L_PTE_CACHEABLE and
>    L_PTE_BUFFERABLE flags
> */
> pte_val(*pte) &= ~(L_PTE_CACHEABLE|L_PTE_BUFFERABLE);
> 
> The problem descriprion simple, kernel at some time doesn't see
> data, which userland writes to shared buffer, without inserting
> flush_cache_all after each operation with shared buffer from kernel.

Rather than just assuming that there are page tables there, if you
added the usual checks which the kernel typically does, you might
get a clue as to what's going on.

You'll find that the PMD is not valid as far as the Linux page table
walking goes - that's because we don't use a set of individual page
mappings to setup the kernel mapping of the page.  In turn, that
means that there is no individual control over the status of pages
allocated by alloc_pages.

To solve your problem, you need to look at the ARM DMA mmap extension
and use that instead.

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

      reply	other threads:[~2006-03-14 22:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-14 21:31 uncachable access to physical pages(ARM, xScale) Nickolay
2006-03-14 22:10 ` Russell King [this message]

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=20060314221020.GA3166@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickolay@protei.ru \
    /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