]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: zfcp: implicitly refresh port-data diagnostics when reading sysfs
authorBenjamin Block <bblock@linux.ibm.com>
Fri, 25 Oct 2019 16:12:48 +0000 (18:12 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 29 Oct 2019 02:16:15 +0000 (22:16 -0400)
commite59476c80fc3e2ff451b411a6b9430682ec0ab29
treecf3888c460269cc7e29d43f78f952537ae3524d1
parentbea73eeb2f1e869a53ce9845daa2d21eb1b6d7ec
scsi: zfcp: implicitly refresh port-data diagnostics when reading sysfs

This patch adds implicit updates to the sysfs entries that read the
diagnostic data stored in the "caching buffer" for Exchange Port Data.

An update is triggered once the buffer is older than ZFCP_DIAG_MAX_AGE
milliseconds (5s). This entails sending an Exchange Port Data command to
the FCP-Channel, and during its ingress path updating the cached data and
the timestamp. To prevent multiple concurrent userspace-applications from
triggering this update in parallel we synchronize all of them using a
wait-queue (waiting threads are interruptible; the updating thread is not).

Link: https://lore.kernel.org/r/c145b5cfc99a63b6a018b1184fbd27bb09c955f5.1572018132.git.bblock@linux.ibm.com
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/s390/scsi/zfcp_diag.c
drivers/s390/scsi/zfcp_diag.h
drivers/s390/scsi/zfcp_sysfs.c