<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Hi,</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">I need one help.</div><div class="gmail_default" style="font-family:verdana,sans-serif">I am using i.MX7 Sabre board with kernel version 4.1.15</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Let's say I am interested in GPIO number: 21</div><div class="gmail_default" style="font-family:verdana,sans-serif">I wanted to set CPU affinity for particular GPIO->IRQ number, so I tried the below steps:</div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">root@10:~# echo 21 > /sys/class/gpio/export</span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">root@10:~# echo "rising" > /sys/class/gpio/gpio21/edge</span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">root@10:~# cat /proc/interrupts | grep 21</span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"> 47: 0 0 gpio-mxc 21 Edge gpiolib</span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">root@10:~# cat /sys/class/gpio/gpio21/direction</span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">in</span></div><div class="gmail_default"><span style="font-family:verdana,sans-serif">root@10:~# cat /proc/irq/47/smp_affinity</span></div><div class="gmail_default"><span style="font-family:verdana,sans-serif">3</span></div><div class="gmail_default" style="font-family:verdana,sans-serif">
<div class="gmail_default">root@10:~# echo 2 > /proc/irq/47/smp_affinity</div><div class="gmail_default">-bash: echo: write error: Input/output error</div><div class="gmail_default"><br></div><div class="gmail_default">But I get input/output error.</div><div class="gmail_default">When I debug further, found that irq_can_set_affinity is returning 0:</div><div class="gmail_default"><div class="gmail_default">[ 0.000000] genirq: irq_can_set_affinity (0): balance: 1, irq_data.chip: a81b7e48, irq_set_affinity: (null)</div><div class="gmail_default">[ 0.000000] write_irq_affinity: FAIL</div><div class="gmail_default"><br></div><div class="gmail_default">I also tried first setting /proc/irq/default_smp_affinity to 2 (from 3).</div><div class="gmail_default">This change is working, but the smp_affinity setting for the new IRQ is not working.</div><div class="gmail_default"><br></div><div class="gmail_default">When I try to set smp_affinity for mmc0, then it works.</div><div class="gmail_default"># cat /proc/interrupts | grep mmc</div><div class="gmail_default"><div class="gmail_default">295: 55 0 GPCV2 22 Edge mmc0</div><div class="gmail_default">296: 0 0 GPCV2 23 Edge mmc1</div><div class="gmail_default">297: 52 0 GPCV2 24 Edge mmc2</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default">root@10:~# echo 2 > /proc/irq/295/smp_affinity</div><div class="gmail_default">root@10:~#</div></div></div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default">So, I wanted to know what are the conditions for which setting smp_affinity for an IRQ will work ?</div><div class="gmail_default"><br></div><div class="gmail_default">Is there any way by which I can set CPU affinity to a GPIO -> IRQ ?</div><div class="gmail_default">Whether, irq_set_affinity_hint() will work in this case ?</div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default">Thanks,</div><div class="gmail_default">Pintu</div><div class="gmail_default"><br></div></div></div></div>