Amit Singh Tomar
Amit Singh Tomar

Reputation: 8610

How and when value for this irq is initialised

I am going through part of the Linux kernel's source code in arch/arm/kernel/perf_event.c and trying to understand how request_irq set-up has been made here:

static int armpmu_reserve_hardware(struct arm_pmu *armpmu)
 {
    int err;
    struct platform_device *pmu_device = armpmu->plat_device;

    if (!pmu_device)
            return -ENODEV;

    pm_runtime_get_sync(&pmu_device->dev);
    err = armpmu->request_irq(armpmu, armpmu_dispatch_irq);
    if (err) {
            armpmu_release_hardware(armpmu);
            return err;
    }

    return 0;

}

Now value of first argument to request_irq should be an integer.Now I could not figured out how is integer value is being initialised.

Also struct pmu is given here:

http://lxr.free-electrons.com/source/arch/arm/include/asm/pmu.h

We have defined PMU representation in kernel device tree file

 pmu {
     compatible = "arm,cortex-a15-pmu";
     interrupts = <0 20 0xf01 0 21 0xf01 0 22 0xf01 0 23 0xf01 >;
  };

Now, I believe one of the interupt line is driven for 20,21,22,23 but now sure how?

Upvotes: 1

Views: 142

Answers (1)

mathk
mathk

Reputation: 8143

According to this code request_id need a struct arm_pmu*

Upvotes: 1

Related Questions