powerpc: rtas_flash needs to use rtas_data_buf
commit2006e74de08d502eda1226adbb1fd5d7b210d74e
authorMilton Miller <miltonm@us.ibm.com>
Sat, 12 Jun 2010 03:48:47 +0000 (12 03:48 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Mar 2011 20:16:58 +0000 (23 13:16 -0700)
tree06894974dbf649f2949468eb65f0f39c6172d05e
parent4d4d502715479044f02ae7464474bbb615b2d158
powerpc: rtas_flash needs to use rtas_data_buf

commit bd2b64a12bf55bec0d1b949e3dca3f8863409646 upstream.

When trying to flash a machine via the update_flash command, Anton received the
following error:

    Restarting system.
    FLASH: kernel bug...flash list header addr above 4GB

The code in question has a comment that the flash list should be in
the kernel data and therefore under 4GB:

        /* NOTE: the "first" block list is a global var with no data
         * blocks in the kernel data segment.  We do this because
         * we want to ensure this block_list addr is under 4GB.
         */

Unfortunately the Kconfig option is marked tristate which means the variable
may not be in the kernel data and could be above 4GB.

Instead of relying on the data segment being below 4GB, use the static
data buffer allocated by the kernel for use by rtas.  Since we don't
use the header struct directly anymore, convert it to a simple pointer.

Reported-By: Anton Blanchard <anton@samba.org>
Signed-Off-By: Milton Miller <miltonm@bga.com>
Tested-By: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/powerpc/kernel/rtas_flash.c