From patchwork Wed Aug 8 12:00:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 954955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41lqjN5zCVz9s1x for ; Wed, 8 Aug 2018 22:01:12 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MJfCSwot"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41lqjN41H6zDqww for ; Wed, 8 Aug 2018 22:01:12 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MJfCSwot"; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::441; helo=mail-pf1-x441.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MJfCSwot"; dkim-atps=neutral Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41lqjH6lJ8zDqgZ for ; Wed, 8 Aug 2018 22:01:07 +1000 (AEST) Received: by mail-pf1-x441.google.com with SMTP id j8-v6so1040641pff.6 for ; Wed, 08 Aug 2018 05:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=qgrEBmQAM1hFkvm+2mQ1RVgsQfSf2r4FbnYR6AWaEgM=; b=MJfCSwotXYcpg79/S01o7zhGAxqqTWjGdgwIrCjcLEnLpZB1HbNMIbFGsEvsgGDkGR 0DwN/nj8c2j1ObyM/4FUKBXbIfJ4UGxrxLn3lTWKrFe+/nMjApWg4jE5666NChlcwonL MhXomXAiyVGdLzERuvAvVvEJThgmaxE4CrQYWM2Fa4MBshAv/zVxVQ7wqnZ5T798krGe rrPcrBbojg5lmdjZ5DmOZcMVbqWxJ44CDezOH4G+ul3AzrioU1wxqwvyrSG8shfNyJf3 x3rKAy0iTk9sVFiGzHzF75ZYnoeOqywgFAhIOoXPZDLixd/6b/bjwb3xTwpa+zaiUBdC HO9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qgrEBmQAM1hFkvm+2mQ1RVgsQfSf2r4FbnYR6AWaEgM=; b=pP4rR+IRUvwXo9WBwma08kwI/7ejE62P7N43YHslFwjR5ET/7119u2GiPlubTKDZsT UthEOe5Cd6X+88MBUEC8O4kY1LDqIoSOS0NXplyzYqyTiujlA0cMvtmmSm8iedRndLEd 713TSCN+z994ow7j1t3oLMkbh3/9DU92QxZi3dhWARp4qzp3XJHJnKYqnRHff+xX20L2 /czJ6VY8bg9CGNZIvQTXqnNa6TdATx2Y/xrz0VZL34K4ngXfAfxu+NZFs0R8IHq+oNpq ms8fly+aJbayKD+aPTmvpqij3tRv2xiF1bDEnrNiEroKLRCqNf/Le+GlDPAMildrqh7Y 8urQ== X-Gm-Message-State: AOUpUlFghAM8Fsa44j6KR/VZzIgWRG83uKI9ZVsAnpqoA3ixHDLVYLJC xIpufxoEhsmONYQ9YdED8wcplgAK X-Google-Smtp-Source: AA+uWPwCpRV+5CooAPeeymC9oEGV/HZcfltVRRmNj3OxwIe9Qq67pHDSi3u1+AgOyIoNhgWDosw21g== X-Received: by 2002:a63:65c2:: with SMTP id z185-v6mr2294839pgb.276.1533729664114; Wed, 08 Aug 2018 05:01:04 -0700 (PDT) Received: from roar.au.ibm.com (123-243-222-142.tpgi.com.au. [123.243.222.142]) by smtp.gmail.com with ESMTPSA id o84-v6sm7580436pfi.165.2018.08.08.05.01.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Aug 2018 05:01:03 -0700 (PDT) From: Nicholas Piggin To: pdbg@lists.ozlabs.org Date: Wed, 8 Aug 2018 22:00:55 +1000 Message-Id: <20180808120055.32528-1-npiggin@gmail.com> X-Mailer: git-send-email 2.17.0 Subject: [Pdbg] [PATCH] libpdbg/p9chip: fix ram_is_setup 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: Nicholas Piggin MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Commit b825a47717 removed ram_is_setup unintentionally. Add it back. Ramming still doesn't really work because special wakeup release between stop and ram commands causes quiesced state to be lost. Signed-off-by: Nicholas Piggin --- libpdbg/p9chip.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c index c5de3bb..c43b0cc 100644 --- a/libpdbg/p9chip.c +++ b/libpdbg/p9chip.c @@ -217,6 +217,9 @@ static int p9_ram_setup(struct thread *thread) struct core *chip = target_to_core(thread->target.parent); uint64_t value; + if (thread->ram_is_setup) + return 1; + /* We can only ram a thread if all the threads on the core/chip are * quiesced */ dt_for_each_compatible(&chip->target, target, "ibm,power9-thread") { @@ -256,6 +259,8 @@ static int p9_ram_setup(struct thread *thread) thread->status = p9_get_thread_status(thread); + thread->ram_is_setup = true; + return 0; out_fail: @@ -362,6 +367,9 @@ static int p9_ram_instruction(struct thread *thread, uint64_t opcode, uint64_t * static int p9_ram_destroy(struct thread *thread) { + if (!thread->ram_is_setup) + return 1; + /* Disable ram mode */ CHECK_ERR(thread_write(thread, P9_RAM_MODEREG, 0)); @@ -370,6 +378,8 @@ static int p9_ram_destroy(struct thread *thread) thread->status = p9_get_thread_status(thread); + thread->ram_is_setup = false; + return 0; }