diff mbox series

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

Message ID 20180619052535.24043-2-mikey@neuling.org
State Accepted
Headers show
Series [01/18] Make -a the default for probe | expand

Commit Message

Michael Neuling June 19, 2018, 5:25 a.m. UTC
This correctly restores the MR_THREAD_IN_DEBUG bit rather than always
clearing it after.

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

Patch

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;