lkml.org 
[lkml]   [2015]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 5/6] arch: introduce memremap_cache() and memremap_wt()
From
On Mon, Jun 8, 2015 at 9:27 AM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Thu, Jun 4, 2015 at 12:34 AM, Dan Williams <dan.j.williams@intel.com> wrote:
>> Existing users of ioremap_cache() are mapping memory that is known in
>> advance to not have i/o side effects. These users are forced to cast
>> away the __iomem annotation, or otherwise neglect to fix the sparse
>> errors thrown when dereferencing pointers to this memory. Provide
>> memremap_*() as a non __iomem annotated ioremap_*().
>>
>> The ARCH_HAS_MEMREMAP kconfig symbol is introduced for archs to assert
>> that it is safe to recast / reuse the return value from ioremap as a
>> normal pointer to memory. In other words, archs that mandate specific
>> accessors for __iomem are not memremap() capable and drivers that care,
>> like pmem, can add a dependency to disable themselves on these archs.
>
> One minor comment. Otherwise looks good for me.
>
> []
>
>> --- a/kernel/resource.c
>> +++ b/kernel/resource.c
>
>> @@ -528,6 +528,45 @@ int region_is_ram(resource_size_t start, unsigned long size)
>> return ret;
>> }
>>
>> +#ifdef CONFIG_ARCH_HAS_MEMREMAP
>> +/*
>> + * memremap() is "ioremap" for cases where it is known that the resource
>> + * being mapped does not have i/o side effects and the __iomem
>> + * annotation is not applicable.
>> + */
>> +static bool memremap_valid(resource_size_t offset, size_t size)
>> +{
>> + if (region_is_ram(offset, size) != 0) {
>> + WARN_ONCE(1, "memremap attempted on ram %pa size: %zd\n",
>
> %zu

Sure, thanks for taking a look Andy!


\
 
 \ /
  Last update: 2015-06-08 20:41    [W:0.070 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site