From patchwork Thu Apr 19 04:41:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 900573 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 40RRCq263gz9s1j for ; Thu, 19 Apr 2018 14:41:59 +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="MJJsn5Hj"; 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 40RRCq07L8zF22T for ; Thu, 19 Apr 2018 14:41:59 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MJJsn5Hj"; dkim-atps=neutral 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:400e:c05::244; helo=mail-pg0-x244.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="MJJsn5Hj"; dkim-atps=neutral Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40RRCK196xzF22R for ; Thu, 19 Apr 2018 14:41:32 +1000 (AEST) Received: by mail-pg0-x244.google.com with SMTP id i29so400387pgn.12 for ; Wed, 18 Apr 2018 21:41:32 -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; bh=U6rP3iWlhdZABupXOvnwMeMjDJOm5M4BT8AjnaMtYko=; b=MJJsn5HjNKtOphyVpieeVvsr+2WvuJSpbHxVkP6ua3l5QSgdkAMV6qhEu46melSD1p ZJGg+SnFN3PEjbNRQr1as8L1MlNHY972SBWgLGD9b0xZ2XqVcmyxi1rmkWWvyXoQWWHA mSbUHu3gDoSsSp9JXY0+ev02b940tIoYqvcKqQePISuCTYedCJ9ysleE6Z+vWIO49y1D DmnZZ25htpBBvigN/q/KgGR0ta05oJbii01N7UUtxe7c53KxZWYHyM4EDFn87hP4DHI6 tsCcIPuwLDZzgwe9Ox25EVwZk1XJuVY+d2kj74BBpB2XpZKwJNWcn0ZRpcxP+/Uifqg3 8Atg== 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; bh=U6rP3iWlhdZABupXOvnwMeMjDJOm5M4BT8AjnaMtYko=; b=JgkUpWtke02F45d7I7CzoM/mscWswMKOmgB/TMj7O4Oq7wkVZ1UoXBLS/bcZ7fAfzg l9hABM2bXN0YsyqkG5zHITxtCvRq9u9ldu7oNeOlE3ZnNqDim9wDvnaFMOskxE16lmj0 YbUMVgR1oOW+NcbzFScrLaESyV0OaLWwpxZeCKfGBOqYft8ONLZ8VIw+vzUaNV7t9I6R x86aW0aPrX5QRAZy4v8YUAefLYFFsPWnjpR6vIFOSX5XB4Gy6cKKsK814mYOxzLq+WyA rjbqhRgZhMjtvNCrUm4ToJ6zXJc/Nyu1ko2mgRKuGJSn/H8wdm+xmb/maNvs6Gq5qM+s G3/w== X-Gm-Message-State: ALQs6tCxDvEBLxVKB83pTtoOvh3eLYiAKAygs5Tck9kDwcqnf30EX2Sv BW2sdL+aK8Ququ0Oo95fb/ux8g== X-Google-Smtp-Source: AIpwx4+pa9/nJfGLTCdLufGFMZV8UHSfL0c1xKo4JqlCKIJl5RKSoCzEVp4Jruhi26QMdpddL5etjg== X-Received: by 10.99.127.3 with SMTP id a3mr3856833pgd.267.1524112890470; Wed, 18 Apr 2018 21:41:30 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id p6sm4423826pfn.140.2018.04.18.21.41.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Apr 2018 21:41:29 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Thu, 19 Apr 2018 14:41:19 +1000 Message-Id: <20180419044119.1970-1-oohall@gmail.com> X-Mailer: git-send-email 2.9.5 Subject: [Skiboot] [PATCH] npu2: Fix NPU<->GPU binding error message X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 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" NVLinks with the same target appear as a multi-function PCI device rather than individual devices. When printing out the error message we assume that the link index is the same as the device number, which is no longer true. Fix this by using the BDFN and setting the appropriate fields. e.g. Old and broken: No PCI device for NPU2 device 0006:00:03.0 to bind to. No PCI device for NPU2 device 0006:00:04.0 to bind to. No PCI device for NPU2 device 0006:00:05.0 to bind to. New and fixed: No PCI device for NPU2 device 0006:00:01.00 to bind to. No PCI device for NPU2 device 0006:00:01.01 to bind to. No PCI device for NPU2 device 0006:00:01.02 to bind to. Signed-off-by: Oliver O'Halloran --- hw/npu2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/npu2.c b/hw/npu2.c index 06e06d4ff2aa..99bc67b30af9 100644 --- a/hw/npu2.c +++ b/hw/npu2.c @@ -434,8 +434,9 @@ static void npu2_dev_bind_pci_dev(struct npu2_dev *dev) } } - prlog(PR_INFO, "%s: No PCI device for NPU2 device %04x:00:%02x.0 to bind to. If you expect a GPU to be there, this is a problem.\n", - __func__, dev->npu->phb_nvlink.opal_id, dev->index); + prlog(PR_INFO, "%s: No PCI device for NPU2 device %04x:00:%02x.%x to bind to. If you expect a GPU to be there, this is a problem.\n", + __func__, dev->npu->phb_nvlink.opal_id, (dev->bdfn >> 3) & 0x1f, + dev->bdfn & 0x3); } static struct lock pci_npu_phandle_lock = LOCK_UNLOCKED;