[U-Boot] [PATCH] sparc: fix return value of disable_interrupts
DUHAMEL Benoit
benoit.duhamel at transport.alstom.com
Wed Dec 16 15:35:23 CET 2015
The return value of disable_interrupts for SPARC is incorrect (false when all interrupts were enabled).
As it may be used to allow re-enabling, this may causes hangs up.
Observed issue on FLASH write (flash_write_cfiword in drivers/mtd/cfi_flash.c)
Signed-off-by: Benoit Duhamel <benoit.duhamel at alstom.com>
---
arch/sparc/lib/interrupts.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/sparc/lib/interrupts.c b/arch/sparc/lib/interrupts.c
index cb73d17..1de2cec 100644
--- a/arch/sparc/lib/interrupts.c
+++ b/arch/sparc/lib/interrupts.c
@@ -44,7 +44,8 @@ void enable_interrupts(void)
int disable_interrupts(void)
{
- return intLock();
+ /* Return TRUE if interrupts were previously enabled */
+ return intLock() < 15;
}
int interrupt_is_enabled(void)
--
1.7.1
________________________________
CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.
More information about the U-Boot
mailing list