drivers/s390/block/dasd_3990_erp.c
Source file repositories/reference/linux-study-clean/drivers/s390/block/dasd_3990_erp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/block/dasd_3990_erp.c- Extension
.c- Size
- 71663 bytes
- Lines
- 2816
- 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/timer.hasm/idals.hdasd_int.hdasd_eckd.h
Detected Declarations
struct DCTL_datafunction dasd_3990_erp_cleanupfunction dasd_3990_erp_block_queuefunction dasd_3990_erp_int_reqfunction dasd_3990_erp_alternate_pathfunction Controlfunction themfunction timerfunction functionsfunction datafunction dasd_3990_erp_com_rejfunction dasd_3990_erp_bus_outfunction dasd_3990_erp_equip_checkfunction dasd_3990_erp_data_checkfunction dasd_3990_erp_overrunfunction dasd_3990_erp_inv_formatfunction originalfunction dasd_3990_erp_env_datafunction dasd_3990_erp_no_recfunction dasd_3990_erp_file_protfunction thefunction functionsfunction dasd_3990_erp_action_1B_32function dasd_3990_update_1Bfunction dasd_3990_erp_compound_retryfunction dasd_3990_erp_compound_pathfunction dasd_3990_erp_compound_codefunction dasd_3990_erp_compound_configfunction currentfunction dasd_3990_erp_handle_simfunction dasd_3990_erp_inspect_32function dasd_3990_erp_disable_pathfunction dasd_3990_erp_account_errorfunction functionsfunction dasd_3990_erp_inspectfunction blockfunction dasd_3990_erp_additional_erpfunction dasd_3990_erp_error_matchfunction ERPfunction DASD_3990_ERP_FURTHER_ERPfunction errorfunction lock
Annotated Snippet
struct DCTL_data {
unsigned char subcommand; /* e.g Inhibit Write, Enable Write,... */
unsigned char modifier; /* Subcommand modifier */
unsigned short res; /* reserved */
} __attribute__ ((packed));
/*
*****************************************************************************
* SECTION ERP HANDLING
*****************************************************************************
*/
/*
*****************************************************************************
* 24 and 32 byte sense ERP functions
*****************************************************************************
*/
/*
* DASD_3990_ERP_CLEANUP
*
* DESCRIPTION
* Removes the already build but not necessary ERP request and sets
* the status of the original cqr / erp to the given (final) status
*
* PARAMETER
* erp request to be blocked
* final_status either DASD_CQR_DONE or DASD_CQR_FAILED
*
* RETURN VALUES
* cqr original cqr
*/
static struct dasd_ccw_req *
dasd_3990_erp_cleanup(struct dasd_ccw_req * erp, char final_status)
{
struct dasd_ccw_req *cqr = erp->refers;
dasd_free_erp_request(erp, erp->memdev);
cqr->status = final_status;
return cqr;
} /* end dasd_3990_erp_cleanup */
/*
* DASD_3990_ERP_BLOCK_QUEUE
*
* DESCRIPTION
* Block the given device request queue to prevent from further
* processing until the started timer has expired or an related
* interrupt was received.
*/
static void dasd_3990_erp_block_queue(struct dasd_ccw_req *erp, int expires)
{
struct dasd_device *device = erp->startdev;
unsigned long flags;
DBF_DEV_EVENT(DBF_INFO, device,
"blocking request queue for %is", expires/HZ);
spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
dasd_device_set_stop_bits(device, DASD_STOPPED_PENDING);
spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
erp->status = DASD_CQR_FILLED;
if (erp->block)
dasd_block_set_timer(erp->block, expires);
else
dasd_device_set_timer(device, expires);
}
/*
* DASD_3990_ERP_INT_REQ
*
* DESCRIPTION
* Handles 'Intervention Required' error.
* This means either device offline or not installed.
*
* PARAMETER
* erp current erp
* RETURN VALUES
* erp modified erp
*/
static struct dasd_ccw_req *
dasd_3990_erp_int_req(struct dasd_ccw_req * erp)
{
struct dasd_device *device = erp->startdev;
/* first time set initial retry counter and erp_function */
/* and retry once without blocking queue */
/* (this enables easier enqueing of the cqr) */
Annotation
- Immediate include surface: `linux/timer.h`, `asm/idals.h`, `dasd_int.h`, `dasd_eckd.h`.
- Detected declarations: `struct DCTL_data`, `function dasd_3990_erp_cleanup`, `function dasd_3990_erp_block_queue`, `function dasd_3990_erp_int_req`, `function dasd_3990_erp_alternate_path`, `function Control`, `function them`, `function timer`, `function functions`, `function data`.
- 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.