Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: fix warning in io_mapping_map_wc() x86: i915 needs pgprot_writecombine() and is_io_mapping_possible()
This commit is contained in:
commit
2d44947a56
3 changed files with 10 additions and 12 deletions
|
@ -20,23 +20,16 @@
|
||||||
#include <asm/pat.h>
|
#include <asm/pat.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
|
|
||||||
#ifdef CONFIG_X86_PAE
|
int is_io_mapping_possible(resource_size_t base, unsigned long size)
|
||||||
int
|
|
||||||
is_io_mapping_possible(resource_size_t base, unsigned long size)
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
int
|
|
||||||
is_io_mapping_possible(resource_size_t base, unsigned long size)
|
|
||||||
{
|
{
|
||||||
|
#ifndef CONFIG_X86_PAE
|
||||||
/* There is no way to map greater than 1 << 32 address without PAE */
|
/* There is no way to map greater than 1 << 32 address without PAE */
|
||||||
if (base + size > 0x100000000ULL)
|
if (base + size > 0x100000000ULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
EXPORT_SYMBOL_GPL(is_io_mapping_possible);
|
||||||
|
|
||||||
/* Map 'pfn' using fixed map 'type' and protections 'prot'
|
/* Map 'pfn' using fixed map 'type' and protections 'prot'
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <linux/bootmem.h>
|
#include <linux/bootmem.h>
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/module.h>
|
||||||
#include <linux/gfp.h>
|
#include <linux/gfp.h>
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
@ -868,6 +869,7 @@ pgprot_t pgprot_writecombine(pgprot_t prot)
|
||||||
else
|
else
|
||||||
return pgprot_noncached(prot);
|
return pgprot_noncached(prot);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(pgprot_writecombine);
|
||||||
|
|
||||||
#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT)
|
#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT)
|
||||||
|
|
||||||
|
|
|
@ -91,8 +91,11 @@ io_mapping_unmap_atomic(void *vaddr)
|
||||||
static inline void *
|
static inline void *
|
||||||
io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset)
|
io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset)
|
||||||
{
|
{
|
||||||
|
resource_size_t phys_addr;
|
||||||
|
|
||||||
BUG_ON(offset >= mapping->size);
|
BUG_ON(offset >= mapping->size);
|
||||||
resource_size_t phys_addr = mapping->base + offset;
|
phys_addr = mapping->base + offset;
|
||||||
|
|
||||||
return ioremap_wc(phys_addr, PAGE_SIZE);
|
return ioremap_wc(phys_addr, PAGE_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue