Commit 97d2a10d authored by Maxim Uvarov's avatar Maxim Uvarov Committed by Wim Van Sebroeck

watchdog: hpwdt: clean up set_memory_x call for 32 bit

1. address has to be page aligned.
2. set_memory_x uses page size argument, not size.
Bug causes with following commit:
	commit da28179b4e90dda56912ee825c7eaa62fc103797
	Author: Mingarelli, Thomas <Thomas.Mingarelli@hp.com>
	Date:   Mon Nov 7 10:59:00 2011 +0100

     watchdog: hpwdt: Changes to handle NX secure bit in 32bit path

    commit e67d668e upstream.

    This patch makes use of the set_memory_x() kernel API in order
    to make necessary BIOS calls to source NMIs.
Signed-off-by: default avatarMaxim Uvarov <maxim.uvarov@oracle.com>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
Cc: stable <stable@vger.kernel.org>
parent 586c6e70
...@@ -231,7 +231,7 @@ static int __devinit cru_detect(unsigned long map_entry, ...@@ -231,7 +231,7 @@ static int __devinit cru_detect(unsigned long map_entry,
cmn_regs.u1.reax = CRU_BIOS_SIGNATURE_VALUE; cmn_regs.u1.reax = CRU_BIOS_SIGNATURE_VALUE;
set_memory_x((unsigned long)bios32_entrypoint, (2 * PAGE_SIZE)); set_memory_x((unsigned long)bios32_map, 2);
asminline_call(&cmn_regs, bios32_entrypoint); asminline_call(&cmn_regs, bios32_entrypoint);
if (cmn_regs.u1.ral != 0) { if (cmn_regs.u1.ral != 0) {
...@@ -250,7 +250,8 @@ static int __devinit cru_detect(unsigned long map_entry, ...@@ -250,7 +250,8 @@ static int __devinit cru_detect(unsigned long map_entry,
cru_rom_addr = cru_rom_addr =
ioremap(cru_physical_address, cru_length); ioremap(cru_physical_address, cru_length);
if (cru_rom_addr) { if (cru_rom_addr) {
set_memory_x((unsigned long)cru_rom_addr, cru_length); set_memory_x((unsigned long)cru_rom_addr & PAGE_MASK,
(cru_length + PAGE_SIZE - 1) >> PAGE_SHIFT);
retval = 0; retval = 0;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment