linux-stable/arch/sh
Paul Mundt 920efaabcb sh: Correct iounmap fixmap teardown.
iounmap_fixed() had a couple of bugs in it that caused it to effectively
fail at life. The total number of pages to unmap factored in the mapping
offset and aligned up to the next page boundary, which doesn't match the
ioremap_fixed() behaviour.

When ioremap_fixed() pegs a slot, the address in the mapping data already
contains the offset displacement, and the size is recorded verbatim given
that we're only interested in total number of pages required. As such, we
need to calculate the total number from the original size in the unmap
path as well.

At the same time, there was also an off-by-1 problem in the fixmap index
calculation which has also been corrected.

Previously subsequent remaps of an identical fixmap index would trigger
the pte_ERROR() in set_pte_phys():

	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).
	arch/sh/mm/init.c:77: bad pte 8053ffb0(0000781003fff506).

With this patch in place, the iounmap-driven fixmap teardown actually
does what it's supposed to do.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-20 18:10:30 +09:00
..
boards sh: mach-sdk7786: reset controller reboot support. 2010-01-20 16:53:11 +09:00
boot sh: fixed PMB mode refactoring. 2010-01-13 18:31:48 +09:00
cchips sh: mach-hp6xx: Fix up the hp6xx build for hd64461 changes. 2009-05-20 11:27:13 +09:00
configs sh: Preliminary SDK7786 board support. 2010-01-14 20:58:58 +09:00
drivers sh: Generalize SH7786 PCIe support. 2010-01-15 19:13:56 +09:00
include sh: machine_ops based reboot support. 2010-01-20 16:42:52 +09:00
kernel sh: machine_ops based reboot support. 2010-01-20 16:42:52 +09:00
lib sh: Optimised memset for SH4 2009-11-24 16:28:43 +09:00
lib64 sh64: Kill off special clear_page() implementation. 2009-08-04 17:17:00 +09:00
math-emu sh: Move over to dynamically allocated FPU context. 2010-01-13 12:51:40 +09:00
mm sh: Correct iounmap fixmap teardown. 2010-01-20 18:10:30 +09:00
oprofile sh: oprofile: Fix up count size mismatch for common impl. 2009-11-05 17:13:15 +09:00
tools Merge branch 'sh/stable-updates' 2010-01-18 20:47:37 +09:00
Kconfig sh: SH7786 clock framework rewrite. 2010-01-19 19:37:14 +09:00
Kconfig.cpu sh: Tidy up SH-4A boot_cpu_data.flags probing. 2009-06-01 19:50:08 +09:00
Kconfig.debug sh: Remove old early serial console code V2 2009-12-15 12:07:35 +09:00
Makefile sh: Preliminary SDK7786 board support. 2010-01-14 20:58:58 +09:00