{"id":816109,"url":"http://patchwork.ozlabs.org/api/patches/816109/?format=json","web_url":"http://patchwork.ozlabs.org/project/skiboot/patch/20170920094602.4838-1-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-1-oohall@gmail.com>","list_archive_url":null,"date":"2017-09-20T09:46:00","name":"[1/3] npu2: Copy link speed from the npu node","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"8e2e84c736d0033a2db20b93fde3b41da0d82c16","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-1-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/816109/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/816109/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 3xxvyT47z1z9sNw\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 19:46:25 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xxvyT0mzFzDqTc\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 19:46:25 +1000 (AEST)","from mail-pg0-x241.google.com (mail-pg0-x241.google.com\n\t[IPv6:2607:f8b0:400e:c05::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 3xxvyL6r8SzDqBd\n\tfor <skiboot@lists.ozlabs.org>; Wed, 20 Sep 2017 19:46:18 +1000 (AEST)","by mail-pg0-x241.google.com with SMTP id u18so1368561pgo.1\n\tfor <skiboot@lists.ozlabs.org>; Wed, 20 Sep 2017 02:46:18 -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.14\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 20 Sep 2017 02:46:15 -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=\"qvFfvZVl\"; 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=\"qvFfvZVl\"; dkim-atps=neutral","ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:400e:c05::241; helo=mail-pg0-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=\"qvFfvZVl\"; 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;\n\tbh=2Zt2+WHUGYP+RDwGqLDfraRkacyBW5iHIjF9D5M7KYY=;\n\tb=qvFfvZVlcOOHoJKMHektHsPqvo2p7WbXODUb25YhKa3jcN+DbsDqfTJaZvfPPPHgPY\n\tt4oL25g47Gvt2l7ibCj7ecVPr2N9b7fKE2EWHsxftUuta1vi0t9CHDX5DIzFLzj8HxSg\n\tXZM18fuFXT6qE38j5h1pv2IfkEzL6rVXV8jsSUd1SGLGgTdyaH0TicTlHlU/uZoML1ME\n\t9EpE1TQ8xgFypRJSVw2/4u9xfqGps+ViyiBHRM3OlYAV7T0x6rqXXvj6xhX91Je/sxBl\n\tjt/nkZerp18mT6VIaSB047Zu80QP6yM9i1AmuSqWxazQLpzMMqGMKV4mSbuyg3xe7UlH\n\tVSlQ==","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;\n\tbh=2Zt2+WHUGYP+RDwGqLDfraRkacyBW5iHIjF9D5M7KYY=;\n\tb=H4T4WpVQO5SXi4F75Vik/FvXMz8BHB8Fkph8qk8Llx0hrkShWa5OE+QuRMyGd+BtRT\n\tkTPhvyCFrfvE+3mjIDy0ASBJiI07HRyUosWKAUGzVAg+M+JgYLeEO/K86mxlvNPfgd+d\n\t+IFf5np9+Kohaei7UXG1iavWo2y6t1lQRVesOeWtldA5ClyzDscH17V8oSbjYqLzTiSX\n\tyyta3OnQso6TEMLGvvWrtQLN7Gmffq8gfBqyblT3v9vo4TqBwUNwwrXTEhL3AwGJd3xw\n\tBFQHzbUgGjDZyNNn43xhpqzXwdq4FZQT0bBjBRs6KqRlom4Q/rcIWXQd3Q64Za0+vfpZ\n\tnP1g==","X-Gm-Message-State":"AHPjjUj8eiHJFltQbsTY6VLt3crCKBRWwubYv8sXTwKDGM7N/LurPJxY\n\t/ilkbNfbh1jSJqkgGA4BTnDvRg==","X-Google-Smtp-Source":"AOwi7QCIvhqaXOAWLr42t7FF+/lVlRb5nP4zv6kosm0CjT3KTn8y4vsSXyH96tHu4RrD4HKcKoxzjQ==","X-Received":"by 10.84.136.34 with SMTP id 31mr1542596plk.174.1505900776306;\n\tWed, 20 Sep 2017 02:46:16 -0700 (PDT)","From":"Oliver O'Halloran <oohall@gmail.com>","To":"skiboot@lists.ozlabs.org","Date":"Wed, 20 Sep 2017 19:46:00 +1000","Message-Id":"<20170920094602.4838-1-oohall@gmail.com>","X-Mailer":"git-send-email 2.9.5","Subject":"[Skiboot] [PATCH 1/3] npu2: Copy link speed from the npu 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":"This needs to be in the PCI device node so the speed of the NVLink\ncan be passed to the GPU driver.\n\nSigned-off-by: Oliver O'Halloran <oohall@gmail.com>\n---\n hw/npu2.c | 17 ++++++++++-------\n 1 file changed, 10 insertions(+), 7 deletions(-)","diff":"diff --git a/hw/npu2.c b/hw/npu2.c\nindex e3365a3fc5d7..1176d3c0a9b7 100644\n--- a/hw/npu2.c\n+++ b/hw/npu2.c\n@@ -709,6 +709,7 @@ static int npu2_dn_fixup(struct phb *phb,\n {\n \tstruct npu2 *p = phb_to_npu2(phb);\n \tstruct npu2_dev *dev;\n+\tuint32_t speed;\n \n \tdev = npu2_bdf_to_dev(p, pd->bdfn);\n \tassert(dev);\n@@ -719,13 +720,15 @@ static int npu2_dn_fixup(struct phb *phb,\n \tnpu2_dn_fixup_gmb(pd->dn, dev);\n \tdt_add_property_cells(pd->dn, \"ibm,nvlink\", dev->dt_node->phandle);\n \n-\t/* NVLink supports multiple speeds and device drivers need to know what\n-\t * speed has been set by firmware. The speed is actually controlled by\n-\t * Hostboot, so until we get a HDAT entry telling us what speed they\n-\t * programmed we will just hard code it here and hope it matches. If it\n-\t * doesn't it is always possible to manually override it when installing\n-\t * the device driver. */\n-\tdt_add_property_cells(pd->dn, \"ibm,nvlink-speed\", 0x9);\n+\t/*\n+\t * NVLink supports multiple speeds and device drivers need to know what\n+\t * speed has been set by firmware. Hostboot does the inits that set the\n+\t * link speed and tell us via HDAT and we need to copy that from the\n+\t * link node.\n+\t */\n+\tspeed = dt_prop_get_u32_def(dev->dt_node, \"nvidia,link-speed\", 0xff);\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","prefixes":["1/3"]}