I/O IRQ conflict

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I/O IRQ conflict

Jump to solution
3,562 Views
Nouchi
Senior Contributor II

    Hello,

 

I'm porting  old timesys BSP to the new Yocto Jethro, we use a 7" LCD panel with egalax touch screen device (like i.MX6 sabre design).

We use the freescale egalax driver with bindings in device tree :

&i2c0 {

    clock-frequency = <100000>;

    pinctrl-names = "default";

    pinctrl-0 = <&pinctrl_i2c0>;

    status = "okay";

 

    at24@50{

        compatible ="at24,24c08";

        pagesize = <16>;

        reg = <0x50>;

       };

 

    touchscreen: egalax_ts@04 {

        compatible = "eeti,egalax_ts";

        reg = <0x04>;

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_eeti2>;

        interrupt-parent = <&gpio0>;

        interrupts = <21 0>;

        wakeup-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;

       };

};

 

pinctrl_eeti2: eeti2grp {

            fsl,pins = <

               VF610_PAD_PTA31__GPIO_21     0x063f

               >;

          };

 

and PTA13 is used as IRQ pin (GPIO 21)

When booting, egalax driver is registered, but it can't set irq, see bootlog in attached file.

 

Any suggestions?

 

Regards

Emmanuel

Original Attachment has been moved to: bootlog.txt.zip

Labels (4)
0 Kudos
1 Solution
2,253 Views
Nouchi
Senior Contributor II

Hello,

I did similar workaround with the 3.0 kernel. I found a solution for the 4.1 kernel, but don't ask me what was the real problem.

I just rewrote the end of egalax_ts_probe, see attached diff file.

It works, but with ts_test, cursor is a little bit jerky due to time out error in I2c reading, but it should be fine for my application.

Thanks,

Emmanuel

View solution in original post

0 Kudos
13 Replies
2,252 Views
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport​ please continue with the follow up.

0 Kudos
2,252 Views
Nouchi
Senior Contributor II

Hello,

I made some test with GPIO Sysfs interface, and it seems to work

16:  25654   GIC  27 Edge  gt
17:      0  vf610-gpc   8 Edge  eDMA tx
18:      0  vf610-gpc   9 Edge  eDMA err
19:      0  vf610-gpc   4 Edge  SEMA4
21:   3050  vf610-gpc  62 Edge  fsl-lpuart
32:      0  vf610-gpc  30 Edge  fsl-dcu-fb
33: 422216  vf610-gpc  71 Edge  40066000.i2c
34:      0  vf610-gpc  92 Edge  wkpu-vf610
35:      0  vf610-gpc  75 Edge  40034000.usb
37:      0  vf610-gpc 100 Edge  rtc alarm
38:   3054  vf610-gpc  76 Edge  400b4000.usb
39:   2244  vf610-gpc  78 Edge  400d0000.ethernet
40:      8  vf610-gpc  83 Edge  vf610_nfc
63:  38510  gpio-vf610  21 Level egalax_ts
125:     51  gpio-vf610  19 Edge  gpiolib

Now I think that it could be an interrupt mask problem, because with IRQF_TRIGGER_LOW (level trigger), interrupt is permanently triggered (counter grow up quickly) , if I replace by IRQF_TRIGGER_FALLING (edge trigger), interrupt is never triggered.

I think it's not really an IRQ conflict, because I tried to force an other IRQ number (125 for example), and the problem remain the same.

Regards,

Emmanuel

0 Kudos
2,253 Views
timesyssupport
Senior Contributor II

Hi Emmanuel,

So, I inquired with one of our Vybrid developers about this, and turns out we did work with an egalax touchscreen for another partner's Vybrid platform, but in the 3.0 kernel. They initially saw a similar issue as you are currently seeing in 4.1 - so many interrupts were being generated with IRQF_TRIGGER_LOW that this was causing a large system slowdown. We changed the driver to use falling edge interrupt instead - please see the attached patch to do so. You could investigate porting the changes from this patch to your 4.1 kernel egalax driver.

