OSDN Git Service

s390x/pci: Fix primary bus number for PCI bridges
authorDavid Hildenbrand <david@redhat.com>
Wed, 30 Jan 2019 15:57:28 +0000 (16:57 +0100)
committerCornelia Huck <cohuck@redhat.com>
Tue, 5 Feb 2019 09:15:12 +0000 (10:15 +0100)
commitd30a7507edf1ca23d33dbf00b25f5e49a7808492
tree18833667682d73270f774451fe3ac133763dca35
parent80a7b759493e05579c26e8a913a3d6349641853e
s390x/pci: Fix primary bus number for PCI bridges

The primary bus number corresponds always to the bus number of the
bus the bridge is attached to.

Right now, if we have two bridges attached to the same bus (e.g. root
bus) this is however not the case. The first bridge will have primary
bus 0, the second bridge primary bus 1, which is wrong. Fix the assignment.

While at it, drop setting the PCI_SUBORDINATE_BUS temporarily to 0xff.
Setting it temporarily to that value (as discussed e.g. in [1]), is
only relevant for a running system that probes the buses. The value is
effectively unused for us just doing a DFS.

Also add a comment why we have to reassign during every reset (which I
found to be surprising.

Please note that hotplugging of bridges is in general still broken, will
be fixed next.

[1] http://www.science.unitn.it/~fiorella/guidelinux/tlk/node76.html

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190130155733.32742-2-david@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
hw/s390x/s390-pci-bus.c