Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1c17f4d615f34a4ecfcf9132d643126b226f5e79
Commit:     1c17f4d615f34a4ecfcf9132d643126b226f5e79
Parent:     d2e626f45cc450c00f5f98a89b8b4c4ac3c9bf5f
Author:     Huang, Ying <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:34:04 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:34:04 2008 +0100

    x86: ioremap_nocache fix
    
    This patch fixes a bug of ioremap_nocache. ioremap_nocache() will call
    __ioremap() with flags != 0 to do the real work, which will call
    change_page_attr_addr() if phys_addr + size - 1 < (end_pfn_map << 
PAGE_SHIFT).
    But some pages between 0 ~ end_pfn_map << PAGE_SHIFT are not mapped by
    identity map, this will make change_page_attr_addr failed.
    
    This patch is based on latest x86 git and has been tested on x86_64 
platform.
    
    Signed-off-by: Huang Ying <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/mm/ioremap_64.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86/mm/ioremap_64.c b/arch/x86/mm/ioremap_64.c
index 2815ab6..0a05f02 100644
--- a/arch/x86/mm/ioremap_64.c
+++ b/arch/x86/mm/ioremap_64.c
@@ -41,8 +41,15 @@ ioremap_change_attr(unsigned long phys_addr, unsigned long 
size,
        if (phys_addr + size - 1 < (end_pfn_map << PAGE_SHIFT)) {
                unsigned long npages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
                unsigned long vaddr = (unsigned long) __va(phys_addr);
+               int level;
 
                /*
+                * If there is no identity map for this address,
+                * change_page_attr_addr is unnecessary
+                */
+               if (!lookup_address(vaddr, &level))
+                       return err;
+               /*
                 * Must use a address here and not struct page because the phys 
addr
                 * can be a in hole between nodes and not have an memmap entry.
                 */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to