Skip to content

Commit fbf3ca4

Browse files
author
Herton R. Krzesinski
committed
Merge: [s390]: RHEL9 - s390/cio: add dev_busid sysfs entry for each subchannel
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/1883 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2160493 Tested: by IBM Build-Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=50048757 Commits: d3683c0 s390/cio: add dev_busid sysfs entry for each subchannel a4751f1 s390/cio: check the subchannel validity for dev_busid Signed-off-by: Tobias Huschle <thuschle@redhat.com> Approved-by: Steve Best <sbest@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2 parents e455a06 + 633b81f commit fbf3ca4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

drivers/s390/cio/css.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,26 @@ static ssize_t pimpampom_show(struct device *dev,
430430
}
431431
static DEVICE_ATTR_RO(pimpampom);
432432

433+
static ssize_t dev_busid_show(struct device *dev,
434+
struct device_attribute *attr,
435+
char *buf)
436+
{
437+
struct subchannel *sch = to_subchannel(dev);
438+
struct pmcw *pmcw = &sch->schib.pmcw;
439+
440+
if ((pmcw->st == SUBCHANNEL_TYPE_IO && pmcw->dnv) ||
441+
(pmcw->st == SUBCHANNEL_TYPE_MSG && pmcw->w))
442+
return sysfs_emit(buf, "0.%x.%04x\n", sch->schid.ssid,
443+
pmcw->dev);
444+
else
445+
return sysfs_emit(buf, "none\n");
446+
}
447+
static DEVICE_ATTR_RO(dev_busid);
448+
433449
static struct attribute *io_subchannel_type_attrs[] = {
434450
&dev_attr_chpids.attr,
435451
&dev_attr_pimpampom.attr,
452+
&dev_attr_dev_busid.attr,
436453
NULL,
437454
};
438455
ATTRIBUTE_GROUPS(io_subchannel_type);

0 commit comments

Comments
 (0)