Commit d9019631 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by Martin K. Petersen

scsi: zfcp: Handle event-lost notification for Version Change events

As recovery for a lost Version Change event, trigger an Exchange Config
Data cmd to retrieve the current FW version.

Doing so requires process context (as eg. zfcp_qdio_sbal_get() might need
to sleep), so defer from tasklet context into a work item.

Link: https://lore.kernel.org/r/297c7be2944c3714863fcd22d531d910312d29f0.1603908167.git.bblock@linux.ibm.comSuggested-by: default avatarSteffen Maier <maier@linux.ibm.com>
Reviewed-by: default avatarSteffen Maier <maier@linux.ibm.com>
Reviewed-by: default avatarBenjamin Block <bblock@linux.ibm.com>
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarBenjamin Block <bblock@linux.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent a6c37abe
...@@ -292,6 +292,14 @@ static void _zfcp_status_read_scheduler(struct work_struct *work) ...@@ -292,6 +292,14 @@ static void _zfcp_status_read_scheduler(struct work_struct *work)
stat_work)); stat_work));
} }
static void zfcp_version_change_lost_work(struct work_struct *work)
{
struct zfcp_adapter *adapter = container_of(work, struct zfcp_adapter,
version_change_lost_work);
zfcp_fsf_exchange_config_data_sync(adapter->qdio, NULL);
}
static void zfcp_print_sl(struct seq_file *m, struct service_level *sl) static void zfcp_print_sl(struct seq_file *m, struct service_level *sl)
{ {
struct zfcp_adapter *adapter = struct zfcp_adapter *adapter =
...@@ -353,6 +361,8 @@ struct zfcp_adapter *zfcp_adapter_enqueue(struct ccw_device *ccw_device) ...@@ -353,6 +361,8 @@ struct zfcp_adapter *zfcp_adapter_enqueue(struct ccw_device *ccw_device)
INIT_WORK(&adapter->stat_work, _zfcp_status_read_scheduler); INIT_WORK(&adapter->stat_work, _zfcp_status_read_scheduler);
INIT_DELAYED_WORK(&adapter->scan_work, zfcp_fc_scan_ports); INIT_DELAYED_WORK(&adapter->scan_work, zfcp_fc_scan_ports);
INIT_WORK(&adapter->ns_up_work, zfcp_fc_sym_name_update); INIT_WORK(&adapter->ns_up_work, zfcp_fc_sym_name_update);
INIT_WORK(&adapter->version_change_lost_work,
zfcp_version_change_lost_work);
adapter->next_port_scan = jiffies; adapter->next_port_scan = jiffies;
...@@ -429,6 +439,7 @@ void zfcp_adapter_unregister(struct zfcp_adapter *adapter) ...@@ -429,6 +439,7 @@ void zfcp_adapter_unregister(struct zfcp_adapter *adapter)
cancel_delayed_work_sync(&adapter->scan_work); cancel_delayed_work_sync(&adapter->scan_work);
cancel_work_sync(&adapter->stat_work); cancel_work_sync(&adapter->stat_work);
cancel_work_sync(&adapter->ns_up_work); cancel_work_sync(&adapter->ns_up_work);
cancel_work_sync(&adapter->version_change_lost_work);
zfcp_destroy_adapter_work_queue(adapter); zfcp_destroy_adapter_work_queue(adapter);
zfcp_fc_wka_ports_force_offline(adapter->gs); zfcp_fc_wka_ports_force_offline(adapter->gs);
......
...@@ -201,6 +201,7 @@ struct zfcp_adapter { ...@@ -201,6 +201,7 @@ struct zfcp_adapter {
struct zfcp_fc_events events; struct zfcp_fc_events events;
unsigned long next_port_scan; unsigned long next_port_scan;
struct zfcp_diag_adapter *diagnostics; struct zfcp_diag_adapter *diagnostics;
struct work_struct version_change_lost_work;
}; };
struct zfcp_port { struct zfcp_port {
......
...@@ -309,6 +309,9 @@ static void zfcp_fsf_status_read_handler(struct zfcp_fsf_req *req) ...@@ -309,6 +309,9 @@ static void zfcp_fsf_status_read_handler(struct zfcp_fsf_req *req)
case FSF_STATUS_READ_NOTIFICATION_LOST: case FSF_STATUS_READ_NOTIFICATION_LOST:
if (sr_buf->status_subtype & FSF_STATUS_READ_SUB_INCOMING_ELS) if (sr_buf->status_subtype & FSF_STATUS_READ_SUB_INCOMING_ELS)
zfcp_fc_conditional_port_scan(adapter); zfcp_fc_conditional_port_scan(adapter);
if (sr_buf->status_subtype & FSF_STATUS_READ_SUB_VERSION_CHANGE)
queue_work(adapter->work_queue,
&adapter->version_change_lost_work);
break; break;
case FSF_STATUS_READ_FEATURE_UPDATE_ALERT: case FSF_STATUS_READ_FEATURE_UPDATE_ALERT:
adapter->adapter_features = sr_buf->payload.word[0]; adapter->adapter_features = sr_buf->payload.word[0];
......
...@@ -143,6 +143,7 @@ ...@@ -143,6 +143,7 @@
/* status subtypes for unsolicited status notification lost */ /* status subtypes for unsolicited status notification lost */
#define FSF_STATUS_READ_SUB_INCOMING_ELS 0x00000001 #define FSF_STATUS_READ_SUB_INCOMING_ELS 0x00000001
#define FSF_STATUS_READ_SUB_VERSION_CHANGE 0x00000100
/* status subtypes for version change */ /* status subtypes for version change */
#define FSF_STATUS_READ_SUB_LIC_CHANGE 0x00000001 #define FSF_STATUS_READ_SUB_LIC_CHANGE 0x00000001
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment