diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-02 14:41:56 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-02 14:41:56 +0100 |
commit | 29c798fecb9b846b363b0a02fa662ff42fc19426 (patch) | |
tree | e708d6aca8f098e69571780f702325b221b66694 /arch/x86/pci/i386.c | |
parent | ASoC: fix the building issue of missing codec field in 'struct snd_soc_card' (diff) | |
parent | Linux 2.6.37-rc1 (diff) | |
download | linux-29c798fecb9b846b363b0a02fa662ff42fc19426.tar.xz linux-29c798fecb9b846b363b0a02fa662ff42fc19426.zip |
Merge commit 'v2.6.37-rc1' into for-2.6.37
Diffstat (limited to 'arch/x86/pci/i386.c')
-rw-r--r-- | arch/x86/pci/i386.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index 55253095be84..c4bb261c106e 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c @@ -65,16 +65,21 @@ pcibios_align_resource(void *data, const struct resource *res, resource_size_t size, resource_size_t align) { struct pci_dev *dev = data; - resource_size_t start = res->start; + resource_size_t start = round_down(res->end - size + 1, align); if (res->flags & IORESOURCE_IO) { - if (skip_isa_ioresource_align(dev)) - return start; - if (start & 0x300) - start = (start + 0x3ff) & ~0x3ff; + + /* + * If we're avoiding ISA aliases, the largest contiguous I/O + * port space is 256 bytes. Clearing bits 9 and 10 preserves + * all 256-byte and smaller alignments, so the result will + * still be correctly aligned. + */ + if (!skip_isa_ioresource_align(dev)) + start &= ~0x300; } else if (res->flags & IORESOURCE_MEM) { if (start < BIOS_END) - start = BIOS_END; + start = res->end; /* fail; no space */ } return start; } @@ -311,6 +316,8 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, */ prot |= _PAGE_CACHE_UC_MINUS; + prot |= _PAGE_IOMAP; /* creating a mapping for IO */ + vma->vm_page_prot = __pgprot(prot); if (io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, |