drivers/s390/scsi/zfcp_erp.c
Source file repositories/reference/linux-study-clean/drivers/s390/scsi/zfcp_erp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/scsi/zfcp_erp.c- Extension
.c- Size
- 53559 bytes
- Lines
- 1866
- Domain
- Driver Families
- Bucket
- drivers/s390
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kthread.hlinux/bug.hzfcp_ext.hzfcp_reqlist.hzfcp_diag.h
Detected Declarations
enum zfcp_erp_act_flagsenum zfcp_erp_act_resultfunction zfcp_erp_adapter_blockfunction zfcp_erp_action_is_runningfunction zfcp_erp_action_readyfunction zfcp_erp_action_dismissfunction zfcp_erp_action_dismiss_lunfunction zfcp_erp_action_dismiss_portfunction zfcp_erp_action_dismiss_adapterfunction zfcp_erp_handle_failedfunction zfcp_erp_required_actfunction zfcp_erp_action_enqueuefunction zfcp_erp_port_forced_no_port_dbffunction _zfcp_erp_adapter_reopenfunction zfcp_erp_adapter_reopenfunction zfcp_erp_adapter_shutdownfunction zfcp_erp_port_shutdownfunction zfcp_erp_port_blockfunction _zfcp_erp_port_forced_reopenfunction zfcp_erp_port_forced_reopenfunction _zfcp_erp_port_reopenfunction zfcp_erp_port_reopenfunction zfcp_erp_lun_blockfunction _zfcp_erp_lun_reopenfunction zfcp_erp_lun_reopenfunction zfcp_erp_lun_shutdownfunction zfcp_erp_lun_shutdown_waitfunction zfcp_erp_status_change_setfunction zfcp_erp_adapter_unblockfunction zfcp_erp_port_unblockfunction zfcp_erp_lun_unblockfunction zfcp_erp_action_to_runningfunction zfcp_erp_strategy_check_fsfreqfunction zfcp_erp_notifyfunction zfcp_erp_timeout_handlerfunction zfcp_erp_memwait_handlerfunction zfcp_erp_strategy_memwaitfunction zfcp_erp_port_forced_reopen_allfunction _zfcp_erp_port_reopen_allfunction _zfcp_erp_lun_reopen_allfunction zfcp_erp_strategy_followup_failedfunction zfcp_erp_strategy_followup_successfunction zfcp_erp_wakeupfunction list_emptyfunction zfcp_erp_enqueue_ptp_portfunction zfcp_erp_adapter_strat_fsf_xconffunction zfcp_erp_adapter_strategy_open_ptp_portfunction zfcp_erp_adapter_strategy_open_fsf_xport
Annotated Snippet
list_empty(&adapter->erp_running_head)) {
atomic_andnot(ZFCP_STATUS_ADAPTER_ERP_PENDING,
&adapter->status);
wake_up(&adapter->erp_done_wqh);
}
read_unlock_irqrestore(&adapter->erp_lock, flags);
}
static void zfcp_erp_enqueue_ptp_port(struct zfcp_adapter *adapter)
{
struct zfcp_port *port;
port = zfcp_port_enqueue(adapter, adapter->peer_wwpn, 0,
adapter->peer_d_id);
if (IS_ERR(port)) /* error or port already attached */
return;
zfcp_erp_port_reopen(port, 0, "ereptp1");
}
static enum zfcp_erp_act_result zfcp_erp_adapter_strat_fsf_xconf(
struct zfcp_erp_action *erp_action)
{
int retries;
int sleep = 1;
struct zfcp_adapter *adapter = erp_action->adapter;
atomic_andnot(ZFCP_STATUS_ADAPTER_XCONFIG_OK, &adapter->status);
for (retries = 7; retries; retries--) {
atomic_andnot(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
&adapter->status);
write_lock_irq(&adapter->erp_lock);
zfcp_erp_action_to_running(erp_action);
write_unlock_irq(&adapter->erp_lock);
if (zfcp_fsf_exchange_config_data(erp_action)) {
atomic_andnot(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
&adapter->status);
return ZFCP_ERP_FAILED;
}
wait_event(adapter->erp_ready_wq,
!list_empty(&adapter->erp_ready_head));
if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT)
break;
if (!(atomic_read(&adapter->status) &
ZFCP_STATUS_ADAPTER_HOST_CON_INIT))
break;
ssleep(sleep);
sleep *= 2;
}
atomic_andnot(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
&adapter->status);
if (!(atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_XCONFIG_OK))
return ZFCP_ERP_FAILED;
return ZFCP_ERP_SUCCEEDED;
}
static void
zfcp_erp_adapter_strategy_open_ptp_port(struct zfcp_adapter *const adapter)
{
if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP)
zfcp_erp_enqueue_ptp_port(adapter);
}
static enum zfcp_erp_act_result zfcp_erp_adapter_strategy_open_fsf_xport(
struct zfcp_erp_action *act)
{
int ret;
struct zfcp_adapter *adapter = act->adapter;
write_lock_irq(&adapter->erp_lock);
zfcp_erp_action_to_running(act);
write_unlock_irq(&adapter->erp_lock);
ret = zfcp_fsf_exchange_port_data(act);
if (ret == -EOPNOTSUPP)
return ZFCP_ERP_SUCCEEDED;
if (ret)
return ZFCP_ERP_FAILED;
zfcp_dbf_rec_run("erasox1", act);
wait_event(adapter->erp_ready_wq,
!list_empty(&adapter->erp_ready_head));
zfcp_dbf_rec_run("erasox2", act);
if (act->status & ZFCP_STATUS_ERP_TIMEDOUT)
return ZFCP_ERP_FAILED;
Annotation
- Immediate include surface: `linux/kthread.h`, `linux/bug.h`, `zfcp_ext.h`, `zfcp_reqlist.h`, `zfcp_diag.h`.
- Detected declarations: `enum zfcp_erp_act_flags`, `enum zfcp_erp_act_result`, `function zfcp_erp_adapter_block`, `function zfcp_erp_action_is_running`, `function zfcp_erp_action_ready`, `function zfcp_erp_action_dismiss`, `function zfcp_erp_action_dismiss_lun`, `function zfcp_erp_action_dismiss_port`, `function zfcp_erp_action_dismiss_adapter`, `function zfcp_erp_handle_failed`.
- Atlas domain: Driver Families / drivers/s390.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.