Skip to content

Commit 991d656

Browse files
chleroympe
authored andcommitted
powerpc/8xx: Fix permanently mapped IMMR region.
When not using large TLBs, the IMMR region is still mapped as a whole block in the FIXMAP area. Properly report that the IMMR region is block-mapped even when not using large TLBs. Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/45f4f414bcd7198b0755cf4287ff216fbfc24b9d.1574774187.git.christophe.leroy@c-s.fr
1 parent f509247 commit 991d656

File tree

1 file changed

+7
-6
lines changed
  • arch/powerpc/mm/nohash

1 file changed

+7
-6
lines changed

arch/powerpc/mm/nohash/8xx.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,34 @@ extern int __map_without_ltlbs;
2121
static unsigned long block_mapped_ram;
2222

2323
/*
24-
* Return PA for this VA if it is in an area mapped with LTLBs.
24+
* Return PA for this VA if it is in an area mapped with LTLBs or fixmap.
2525
* Otherwise, returns 0
2626
*/
2727
phys_addr_t v_block_mapped(unsigned long va)
2828
{
2929
unsigned long p = PHYS_IMMR_BASE;
3030

31-
if (__map_without_ltlbs)
32-
return 0;
3331
if (va >= VIRT_IMMR_BASE && va < VIRT_IMMR_BASE + IMMR_SIZE)
3432
return p + va - VIRT_IMMR_BASE;
33+
if (__map_without_ltlbs)
34+
return 0;
3535
if (va >= PAGE_OFFSET && va < PAGE_OFFSET + block_mapped_ram)
3636
return __pa(va);
3737
return 0;
3838
}
3939

4040
/*
41-
* Return VA for a given PA mapped with LTLBs or 0 if not mapped
41+
* Return VA for a given PA mapped with LTLBs or fixmap
42+
* Return 0 if not mapped
4243
*/
4344
unsigned long p_block_mapped(phys_addr_t pa)
4445
{
4546
unsigned long p = PHYS_IMMR_BASE;
4647

47-
if (__map_without_ltlbs)
48-
return 0;
4948
if (pa >= p && pa < p + IMMR_SIZE)
5049
return VIRT_IMMR_BASE + pa - p;
50+
if (__map_without_ltlbs)
51+
return 0;
5152
if (pa < block_mapped_ram)
5253
return (unsigned long)__va(pa);
5354
return 0;

0 commit comments

Comments
 (0)