From: Sebastian Ott Date: Wed, 10 Jul 2019 14:06:47 +0200 Subject: s390/pci: add mio_enabled attribute Git-commit: 8e4708b3f8d949a74499426614b9b8ea5bcad15a Patch-mainline: v5.3-rc1 References: bsc#1152665 LTC#181729 Provide an attribute to query the usage of mio instructions. Signed-off-by: Sebastian Ott Signed-off-by: Vasily Gorbik Acked-by: Petr Tesarik --- arch/s390/pci/pci_sysfs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/arch/s390/pci/pci_sysfs.c +++ b/arch/s390/pci/pci_sysfs.c @@ -36,6 +36,15 @@ zpci_attr(segment1, "0x%02x\n", pfip[1]) zpci_attr(segment2, "0x%02x\n", pfip[2]); zpci_attr(segment3, "0x%02x\n", pfip[3]); +static ssize_t mio_enabled_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct zpci_dev *zdev = to_zpci(to_pci_dev(dev)); + + return sprintf(buf, zpci_use_mio(zdev) ? "1\n" : "0\n"); +} +static DEVICE_ATTR_RO(mio_enabled); + static ssize_t recover_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { @@ -114,6 +123,7 @@ static struct attribute *zpci_dev_attrs[ &dev_attr_vfn.attr, &dev_attr_uid.attr, &dev_attr_recover.attr, + &dev_attr_mio_enabled.attr, NULL, }; static struct attribute_group zpci_attr_group = {