scsi: zfcp: Process Version Change events

Handle notifications for a concurrent change of the FCP Channel firmware.
Update the relevant user-visible fields to provide accurate data.

Link: https://lore.kernel.org/r/d2c7bc57c6cf1b65eabbf7a5d0e3927b9f65647f.1603908167.git.bblock@linux.ibm.com
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Julian Wiedmann 2020-10-28 19:30:51 +01:00 committed by Martin K. Petersen
parent efd321768d
commit a6c37abe69
2 changed files with 26 additions and 0 deletions

View file

@ -242,6 +242,19 @@ static void zfcp_fsf_status_read_link_down(struct zfcp_fsf_req *req)
}
}
static void
zfcp_fsf_status_read_version_change(struct zfcp_adapter *adapter,
struct fsf_status_read_buffer *sr_buf)
{
if (sr_buf->status_subtype == FSF_STATUS_READ_SUB_LIC_CHANGE) {
u32 version = sr_buf->payload.version_change.current_version;
WRITE_ONCE(adapter->fsf_lic_version, version);
snprintf(fc_host_firmware_version(adapter->scsi_host),
FC_VERSION_STRING_SIZE, "%#08x", version);
}
}
static void zfcp_fsf_status_read_handler(struct zfcp_fsf_req *req)
{
struct zfcp_adapter *adapter = req->adapter;
@ -300,6 +313,9 @@ static void zfcp_fsf_status_read_handler(struct zfcp_fsf_req *req)
case FSF_STATUS_READ_FEATURE_UPDATE_ALERT:
adapter->adapter_features = sr_buf->payload.word[0];
break;
case FSF_STATUS_READ_VERSION_CHANGE:
zfcp_fsf_status_read_version_change(adapter, sr_buf);
break;
}
mempool_free(virt_to_page(sr_buf), adapter->pool.sr_data);

View file

@ -134,6 +134,7 @@
#define FSF_STATUS_READ_LINK_UP 0x00000006
#define FSF_STATUS_READ_NOTIFICATION_LOST 0x00000009
#define FSF_STATUS_READ_FEATURE_UPDATE_ALERT 0x0000000C
#define FSF_STATUS_READ_VERSION_CHANGE 0x0000000D
/* status subtypes for link down */
#define FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK 0x00000000
@ -143,6 +144,9 @@
/* status subtypes for unsolicited status notification lost */
#define FSF_STATUS_READ_SUB_INCOMING_ELS 0x00000001
/* status subtypes for version change */
#define FSF_STATUS_READ_SUB_LIC_CHANGE 0x00000001
/* topologie that is detected by the adapter */
#define FSF_TOPO_P2P 0x00000001
#define FSF_TOPO_FABRIC 0x00000002
@ -226,6 +230,11 @@ struct fsf_link_down_info {
u8 vendor_specific_code;
} __attribute__ ((packed));
struct fsf_version_change {
u32 current_version;
u32 previous_version;
} __packed;
struct fsf_status_read_buffer {
u32 status_type;
u32 status_subtype;
@ -242,6 +251,7 @@ struct fsf_status_read_buffer {
u32 word[FSF_STATUS_READ_PAYLOAD_SIZE/sizeof(u32)];
struct fsf_link_down_info link_down_info;
struct fsf_bit_error_payload bit_error;
struct fsf_version_change version_change;
} payload;
} __attribute__ ((packed));