drivers/gpu/drm/xe/xe_heci_gsc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_heci_gsc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_heci_gsc.c- Extension
.c- Size
- 5768 bytes
- Lines
- 249
- 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.
- 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/irq.hlinux/mei_aux.hlinux/pci.hlinux/sizes.hdrm/drm_print.hxe_device_types.hxe_heci_gsc.hregs/xe_gsc_regs.hxe_platform_types.hxe_survivability_mode.h
Detected Declarations
struct heci_gsc_deffunction Copyrightfunction heci_gsc_irq_initfunction heci_gsc_release_devfunction xe_heci_gsc_finifunction heci_gsc_irq_setupfunction heci_gsc_add_devicefunction xe_heci_gsc_initfunction xe_heci_gsc_irq_handlerfunction xe_heci_csc_irq_handler
Annotated Snippet
struct heci_gsc_def {
const char *name;
unsigned long bar;
size_t bar_size;
bool use_polling;
bool slow_firmware;
};
/* gsc resources and definitions */
static const struct heci_gsc_def heci_gsc_def_dg1 = {
.name = "mei-gscfi",
.bar = DG1_GSC_HECI2_BASE,
.bar_size = GSC_BAR_LENGTH,
};
static const struct heci_gsc_def heci_gsc_def_dg2 = {
.name = "mei-gscfi",
.bar = DG2_GSC_HECI2_BASE,
.bar_size = GSC_BAR_LENGTH,
};
static const struct heci_gsc_def heci_gsc_def_pvc = {
.name = "mei-gscfi",
.bar = PVC_GSC_HECI2_BASE,
.bar_size = GSC_BAR_LENGTH,
.slow_firmware = true,
};
static void heci_gsc_release_dev(struct device *dev)
{
struct auxiliary_device *aux_dev = to_auxiliary_dev(dev);
struct mei_aux_device *adev = auxiliary_dev_to_mei_aux_dev(aux_dev);
kfree(adev);
}
static void xe_heci_gsc_fini(void *arg)
{
struct xe_heci_gsc *heci_gsc = arg;
if (heci_gsc->adev) {
struct auxiliary_device *aux_dev = &heci_gsc->adev->aux_dev;
auxiliary_device_delete(aux_dev);
auxiliary_device_uninit(aux_dev);
heci_gsc->adev = NULL;
}
if (heci_gsc->irq >= 0)
irq_free_desc(heci_gsc->irq);
heci_gsc->irq = -1;
}
static int heci_gsc_irq_setup(struct xe_device *xe)
{
struct xe_heci_gsc *heci_gsc = &xe->heci_gsc;
int ret;
heci_gsc->irq = irq_alloc_desc(0);
if (heci_gsc->irq < 0) {
drm_err(&xe->drm, "gsc irq error %d\n", heci_gsc->irq);
return heci_gsc->irq;
}
ret = heci_gsc_irq_init(heci_gsc->irq);
if (ret < 0)
drm_err(&xe->drm, "gsc irq init failed %d\n", ret);
return ret;
}
static int heci_gsc_add_device(struct xe_device *xe, const struct heci_gsc_def *def)
{
struct xe_heci_gsc *heci_gsc = &xe->heci_gsc;
struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
struct auxiliary_device *aux_dev;
struct mei_aux_device *adev;
int ret;
adev = kzalloc_obj(*adev);
if (!adev)
return -ENOMEM;
adev->irq = heci_gsc->irq;
adev->bar.parent = &pdev->resource[0];
adev->bar.start = def->bar + pdev->resource[0].start;
adev->bar.end = adev->bar.start + def->bar_size - 1;
adev->bar.flags = IORESOURCE_MEM;
adev->bar.desc = IORES_DESC_NONE;
adev->slow_firmware = def->slow_firmware;
Annotation
- Immediate include surface: `linux/irq.h`, `linux/mei_aux.h`, `linux/pci.h`, `linux/sizes.h`, `drm/drm_print.h`, `xe_device_types.h`, `xe_heci_gsc.h`, `regs/xe_gsc_regs.h`.
- Detected declarations: `struct heci_gsc_def`, `function Copyright`, `function heci_gsc_irq_init`, `function heci_gsc_release_dev`, `function xe_heci_gsc_fini`, `function heci_gsc_irq_setup`, `function heci_gsc_add_device`, `function xe_heci_gsc_init`, `function xe_heci_gsc_irq_handler`, `function xe_heci_csc_irq_handler`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.