[coreboot] New patch to review for coreboot: c8c5522 Fix 2 infinite loops if IMC doesn't respond

Martin Roth (martin@se-eng.com) gerrit at coreboot.org
Wed Jan 9 19:20:21 CET 2013


Martin Roth (martin at se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2119

-gerrit

commit c8c5522e624b266283316ee6fd979c80306b4a81
Author: Martin Roth <martin at se-eng.com>
Date:   Tue Jan 8 13:36:14 2013 -0700

    Fix 2 infinite loops if IMC doesn't respond
    
    ACPI code:
    The ACPI code is not currently being compiled in by default, but
    assuming that it will be at some point, I'm fixing the loop that
    waits for the IMC to respond after sending it a command.  The
    loop now exits after 500ms, similar to the function in agesa.
    
    Agesa Code:
    a 16 bit variable will always be less than 100000.  Change to
    be a 32 bit variable.
    
    Change-Id: I9430ef900a22d056871b744f3b1511abdfea516e
    Signed-off-by: Martin Roth <martin at se-eng.com>
---
 src/mainboard/amd/parmer/acpi/AmdImc.asl             | 4 +++-
 src/mainboard/amd/thatcher/acpi/AmdImc.asl           | 4 +++-
 src/vendorcode/amd/agesa/f15tn/Proc/Fch/Imc/ImcLib.c | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/mainboard/amd/parmer/acpi/AmdImc.asl b/src/mainboard/amd/parmer/acpi/AmdImc.asl
index 937c10a..f55a12a 100644
--- a/src/mainboard/amd/parmer/acpi/AmdImc.asl
+++ b/src/mainboard/amd/parmer/acpi/AmdImc.asl
@@ -18,9 +18,11 @@ IndexField(IMCX, IMCA, ByteAcc, NoLock, Preserve) {
 Method(WACK, 0)
 {
 	Store(0, Local0)
-	While (LNotEqual(Local0, 0xFA)) {
+	Store(50, Local1)
+	While (LAnd (LNotEqual(Local0, 0xFA), LGreater(Local1,0))) {
 		Store(MRG0, Local0)
 		Sleep(10)
+		Decrement(Local1)
 	}
 }
 
diff --git a/src/mainboard/amd/thatcher/acpi/AmdImc.asl b/src/mainboard/amd/thatcher/acpi/AmdImc.asl
index 937c10a..f55a12a 100644
--- a/src/mainboard/amd/thatcher/acpi/AmdImc.asl
+++ b/src/mainboard/amd/thatcher/acpi/AmdImc.asl
@@ -18,9 +18,11 @@ IndexField(IMCX, IMCA, ByteAcc, NoLock, Preserve) {
 Method(WACK, 0)
 {
 	Store(0, Local0)
-	While (LNotEqual(Local0, 0xFA)) {
+	Store(50, Local1)
+	While (LAnd (LNotEqual(Local0, 0xFA), LGreater(Local1,0))) {
 		Store(MRG0, Local0)
 		Sleep(10)
+		Decrement(Local1)
 	}
 }
 
diff --git a/src/vendorcode/amd/agesa/f15tn/Proc/Fch/Imc/ImcLib.c b/src/vendorcode/amd/agesa/f15tn/Proc/Fch/Imc/ImcLib.c
index 6f8903c..d8df41a 100644
--- a/src/vendorcode/amd/agesa/f15tn/Proc/Fch/Imc/ImcLib.c
+++ b/src/vendorcode/amd/agesa/f15tn/Proc/Fch/Imc/ImcLib.c
@@ -126,7 +126,7 @@ WaitForEcLDN9MailboxCmdAck (
   )
 {
   UINT8    Msgdata;
-  UINT16   Delaytime;
+  UINT32   Delaytime;
 
   Msgdata = 0;
 



More information about the coreboot mailing list