This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM625: Can't set affinity for some interrupts

Genius 13655 points
Part Number: AM625

Hello Champs, 

SDK: 08.03.00.19
Real Time (RT) Linux Kernel
RT Kernel Version: 5.10.109-rt65
Kernel defconfig: ti_sdk_arm64_rt_release_defconfig
uboot enviroment variables:

setenv args_all setenv optargs earlycon=ns16550a,mmio32,0x02800000 isolcpus=1-3


root@ok6254:echo 2>/proc/irq/378/smp_affinity_list
-sh:echo:write error:input/output error

Some interrupts e.g i2c no.16 can set the affinity, but other interrupts affinity can't work.

Thanks
Regards,
Shine

  • Hi,

    I see an issue being tracked in the release notes concerning IRQ balance. I will need to discuss with the development team. I will have an answer in the next day or two.

    Best Regards,

    Schuyler

  • Hi,

    This issue was fixed in the 8.6 SDK which is available now.

    Best Regards,

    Schuyler

  • I tested it, but it still doesn't work.

    Here are my test conditions:

    root@ok6254:~# uname -a
    Linux ok6254 5.10.168-g2c23e6c538 #1 SMP PREEMPT Fri Mar 31 13:24:31 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
    root@ok6254:~# echo 4 > /proc/irq/317/smp_affinity
    -sh: echo: write error: Input/output error
    root@ok6254:~# cat /proc/interrupts
               CPU0       CPU1       CPU2       CPU3
     11:      59261         63         63         62     GICv3  30 Level     arch_timer
     14:          0          0          0          0     GICv3  23 Level     arm-pmu
     16:          0          0          0          0     GICv3 139 Level     4900000.i2c
     17:          0          0          0          0     GICv3 208 Level     4b00000.spi
     18:          0          0          0          0     GICv3 209 Level     4b10000.spi
     20:          0          0          0          0     GICv3 197 Level     2b200000.i2c
     21:        559          0          0          0     GICv3  66 Level     4d000000.mailbox thr_012
     22:       3640          0          0         30     GICv3 210 Level     2800000.serial
     25:          0          0          0          0     GICv3 194 Level     20010000.i2c
     26:          0          0          0          0     GICv3 195 Level     20020000.i2c
     27:          0          0          0          0     GICv3 196 Level     20030000.i2c
     28:          0          0          0          0     GICv3 204 Level     20100000.spi
     29:          0          0          0          0     GICv3 205 Level     20110000.spi
     30:          0          0          0          0     GICv3 206 Level     20120000.spi
     31:       3599          0          0          0     GICv3 165 Level     mmc0
     32:       1373          0          0          0     GICv3 115 Level     mmc1
     33:        193          0          0          0     GICv3 114 Level     mmc2
     35:          0          0          0          0     GICv3 171 Level     fc40000.spi
     44:          0          0          0          0     GICv3 267 Level     2b00000.mcasp_rx
     45:          0          0          0          0     GICv3 268 Level     2b00000.mcasp_tx
     46:          0          0          0          0  MSI-INTA 1713152 Level     485c0100.dma-controller chan0
     64:          0          0          0          0  MSI-INTA 1714176 Edge      485c0100.dma-controller chan1
     76:          0          0          0          0  MSI-INTA 1714688 Level     485c0100.dma-controller chan1
     94:          0          0          0          0  MSI-INTA 1715718 Edge      485c0100.dma-controller chan2
    112:          0          0          0          0  MSI-INTA 1716230 Level     485c0100.dma-controller chan2
    134:          0          0          0          0  MSI-INTA 1970707 Level     8000000.ethernet-tx0
    224:          0          0          0          0  MSI-INTA 1971731 Level     8000000.ethernet
    257:          0          0          0          0     GICv3 134 Level     8000000.ethernet
    317:          0          0          0          0      GPIO  22 Edge    -davinci_gpio  key1
    IPI0:        33         14         13         13       Rescheduling interrupts
    IPI1:         1         28         28         28       Function call interrupts
    IPI2:         0          0          0          0       CPU stop interrupts
    IPI3:         0          0          0          0       CPU stop (for crash dump) interrupts
    IPI4:         0          0          0          0       Timer broadcast interrupts
    IPI5:         0          0          0          0       IRQ work interrupts
    IPI6:         0          0          0          0       CPU wake-up interrupts
    Err:          0
    

    and my interrupt request code and device tree:

    //probe
    static int temp_probe (struct platform_device *pdev)
    {
    	int ret = -1;
    	cpumask_t mask;
    	nd = of_find_node_by_path("/inc_1");
    	if (NULL == nd) {
    		printk("find /out_control fail\n");
    	}
    	out1 = of_irq_get(nd, 0);
    	
    	ret = request_irq( out1, do_key, IRQF_TRIGGER_RISING, "key1", pdev);
    	if (ret) {
    		printk("request irq1 error\n");
    		return -EBUSY;
    	}
    	
    	return 0;
    }
    
    //device tree
    inc_1 {
            compatible = "inc_1";
    	 	pinctrl-names = "default";
    		pinctrl-0 = <&outc_pins_default>;
    		interrupt-parent = <&main_gpio0>;
    		interrupts =  <22 IRQ_TYPE_EDGE_RISING>;
    		status = "okay";
    };
    

    The interrupt function is working properly

  • I tested it, but it still doesn't work.The test results can be found in the latest comments on this issue

  • 8.6 had the interrupt affinity improvement for Ethernet, so Ethernet related interrupts are no longer tied to CPU0. There are still some interrupts that are not movable.

    Can you clarify, you have " isolcpus=1-3" as a kernel command line option. So this means you are trying to have everything one CPU0 ? So is the concern:

     22:       3640          0          0         30     GICv3 210 Level     2800000.serial

    ?

      Pekka