Also, sorry about the length of the patch, most of the changes are whitespace changes rather than content changes. You should be able to ignore code line #s ~100-185 in the patch.

Thanks,

Timesys Support

0 Kudos
2,254 Views
Nouchi
Senior Contributor II

Hello,

I did similar workaround with the 3.0 kernel. I found a solution for the 4.1 kernel, but don't ask me what was the real problem.

I just rewrote the end of egalax_ts_probe, see attached diff file.

It works, but with ts_test, cursor is a little bit jerky due to time out error in I2c reading, but it should be fine for my application.

Thanks,

Emmanuel

0 Kudos
2,253 Views
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport​ please continue with the follow up.

0 Kudos
2,253 Views
Nouchi
Senior Contributor II

Hello,

The egalax_ts is well probed, because egalax driver is registered :

input: EETI eGalax Touch Screen as /devices/platform/soc/soc:aips-bus@40000000/40066000.i2c/i2c-0/0-0004/input/input0

in egalax_ts_probe :

error = devm_request_threaded_irq(&client->dev, client->irq, NULL,egalax_ts_interrupt, IRQF_TRIGGER_LOW | IRQF_ONESHOT, "egalax_ts", ts);

if (error < 0) { dev_err(&client->dev, "Failed to register interrupt\n"); return error; }

didn't return errors.

I think the problem is not egalax_ts driver.

Weird, I just tried with Toradex kernel 4.1, and it works.....

I will make a diff....

Thanks ,

Emmanuel

0 Kudos
2,253 Views
Nouchi
Senior Contributor II

Hello,

Somebody can explain how interrupts numbers are attributed, because irq number is already defined before enter devm_request_threaded_irq, client->irq is 60.

with linux-3.0.13, egalax interrupt number was 277, but many things changed since linux 3.0 .....

Regards,

Emmanuel

0 Kudos
2,253 Views
timesyssupport
Senior Contributor II

Hi Emmanuel,

This is likely due to the introduction of the ARM GIC driver for Linux kernel >3.0, which is assigning a different virtual interrupt number in the newer kernel.

Thanks,

Timesys Support

2,253 Views
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport​  can you help to review this case?

0 Kudos
2,253 Views
timesyssupport
Senior Contributor II

Hi Emmanuel,

I could see irq 60 from your boot log which is GIC id for SDHC1.Could you please confirm your kernel version and complete boot log along with the output of "cat /proc/interrupts" ?

Thanks,

Timesys Support

0 Kudos
2,253 Views
Nouchi
Senior Contributor II

Hello,

The problem still there, even after removed mmc/sd/sdio drivers (I don't need sdcard support).

The kernel version is Linux version 4.1.13+ge55a6a9 from fsl-community-bsp-platform jethro branch, boot log is attached to this message.

Best regards,

Emmanuel

0 Kudos
2,253 Views
timesyssupport
Senior Contributor II

Hello Emmanuel,

We have reviewed your device tree configuration , but have not found anything wrong with this. We are not able to reproduce your issue because we do not have the egalax hardware with the vybrid tower, so you will need to debug the driver in the 4.1 kernel at drivers/input/touchscreen/egalax_ts.c.

If you had this working in the previous bsp then I would recommend reviewing the probe function in that egalax driver compared to the probe function in the egalax driver in the 4.1 kernel.

Thanks,

Timesys Support

0 Kudos
2,253 Views
Nouchi
Senior Contributor II

Hello,

I made some tests with Toradex kernel, and it doesn't work, there's also irq conflict, what cause asynchronous reads of egalax device. Even when IRQ line is in idle state, the isr routine is called, then ts_test works but very slow.

I tried to use PTA30 as irq line (instead of PTA31), the problem still there with IRQ 62 (DCU 0). It seems something is broken in irq management.

In 3.0.15-ts-armv7l, cat /proc/interrupts gives :

277:     61  GPIO  egalax_ts

Regards,

Emmanuel

0 Kudos