From patchwork Fri Sep 15 00:27:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 814009 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 ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xtbpC0TRtz9t2V for ; Fri, 15 Sep 2017 10:27:47 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xtbpB6cqszDrCv for ; Fri, 15 Sep 2017 10:27:46 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xtbp70sXhzDqGs for ; Fri, 15 Sep 2017 10:27:43 +1000 (AEST) Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 3xtbp66n7jz9sxR; Fri, 15 Sep 2017 10:27:42 +1000 (AEST) Received: by localhost.localdomain (Postfix, from userid 1000) id D14D1EEA9E9; Fri, 15 Sep 2017 10:27:42 +1000 (AEST) From: Michael Neuling To: stewart@linux.vnet.ibm.com Date: Fri, 15 Sep 2017 10:27:39 +1000 Message-Id: <20170915002739.20717-1-mikey@neuling.org> X-Mailer: git-send-email 2.11.0 Subject: [Skiboot] [PATCH] phb4: Use link if degraded X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: skiboot@lists.ozlabs.org, mikey@neuling.org MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" In the recent change: 3f936bae97 phb4: Retrain link if degraded We retrain if the link is degraded. We do 3 retries to get an optimal link. Unfortunately if the last retry fails, we mark the PHB as bad and don't use it. Hence that PHB is lost even though it actually trained (just degraded). This fixes the problem by printing an error message (as below) but still marking the PHB as good. [ 7.179320404,3] PHB#0005[0:5]: LINK: Link degraded [ 8.387346665,3] PHB#0005[0:5]: LINK: Link degraded [ 10.078409137,3] PHB#0005[0:5]: LINK: Link degraded [ 11.281477269,3] PHB#0005[0:5]: LINK: Link degraded [ 11.283123885,3] PHB#0005[0:5]: LINK: Degraded but no more retries Signed-off-by: Michael Neuling Acked-by: Russell Currey --- hw/phb4.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/phb4.c b/hw/phb4.c index c51e57ce2d..620961b12d 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -2622,7 +2622,13 @@ static int64_t phb4_poll_link(struct pci_slot *slot) PHBDBG(p, "LINK: Link is stable\n"); if (!phb4_link_optimal(slot)) { PHBERR(p, "LINK: Link degraded\n"); - return phb4_retry_state(slot); + if (slot->link_retries) + return phb4_retry_state(slot); + /* + * Link is degraded but no more retries, so + * settle for what we have :-( + */ + PHBERR(p, "LINK: Degraded but no more retries\n"); } pci_slot_set_state(slot, PHB4_SLOT_NORMAL); return OPAL_SUCCESS;