summaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_diag.c
diff options
context:
space:
mode:
authorBenjamin Block <bblock@linux.ibm.com>2019-10-25 18:12:45 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2019-10-28 22:16:14 -0400
commit088210233e6fc039fd2c0bfe44b06bb94328d09e (patch)
tree41672e76b7d28d277bef85ed44f24e6ab8e4fbcd /drivers/s390/scsi/zfcp_diag.c
parent7e418833e68948cb9ed15262889173b7db2960cb (diff)
downloadlinux-stable-088210233e6fc039fd2c0bfe44b06bb94328d09e.tar.gz
linux-stable-088210233e6fc039fd2c0bfe44b06bb94328d09e.tar.bz2
linux-stable-088210233e6fc039fd2c0bfe44b06bb94328d09e.zip
scsi: zfcp: add diagnostics buffer for exchange config data
In the same vein as the previous patch, add diagnostic data capture for the Exchange Config Data command. Link: https://lore.kernel.org/r/7d8ac0a6cad403fa8f8b888693476a84e80a277b.1572018131.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>
Diffstat (limited to 'drivers/s390/scsi/zfcp_diag.c')
-rw-r--r--drivers/s390/scsi/zfcp_diag.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/s390/scsi/zfcp_diag.c b/drivers/s390/scsi/zfcp_diag.c
index fa1b25f3ec3c..d7d2db85b32e 100644
--- a/drivers/s390/scsi/zfcp_diag.c
+++ b/drivers/s390/scsi/zfcp_diag.c
@@ -34,6 +34,9 @@
*/
int zfcp_diag_adapter_setup(struct zfcp_adapter *const adapter)
{
+ /* set the timestamp so that the first test on age will always fail */
+ const unsigned long initial_timestamp =
+ jiffies - msecs_to_jiffies(ZFCP_DIAG_MAX_AGE);
struct zfcp_diag_adapter *diag;
struct zfcp_diag_header *hdr;
@@ -47,8 +50,15 @@ int zfcp_diag_adapter_setup(struct zfcp_adapter *const adapter)
spin_lock_init(&hdr->access_lock);
hdr->buffer = &diag->port_data.data;
hdr->buffer_size = sizeof(diag->port_data.data);
- /* set the timestamp so that the first test on age will always fail */
- hdr->timestamp = jiffies - msecs_to_jiffies(ZFCP_DIAG_MAX_AGE);
+ hdr->timestamp = initial_timestamp;
+
+ /* setup header for config_data */
+ hdr = &diag->config_data.header;
+
+ spin_lock_init(&hdr->access_lock);
+ hdr->buffer = &diag->config_data.data;
+ hdr->buffer_size = sizeof(diag->config_data.data);
+ hdr->timestamp = initial_timestamp;
adapter->diagnostics = diag;
return 0;