From patchwork Fri Aug 23 07:36:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 1152014 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46FCs52zpQz9sBp for ; Fri, 23 Aug 2019 17:36:57 +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="lgQmvOE0"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46FCs43WSRzDqfV for ; Fri, 23 Aug 2019 17:36:56 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::544; helo=mail-pg1-x544.google.com; envelope-from=oohall@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="lgQmvOE0"; dkim-atps=neutral Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46FCrx3kHxzDrQ1 for ; Fri, 23 Aug 2019 17:36:48 +1000 (AEST) Received: by mail-pg1-x544.google.com with SMTP id n4so5317750pgv.2 for ; Fri, 23 Aug 2019 00:36:48 -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:mime-version :content-transfer-encoding; bh=T6GllLrRYURCLyN5jZi+0ngrwJF4MyHRo6KFQUgD/pc=; b=lgQmvOE0nAeo8e8N2G6M2LRpAOl+xvMpL5gfKs3FmAVLLYzzDPUoSFEw0SYt4hNbcG yAZsuAX5xzG3iGPUsu3Yn/FTaO9iHMrwsGoI+I1ARFJX/wJ421Sc5rWrGDQNthRvhULo OON6ELcW+zTMNcFzsFmeueytRX065q2e0t5viJnTff5YfTtL5c5gIh7GpFGsVJt0dMfK uw2iq+G8DmiuFcJSN38NAd6N3pE8nwJ/boy8/IIxDEdb1Vq7D3S0gAJr3ks1NxfLTnIr ydCW/AYdCD9XHg0dD19U0vy4vxMaGOGdy2IGBVAH6EK/uX41HUOUyKcvA/eflfjr4rmk ilKQ== 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:mime-version :content-transfer-encoding; bh=T6GllLrRYURCLyN5jZi+0ngrwJF4MyHRo6KFQUgD/pc=; b=t+h1RzBmvqFbNnm8+8Y3+jSZEF2HJ9f0/KWS6CHuYfUFhh8+SDcy6bDyucYop+iHSJ zDOBwD5oNB5Lb4Mwp4ft3Aweq+vfIGmI920ZbAcntvgVOVg97i6c0UOaTDeS7VRQvVsP 2g3HY2i5E2hUfpbcBl3/VIQMGufilCryy6c+kayvYcPexbKbgfKiUanW/wUNzj8RnpHo t9L+HzJz5UzRuJHcDTMIu/JJ1nJGaloGN/wYlnlbIiTLdK0RnD6+pI9bY8GVsiyb/gQu sc3AsmOAs4RhJI3NPvr3Xpz3VWDIuQB99WCAmzBuHHwvegQfxsRTFSL9F++PUxdzwa9w 9Xvw== X-Gm-Message-State: APjAAAW1IKMaZDBliHvmQouG0gpbW8Zpx7gkfYOO6wOSz7CkAs9I6TAg mpYw77HzMrGb6O+fAcJWKRGn+GNd X-Google-Smtp-Source: APXvYqzfCYD8APNI77KDVU1TAP3KcxBeujz7F3BEwK4135br4aSC1lZQUJkzVtjHPH1oYpyTdds+Mw== X-Received: by 2002:a17:90a:c502:: with SMTP id k2mr3820604pjt.16.1566545806216; Fri, 23 Aug 2019 00:36:46 -0700 (PDT) Received: from wafer.ozlabs.ibm.com.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id 131sm1294448pge.37.2019.08.23.00.36.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2019 00:36:45 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Fri, 23 Aug 2019 17:36:34 +1000 Message-Id: <20190823073634.21669-1-oohall@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Skiboot] [PATCH] core/pci: Only hack class code for root ports X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Currently we apply a hack to devices directly under a PHB which sets the class code shown in the DT to that of a generic PCI-PCI bridge. This is done to work around a bug in some IBM PHBs where the root port had an incorrect class code. This has the side effect of forcing the class code of any devices on a root bus to that of a PCI-PCI bridge including NVLink and OpenCAPI devices which causes them to be mis-labed in the Skiboot PCI Summary. Fix this by only appling the hack to PCIe devices that are marked as root ports and add a description string for the 0680 class code that we use for nvlink device. Signed-off-by: Oliver O'Halloran --- core/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pci.c b/core/pci.c index cd6b9f3f000c..9ee70f4fddc5 100644 --- a/core/pci.c +++ b/core/pci.c @@ -1570,7 +1570,7 @@ static void __noinline pci_add_one_device_node(struct phb *phb, * uses prefers to read the class code from the DT rather than * re-reading config space we can hack around it here. */ - if (is_pcie && parent_node == phb->dt_node) + if (is_pcie && pd->dev_type == PCIE_TYPE_ROOT_PORT) rev_class = (rev_class & 0xff) | 0x6040000; cname = pci_class_name(rev_class >> 8);