linux/drivers/s390
Peter Oberparleiter 4d293411ad s390/cio: Fix CHPID "configure" attribute caching
[ Upstream commit 32ae4a2992 ]

In some environments, the SCLP firmware interface used to query a
CHPID's configured state is not supported. On these environments,
rapidly reading the corresponding sysfs attribute produces inconsistent
results:

  $ cat /sys/devices/css0/chp0.00/configure
  cat: /sys/devices/css0/chp0.00/configure: Operation not supported
  $ cat /sys/devices/css0/chp0.00/configure
  3

This occurs for example when Linux is run as a KVM guest. The
inconsistency is a result of CIO using cached results for generating
the value of the "configure" attribute while failing to handle the
situation where no data was returned by SCLP.

Fix this by not updating the cache-expiration timestamp when SCLP
returns no data. With the fix applied, the system response is
consistent:

  $ cat /sys/devices/css0/chp0.00/configure
  cat: /sys/devices/css0/chp0.00/configure: Operation not supported
  $ cat /sys/devices/css0/chp0.00/configure
  cat: /sys/devices/css0/chp0.00/configure: Operation not supported

Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Tested-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-03-28 21:58:51 +01:00
..
block Revert "s390/dasd: Establish DMA alignment" 2024-08-29 17:30:54 +02:00
char s390/sclp_vt220: Convert newlines to CRLF instead of LFCR 2024-10-22 15:56:44 +02:00
cio s390/cio: Fix CHPID "configure" attribute caching 2025-03-28 21:58:51 +01:00
crypto s390/pkey: Wipe sensitive data on failure 2024-07-11 12:47:10 +02:00
net s390/qeth: Fix kernel panic after setting hsuid 2024-05-17 11:56:01 +02:00
scsi scsi: zfcp: Fix a double put in zfcp_port_enqueue() 2023-10-10 22:00:38 +02:00
virtio virtio: Revert "virtio: find_vqs() add arg sizes" 2022-08-16 01:40:24 -04:00
Makefile s390: remove pointless drivers-y in drivers/s390/Makefile 2019-09-16 13:21:51 +02:00