{"id":816110,"url":"http://patchwork.ozlabs.org/api/patches/816110/?format=json","web_url":"http://patchwork.ozlabs.org/project/skiboot/patch/20170920094602.4838-2-oohall@gmail.com/","project":{"id":44,"url":"http://patchwork.ozlabs.org/api/projects/44/?format=json","name":"skiboot firmware development","link_name":"skiboot","list_id":"skiboot.lists.ozlabs.org","list_email":"skiboot@lists.ozlabs.org","web_url":"http://github.com/open-power/skiboot","scm_url":"http://github.com/open-power/skiboot","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170920094602.4838-2-oohall@gmail.com>","list_archive_url":null,"date":"2017-09-20T09:46:01","name":"[2/3] npu2: Read slot label from the link node","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"b6d7461d039069fb779243628a41b58e1117633d","submitter":{"id":68108,"url":"http://patchwork.ozlabs.org/api/people/68108/?format=json","name":"Oliver O'Halloran","email":"oohall@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/skiboot/patch/20170920094602.4838-2-oohall@gmail.com/mbox/","series":[{"id":4066,"url":"http://patchwork.ozlabs.org/api/series/4066/?format=json","web_url":"http://patchwork.ozlabs.org/project/skiboot/list/?series=4066","date":"2017-09-20T09:46:00","name":"[1/3] npu2: Copy link speed from the npu node","version":1,"mbox":"http://patchwork.ozlabs.org/series/4066/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/816110/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/816110/checks/","tags":{},"related":[],"headers":{"Return-Path":"<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","skiboot@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","skiboot@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xxvym1Q2xz9sNr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 19:46:40 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xxvyl70x0zDqZ1\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 19:46:39 +1000 (AEST)","from mail-pf0-x241.google.com (mail-pf0-x241.google.com\n\t[IPv6:2607:f8b0:400e:c00::241])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xxvyN5hl4zDqBd\n\tfor <skiboot@lists.ozlabs.org>; Wed, 20 Sep 2017 19:46:20 +1000 (AEST)","by mail-pf0-x241.google.com with SMTP id a7so996090pfj.5\n\tfor <skiboot@lists.ozlabs.org>; Wed, 20 Sep 2017 02:46:20 -0700 (PDT)","from flat-canetoad.au.ibm.com (bh02i525f01.au.ibm.com.\n\t[202.81.18.30]) by smtp.gmail.com with ESMTPSA id\n\th1sm6930732pgf.54.2017.09.20.02.46.16\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 20 Sep 2017 02:46:17 -0700 (PDT)"],"Authentication-Results":["ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"LDacnTiE\"; dkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"LDacnTiE\"; dkim-atps=neutral","ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:400e:c00::241; helo=mail-pf0-x241.google.com;\n\tenvelope-from=oohall@gmail.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"LDacnTiE\"; dkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=Qy6+140wwXx5VX3toZRhVKmb8Eb6Jh8Qa7jgsUE41Rs=;\n\tb=LDacnTiEhzsnT6EBwHnboJT+VcqysAKhCQP5EoSLO2brzKVFM/1Ha1mEUkyKZvtoEN\n\tYXzXyu4344qxGt7ToKFdbr2B3cyWQe29sba1lse6MtoIDFyC7WgD00YVv5/8LiDk2A4K\n\tGA0Y3WSAdx1sRxfqduxOk2CUDCiw0UhxuD6Xk/mI7by2sDLIoAmUkpNXnesmfqZDbS2V\n\tshWgunC9rR6+AB38Ga3drXhj7MfqwVOMCZKJQiekjBBMx1heQ2L+m7vBdmIfXaR55BQu\n\tsPdasT1wltHJwWE2wz7if05zelO14WAemVJpLwBLvHuE5exW1JFGNsJF8y6ML45q77mL\n\tVcKQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=Qy6+140wwXx5VX3toZRhVKmb8Eb6Jh8Qa7jgsUE41Rs=;\n\tb=Kb2zHN9CHJMssGQMiWchWJu3Fceb4I1O+mkIwGLn0WTWPSKeHbQkEmdHpRdVfAJa5R\n\tMo8z3g8ytcF61a7hrHB6wOWs4VtLSfxHTA2ugnHGL/JVoNFOq0zJ28bfnX5xEFoo1zv7\n\tErPSkTeD5AIZIEllgNFGnt1LuvuvhhWroJSCCbJ/hyJ31RZHOJcrtcnpnR8802cUGJCg\n\tWqdiVFBf9z53ofcBOHAm1ZsFungGOnvPFB88iM4u/lEt+i6iicmokdpB5VWMXjN/TxnO\n\ttiE2sZrcc93z0JxurWOxkCUU3x59949CJlelrH5+9A6YD6cblFcUBKx41o3jSKD//jpZ\n\tJUrQ==","X-Gm-Message-State":"AHPjjUguIMQ5SCG2GpIk6YaINK0s8SSX7ibFsMO5T4H3YocxtuoD1YGn\n\tvDT5WANUxN0sl15LToFoc6SYBg==","X-Google-Smtp-Source":"AOwi7QDFeukuJ3aPTx6WrCUH7yzR/mV/RV2CBttrkVOeITKy1PbLlmPYL9rAT2+rtFxhtex+qsyKug==","X-Received":"by 10.101.93.65 with SMTP id e1mr1611842pgt.150.1505900778470;\n\tWed, 20 Sep 2017 02:46:18 -0700 (PDT)","From":"Oliver O'Halloran <oohall@gmail.com>","To":"skiboot@lists.ozlabs.org","Date":"Wed, 20 Sep 2017 19:46:01 +1000","Message-Id":"<20170920094602.4838-2-oohall@gmail.com>","X-Mailer":"git-send-email 2.9.5","In-Reply-To":"<20170920094602.4838-1-oohall@gmail.com>","References":"<20170920094602.4838-1-oohall@gmail.com>","Subject":"[Skiboot] [PATCH 2/3] npu2: Read slot label from the link node","X-BeenThere":"skiboot@lists.ozlabs.org","X-Mailman-Version":"2.1.24","Precedence":"list","List-Id":"Mailing list for skiboot development <skiboot.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/skiboot/>","List-Post":"<mailto:skiboot@lists.ozlabs.org>","List-Help":"<mailto:skiboot-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"Skiboot\"\n\t<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"},"content":"Binding GPU to emulated NPU PCI devices is done using the slot labels\nsince the NPU devices do not have a patching slot node we need to\ncopy the label in here.\n\nSigned-off-by: Oliver O'Halloran <oohall@gmail.com>\n---\n hw/npu2.c | 20 +++++++++++++++++---\n 1 file changed, 17 insertions(+), 3 deletions(-)","diff":"diff --git a/hw/npu2.c b/hw/npu2.c\nindex 1176d3c0a9b7..0b85a5dae26b 100644\n--- a/hw/npu2.c\n+++ b/hw/npu2.c\n@@ -710,6 +710,7 @@ static int npu2_dn_fixup(struct phb *phb,\n \tstruct npu2 *p = phb_to_npu2(phb);\n \tstruct npu2_dev *dev;\n \tuint32_t speed;\n+\tconst char *label;\n \n \tdev = npu2_bdf_to_dev(p, pd->bdfn);\n \tassert(dev);\n@@ -730,9 +731,20 @@ static int npu2_dn_fixup(struct phb *phb,\n \tif (speed != 0xff)\n \t\tdt_add_property_cells(pd->dn, \"ibm,nvlink-speed\", speed);\n \n-\t/* NPU2 devices require a slot location to associate with GPUs */\n-\tdev->slot_label = dt_prop_get_def(pd->dn, \"ibm,slot-label\", NULL);\n-\tif (!dev->slot_label) {\n+\t/*\n+\t * NPU2 devices require a slot location to associate with GPUs.\n+\t * This can be added via the slot table matching, otherwise we\n+\t * read it from the link node.\n+\t */\n+\tlabel = dt_prop_get_def(pd->dn, \"ibm,slot-label\", NULL);\n+\n+\tif (!label) {\n+\t\tlabel = dt_prop_get_def(dev->dt_node, \"ibm,slot-label\", NULL);\n+\t\tif (label)\n+\t\t\tdt_add_property_string(pd->dn, \"ibm,slot-label\", label);\n+\t}\n+\n+\tif (!label) {\n \t\t/**\n \t\t * @fwts-label NPUNoPHBSlotLabel\n \t\t * @fwts-advice No GPU/NPU2 slot information was found.\n@@ -742,6 +754,8 @@ static int npu2_dn_fixup(struct phb *phb,\n \t\treturn 0;\n \t}\n \n+\tdev->slot_label = label;\n+\n \t/*\n \t * Bind the emulated PCI device with the real one, which can't\n \t * be done until the PCI devices are populated. Once the real\n","prefixes":["2/3"]}