All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: mfornero@aanddtech.com
Cc: Xenomai@xenomai.org
Subject: Re: [Xenomai] Porting Ipipe to new ARM SoC (Xilinx Zynq)
Date: Wed, 23 Jan 2013 03:00:20 +0100	[thread overview]
Message-ID: <50FF4434.7030405@xenomai.org> (raw)
In-Reply-To: <OF518EBAA9.1B02356C-ON85257AFC.00002A9B-85257AFC.00028E23@aanddtech.com>

On 01/23/2013 01:27 AM, mfornero@aanddtech.com wrote:

> Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org> wrote on
> 01/22/2013 02:55:21 AM:
> 
>> From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
>> To: mfornero@aanddtech.com,
>> Cc: Xenomai@xenomai.org
>> Date: 01/22/2013 02:55 AM
>> Subject: Re: [Xenomai] Porting Ipipe to new ARM SoC (Xilinx Zynq)
>>
>> On 01/22/2013 01:00 AM, mfornero@aanddtech.com wrote:
>>
>> > The issue seems to be somewhat erratic, as I was able to run the
> latency
>> > test for a couple of hours this morning without observing it. Now
> however,
>> > it seems to show up on every boot (I don't believe I changed
> anything, but
>> > it's possible).
>> >
>> > For reference, I'm booting from a SDHC partitioned as such:
>> >         1) vfat         256 MB <-- This partition holds the first stage
>> > bootloader, uboot, the device tree and the Kernel zImage
>> >         2) ext4         768 MB <-- This partition is the rootfs
> (busybox +
>> > xenomai)
>> >
>> > The kernel boot command line is:
>> >         bootargs = "console=ttyPS0,115200 root=/dev/mmcblk0p2 rw
>> > earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=1";
>> >
>> > And I'm using the uboot compilation shipped with the ZedBoard.
>> >
>> > My ipipe port can be found here:
>> > git://github.com/mfornero/ipipe.git
>>
>>
>> At a quick glance, you are missing this change:
>>
> http://xenomai.org/index.php/I-pipe-core:ArmPorting#GPIOs_as_interrupt_sources
>>
>> In drivers/gpio/gpio-xilinxps.c
> 
> Thanks Gilles. I fixed the irq handler as follows (pushed to github):
> 
> --- a/drivers/gpio/gpio-xilinxps.c
> +++ b/drivers/gpio/gpio-xilinxps.c
> @@ -422,7 +422,7 @@ void xgpiops_irqhandler(unsigned int irq, struct
> irq_desc *desc)
>                         chip->irq_ack(&gpio_irq_desc->irq_data);
>  
>                         /* call the pin specific handler */
> -                       generic_handle_irq(gpio_irq);
> +                       ipipe_handle_demuxed_irq(gpio_irq);
>                 }
>                 /* shift to first virtual irq of next bank */
>                 gpio_irq = (int)irq_get_handler_data(irq) +
> 
> 
> Unfortunately, this does not seem to have any effect on the issue. I did
> a couple more tests today, and found the following:


Could you run cat /proc/interrupts on the running kernel? Are there not
other multiplexed gpios you should modify? Have you read the porting
guide and applied everything (the fact that you missed that point makes
me think that maybe you did not)? Have you tried enabling I-pipe debugs?
Other than that, you have to trace starting from __ipipe_grab_irq to
understand what happens. Debugging such kind of issues by proxy is a bit
hard.


> If I boot with Xenomai off (CONFIG_XENOMAI = n) but IPIPE still on
> (CONFIG_IPIPE = y), I get a warning at boot. Haven't looked into the
> root cause of this-- but maybe it's related?
> 
> mmc0: new high speed SDHC card at address b368
> mmcblk0: mmc0:b368 F0F0F 3.71 GiB
>  mmcblk0: p1 p2
> EXT4-fs (mmcblk0p2): recovery complete
> EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts:
> (null)
> VFS: Mounted root (ext4 filesystem) on device 179:2.
> devtmpfs: mounted
> Freeing init memory: 160K
> ------------[ cut here ]------------
> WARNING: at arch/arm/mm/context.c:182 __new_context+0x40/0x118()


Known issue, which I thought was fixed, but maybe not. Try this patch:

diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
index 3ae015f..79de5dc 100644
--- a/arch/arm/mm/context.c
+++ b/arch/arm/mm/context.c
@@ -167,11 +167,12 @@ static inline void set_mm_context(struct mm_struct
*mm, unsigned int asid)

 void __new_context(struct mm_struct *mm)
 {
-	int cpu = ipipe_processor_id();
 	unsigned long flags;
 	unsigned int asid;
+	int cpu;

 	asid_lock(flags);
+	cpu = ipipe_processor_id();
 #ifdef CONFIG_SMP
 	/*
 	 * Check the ASID again, in case the change was broadcast from



> If I boot with Xenomai on (CONFIG_XENOMAI = y) and Nucleus as a module
> (CONFIG_XENO_OPT_NUCLEUS = m), the system boots without issue (not even
> a warning at boot), but the Nucleus module fails to compile with the
> following error:
> 
> [mfornero@hwbuild linux]$ make -j8 modules
>   CHK     include/linux/version.h
>   CHK     include/generated/utsrelease.h
> make[1]: `include/generated/mach-types.h' is up to date.
>   CALL    scripts/checksyscalls.sh
>   Building modules, stage 2.
>   MODPOST 22 modules
> ERROR: "current_mm" [kernel/xenomai/nucleus/xeno_nucleus.ko] undefined!
> make[1]: *** [__modpost] Error 1
> make: *** [modules] Error 2


It simply means EXPORT_SYMBOL_GPL(current_mm) is missing.

-- 
                                                                Gilles.


  reply	other threads:[~2013-01-23  2:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-12 17:21 [Xenomai] Porting Ipipe to new ARM SoC (Xilinx Zynq) mfornero
2013-01-14 10:27 ` Stefan Roese
2013-01-22  0:00   ` mfornero
2013-01-22  7:55     ` Gilles Chanteperdrix
2013-01-23  0:27       ` mfornero
2013-01-23  2:00         ` Gilles Chanteperdrix [this message]
2013-01-23  3:43           ` Matthew Fornero
2013-01-23  7:02             ` Gilles Chanteperdrix
2013-01-23 23:51               ` mfornero
2013-01-24  9:03                 ` Gilles Chanteperdrix
2013-01-24 23:57                   ` mfornero
2013-01-25  9:01                     ` Gilles Chanteperdrix
     [not found]               ` <OFC84FDBBF.88E9186F-ON85257AFC.007B4CC3-85257AFC.008309FB@LocalDomain>
2013-01-24  0:12                 ` mfornero
2013-02-10 14:23   ` Gilles Chanteperdrix
2013-02-13 17:57     ` mfornero
2013-02-13 18:14       ` Stefan Roese
2013-02-13 18:38         ` mfornero
2013-02-14  8:19           ` Stefan Roese
2013-02-13 19:44       ` Gilles Chanteperdrix
2013-02-14 19:41         ` Gilles Chanteperdrix
2013-02-14 19:42           ` Gilles Chanteperdrix

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=50FF4434.7030405@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=Xenomai@xenomai.org \
    --cc=mfornero@aanddtech.com \
    /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.