beagleboard / linux

The official Read Only BeagleBoard and BeagleBone kernel repository https://git.beagleboard.org/beagleboard/linux
http://beagleboard.org/source
Other
707 stars 565 forks source link

Domain Mismatch Issue with irq-pruss-intc or pru_rproc driver? #287

Closed jjd35 closed 4 months ago

jjd35 commented 4 months ago

kernel version: Linux BeagleBone 5.10.168-ti-r72 on a beagelbone blue

With debugging prints enabled, on boot I see the pruss-intc device is creating mappings on domain @2ab54590. Here is the log for the interrupts <20 21 22 23 24 25 26 27> as specified in the device tree for the pruss-intc:

[   43.472027] irq: irq_create_mapping(0x2ab54590, 0x14)
[   43.472036] irq: -> using domain @2ab54590
[   43.472145] irq: irq 20 on domain interrupt-controller@48200000 mapped to virtual irq 70
--
[   43.472243] OF:  -> addrsize=1
[   43.472251] OF:  -> got it !
[   43.472263] irq: irq_create_mapping(0x2ab54590, 0x15)
[   43.472271] irq: -> using domain @2ab54590
[   43.472320] irq: irq 21 on domain interrupt-controller@48200000 mapped to virtual irq 71
--
[   43.472412] OF:  -> addrsize=1
[   43.472419] OF:  -> got it !
[   43.472431] irq: irq_create_mapping(0x2ab54590, 0x16)
[   43.472439] irq: -> using domain @2ab54590
[   43.472507] irq: irq 22 on domain interrupt-controller@48200000 mapped to virtual irq 72
--
[   43.472600] OF:  -> addrsize=1
[   43.472608] OF:  -> got it !
[   43.472619] irq: irq_create_mapping(0x2ab54590, 0x17)
[   43.472627] irq: -> using domain @2ab54590
[   43.472671] irq: irq 23 on domain interrupt-controller@48200000 mapped to virtual irq 73
--
[   43.472763] OF:  -> addrsize=1
[   43.472771] OF:  -> got it !
[   43.472781] irq: irq_create_mapping(0x2ab54590, 0x18)
[   43.472789] irq: -> using domain @2ab54590
[   43.613181] irq: irq 24 on domain interrupt-controller@48200000 mapped to virtual irq 74
--
[   43.613346] OF:  -> addrsize=1
[   43.613355] OF:  -> got it !
[   43.613379] irq: irq_create_mapping(0x2ab54590, 0x19)
[   43.613389] irq: -> using domain @2ab54590
[   43.613479] irq: irq 25 on domain interrupt-controller@48200000 mapped to virtual irq 75
--
[   43.613572] OF:  -> addrsize=1
[   43.613580] OF:  -> got it !
[   43.613592] irq: irq_create_mapping(0x2ab54590, 0x1a)
[   43.613600] irq: -> using domain @2ab54590
[   43.613647] irq: irq 26 on domain interrupt-controller@48200000 mapped to virtual irq 76
--
[   43.613737] OF:  -> addrsize=1
[   43.613745] OF:  -> got it !
[   43.613757] irq: irq_create_mapping(0x2ab54590, 0x1b)
[   43.613764] irq: -> using domain @2ab54590
[   43.613813] irq: irq 27 on domain interrupt-controller@48200000 mapped to virtual irq 77

You can see all interrupts are using domain @2ab54590, however when I load in PRU firmware that contains an intc map with sysevent 20, Channel 2, host 2. I see this output:

[  737.680251] pru-rproc 4a334000.pru: mapping0: event 20, chnl 2, host 2
[  737.680279] irq: irq_create_mapping(0x5f8359a5, 0x14)
[  737.680289] irq: -> using domain @5f8359a5
[  737.680412] pruss-intc 4a320000.interrupt-controller: SYSEV20 -> CH2 (CMR5 0x00000002)
[  737.680426] pruss-intc 4a320000.interrupt-controller: CH2 -> HOST2 (HMR0 0x00020000)

As you can see, the domain is now @5f8359a5. I believe it should map back to the domain of the pruss-intc irq's. However the PRU's interrupt is assigned a whole new domain by the kernel.

jjd35 commented 4 months ago

nvm, I'm stupid. I believe this might make sense due to the PRU mapping to the pruss-intc domain and the pruss-intc mapping to the top level OCP intc domain