GPIO interrupt not working on Zynq7000
Hello,
trying to diagnose an interrupt problem on a Zynq 7000 hardware. The environment is linux 4.4.189, xenomai 3.0.9.
I'm trying to trig some realtime thread pending on a gpio read.
At the beginning, the system would freeze if the GPIO pin was toggled, because the GPIO int pending status was never cleared by the existing code. So now I don't get the system freeze anymore, however, the RTDM gpio irq handler never gets called whenever the interrupt is raised.
I'm not sure how to diagnose that. For what I could see, the IRQ is registered in ipipe domain "xnsched_realtime_domain", and I'm not sure if that matches "ipipe_head_domain" that is used in the __ipipe_dispatch_irq
Any help appreciated
François
Hi,
Quoted 9 lines · François Legal via Xenomai
Hello,
trying to diagnose an interrupt problem on a Zynq 7000 hardware. The environment is linux 4.4.189, xenomai 3.0.9.
I'm trying to trig some realtime thread pending on a gpio read.
At the beginning, the system would freeze if the GPIO pin was toggled, because the GPIO int pending status was never cleared by the existing code.
how do you clear it? Do you call one of the irqchip functions?
Quoted 4 lines
So now I don't get the system freeze anymore, however, the RTDM gpio irq handler never gets called whenever the interrupt is raised.
It’s possible what you called to clear the irq has also masked the interrupt and requires a unmask. Can you post a patch of what you did?
Quoted 3 lines
I'm not sure how to diagnose that. For what I could see, the IRQ is registered in ipipe domain "
xnsched_realtime_domain", and I'm not sure if that matches "ipipe_head_domain" that is
Are you using the rtdm gpio driver? Or is this a custom rtdm driver using the gpio directly?
Quoted 5 lines
Any help appreciated
François
Greg
Quoted 3 lines
Quoted 25 lines · Greg Gallagher
Hi,
Quoted 9 lines · François Legal via Xenomai
Hello,
trying to diagnose an interrupt problem on a Zynq 7000 hardware. The environment is linux 4.4.189, xenomai 3.0.9.
I'm trying to trig some realtime thread pending on a gpio read.
At the beginning, the system would freeze if the GPIO pin was toggled, because the GPIO int pending status was never cleared by the existing code.
how do you clear it? Do you call one of the irqchip functions?
Quoted 4 lines
So now I don't get the system freeze anymore, however, the RTDM gpio irq handler never gets called whenever the interrupt is raised.
It’s possible what you called to clear the irq has also masked the interrupt and requires a unmask. Can you post a patch of what you did?
Quoted 8 lines
Quoted 3 lines
I'm not sure how to diagnose that. For what I could see, the IRQ is registered in ipipe domain "
xnsched_realtime_domain", and I'm not sure if that matches "ipipe_head_domain" that isAre you using the rtdm gpio driver? Or is this a custom rtdm driver using the gpio directly?
I also forgot to mention here, whenever the program is being run, I can see my gpio pin (gpio957) in /proc/xenomai/irq, but not in /proc/interrupts. However, the irq count does not increment in /proc/xenomai/irq
Quoted 12 lines
Quoted 6 lines
Any help appreciated
François
Greg
Quoted 3 lines
hi,
Quoted 5 lines · François Legal
Quoted 2 lines · Greg Gallagher
Hi,
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines · François Legal via Xenomai
Hello,
trying to diagnose an interrupt problem on a Zynq 7000 hardware. The environment is linux 4.4.189, xenomai 3.0.9.
Are you building directly from the ipipe repo or applying one of the patches? If it's a patch what patch are you applying?
Quoted 40 lines
Quoted 15 lines
Quoted 4 lines
I'm trying to trig some realtime thread pending on a gpio read.
At the beginning, the system would freeze if the GPIO pin was toggled, because the GPIO int pending status was never cleared by the existing code.
how do you clear it? Do you call one of the irqchip functions?
Quoted 4 lines
So now I don't get the system freeze anymore, however, the RTDM gpio irq handler never gets called whenever the interrupt is raised.
It’s possible what you called to clear the irq has also masked the interrupt and requires a unmask. Can you post a patch of what you did?
Quoted 8 lines
Quoted 3 lines
I'm not sure how to diagnose that. For what I could see, the IRQ is registered in ipipe domain "
xnsched_realtime_domain", and I'm not sure if that matches "ipipe_head_domain" that isAre you using the rtdm gpio driver? Or is this a custom rtdm driver using the gpio directly?
I also forgot to mention here, whenever the program is being run, I can see my gpio pin (gpio957) in
/proc/xenomai/irq, but not in/proc/interrupts. However, the irq count does not increment in/proc/xenomai/irqQuoted 12 lines
Quoted 6 lines
Any help appreciated
François
Greg
Quoted 3 lines
Quoted 11 lines · Greg Gallagher
hi,
Quoted 8 lines · François Legal
Quoted 5 lines · Greg Gallagher
Hi,
On Wed, Mar 4, 2020 at 4:01 AM François Legal via Xenomai < [email protected]> wrote:
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Hello,
trying to diagnose an interrupt problem on a Zynq 7000 hardware. The environment is linux 4.4.189, xenomai 3.0.9.
Are you building directly from the ipipe repo or applying one of the patches? If it's a patch what patch are you applying?
I'm applying ipipe-core-4.4.176-arm-10.patch with slight modifications (KUSER_TSC is not enabled for Zynq 7000 in that patch)
Quoted 41 lines
Quoted 41 lines
Quoted 16 lines
Quoted 5 lines
I'm trying to trig some realtime thread pending on a gpio read.
At the beginning, the system would freeze if the GPIO pin was toggled, because the GPIO int pending status was never cleared by the existing code.
how do you clear it? Do you call one of the irqchip functions?
Quoted 4 lines
So now I don't get the system freeze anymore, however, the RTDM gpio irq handler never gets called whenever the interrupt is raised.
It’s possible what you called to clear the irq has also masked the interrupt and requires a unmask. Can you post a patch of what you did?
Quoted 8 lines
Quoted 3 lines
I'm not sure how to diagnose that. For what I could see, the IRQ is registered in ipipe domain "
xnsched_realtime_domain", and I'm not sure if that matches "ipipe_head_domain" that isAre you using the rtdm gpio driver? Or is this a custom rtdm driver using the gpio directly?
I also forgot to mention here, whenever the program is being run, I can see my gpio pin (gpio957) in
/proc/xenomai/irq, but not in/proc/interrupts. However, the irq count does not increment in/proc/xenomai/irqQuoted 12 lines
Quoted 6 lines
Any help appreciated
François
Greg
Quoted 3 lines
Quoted 15 lines · François Legal via Xenomai
Quoted 13 lines · Greg Gallagher
hi,
Quoted 10 lines · François Legal
Quoted 7 lines · Greg Gallagher
Hi,
Quoted 2 lines · François Legal via Xenomai
Hello,
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
trying to diagnose an interrupt problem on a Zynq 7000 hardware. The environment is linux 4.4.189, xenomai 3.0.9.
Are you building directly from the ipipe repo or applying one of the patches? If it's a patch what patch are you applying?
I'm applying ipipe-core-4.4.176-arm-10.patch with slight modifications (
KUSER_TSCis not enabled for Zynq 7000 in that patch)
You know that you can find a newer version in https://gitlab.denx.de/Xenomai/ipipe/tree/ipipe-4.4.y-cip? I'm just not releasing it as I'm lacking test feedback on the updates. It is not supposed to resolve the GPIO issue, though.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
Quoted 31 lines · Jan Kiszka
Quoted 15 lines · François Legal via Xenomai
Quoted 13 lines · Greg Gallagher
hi,
Quoted 10 lines · François Legal
Quoted 7 lines · Greg Gallagher
Hi,
Quoted 2 lines · François Legal via Xenomai
Hello,
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
trying to diagnose an interrupt problem on a Zynq 7000 hardware. The environment is linux 4.4.189, xenomai 3.0.9.
Are you building directly from the ipipe repo or applying one of the patches? If it's a patch what patch are you applying?
I'm applying ipipe-core-4.4.176-arm-10.patch with slight modifications (
KUSER_TSCis not enabled for Zynq 7000 in that patch)You know that you can find a newer version in
https://gitlab.denx.de/Xenomai/ipipe/tree/ipipe-4.4.y-cip? I'm just not releasing it as I'm lacking test feedback on the updates. It is not supposed to resolve the GPIO issue, though.
Quoted 5 lines
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
I'll have to look at this a little more closely, I don't think you need to clear the pending status unless something changed upstream on us. The chained handler should be calling a mask and ack to hold the line and then unmask once the handler is called. In userspace you're just calling select on the gpio path? I can test this with just the ipipe first and see if we can isolate the issue to either the ipipe or Xenomai. It may take me a couple of days to get setup with my Zynq board again, can you try the 4.4.y branch Jan mentioned, I'll use that as a starting point when I start debugging.
Thanks
Greg
Quoted 48 lines · Greg Gallagher
Quoted 31 lines · Jan Kiszka
Quoted 15 lines · François Legal via Xenomai
Quoted 13 lines · Greg Gallagher
hi,
Quoted 10 lines · François Legal
Quoted 7 lines · Greg Gallagher
Hi,
Quoted 2 lines · François Legal via Xenomai
Hello,
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
trying to diagnose an interrupt problem on a Zynq 7000 hardware. The environment is linux 4.4.189, xenomai 3.0.9.
Are you building directly from the ipipe repo or applying one of the patches? If it's a patch what patch are you applying?
I'm applying ipipe-core-4.4.176-arm-10.patch with slight modifications (
KUSER_TSCis not enabled for Zynq 7000 in that patch)You know that you can find a newer version in
https://gitlab.denx.de/Xenomai/ipipe/tree/ipipe-4.4.y-cip? I'm just not releasing it as I'm lacking test feedback on the updates. It is not supposed to resolve the GPIO issue, though.Quoted 5 lines
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded LinuxI'll have to look at this a little more closely, I don't think you need to clear the pending status unless something changed upstream on us. The chained handler should be calling a mask and ack to hold the line and then unmask once the handler is called. In userspace you're just calling select on the gpio path? I can test this with just the ipipe first and see if we can isolate the issue to either the ipipe or Xenomai. It may take me a couple of days to get setup with my Zynq board again, can you try the 4.4.y branch Jan mentioned, I'll use that as a starting point when I start debugging.
Quoted 3 lines
Thanks
Greg
Your comment on using the ipipe repo made me go there and have a look. It seems I found the answer. In the zynq_gpio_handle_bank_irq, the ipipe repo uses "ipipe_handle_demuxed_irq" whereas mine used "generic_handle_irq"
It seems that my problem is solved now.
So I think I saw the announcement for ipipe-core-4.4.196-cip38-x86-19.patch, but nothing for arm.
Thanks
François
Quoted 52 lines · François Legal
Quoted 50 lines · Greg Gallagher
Quoted 31 lines · Jan Kiszka
Quoted 15 lines · François Legal via Xenomai
Quoted 13 lines · Greg Gallagher
hi,
Quoted 10 lines · François Legal
Quoted 7 lines · Greg Gallagher
Hi,
Quoted 2 lines · François Legal via Xenomai
Hello,
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
trying to diagnose an interrupt problem on a Zynq 7000 hardware. The environment is linux 4.4.189, xenomai 3.0.9.
Are you building directly from the ipipe repo or applying one of the patches? If it's a patch what patch are you applying?
I'm applying ipipe-core-4.4.176-arm-10.patch with slight modifications (
KUSER_TSCis not enabled for Zynq 7000 in that patch)You know that you can find a newer version in
https://gitlab.denx.de/Xenomai/ipipe/tree/ipipe-4.4.y-cip? I'm just not releasing it as I'm lacking test feedback on the updates. It is not supposed to resolve the GPIO issue, though.Quoted 5 lines
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded LinuxI'll have to look at this a little more closely, I don't think you need to clear the pending status unless something changed upstream on us. The chained handler should be calling a mask and ack to hold the line and then unmask once the handler is called. In userspace you're just calling select on the gpio path? I can test this with just the ipipe first and see if we can isolate the issue to either the ipipe or Xenomai. It may take me a couple of days to get setup with my Zynq board again, can you try the 4.4.y branch Jan mentioned, I'll use that as a starting point when I start debugging.
Thanks
Quoted 8 lines
Quoted 1 line
Greg
Your comment on using the ipipe repo made me go there and have a look. It seems I found the answer. In the
zynq_gpio_handle_bank_irq, the ipipe repo uses "ipipe_handle_demuxed_irq" whereas mine used "generic_handle_irq"It seems that my problem is solved now.
So I think I saw the announcement for ipipe-core-4.4.196-cip38-x86-19.patch, but nothing for arm.
That's what I meant with "I'm just not releasing it as I'm lacking test feedback on the updates". Only since rather recently, we have here a BeagleBone Black as part of our lab on 4.4-cip head as well, but that's just one target.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
Quoted 67 lines · Jan Kiszka
Quoted 52 lines · François Legal
Quoted 50 lines · Greg Gallagher
Quoted 31 lines · Jan Kiszka
Quoted 15 lines · François Legal via Xenomai
Quoted 13 lines · Greg Gallagher
hi,
Quoted 10 lines · François Legal
Quoted 7 lines · Greg Gallagher
Hi,
Quoted 2 lines · François Legal via Xenomai
Hello,
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
trying to diagnose an interrupt problem on a Zynq 7000 hardware. The environment is linux 4.4.189, xenomai 3.0.9.
Are you building directly from the ipipe repo or applying one of the patches? If it's a patch what patch are you applying?
I'm applying ipipe-core-4.4.176-arm-10.patch with slight modifications (
KUSER_TSCis not enabled for Zynq 7000 in that patch)You know that you can find a newer version in
https://gitlab.denx.de/Xenomai/ipipe/tree/ipipe-4.4.y-cip? I'm just not releasing it as I'm lacking test feedback on the updates. It is not supposed to resolve the GPIO issue, though.Quoted 5 lines
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded LinuxI'll have to look at this a little more closely, I don't think you need to clear the pending status unless something changed upstream on us. The chained handler should be calling a mask and ack to hold the line and then unmask once the handler is called. In userspace you're just calling select on the gpio path? I can test this with just the ipipe first and see if we can isolate the issue to either the ipipe or Xenomai. It may take me a couple of days to get setup with my Zynq board again, can you try the 4.4.y branch Jan mentioned, I'll use that as a starting point when I start debugging.
Thanks
Quoted 8 lines
Quoted 1 line
Greg
Your comment on using the ipipe repo made me go there and have a look. It seems I found the answer. In the
zynq_gpio_handle_bank_irq, the ipipe repo uses "ipipe_handle_demuxed_irq" whereas mine used "generic_handle_irq"It seems that my problem is solved now.
So I think I saw the announcement for ipipe-core-4.4.196-cip38-x86-19.patch, but nothing for arm.
That's what I meant with "I'm just not releasing it as I'm lacking test feedback on the updates". Only since rather recently, we have here a BeagleBone Black as part of our lab on 4.4-cip head as well, but that's just one target.
Quoted 5 lines
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
Ah alright. My bad.
So to terminate on that ipipe topic, I checked the legacy ipipe 4.4.y / 4.4.y-cip branches, and none fo them seem to handle the zynq-gpio correctly. It looks like this has been fixed in 4.9.y branch.
Shall I submit a patch on this ?
François
Quoted 72 lines · François Legal
Quoted 69 lines · Jan Kiszka
Quoted 52 lines · François Legal
Quoted 50 lines · Greg Gallagher
Quoted 31 lines · Jan Kiszka
Quoted 15 lines · François Legal via Xenomai
Quoted 13 lines · Greg Gallagher
hi,
Quoted 10 lines · François Legal
Quoted 7 lines · Greg Gallagher
Hi,
Quoted 2 lines · François Legal via Xenomai
Hello,
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
trying to diagnose an interrupt problem on a Zynq 7000 hardware. The environment is linux 4.4.189, xenomai 3.0.9.
Are you building directly from the ipipe repo or applying one of the patches? If it's a patch what patch are you applying?
I'm applying ipipe-core-4.4.176-arm-10.patch with slight modifications (
KUSER_TSCis not enabled for Zynq 7000 in that patch)You know that you can find a newer version in
https://gitlab.denx.de/Xenomai/ipipe/tree/ipipe-4.4.y-cip? I'm just not releasing it as I'm lacking test feedback on the updates. It is not supposed to resolve the GPIO issue, though.Quoted 5 lines
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded LinuxI'll have to look at this a little more closely, I don't think you need to clear the pending status unless something changed upstream on us. The chained handler should be calling a mask and ack to hold the line and then unmask once the handler is called. In userspace you're just calling select on the gpio path? I can test this with just the ipipe first and see if we can isolate the issue to either the ipipe or Xenomai. It may take me a couple of days to get setup with my Zynq board again, can you try the 4.4.y branch Jan mentioned, I'll use that as a starting point when I start debugging.
Thanks
Quoted 8 lines
Quoted 1 line
Greg
Your comment on using the ipipe repo made me go there and have a look. It seems I found the answer. In the
zynq_gpio_handle_bank_irq, the ipipe repo uses "ipipe_handle_demuxed_irq" whereas mine used "generic_handle_irq"It seems that my problem is solved now.
So I think I saw the announcement for ipipe-core-4.4.196-cip38-x86-19.patch, but nothing for arm.
That's what I meant with "I'm just not releasing it as I'm lacking test feedback on the updates". Only since rather recently, we have here a BeagleBone Black as part of our lab on 4.4-cip head as well, but that's just one target.
Jan
Quoted 8 lines
Quoted 3 lines
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded LinuxAh alright. My bad.
So to terminate on that ipipe topic, I checked the legacy ipipe 4.4.y / 4.4.y-cip branches, and none fo them seem to handle the zynq-gpio correctly. It looks like this has been fixed in 4.9.y branch.
That makes sense why we are seeing it here and not in 4.19/4.14
Quoted 1 line
Shall I submit a patch on this ?
Yes please.
Quoted 3 lines
François
Quoted 3 lines · François Legal
So to terminate on that ipipe topic, I checked the legacy ipipe 4.4.y / 4.4.y-cip branches, and none fo them seem to handle the zynq-gpio correctly. It looks like this has been fixed in 4.9.y branch.
Shall I submit a patch on this ?
That would be perfect. I already cherry-picked a few ARM patches from newer releases that Philippe pointed me to. If those apply, just list the commit shas. If not, please send the adjusted ones as backport. I would recommend to also check ipipe-4.19 for potential further fixes.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
Quoted 10 lines · Jan Kiszka
Quoted 3 lines · François Legal
So to terminate on that ipipe topic, I checked the legacy ipipe 4.4.y / 4.4.y-cip branches, and none fo them seem to handle the zynq-gpio correctly. It looks like this has been fixed in 4.9.y branch.
Shall I submit a patch on this ?
That would be perfect. I already cherry-picked a few ARM patches from newer releases that Philippe pointed me to. If those apply, just list the commit shas. If not, please send the adjusted ones as backport. I would recommend to also check ipipe-4.19 for potential further fixes.
Quoted 5 lines
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux
I think this "389e3638" is the one
François
Quoted 12 lines · François Legal
Quoted 10 lines · Jan Kiszka
Quoted 3 lines · François Legal
So to terminate on that ipipe topic, I checked the legacy ipipe 4.4.y / 4.4.y-cip branches, and none fo them seem to handle the zynq-gpio correctly. It looks like this has been fixed in 4.9.y branch.
Shall I submit a patch on this ?
That would be perfect. I already cherry-picked a few ARM patches from newer releases that Philippe pointed me to. If those apply, just list the commit shas. If not, please send the adjusted ones as backport. I would recommend to also check ipipe-4.19 for potential further fixes.
Quoted 8 lines
Quoted 5 lines
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded LinuxI think this "
389e3638" is the one
Thanks, I've applied that quickly and pushed it for your testing purposes.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux