summaryrefslogtreecommitdiffstats
path: root/arch/s390/include
diff options
context:
space:
mode:
authorPierre Morel <pmorel@linux.ibm.com>2020-04-22 15:15:23 +0200
committerVasily Gorbik <gor@linux.ibm.com>2020-04-28 13:49:47 +0200
commit44510d6fa0c00aa90b80075caa6b313b25927475 (patch)
tree23c0c41788e48e66cd343b7db76e5595bbc037d6 /arch/s390/include
parent65e450a9f9adabf3de1305a4c616f1313df402a3 (diff)
downloadlinux-44510d6fa0c00aa90b80075caa6b313b25927475.tar.bz2
s390/pci: Handling multifunctions
We allow multiple functions on a single bus. We suppress the ZPCI_DEVFN definition and replace its occurences with zpci->devfn. We verify the number of device during the registration. There can never be more domains in use than existing devices, so we do not need to verify the count of domain after having verified the count of devices. 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>
Diffstat (limited to 'arch/s390/include')
-rw-r--r--arch/s390/include/asm/pci.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h
index 7d99ab35833c..c1558cf071b8 100644
--- a/arch/s390/include/asm/pci.h
+++ b/arch/s390/include/asm/pci.h
@@ -22,7 +22,6 @@ int pci_domain_nr(struct pci_bus *);
int pci_proc_domain(struct pci_bus *);
#define ZPCI_BUS_NR 0 /* default bus number */
-#define ZPCI_DEVFN 0 /* default device number */
#define ZPCI_NR_DMA_SPACES 1
#define ZPCI_NR_DEVICES CONFIG_PCI_NR_FUNCTIONS
@@ -110,6 +109,7 @@ struct zpci_bus {
struct resource bus_resource;
int pchid;
int domain_nr;
+ bool multifunction;
enum pci_bus_speed max_bus_speed;
};
@@ -117,6 +117,7 @@ struct zpci_bus {
struct zpci_dev {
struct zpci_bus *zbus;
struct list_head entry; /* list of all zpci_devices, needed for hotplug, etc. */
+ struct list_head bus_next;
struct kref kref;
struct hotplug_slot hotplug_slot;
@@ -129,7 +130,8 @@ struct zpci_dev {
u8 pft; /* pci function type */
u8 port;
u8 rid_available : 1;
- u8 reserved : 7;
+ u8 has_hp_slot : 1;
+ u8 reserved : 6;
unsigned int devfn; /* DEVFN part of the RID*/
struct mutex lock;
@@ -253,7 +255,7 @@ static inline struct zpci_dev *to_zpci(struct pci_dev *pdev)
{
struct zpci_bus *zbus = pdev->sysdata;
- return zbus->function[ZPCI_DEVFN];
+ return zbus->function[pdev->devfn];
}
static inline struct zpci_dev *to_zpci_dev(struct device *dev)