gpio_irq.txt (3.4 KB)
Continuing the discussion from Adjusting GPIO IRQ affinity in GIC:
Device: Jetson Xavier 32Gb
JetPack: R32 (release), REVISION: 7.1, GCID: 29818004, BOARD: t186ref, EABI: aarch64, DATE: Sat Feb 19 17:07:00 UTC 2022
I am using GPIO417 as interrupt source. My goal is to assign GPIO417 to Core-0 (or any other core) using affinity.
Details:
I have written a Linux Kernel Module (which is attached) which processes the interrupt and signals user space application.
When I checked, my IRQ number is 330. Also you can see that I am able to register the interrupt (116 times in below snapshot)
nvidia@ubuntu:~$ cat /proc/interrupts | grep my_gpio
330: 116 0 0 0 0 0 0 0 ff% tegra-gpio-129 Edge my_gpio_irq_signal
If I try to assign affinity to interrupt, I get Input/output error
nvidia@ubuntu:~$ echo 0 | sudo tee /proc/irq/330/smp_affinity
0
tee: /proc/irq/330/smp_affinity: Input/output error
I understand that, we need to configure the interrupt at GIC level. I am okay with all the interrupts handled by GIC to be routed to core-0 only.
But How do I assign processor affinity using GIC? I am unable to identify GIC and its interrupt number.
I am giving some more information which may help to answer my question.
nvidia@ubuntu:~$ dmesg | grep "registered GPIOs"
[ 0.373824] gpiochip_setup_dev: registered GPIOs 288 to 511 on device: gpiochip0 (tegra-gpio)
[ 0.379486] gpiochip_setup_dev: registered GPIOs 248 to 287 on device: gpiochip1 (tegra-gpio-aon)
[ 0.500734] gpiochip_setup_dev: registered GPIOs 240 to 247 on device: gpiochip2 (max77620-gpio)
My interrupt is 417 so, it must be from gpiochip0
and my /proc/interrupts dump for reference
nvidia@ubuntu:~$ cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7
1: 0 0 0 0 0 0 0 0 ff% GICv2-25 Level vgic
2: 0 0 0 0 0 0 0 0 ff% GICv2-29 Level trusty
3: 226038 221027 574594 177397 110381 114915 135411 127406 ff% GICv2-30 Level arch_timer
4: 0 0 0 0 0 0 0 0 ff% GICv2-27 Level kvm guest timer
6: 16518 0 0 0 0 0 0 0 ff GICv2-208 Level hsp
7: 0 0 0 0 0 0 0 0 ff GICv2-202 Level arm-smmu global fault
8: 0 0 0 0 0 0 0 0 ff GICv2-203 Level arm-smmu global fault
9: 0 0 0 0 0 0 0 0 ff GICv2-264 Level arm-smmu global fault
10: 0 0 0 0 0 0 0 0 ff GICv2-265 Level arm-smmu global fault
11: 0 0 0 0 0 0 0 0 ff GICv2-272 Level arm-smmu global fault
12: 0 0 0 0 0 0 0 0 ff GICv2-273 Level arm-smmu global fault
13: 0 0 0 0 0 0 0 0 ff GICv2-368 Level tegra-p2u-intr
14: 0 0 0 0 0 0 0 0 ff GICv2-369 Level tegra-p2u-intr
15: 0 0 0 0 0 0 0 0 ff GICv2-370 Level tegra-p2u-intr
16: 0 0 0 0 0 0 0 0 ff GICv2-371 Level tegra-p2u-intr
17: 0 0 0 0 0 0 0 0 ff GICv2-372 Level tegra-p2u-intr
18: 0 0 0 0 0 0 0 0 ff GICv2-373 Level tegra-p2u-intr
19: 0 0 0 0 0 0 0 0 ff GICv2-374 Level tegra-p2u-intr
20: 0 0 0 0 0 0 0 0 ff GICv2-375 Level tegra-p2u-intr
21: 0 0 0 0 0 0 0 0 ff GICv2-376 Level tegra-p2u-intr
22: 0 0 0 0 0 0 0 0 ff GICv2-377 Level tegra-p2u-intr
23: 0 0 0 0 0 0 0 0 ff GICv2-253 Level tegra-p2u-intr
24: 0 0 0 0 0 0 0 0 ff GICv2-254 Level tegra-p2u-intr
25: 0 0 0 0 0 0 0 0 ff GICv2-378 Level tegra-p2u-intr
26: 0 0 0 0 0 0 0 0 ff GICv2-379 Level tegra-p2u-intr
27: 0 0 0 0 0 0 0 0 ff GICv2-380 Level tegra-p2u-intr
28: 0 0 0 0 0 0 0 0 ff GICv2-381 Level tegra-p2u-intr
29: 0 0 0 0 0 0 0 0 ff GICv2-382 Level tegra-p2u-intr
30: 0 0 0 0 0 0 0 0 ff GICv2-383 Level tegra-p2u-intr
31: 0 0 0 0 0 0 0 0 ff GICv2-235 Level tegra-p2u-intr
32: 0 0 0 0 0 0 0 0 ff GICv2-252 Level tegra-p2u-intr
33: 1 0 0 0 0 0 0 0 ff GICv2-104 Level tegra-pcie-intr, PCIe PME, aerdrv
34: 0 0 0 0 0 0 0 0 ff GICv2-105 Level tegra-pcie-msi
35: 1 0 0 0 0 0 0 0 ff GICv2-77 Level tegra-pcie-intr, PCIe PME, aerdrv
36: 0 0 0 0 0 0 0 0 ff GICv2-78 Level tegra-pcie-msi
37: 1 0 0 0 0 0 0 0 ff GICv2-81 Level tegra-pcie-intr, PCIe PME, aerdrv
38: 0 0 0 0 0 0 0 0 ff GICv2-82 Level tegra-pcie-msi
39: 1 0 0 0 0 0 0 0 ff GICv2-85 Level tegra-pcie-intr, PCIe PME, aerdrv
40: 470 0 0 0 0 0 0 0 ff GICv2-86 Level tegra-pcie-msi
41: 0 0 0 0 0 0 0 0 ff GICv2-226 Level ether_qos.common_irq
43: 0 0 0 0 0 0 0 0 ff GICv2-222 Level 2490000.ether_qos.rx0
44: 0 0 0 0 0 0 0 0 ff GICv2-218 Level 2490000.ether_qos.tx0
51: 10760 0 0 0 0 0 0 0 ff GICv2-144 Level
54: 0 0 0 0 0 0 0 0 ff GICv2-152 Level combined_uart rx
55: 55736 0 0 0 0 0 0 0 ff GICv2-97 Level mmc0
56: 1083 0 0 0 0 0 0 0 ff GICv2-94 Level mmc1
57: 0 0 0 0 0 0 0 0 ff GICv2-76 Level ufshcd
58: 0 0 0 0 0 0 0 0 ff GICv2-68 Level 3210000.spi
59: 0 0 0 0 0 0 0 0 ff GICv2-69 Level c260000.spi
60: 34 0 0 0 0 0 0 0 ff GICv2-57 Level 3160000.i2c
61: 76 0 0 0 0 0 0 0 ff GICv2-58 Level c240000.i2c
62: 0 0 0 0 0 0 0 0 ff GICv2-59 Level 3180000.i2c
63: 0 0 0 0 0 0 0 0 ff GICv2-60 Level 3190000.i2c
64: 0 0 0 0 0 0 0 0 ff GICv2-62 Level 31b0000.i2c
65: 3 0 0 0 0 0 0 0 ff GICv2-63 Level 31c0000.i2c
66: 0 0 0 0 0 0 0 0 ff GICv2-64 Level c250000.i2c
67: 7 0 0 0 0 0 0 0 ff GICv2-65 Level 31e0000.i2c
68: 0 0 0 0 0 0 0 0 ff GICv2-72 Level can0
69: 0 0 0 0 0 0 0 0 ff GICv2-74 Level can1
70: 378 0 0 0 0 0 0 0 ff GICv2-193 Level snd_hda_tegra
71: 0 0 0 0 0 0 0 0 ff GICv2-51 Level bc00000.rtcpu
72: 338 0 0 0 0 0 0 0 ff GICv2-242 Level d230000.actmon
73: 80366 0 0 0 0 0 0 0 ff GICv2-297 Level host_syncpt
74: 2 0 0 0 0 0 0 0 ff GICv2-295 Level host_status
75: 0 0 0 0 0 0 0 0 ff GICv2-238 Level vic
76: 0 0 0 0 0 0 0 0 ff GICv2-268 Level nvdla0
77: 0 0 0 0 0 0 0 0 ff GICv2-269 Level nvdla1
78: 64881 0 0 0 0 0 0 0 ff GICv2-185 Level 15200000.nvdisplay
79: 0 0 0 0 0 0 0 0 ff GICv2-186 Level 15210000.nvdisplay
80: 0 0 0 0 0 0 0 0 ff GICv2-187 Level 15220000.nvdisplay
81: 0 0 0 0 0 0 0 0 ff GICv2-191 Level tegra_dp
82: 0 0 0 0 0 0 0 0 ff GICv2-192 Level tegra_dp
85: 0 0 0 0 0 0 0 0 ff GICv2-194 Level cec_irq
87: 0 0 0 0 0 0 0 0 ff GICv2-266 Level pva-isr
88: 0 0 0 0 0 0 0 0 ff GICv2-267 Level pva-isr
97: 0 0 0 0 0 0 0 0 ff% GICv2-397 Level carmel-pmu
98: 0 0 0 0 0 0 0 0 ff GICv2-169 Level tegra-oc-event
99: 0 0 0 0 0 0 0 0 ff GICv2-270 Level noc_nonsecure_irq
100: 0 0 0 0 0 0 0 0 ff GICv2-271 Level noc_secure_irq
101: 0 0 0 0 0 0 0 0 ff PM-42 Level tegra_rtc
102: 0 0 0 0 0 0 0 0 ff GICv2-255 Level mc_status
104: 0 0 0 0 0 0 0 0 ff GICv2-165 Level c150000.tegra-hsp
115: 29 0 0 0 0 0 0 0 ff GICv2-214 Level b950000.tegra-hsp, b950000.tegra-hsp, b950000.tegra-hsp
119: 0 0 0 0 0 0 0 0 ff GICv2-315 Level 3ad0000.se_elp
121: 0 0 0 0 0 0 0 0 ff GICv2-108 Level gpcdma.0
122: 0 0 0 0 0 0 0 0 ff GICv2-109 Level gpcdma.1
123: 0 0 0 0 0 0 0 0 ff GICv2-110 Level gpcdma.2
124: 0 0 0 0 0 0 0 0 ff GICv2-111 Level gpcdma.3
125: 3 0 0 0 0 0 0 0 ff GICv2-112 Level gpcdma.4
126: 3 0 0 0 0 0 0 0 ff GICv2-113 Level gpcdma.5
127: 0 0 0 0 0 0 0 0 ff GICv2-114 Level gpcdma.6
128: 0 0 0 0 0 0 0 0 ff GICv2-115 Level gpcdma.7
129: 0 0 0 0 0 0 0 0 ff GICv2-116 Level gpcdma.8
130: 0 0 0 0 0 0 0 0 ff GICv2-117 Level gpcdma.9
131: 0 0 0 0 0 0 0 0 ff GICv2-118 Level gpcdma.10
132: 0 0 0 0 0 0 0 0 ff GICv2-119 Level gpcdma.11
133: 0 0 0 0 0 0 0 0 ff GICv2-120 Level gpcdma.12
134: 0 0 0 0 0 0 0 0 ff GICv2-121 Level gpcdma.13
135: 0 0 0 0 0 0 0 0 ff GICv2-122 Level gpcdma.14
136: 0 0 0 0 0 0 0 0 ff GICv2-123 Level gpcdma.15
137: 0 0 0 0 0 0 0 0 ff GICv2-124 Level gpcdma.16
138: 0 0 0 0 0 0 0 0 ff GICv2-125 Level gpcdma.17
139: 0 0 0 0 0 0 0 0 ff GICv2-126 Level gpcdma.18
140: 0 0 0 0 0 0 0 0 ff GICv2-127 Level gpcdma.19
141: 0 0 0 0 0 0 0 0 ff GICv2-128 Level gpcdma.20
142: 0 0 0 0 0 0 0 0 ff GICv2-129 Level gpcdma.21
143: 0 0 0 0 0 0 0 0 ff GICv2-130 Level gpcdma.22
144: 0 0 0 0 0 0 0 0 ff GICv2-131 Level gpcdma.23
145: 0 0 0 0 0 0 0 0 ff GICv2-132 Level gpcdma.24
146: 0 0 0 0 0 0 0 0 ff GICv2-133 Level gpcdma.25
147: 0 0 0 0 0 0 0 0 ff GICv2-134 Level gpcdma.26
148: 0 0 0 0 0 0 0 0 ff GICv2-135 Level gpcdma.27
149: 0 0 0 0 0 0 0 0 ff GICv2-136 Level gpcdma.28
150: 0 0 0 0 0 0 0 0 ff GICv2-137 Level gpcdma.29
151: 0 0 0 0 0 0 0 0 ff GICv2-138 Level gpcdma.30
249: 0 0 0 0 0 0 0 0 ff% tegra-gpio-48 Edge force-recovery
253: 0 0 0 0 0 0 0 0 ff% tegra-gpio-52 Level phy_interrupt
256: 0 0 0 0 0 0 0 0 ff% tegra-gpio-55 Edge 3400000.sdhci cd
259: 0 0 0 0 0 0 0 0 ff% tegra-gpio-58 Level tmp451
299: 0 0 0 0 0 0 0 0 ff% tegra-gpio-98 Edge 15200000.nvdisplay
330: 6704 0 0 0 0 0 0 0 ff% tegra-gpio-129 Edge my_gpio_irq_signal
393: 0 0 0 0 0 0 0 0 ff% tegra-gpio-192 Edge bluetooth hostwake
461: 0 0 0 0 0 0 0 0 ff% tegra-gpio-aon-32 Edge ufs_cd_gpio
465: 0 0 0 0 0 0 0 0 ff% tegra-gpio-aon-36 Edge power-key
474: 90712 0 0 0 0 0 0 0 ff PM-195 Level xhci-hcd:usb1
475: 3 0 0 0 0 0 0 0 ff PM-196 Level 3610000.xhci
476: 0 0 0 0 0 0 0 0 ff PM-199 Level 3610000.xhci
477: 30290 0 0 0 0 0 0 0 ff GICv2-102 Level gk20a_stall
478: 0 0 0 0 0 0 0 0 ff GICv2-103 Level gk20a_nonstall
479: 0 0 0 0 0 0 0 0 01* GICv2-424 Level ras-fhi
480: 0 0 0 0 0 0 0 0 02* GICv2-425 Level ras-fhi
481: 0 0 0 0 0 0 0 0 04* GICv2-426 Level ras-fhi
482: 0 0 0 0 0 0 0 0 08* GICv2-427 Level ras-fhi
483: 0 0 0 0 0 0 0 0 10* GICv2-428 Level ras-fhi
484: 0 0 0 0 0 0 0 0 20* GICv2-429 Level ras-fhi
485: 0 0 0 0 0 0 0 0 40* GICv2-430 Level ras-fhi
486: 0 0 0 0 0 0 0 0 80* GICv2-431 Level ras-fhi
487: 0 0 0 0 0 0 0 0 ff GICv2-262 Level noc_nonsecure_irq
488: 0 0 0 0 0 0 0 0 ff GICv2-263 Level noc_secure_irq
489: 0 0 0 0 0 0 0 0 ff GICv2-292 Level noc_nonsecure_irq
490: 0 0 0 0 0 0 0 0 ff GICv2-204 Level noc_secure_irq
491: 0 0 0 0 0 0 0 0 ff GICv2-294 Level noc_nonsecure_irq
492: 0 0 0 0 0 0 0 0 ff GICv2-206 Level noc_secure_irq
493: 0 0 0 0 0 0 0 0 ff GICv2-291 Level noc_nonsecure_irq
494: 0 0 0 0 0 0 0 0 ff GICv2-207 Level noc_secure_irq
495: 0 0 0 0 0 0 0 0 ff GICv2-293 Level noc_nonsecure_irq
496: 0 0 0 0 0 0 0 0 ff GICv2-205 Level noc_secure_irq
498: 1 0 0 0 0 0 0 0 ff PM-241 Edge max77620-top
502: 0 0 0 0 0 0 0 0 ff% max77620-top-3 Edge max77620-gpio
503: 1 0 0 0 0 0 0 0 ff% max77620-top-4 Edge max77686-rtc
507: 0 0 0 0 0 0 0 0 ff% max77620-top-8 Edge max77620-thermal
508: 0 0 0 0 0 0 0 0 ff% max77620-top-9 Edge max77620-thermal
563: 1 0 0 0 0 0 0 0 ff% max77686-rtc-1 Edge rtc-alarm1
565: 0 0 0 0 0 0 0 0 ff% PCI-MSI-0 Edge predator_driver
1333: 470 0 0 0 0 0 0 0 ff% PCI-MSI-0 Edge eth1-TxRx-0
1334: 470 0 0 0 0 0 0 0 ff% PCI-MSI-1 Edge eth1-TxRx-1
1335: 470 0 0 0 0 0 0 0 ff% PCI-MSI-2 Edge eth1-TxRx-2
1336: 470 0 0 0 0 0 0 0 ff% PCI-MSI-3 Edge eth1-TxRx-3
1337: 470 0 0 0 0 0 0 0 ff% PCI-MSI-4 Edge eth1-TxRx-4
1338: 470 0 0 0 0 0 0 0 ff% PCI-MSI-5 Edge eth1-TxRx-5
1339: 470 0 0 0 0 0 0 0 ff% PCI-MSI-6 Edge eth1-TxRx-6
1340: 470 0 0 0 0 0 0 0 ff% PCI-MSI-7 Edge eth1-TxRx-7
1341: 0 0 0 0 0 0 0 0 ff% PCI-MSI-8 Edge eth1
1589: 0 0 0 0 0 0 0 0 ff PM-211 Level sw-wake
IPI0: 129004 226703 139154 143108 74636 76299 107080 100708 Rescheduling interrupts
IPI1: 719 679 10335 5655 5596 6567 5320 9164 Function call interrupts
IPI2: 0 0 0 0 0 0 0 0 CPU stop interrupts
IPI3: 0 0 0 0 0 0 0 0 Timer broadcast interrupts
IPI4: 1 0 0 0 0 0 0 0 IRQ work interrupts
IPI5: 0 0 0 0 0 0 0 0 CPU wake-up interrupts
Err: 0
RTE: 0 0 0 0 0 0 0 0 RT throttling events
