From 0a70e59cb86deed71fd92ceffdd233478e237ebb Mon Sep 17 00:00:00 2001 From: Jan Matyas <50193733+JanMatCodasip@users.noreply.github.com> Date: Wed, 23 Mar 2022 17:47:57 +0100 Subject: [PATCH] Fix: Set proper debug_reason in deassert_reset() (#687) * Fix checkpatch workflow: ignore changes in .github/ Ignore changes in .github/ directory when running checkpatch. Checkpatch emits false alarms on substrings "CC:" found in *.yml workflow files, apparently thinking it is a "Cc:" signature in commit message. Change-Id: Id977d5a8838797e4676758066af4825651c41a87 * Fix: Set proper debug_reason in deassert_reset() The issue was visible for example when user's .cfg file ended with "reset halt" command: In such case, the hart would remain halted but the debug_reason would not be updated and may retain an incorrect value, e.g. DBG_REASON_NOTHALTED. In such cases, gdb_last_signal() would provide an incorrect reply to GDB. Change-Id: Ie6f050295fb5cbe9db38b189c4bc385662acf5b4 Signed-off-by: Jan Matyas * Fix checkpatch workflow: add 'apt-get update' Change-Id: Ic5843ec86d16a187d01970a3253caade3d13b7ab Signed-off-by: Jan Matyas --- .github/workflows/checkpatch.yml | 16 +++++++++++----- src/target/riscv/riscv-013.c | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml index 0c120c0f2..c9ec78d59 100644 --- a/.github/workflows/checkpatch.yml +++ b/.github/workflows/checkpatch.yml @@ -1,6 +1,6 @@ on: pull_request -name: Check Code Style +name: Check Code Style (checkpatch) jobs: check: @@ -13,9 +13,15 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 50 - - run: sudo apt-get install patchutils + - name: Install required packages (apt-get) + run: | + sudo apt-get update + sudo apt-get install patchutils - name: Run checkpatch run: | - git diff -U20 HEAD~40 | \ - filterdiff -x "a/src/jtag/drivers/libjaylink/*" -x "a/tools/git2cl/*" | \ - ./tools/scripts/checkpatch.pl --no-signoff - + git diff -U20 HEAD~40 \ + | filterdiff \ + -x "a/src/jtag/drivers/libjaylink/*" \ + -x "a/tools/git2cl/*" \ + -x "a/.github/*" \ + | ./tools/scripts/checkpatch.pl --no-signoff - diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 553cc3955..b719fa4f5 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -2436,6 +2436,7 @@ static int deassert_reset(struct target *target) } } target->state = TARGET_HALTED; + target->debug_reason = DBG_REASON_DBGRQ; if (get_field(dmstatus, DM_DMSTATUS_ALLHAVERESET)) { /* Ack reset. */