Re: [PATCH] powerpc: rtas_flash cannot be a module

2010-06-12 Thread Anton Blanchard
 
Hi,

 So we should use that rtas_data_buf with its lock ...
 
 Oh look, the driver already uses that buffer for the call to verify_flash
 
 untested patch to follow

Thanks, it built and tested OK with the following patch. Will send a
complete patch with these changes in a minute.

Anton

--- build/arch/powerpc/kernel/rtas_flash.c~ 2010-06-12 09:06:43.0 
-0400
+++ build/arch/powerpc/kernel/rtas_flash.c  2010-06-12 09:08:30.0 
-0400
@@ -613,9 +613,9 @@
 * the kernel data segment.
 */
spin_lock(rtas_data_buf_lock);
-   flist = (struct rtas_flash_list *)rtas_data_buf[0];
-   flist.num_blocks = 0;
-   flist.next = rtas_firmware_flash_list;
+   flist = (struct flash_block_list *)rtas_data_buf[0];
+   flist-num_blocks = 0;
+   flist-next = rtas_firmware_flash_list;
rtas_block_list = virt_to_abs(flist);
if (rtas_block_list = 4UL*1024*1024*1024) {
printk(KERN_ALERT FLASH: kernel bug...flash list header addr 
above 4GB\n);
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] powerpc: rtas_flash cannot be a module

2010-06-11 Thread Milton Miller
On Wed, 9 Jun 2010 at about 16:01:10 +1000 Anton Blanchard wrote:
 
 When trying to flash a machine via the update_flash command, I 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.

So we should use that rtas_data_buf with its lock ...

Oh look, the driver already uses that buffer for the call to verify_flash

untested patch to follow

milton
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] powerpc: rtas_flash cannot be a module

2010-06-09 Thread Anton Blanchard

When trying to flash a machine via the update_flash command, I 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.

Change RTAS_FLASH to a bool. If we are worried about kernel footprint we
could move the problem variables out of the module and export them.

Signed-off-by: Anton Blanchard an...@samba.org
--- 

Index: linux-2.6/arch/powerpc/platforms/Kconfig
===
--- linux-2.6.orig/arch/powerpc/platforms/Kconfig   2010-06-09 
15:44:53.635955260 +1000
+++ linux-2.6/arch/powerpc/platforms/Kconfig2010-06-09 15:45:00.503453428 
+1000
@@ -97,7 +97,7 @@ config RTAS_PROC
default y
 
 config RTAS_FLASH
-   tristate Firmware flash interface
+   bool Firmware flash interface
depends on PPC64  RTAS_PROC
 
 config MMIO_NVRAM
Index: linux-2.6/arch/powerpc/configs/ppc64_defconfig
===
--- linux-2.6.orig/arch/powerpc/configs/ppc64_defconfig 2010-06-09 
15:46:25.394704486 +1000
+++ linux-2.6/arch/powerpc/configs/ppc64_defconfig  2010-06-09 
15:46:37.083454943 +1000
@@ -264,7 +264,7 @@ CONFIG_U3_DART=y
 CONFIG_PPC_RTAS=y
 CONFIG_RTAS_ERROR_LOGGING=y
 CONFIG_RTAS_PROC=y
-CONFIG_RTAS_FLASH=m
+CONFIG_RTAS_FLASH=y
 CONFIG_PPC_PMI=m
 CONFIG_MMIO_NVRAM=y
 CONFIG_MPIC_U3_HT_IRQS=y
Index: linux-2.6/arch/powerpc/configs/pseries_defconfig
===
--- linux-2.6.orig/arch/powerpc/configs/pseries_defconfig   2010-06-09 
15:46:25.364703092 +1000
+++ linux-2.6/arch/powerpc/configs/pseries_defconfig2010-06-09 
15:46:31.723454300 +1000
@@ -213,7 +213,7 @@ CONFIG_PPC_I8259=y
 CONFIG_PPC_RTAS=y
 CONFIG_RTAS_ERROR_LOGGING=y
 CONFIG_RTAS_PROC=y
-CONFIG_RTAS_FLASH=m
+CONFIG_RTAS_FLASH=y
 # CONFIG_MMIO_NVRAM is not set
 CONFIG_IBMVIO=y
 CONFIG_IBMEBUS=y
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev