s390/pci: Adding bus resource
authorPierre Morel <pmorel@linux.ibm.com>
Mon, 23 Mar 2020 11:29:37 +0000 (12:29 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 28 Apr 2020 11:49:46 +0000 (13:49 +0200)
The current PCI implementation do not provide a bus resource.
This leads to a notice being print at boot.
Let's do it more nicely and provide the bus resource.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/pci.h
arch/s390/pci/pci_bus.c

index 686a442..7d99ab3 100644 (file)
@@ -107,6 +107,7 @@ struct zpci_bus {
        struct zpci_dev         *function[ZPCI_FUNCTIONS_PER_BUS];
        struct list_head        resources;
        struct list_head        bus_next;
+       struct resource         bus_resource;
        int                     pchid;
        int                     domain_nr;
        enum pci_bus_speed      max_bus_speed;
index e1565b8..b4fefc6 100644 (file)
@@ -99,6 +99,11 @@ static struct zpci_bus *zpci_bus_alloc(int pchid)
        kref_init(&zbus->kref);
        INIT_LIST_HEAD(&zbus->resources);
 
+       zbus->bus_resource.start = 0;
+       zbus->bus_resource.end = ZPCI_BUS_NR;
+       zbus->bus_resource.flags = IORESOURCE_BUS;
+       pci_add_resource(&zbus->resources, &zbus->bus_resource);
+
        return zbus;
 }