diff options
| author | Sumanth Korikkar <sumanthk@linux.ibm.com> | 2024-12-12 17:17:19 +0100 |
|---|---|---|
| committer | Alexander Gordeev <agordeev@linux.ibm.com> | 2024-12-17 12:46:14 +0100 |
| commit | 90e6f191e1ee094d13faae5fc29af7b5baf9d1b8 (patch) | |
| tree | 8ca0bcc21e649083b6617145bbdef62ad24ce06d /drivers/s390 | |
| parent | 2478d43ed621c4d15549142c0cfe6fa4a05e5f10 (diff) | |
| download | ath-90e6f191e1ee094d13faae5fc29af7b5baf9d1b8.tar.gz | |
s390/diag324: Retrieve power readings via diag 0x324
Retrieve electrical power readings for resources in a computing
environment via diag 0x324. diag 0x324 stores the power readings in the
power information block (pib).
Provide power readings from pib via diag324 ioctl interface. diag324
ioctl provides new pib to the user only if the threshold time has passed
since the last call. Otherwise, cache data is returned. When there are
no active readers, cleanup of pib buffer is performed.
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'drivers/s390')
| -rw-r--r-- | drivers/s390/char/sclp.h | 4 | ||||
| -rw-r--r-- | drivers/s390/char/sclp_early.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/s390/char/sclp.h b/drivers/s390/char/sclp.h index 6c91e422927ff..847674ca94c39 100644 --- a/drivers/s390/char/sclp.h +++ b/drivers/s390/char/sclp.h @@ -196,7 +196,9 @@ struct read_info_sccb { u8 byte_134; /* 134 */ u8 cpudirq; /* 135 */ u16 cbl; /* 136-137 */ - u8 _pad_138[EXT_SCCB_READ_SCP - 138]; + u8 byte_138; /* 138 */ + u8 byte_139; /* 139 */ + u8 _pad_140[EXT_SCCB_READ_SCP - 140]; } __packed __aligned(PAGE_SIZE); struct read_storage_sccb { diff --git a/drivers/s390/char/sclp_early.c b/drivers/s390/char/sclp_early.c index 29156455970e9..b7a55ea6c77a6 100644 --- a/drivers/s390/char/sclp_early.c +++ b/drivers/s390/char/sclp_early.c @@ -64,6 +64,8 @@ static void __init sclp_early_facilities_detect(void) sclp.has_sipl = !!(sccb->cbl & 0x4000); sclp.has_sipl_eckd = !!(sccb->cbl & 0x2000); } + if (sccb->cpuoff > 139) + sclp.has_diag324 = !!(sccb->byte_139 & 0x80); sclp.rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2; sclp.rzm = sccb->rnsize ? sccb->rnsize : sccb->rnsize2; sclp.rzm <<= 20; |
