All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harco Kuppens <h.kuppens@cs.ru.nl>
To: Philippe Gerum <rpm@xenomai.org>, xenomai@xenomai.org
Subject: Re: [Xenomai] problem gpio interrupts xenomai3 on the raspberry pi 2 (or 3)
Date: Tue, 30 May 2017 21:32:25 +0200	[thread overview]
Message-ID: <e8f3c456-0efc-5d91-bb99-e4eb4c8f5a5b@cs.ru.nl> (raw)
In-Reply-To: <cb912c40-1247-6395-9a84-a3203dd5f022@xenomai.org>



On 30/05/17 19:30, Philippe Gerum wrote:
> On 05/30/2017 06:38 PM, Harco Kuppens wrote:
>> So I decided to also  test these wiringpi test programs on mine build
>> xenomai 3 image for the rpi2. Unfortunately the isr.c wiringpi program
>> didn't work anymore on mine build image. So even without using xenomai3,
>> but just using linux the pi2 just hangs and a hard reset was needed.
>>
>> Thus I guess there is still something wrong with mine image?
>> Does anybody know what I'm doing wrong?
>> Or is this still a bug in the gpio library or in the patches applied?
>>
> It looks obvious that you tried hard and got your feet wet with Xenomai
> already, so let's go straight to the point: the lockup issue when using
> GPIO interrupts is most likely due to the I-pipe patch not properly
> adapting the GPIO chip driver for dealing with IRQ virtualization.
>
> In short, each IRQ controller which may be active on a SoC must be
> driven by I-pipe aware code. For instance, the bcm2835 family has common
> GPIOs controlled by the driver at drivers/pinctrl/pinctrl-bcm2835.c. If
> that driver has not been patched specifically for supporting the IRQ
> pipeline, then this won't work with Xenomai, and may well end up with
> painful IRQ storms causing a machine hang. The same goes for any other
> chip serving as an IRQ controller you might need on your platform.
>
> So, first and foremost, I would recommend to make sure the I-pipe code
> is right for your kernel, then build on top of that. A good way to
> figure out which IRQ controllers are active is look at the output of
> /proc/interrupts on a kernel that disables the interrupt pipeline.
yes, I already checked  /proc/interrupts and when the xeno_gpio module
was loaded I could see the IRQ used.
> Each IRQ information mentions the label of the controller which deals
> with it. With that information, you need to cross-check whether the
> corresponding IRQ chip driver (the one that bears this label in the
> irq_chip descriptor structure) was made I-pipe aware.
I thought the label said "gpio", I have to look that up again.

In the installations instructions I put on the github page, there was 
next to
the ipipe patch an extra patch specific for the bcm2836 chip. I guess
that something is wrong in that patch. But I'm not an expert in the linux
kernel and ipipe code so I find it difficult  to find out what is wrong 
with it.
>
> Some time ago, I ported Xenomai 3 to the PI Zero (kernel 4.1.18), which
> is based on the bcm2835 SoC like the PI 1 series. That code is available
> from the vendors/raspberry/ipipe-4.1 branch at
> git://git.xenomai.org/ipipe.git. This may be a good starting point, at
> least for testing with a PI 1, before working on the required fixups for
> supporting other Broadcom SoCs.
Ok I'll try to first get the xenomai 4 working on mine pi 1,
then I will try the same code on the pi zero which should be ok.
Maybe we can use the pi zero instead in the course.

But when I get this working, I will try to take a deeper look into how
for this chip the  patch works. If I then understand it better then
I can take a look at the chip for the pi2 or pi3 to fix the ipipe or bcm 
patch.

>
> IIRC, RPI 2B and RPI 3 are based on the bcm2836, bcm2837 SoCs resp.,
> which are not covered by the port just mentioned. You may find some
> preliminary I-pipe related changes in the bcm2836 core interrupt support
> code, but those have never been tested. By preliminary, I mean that
> there is likely a few more IRQ controllers to make I-pipe aware on these
> SoCs, aside of testing the initial changes.
>
> Bottom line: using a stock I-pipe patch is unlikely to work out of the
> box. The fact that such patch does support several SoCs equipped with
> Cortex A7/A9 CPUs is by no mean a guarantee that all Cortex-based SoCs
> are supported by the same code.

Message is clear, unfortunately there is no quick fix, but with your 
tips, I now have at least an approach via the rpi1
to see if I can fix it.  If I find a  solution I will report it.

Thank you for the quick response ,

Harco

>



  reply	other threads:[~2017-05-30 19:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-30 16:38 [Xenomai] problem gpio interrupts xenomai3 on the raspberry pi 2 (or 3) Harco Kuppens
2017-05-30 17:30 ` Philippe Gerum
2017-05-30 19:32   ` Harco Kuppens [this message]
     [not found] <mailman.115.1496162312.4225.xenomai@xenomai.org>
2017-05-30 17:47 ` Nitin Kulkarni
     [not found] <mailman.117.1496166485.4225.xenomai@xenomai.org>
2017-05-30 18:02 ` Nitin Kulkarni
2017-05-31  7:16   ` Philippe Gerum
2017-05-31 10:34     ` Nitin Kulkarni
2017-06-01  7:11       ` Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8f3c456-0efc-5d91-bb99-e4eb4c8f5a5b@cs.ru.nl \
    --to=h.kuppens@cs.ru.nl \
    --cc=rpm@xenomai.org \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.