[Pdbg] [PATCH 02/18] p8chip: Restore RAS_MODE_REG to original value

Michael Neuling mikey at neuling.org
Tue Jun 19 15:25:19 AEST 2018


This correctly restores the MR_THREAD_IN_DEBUG bit rather than always
clearing it after.

Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 libpdbg/p8chip.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libpdbg/p8chip.c b/libpdbg/p8chip.c
index 6640bb46a8..3e90c8dd16 100644
--- a/libpdbg/p8chip.c
+++ b/libpdbg/p8chip.c
@@ -127,8 +127,7 @@ static struct thread_state get_thread_status(struct thread *thread)
 
 	/* Need to activete debug mode to get complete status */
 	pib_read(&thread->target, RAS_MODE_REG, &mode_reg);
-	mode_reg |= MR_THREAD_IN_DEBUG;
-	pib_write(&thread->target, RAS_MODE_REG, mode_reg);
+	pib_write(&thread->target, RAS_MODE_REG, mode_reg | MR_THREAD_IN_DEBUG);
 
 	/* Read status */
 	pib_read(&thread->target, RAS_STATUS_REG, &val);
@@ -194,7 +193,6 @@ static struct thread_state get_thread_status(struct thread *thread)
 	}
 
 	/* Clear debug mode */
-	mode_reg &= ~MR_THREAD_IN_DEBUG;
 	pib_write(&thread->target, RAS_MODE_REG, mode_reg);
 
 	return thread_status;
-- 
2.17.1



More information about the Pdbg mailing list