From patchwork Mon Nov 20 06:32:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Currey X-Patchwork-Id: 839451 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 3ygJml39g2z9ryv for ; Mon, 20 Nov 2017 17:32:39 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Kyjt06HT"; 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 3ygJml20SpzDrTj for ; Mon, 20 Nov 2017 17:32:39 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Kyjt06HT"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=russell.cc (client-ip=66.111.4.28; helo=out4-smtp.messagingengine.com; envelope-from=ruscur@russell.cc; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Kyjt06HT"; dkim-atps=neutral Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3ygJmd4vBGzDrTc for ; Mon, 20 Nov 2017 17:32:32 +1100 (AEDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9FF5620BC9; Mon, 20 Nov 2017 01:32:29 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Mon, 20 Nov 2017 01:32:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=vsp3tWJUfK/3yeuJF yn7vhnBinfsj6wf5EL4JXJRX1A=; b=Kyjt06HTO0jNxGlZhLnJKfSc+7kofxK0a Yz5RtBloijb3vh13ocikJWKjuKbqXsz+5KvC9wHOpdJSP7Sw9x9CQPgWvtJmHFA8 QMXUHtancKb3E6IUAGUQceocaYcdq1n3YvsNaF2mwnsK4WtaUrSRzM5ZNa2lcvUS GoT/2p88HTtC6MCZNrFyaTLAy17rkKxbaTycvErGnT2bYRP85Fx2BIeQZsRzXg5O z6IAw71bVu2QUtKyxFCWtQvJBSokK7lI3GReddijJWlPEOpaelKDVh1T7qMF6dbE wL1Mfi/rfk1LjGQAL/W8t2YGh/LFYl1tFiNBjLGdnLyy+hs3tRZXA== X-ME-Sender: Received: from snap.au.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 875A82471D; Mon, 20 Nov 2017 01:32:28 -0500 (EST) From: Russell Currey To: skiboot@lists.ozlabs.org Date: Mon, 20 Nov 2017 17:32:12 +1100 Message-Id: <20171120063213.22892-1-ruscur@russell.cc> X-Mailer: git-send-email 2.14.1 Subject: [Skiboot] [PATCH 1/2] pci: Track peers of slots 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: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Witherspoon introduced a new concept where one physical slot is shared between two PHBs. Making a slot aware of its peer enables syncing between them where necessary. Signed-off-by: Russell Currey --- core/pci-slot.c | 1 + include/pci-slot.h | 1 + platforms/astbmc/witherspoon.c | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/pci-slot.c b/core/pci-slot.c index 6d3ed6cb..8bddc147 100644 --- a/core/pci-slot.c +++ b/core/pci-slot.c @@ -178,6 +178,7 @@ struct pci_slot *pci_slot_alloc(struct phb *phb, slot->power_state = PCI_SLOT_POWER_ON; slot->ops.run_sm = pci_slot_run_sm; slot->ops.prepare_link_change = pci_slot_prepare_link_change; + slot->peer_slot = NULL; if (!pd) { slot->id = PCI_PHB_SLOT_ID(phb); phb->slot = slot; diff --git a/include/pci-slot.h b/include/pci-slot.h index 1d323aa7..bb66d7c7 100644 --- a/include/pci-slot.h +++ b/include/pci-slot.h @@ -186,6 +186,7 @@ struct pci_slot { uint64_t retries; uint64_t link_retries; struct pci_slot_ops ops; + struct pci_slot *peer_slot; void *data; }; diff --git a/platforms/astbmc/witherspoon.c b/platforms/astbmc/witherspoon.c index 1caa2edb..b9ed2778 100644 --- a/platforms/astbmc/witherspoon.c +++ b/platforms/astbmc/witherspoon.c @@ -457,8 +457,11 @@ static void phb4_pre_pci_fixup_witherspoon(void) slot0->ops.get_presence_state(slot0, &p0); if (slot1->ops.get_presence_state) slot1->ops.get_presence_state(slot1, &p1); - if (p0 == 1 && p1 == 1) + if (p0 == 1 && p1 == 1) { phb4_activate_shared_slot_witherspoon(chip1); + slot0->peer_slot = slot1; + slot1->peer_slot = slot0; + } } }