drivers/gpu/drm/xe/xe_sysctrl_event.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_sysctrl_event.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_sysctrl_event.c- Extension
.c- Size
- 2477 bytes
- Lines
- 89
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
xe_device.hxe_irq.hxe_printk.hxe_ras.hxe_sysctrl.hxe_sysctrl_event_types.hxe_sysctrl_mailbox.hxe_sysctrl_mailbox_types.h
Detected Declarations
function get_pending_eventfunction event_request_preparefunction xe_sysctrl_event
Annotated Snippet
if (ret) {
xe_err(xe, "sysctrl: failed to get pending event %d\n", ret);
return;
}
if (len != sizeof(*response)) {
xe_err(xe, "sysctrl: unexpected event response length %zu (expected %zu)\n",
len, sizeof(*response));
return;
}
if (response->event == XE_SYSCTRL_EVENT_THRESHOLD_CROSSED)
xe_ras_counter_threshold_crossed(xe, response);
else
xe_warn(xe, "sysctrl: unexpected event %#x\n", response->event);
if (!--count) {
xe_err(xe, "sysctrl: event flooding\n");
return;
}
xe_dbg(xe, "sysctrl: %u events pending\n", response->count);
} while (response->count);
}
static void event_request_prepare(struct xe_device *xe, struct xe_sysctrl_app_msg_hdr *header,
struct xe_sysctrl_event_request *request)
{
struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
header->data = REG_FIELD_PREP(APP_HDR_GROUP_ID_MASK, XE_SYSCTRL_GROUP_GFSP) |
REG_FIELD_PREP(APP_HDR_COMMAND_MASK, XE_SYSCTRL_CMD_GET_PENDING_EVENT);
request->vector = xe_device_has_msix(xe) ? XE_IRQ_DEFAULT_MSIX : 0;
request->fn = PCI_FUNC(pdev->devfn);
}
/**
* xe_sysctrl_event() - Handler for System Controller events
* @sc: System Controller instance
*
* Handle events generated by System Controller.
*/
void xe_sysctrl_event(struct xe_sysctrl *sc)
{
struct xe_sysctrl_mailbox_command command = {};
struct xe_sysctrl_event_response response = {};
struct xe_sysctrl_event_request request = {};
struct xe_sysctrl_app_msg_hdr header = {};
xe_device_assert_mem_access(sc_to_xe(sc));
event_request_prepare(sc_to_xe(sc), &header, &request);
command.header = header;
command.data_in = &request;
command.data_in_len = sizeof(request);
command.data_out = &response;
command.data_out_len = sizeof(response);
guard(mutex)(&sc->event_lock);
get_pending_event(sc, &command);
}
Annotation
- Immediate include surface: `xe_device.h`, `xe_irq.h`, `xe_printk.h`, `xe_ras.h`, `xe_sysctrl.h`, `xe_sysctrl_event_types.h`, `xe_sysctrl_mailbox.h`, `xe_sysctrl_mailbox_types.h`.
- Detected declarations: `function get_pending_event`, `function event_request_prepare`, `function xe_sysctrl_event`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.