lkml.org 
[lkml]   [2011]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] EFI: Do not use __pa() to get the physical address of an ioremapped memory range
From
On Thu, Sep 1, 2011 at 8:28 PM, Matt Fleming <matt@console-pimps.org> wrote:
> On Thu, 2011-09-01 at 16:14 +0800, Zhang Rui wrote:
>> On Thu, 2011-09-01 at 14:55 +0800, Zhang, Rui wrote:
>> > From: Zhang Rui <rui.zhang@intel.com>
>> > Date: Wed, 31 Aug 2011 09:59:01 +0800
>> > Subject: Do not use __pa() to get the physical address of an ioremapped memory range.
>> >
>> > set_memory_uc uses __pa() to translate the virtual address to the physical address.
>> > This breaks a EFI_MEMORY_MAPPED_IO memory region in my case as it was ioremapped first.
>> >
>> oops, wrong patch was attached.
>>
>> here is the correct patch.
>>
>> From: Zhang Rui <rui.zhang@intel.com>
>> Date: Wed, 31 Aug 2011 09:59:01 +0800
>> Subject: Do not use __pa() to get the physical address of an ioremapped memory range.
>>
>> set_memory_uc uses __pa() to translate the virtual address to the physical address.
>> This breaks a EFI_MEMORY_MAPPED_IO memory region in my case as it was ioremapped first.
>
> Hmm.. does anyone know why we ioremap_cache() the memory on
> CONFIG_X86_32 instead of ioremap_nocache()? In the case of
> EFI_MEMORY_MAPPED_IO the memory really needs to be uncached. Then if
> we've ioremap'd the memory we should skip set_memory_uc() altogether,
> no?

Because whether the mapping should be cached is determined by md->attr
instead of md->type. And besides UC, we may add WC, etc support.

Best Regards,
Huang Ying


\
 
 \ /
  Last update: 2011-09-02 07:15    [W:0.127 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site