drivers/scsi/mpt3sas/mpt3sas_trigger_diag.c
Source file repositories/reference/linux-study-clean/drivers/scsi/mpt3sas/mpt3sas_trigger_diag.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/mpt3sas/mpt3sas_trigger_diag.c- Extension
.c- Size
- 14786 bytes
- Lines
- 474
- Domain
- Driver Families
- Bucket
- drivers/scsi
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/errno.hlinux/init.hlinux/slab.hlinux/types.hlinux/pci.hlinux/delay.hlinux/compat.hlinux/poll.hlinux/io.hlinux/uaccess.hmpt3sas_base.h
Detected Declarations
function _mpt3sas_raise_sigiofunction mpt3sas_process_trigger_datafunction mpt3sas_trigger_masterfunction mpt3sas_trigger_eventfunction mpt3sas_trigger_scsifunction mpt3sas_trigger_mpi
Annotated Snippet
switch (event_data->trigger_type) {
case MPT3SAS_TRIGGER_SCSI:
memcpy(&ioc->htb_rel.trigger_info_dwords,
&event_data->u.scsi,
sizeof(struct SL_WH_SCSI_TRIGGER_T));
break;
case MPT3SAS_TRIGGER_MPI:
memcpy(&ioc->htb_rel.trigger_info_dwords,
&event_data->u.mpi,
sizeof(struct SL_WH_MPI_TRIGGER_T));
break;
case MPT3SAS_TRIGGER_MASTER:
ioc->htb_rel.trigger_info_dwords[0] =
event_data->u.master.MasterData;
break;
case MPT3SAS_TRIGGER_EVENT:
memcpy(&ioc->htb_rel.trigger_info_dwords,
&event_data->u.event,
sizeof(struct SL_WH_EVENT_TRIGGER_T));
break;
default:
ioc_err(ioc, "%d - Is not a valid Trigger type\n",
event_data->trigger_type);
break;
}
}
_mpt3sas_raise_sigio(ioc, event_data);
dTriggerDiagPrintk(ioc, ioc_info(ioc, "%s: exit\n",
__func__));
}
/**
* mpt3sas_trigger_master - Master trigger handler
* @ioc: per adapter object
* @trigger_bitmask:
*
*/
void
mpt3sas_trigger_master(struct MPT3SAS_ADAPTER *ioc, u32 trigger_bitmask)
{
struct SL_WH_TRIGGERS_EVENT_DATA_T event_data;
unsigned long flags;
u8 found_match = 0;
spin_lock_irqsave(&ioc->diag_trigger_lock, flags);
if (trigger_bitmask & MASTER_TRIGGER_FW_FAULT ||
trigger_bitmask & MASTER_TRIGGER_ADAPTER_RESET)
goto by_pass_checks;
/* check to see if trace buffers are currently registered */
if ((ioc->diag_buffer_status[MPI2_DIAG_BUF_TYPE_TRACE] &
MPT3_DIAG_BUFFER_IS_REGISTERED) == 0) {
spin_unlock_irqrestore(&ioc->diag_trigger_lock, flags);
return;
}
/* check to see if trace buffers are currently released */
if (ioc->diag_buffer_status[MPI2_DIAG_BUF_TYPE_TRACE] &
MPT3_DIAG_BUFFER_IS_RELEASED) {
spin_unlock_irqrestore(&ioc->diag_trigger_lock, flags);
return;
}
by_pass_checks:
dTriggerDiagPrintk(ioc,
ioc_info(ioc, "%s: enter - trigger_bitmask = 0x%08x\n",
__func__, trigger_bitmask));
/* don't send trigger if an trigger is currently active */
if (ioc->diag_trigger_active) {
spin_unlock_irqrestore(&ioc->diag_trigger_lock, flags);
goto out;
}
/* check for the trigger condition */
if (ioc->diag_trigger_master.MasterData & trigger_bitmask) {
found_match = 1;
ioc->diag_trigger_active = 1;
dTriggerDiagPrintk(ioc,
ioc_info(ioc, "%s: setting diag_trigger_active flag\n",
__func__));
}
spin_unlock_irqrestore(&ioc->diag_trigger_lock, flags);
if (!found_match)
goto out;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/errno.h`, `linux/init.h`, `linux/slab.h`, `linux/types.h`, `linux/pci.h`, `linux/delay.h`.
- Detected declarations: `function _mpt3sas_raise_sigio`, `function mpt3sas_process_trigger_data`, `function mpt3sas_trigger_master`, `function mpt3sas_trigger_event`, `function mpt3sas_trigger_scsi`, `function mpt3sas_trigger_mpi`.
- Atlas domain: Driver Families / drivers/scsi.
- 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.