From patchwork Mon Jun 12 09:50:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 774486 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 3wmSp41m4tz9s65 for ; Mon, 12 Jun 2017 19:51:08 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wmSp40YlbzDqLC for ; Mon, 12 Jun 2017 19:51:08 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wmSnz2N1yzDqL2 for ; Mon, 12 Jun 2017 19:51:03 +1000 (AEST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 84D4C334587 for ; Mon, 12 Jun 2017 09:51:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 84D4C334587 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=thuth@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 84D4C334587 Received: from thh440s.redhat.com (ovpn-116-84.ams2.redhat.com [10.36.116.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAEC718659 for ; Mon, 12 Jun 2017 09:51:00 +0000 (UTC) From: Thomas Huth To: slof@lists.ozlabs.org Date: Mon, 12 Jun 2017 11:50:59 +0200 Message-Id: <1497261059-25068-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 12 Jun 2017 09:51:01 +0000 (UTC) Subject: [SLOF] [PATCH] pci-phb: Set correct pci-bus-number while walking PCI bridges X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" Commit e44b7f07 ("Fix secondary and subordinate PCI bus enumeration") created a board-qemu specific version of the pci-bridge-probe function to fix problems with the secondary and subordinate bus number registers. Unfortunately, this function missed to update the pci-bus-number variable like the original pci-bridge-probe function did it, so that new bridges currently end up with a bad "my-bus" setting (which is initialized from the pci-bus-number variable) and thus things that depend on this setting, like the "decode-unit" function currently don't work as expected on these PCI bridges. Fix it by initializing the pci-bus-number from the PCI config space settings that is provided by QEMU. Fixes: e44b7f074f549f78303ad4d67d39b18db93d11bf Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1459755 Signed-off-by: Thomas Huth --- board-qemu/slof/pci-phb.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/board-qemu/slof/pci-phb.fs b/board-qemu/slof/pci-phb.fs index 6dfb2e6..b7bf9cf 100644 --- a/board-qemu/slof/pci-phb.fs +++ b/board-qemu/slof/pci-phb.fs @@ -309,6 +309,7 @@ setup-puid : phb-pci-bridge-probe ( addr -- ) dup pci-bridge-set-bases \ Set up all Base Registers dup func-pci-bridge-range-props \ Set up temporary "range" + my-space pci-bus-scnd@ TO pci-bus-number \ Set correct current bus number pci-device-vec-len 1+ TO pci-device-vec-len \ increase the device-slot vector depth pci-enable \ enable mem/IO transactions phb-pci-walk-bridge \ and walk the secondary bus