diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2013-06-20 05:00:18 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-06-21 02:01:54 -0400 |
commit | 12bc9f6fc1d6582b4529ac522d2231bd2584a5f1 (patch) | |
tree | 40be8749c9b19e0e9dfddeee54436271dce2bb2f /arch/powerpc/kernel | |
parent | ac52ae4721233150a3c30e9732a1c1f4f68e7db7 (diff) |
powerpc: Replace find_linux_pte with find_linux_pte_or_hugepte
Replace find_linux_pte with find_linux_pte_or_hugepte and explicitly
document why we don't need to handle transparent hugepages at callsites.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/eeh.c | 7 | ||||
-rw-r--r-- | arch/powerpc/kernel/io-workarounds.c | 11 |
2 files changed, 15 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c index 7c567be3dd03..af2b9ae07df5 100644 --- a/arch/powerpc/kernel/eeh.c +++ b/arch/powerpc/kernel/eeh.c | |||
@@ -260,10 +260,15 @@ static inline unsigned long eeh_token_to_phys(unsigned long token) | |||
260 | { | 260 | { |
261 | pte_t *ptep; | 261 | pte_t *ptep; |
262 | unsigned long pa; | 262 | unsigned long pa; |
263 | int hugepage_shift; | ||
263 | 264 | ||
264 | ptep = find_linux_pte(init_mm.pgd, token); | 265 | /* |
266 | * We won't find hugepages here, iomem | ||
267 | */ | ||
268 | ptep = find_linux_pte_or_hugepte(init_mm.pgd, token, &hugepage_shift); | ||
265 | if (!ptep) | 269 | if (!ptep) |
266 | return token; | 270 | return token; |
271 | WARN_ON(hugepage_shift); | ||
267 | pa = pte_pfn(*ptep) << PAGE_SHIFT; | 272 | pa = pte_pfn(*ptep) << PAGE_SHIFT; |
268 | 273 | ||
269 | return pa | (token & (PAGE_SIZE-1)); | 274 | return pa | (token & (PAGE_SIZE-1)); |
diff --git a/arch/powerpc/kernel/io-workarounds.c b/arch/powerpc/kernel/io-workarounds.c index 50e90b7e7139..fa0b54b2a362 100644 --- a/arch/powerpc/kernel/io-workarounds.c +++ b/arch/powerpc/kernel/io-workarounds.c | |||
@@ -55,6 +55,7 @@ static struct iowa_bus *iowa_pci_find(unsigned long vaddr, unsigned long paddr) | |||
55 | 55 | ||
56 | struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR addr) | 56 | struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR addr) |
57 | { | 57 | { |
58 | unsigned hugepage_shift; | ||
58 | struct iowa_bus *bus; | 59 | struct iowa_bus *bus; |
59 | int token; | 60 | int token; |
60 | 61 | ||
@@ -70,11 +71,17 @@ struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR addr) | |||
70 | if (vaddr < PHB_IO_BASE || vaddr >= PHB_IO_END) | 71 | if (vaddr < PHB_IO_BASE || vaddr >= PHB_IO_END) |
71 | return NULL; | 72 | return NULL; |
72 | 73 | ||
73 | ptep = find_linux_pte(init_mm.pgd, vaddr); | 74 | ptep = find_linux_pte_or_hugepte(init_mm.pgd, vaddr, |
75 | &hugepage_shift); | ||
74 | if (ptep == NULL) | 76 | if (ptep == NULL) |
75 | paddr = 0; | 77 | paddr = 0; |
76 | else | 78 | else { |
79 | /* | ||
80 | * we don't have hugepages backing iomem | ||
81 | */ | ||
82 | WARN_ON(hugepage_shift); | ||
77 | paddr = pte_pfn(*ptep) << PAGE_SHIFT; | 83 | paddr = pte_pfn(*ptep) << PAGE_SHIFT; |
84 | } | ||
78 | bus = iowa_pci_find(vaddr, paddr); | 85 | bus = iowa_pci_find(vaddr, paddr); |
79 | 86 | ||
80 | if (bus == NULL) | 87 | if (bus == NULL) |