From patchwork Tue Sep 4 06:12:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 965789 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 424Gmc5v0Dz9s3Z for ; Tue, 4 Sep 2018 16:16:00 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 424Gmc3WdRzF5yB for ; Tue, 4 Sep 2018 16:16:00 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 424Ghh65sMzF5nX for ; Tue, 4 Sep 2018 16:12:36 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 424Ghh38RSz9s3l; Tue, 4 Sep 2018 16:12:36 +1000 (AEST) Received: by localhost.localdomain (Postfix, from userid 1000) id 64EF2EE791F; Tue, 4 Sep 2018 16:12:36 +1000 (AEST) From: Michael Neuling To: alistair@popple.id.au Date: Tue, 4 Sep 2018 16:12:30 +1000 Message-Id: <20180904061231.6409-2-mikey@neuling.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180904061231.6409-1-mikey@neuling.org> References: <20180904061231.6409-1-mikey@neuling.org> Subject: [Pdbg] [PATCH 2/3] htm: Allow nest htm in htm_toggle_debug_bit() X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pdbg@lists.ozlabs.org MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Currently htm_toggle_debug_bit() assumes the target's parent is a core but this is only the case for core htm. For nest htm, the target's parent is a chip. Also for nest, we don't need to toggle this bit. This detects the nest htm case and just returns. Signed-off-by: Michael Neuling --- libpdbg/htm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libpdbg/htm.c b/libpdbg/htm.c index 6bc6b734e4..f9013e5aba 100644 --- a/libpdbg/htm.c +++ b/libpdbg/htm.c @@ -730,9 +730,15 @@ static int do_htm_reset(struct htm *htm, bool wrap) static int htm_toggle_debug_bit(struct htm *htm) { struct pdbg_target *target; - struct pdbg_target *core = pdbg_target_require_parent("core", &htm->target); + struct pdbg_target *core; uint64_t reg; + /* NHTM doesn't have a core as a parent but donesn't need this + * bit toggled */ + core = pdbg_target_parent("core", &htm->target); + if (!core) + return 0; /* nhtm case */ + /* FIXME: this is a hack for P8 */ if (!dt_node_is_compatible(core, "ibm,power8-core")) { PR_ERROR("HTM is POWER8 only currently\n");