Fwd: Xenomai - RTNet - patch error

2019-08-14 Thread Laurentiu-Cristian Duca via Xenomai
-- Forwarded message --
From: Laurentiu-Cristian Duca 
Date: Wed, 14 Aug 2019 20:46:19 +0300
Subject: Re: Xenomai - RTNet - patch error
To: Quirin Gylstorff 

Hello Quirin,

  Thank you for this quick answer.

On 8/14/19, Quirin Gylstorff  wrote:
> Hi Laurentiu,
>
>> Hello xenomai community,
>>
>>I am an open source enthusiast interested in Xenomai and RTNet.
>> I have the RTNet modules successfully installed on BeagleBone black
>> and now I want to install RTNet on qemu-system-x86_64
>> in order to do more tests with bbb and x86_64.
>>
> We are also interested using the beagle bone black as the target device
> for xenomai. Do you want to supply us the patches for it?

Here are some hints, I just wanted to have something that works:
- tested on 4.14.108 robertcnelson kernel sources,
https://github.com/RobertCNelson/ti-linux-kernel-dev/tree/ti-linux-xenomai-4.14.y
- https://github.com/G-Ray/xenomai-boneblack-rtnet-drivers
those drivers were adapted after Hidde (see RTNet mailing list on
sourceforge and search for beaglebone), written and tested on linux
4.1

quick and dirty fixes in order to run on 4.14.108 (success with
rtping, more tests will follow)
- rt_ticpsw must be inserted after rt_smsc and rt_davinci_mdio and
before rtnet start
- drivers/xenomai/net/drivers/ticpsw/cpsw.c
if (of_property_read_u32(node, "rx_descs", )) {
dev_err(>dev, "Missing rx_descs property in the DT; 
default to 64\n");
prop = 64;
//return -EINVAL;
}
- rt_davinci_mdio.c, davinci_mdio_probe()
...
/* scan and dump the bus */
for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
phy = mdiobus_get_phy(data->bus, addr);
if (phy) {
dev_info(dev, "phy[%d]: device %s, driver %s\n",
 phy->mdio.addr, phydev_name(phy),
 phy->drv ? phy->drv->name : "unknown");
}
}
return 0;
}
- in kernel
drivers/net/phy/phy_device.c
int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
  u32 flags, phy_interface_t interface)
{
//struct module *ndev_owner = dev->dev.parent->driver->owner;
// comment all lines that use ndev_owner

>
>
>>I have tried to compile the project
>> https://github.com/jan-kiszka/xenomai-images
>> with the command
>> kas-docker --isar build kas.yml:board-qemu-amd64.yml
>
>
> The github repository from Jan is outdated an no longer
> maintained/updated. Use https://gitlab.denx.de/Xenomai/xenomai-images
> instead.
>
> How did you get to the github repository?
I found it on google.

>
>> and it returns the below copied error. > Do you have any ideas how to get
>> over it? Maybe to transform it into
> an warning,
>> or by automatically/manually answer  to patch anyway.
>>
>> ERROR: xenomai--next-r0 do_patch: patching failed
>> ERROR: xenomai--next-r0 do_patch: Function failed: do_patch
>> ERROR: Logfile of failure stored in:
>> /work/build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/temp/log.do_patch.123
>> ERROR: Task (/repo/recipes-xenomai/xenomai/xenomai_next.bb:do_patch)
>> failed with exit code '1'
>> NOTE: Tasks Summary: Attempted 46 tasks of which 45 didn't need to be
>> rerun and 1 failed.
>>
>> Summary: 1 task failed:
>>/repo/recipes-xenomai/xenomai/xenomai_next.bb:do_patch
>> Summary: There were 2 ERROR messages shown, returning a non-zero exit
>> code.
>>
>> $ cat
>> build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/temp/log.do_patch
>> DEBUG: Executing python function do_patch
>> DEBUG: Fetcher accessed the network with the command git -c
>> core.fsyncobjectfiles=0 ls-remote
>> https://gitlab.denx.de/Xenomai/xenomai.git
>> DEBUG: Running export PSEUDO_DISABLED=1; export
>> GIT_PROXY_COMMAND="oe-git-proxy"; export NO_PROXY="*"; export
>> PATH="/work/isar/bitbake/bin:/work/isar/scripts:/usr/sbin:/usr/bin:/sbin:/bin";
>> export HOME="/tmp/tmp89g2x4r8"; git -c core.fsyncobjectfiles=0
>> ls-remotehttps://gitlab.denx.de/Xenomai/xenomai.git
>> NOTE: patch --no-backup-if-mismatch -p 1 --directory
>> /work/build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/git
>> --input
>> /work/build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/0001-debian-Add-config-folder-to-xenomai-kernel-source.patch
>> patching file debian/rules
>>
>> Reversed (or previously applied) patch detected!  Assume -R? [n]
>> Apply anyway? [n]
>> Skipping patch.
>> 1 out of 1 hunk ignored -- saving rejects to file debian/rules.rej
>> ERROR: patching failed
>> DEBUG: Python function do_patch finished
>> ERROR: Function failed: do_patch
>>
> ISAR tries to apply the patch on the current HEAD of next, but the patch
> is already submitted patch and therefore git fails to apply the patch.
>
>>
>> Thank you and kind regards,
>> L-C. Duca
>
>
> Can we clarify for you that
> https://gitlab.denx.de/Xenomai/xenomai-images is the correct image. Like
> linking it to Xenomai Main page or mention it the in the README?
>
> Kind regards,
> Quirin
>

Kind regads,

Re: Xenomai - RTNet - patch error

2019-08-14 Thread Quirin Gylstorff via Xenomai



Hi,


Hello xenomai community,

   I am an open source enthusiast interested in Xenomai and RTNet.
I have the RTNet modules successfully installed on BeagleBone black
and now I want to install RTNet on qemu-system-x86_64
in order to do more tests with bbb and x86_64.

We are also interested using the beagle bone black as the target device 
for xenomai. Do you want to supply us the patches for it?




   I have tried to compile the project
https://github.com/jan-kiszka/xenomai-images
with the command
kas-docker --isar build kas.yml:board-qemu-amd64.yml



The github repository from Jan is outdated an no longer 
maintained/updated. Use https://gitlab.denx.de/Xenomai/xenomai-images 
instead.


How did you get to the github repository?

and it returns the below copied error. > Do you have any ideas how to get over it? Maybe to transform it into 

an warning,

or by automatically/manually answer  to patch anyway.

ERROR: xenomai--next-r0 do_patch: patching failed
ERROR: xenomai--next-r0 do_patch: Function failed: do_patch
ERROR: Logfile of failure stored in:
/work/build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/temp/log.do_patch.123
ERROR: Task (/repo/recipes-xenomai/xenomai/xenomai_next.bb:do_patch)
failed with exit code '1'
NOTE: Tasks Summary: Attempted 46 tasks of which 45 didn't need to be
rerun and 1 failed.

Summary: 1 task failed:
   /repo/recipes-xenomai/xenomai/xenomai_next.bb:do_patch
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

$ cat build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/temp/log.do_patch
DEBUG: Executing python function do_patch
DEBUG: Fetcher accessed the network with the command git -c
core.fsyncobjectfiles=0 ls-remote
https://gitlab.denx.de/Xenomai/xenomai.git
DEBUG: Running export PSEUDO_DISABLED=1; export
GIT_PROXY_COMMAND="oe-git-proxy"; export NO_PROXY="*"; export
PATH="/work/isar/bitbake/bin:/work/isar/scripts:/usr/sbin:/usr/bin:/sbin:/bin";
export HOME="/tmp/tmp89g2x4r8"; git -c core.fsyncobjectfiles=0
ls-remotehttps://gitlab.denx.de/Xenomai/xenomai.git
NOTE: patch --no-backup-if-mismatch -p 1 --directory
/work/build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/git
--input 
/work/build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/0001-debian-Add-config-folder-to-xenomai-kernel-source.patch
patching file debian/rules

Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file debian/rules.rej
ERROR: patching failed
DEBUG: Python function do_patch finished
ERROR: Function failed: do_patch

ISAR tries to apply the patch on the current HEAD of next, but the patch 
is already submitted patch and therefore git fails to apply the patch.




Thank you and kind regards,
L-C. Duca



Can we clarify for you that 
https://gitlab.denx.de/Xenomai/xenomai-images is the correct image. Like 
linking it to Xenomai Main page or mention it the in the README?


Kind regards,
Quirin



Re: Xenomai - RTNet - patch error

2019-08-14 Thread Laurentiu-Cristian Duca via Xenomai
I have fixed it quick and dirty:
remove the patch file from package/xenomai/

On 8/14/19, Laurentiu-Cristian Duca  wrote:
> Hello xenomai community,
>
>   I am an open source enthusiast interested in Xenomai and RTNet.
> I have the RTNet modules successfully installed on BeagleBone black
> and now I want to install RTNet on qemu-system-x86_64
> in order to do more tests with bbb and x86_64.
>
>   I have tried to compile the project
> https://github.com/jan-kiszka/xenomai-images
> with the command
> kas-docker --isar build kas.yml:board-qemu-amd64.yml
> and it returns the below copied error.
> Do you have any ideas how to get over it? Maybe to transform it into an
> warning,
> or by automatically/manually answer  to patch anyway.
>
> ERROR: xenomai--next-r0 do_patch: patching failed
> ERROR: xenomai--next-r0 do_patch: Function failed: do_patch
> ERROR: Logfile of failure stored in:
> /work/build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/temp/log.do_patch.123
> ERROR: Task (/repo/recipes-xenomai/xenomai/xenomai_next.bb:do_patch)
> failed with exit code '1'
> NOTE: Tasks Summary: Attempted 46 tasks of which 45 didn't need to be
> rerun and 1 failed.
>
> Summary: 1 task failed:
>   /repo/recipes-xenomai/xenomai/xenomai_next.bb:do_patch
> Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
>
> $ cat
> build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/temp/log.do_patch
> DEBUG: Executing python function do_patch
> DEBUG: Fetcher accessed the network with the command git -c
> core.fsyncobjectfiles=0 ls-remote
> https://gitlab.denx.de/Xenomai/xenomai.git
> DEBUG: Running export PSEUDO_DISABLED=1; export
> GIT_PROXY_COMMAND="oe-git-proxy"; export NO_PROXY="*"; export
> PATH="/work/isar/bitbake/bin:/work/isar/scripts:/usr/sbin:/usr/bin:/sbin:/bin";
> export HOME="/tmp/tmp89g2x4r8"; git -c core.fsyncobjectfiles=0
> ls-remote https://gitlab.denx.de/Xenomai/xenomai.git
> NOTE: patch --no-backup-if-mismatch -p 1 --directory
> /work/build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/git
> --input
> /work/build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/0001-debian-Add-config-folder-to-xenomai-kernel-source.patch
> patching file debian/rules
>
> Reversed (or previously applied) patch detected!  Assume -R? [n]
> Apply anyway? [n]
> Skipping patch.
> 1 out of 1 hunk ignored -- saving rejects to file debian/rules.rej
> ERROR: patching failed
> DEBUG: Python function do_patch finished
> ERROR: Function failed: do_patch
>
>
> Thank you and kind regards,
> L-C. Duca
>



[xenomai-images][PATCH] distro/xenomai-demo: Update to Debian 10

2019-08-14 Thread Q. Gylstorff via Xenomai
From: Quirin Gylstorff 

Debian 10 (Buster) was released and Stretch is now old stable, update
the distribution to the latest stable version.

Signed-off-by: Quirin Gylstorff 
---
 conf/distro/xenomai-demo.conf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/conf/distro/xenomai-demo.conf b/conf/distro/xenomai-demo.conf
index 1fb7838..2610548 100644
--- a/conf/distro/xenomai-demo.conf
+++ b/conf/distro/xenomai-demo.conf
@@ -9,9 +9,9 @@
 # SPDX-License-Identifier: MIT
 #
 
-require conf/distro/debian-stretch.conf
+require conf/distro/debian-buster.conf
 
-HOST_DISTRO ?= "debian-stretch"
+HOST_DISTRO ?= "debian-buster"
 
 KERNEL_NAME = "xenomai"
 
-- 
2.20.1




[xenomai-images][PATCH] kernel/linux-xenomai: Update versions

2019-08-14 Thread Q. Gylstorff via Xenomai
From: Quirin Gylstorff 

Kernel 4.14 will soon be deprecated. Add kernel 4.19 for armhf and
x86 builds. Currently there is no 4.19 for arm64 available, therefore
pin to 4.14.%.

Signed-off-by: Quirin Gylstorff 
---
 conf/machine/qemu-arm64.conf   |  1 +
 recipes-kernel/linux/linux-xenomai_4.14.bb | 10 +-
 recipes-kernel/linux/linux-xenomai_4.19.bb | 21 +
 3 files changed, 27 insertions(+), 5 deletions(-)
 create mode 100644 recipes-kernel/linux/linux-xenomai_4.19.bb

diff --git a/conf/machine/qemu-arm64.conf b/conf/machine/qemu-arm64.conf
index a633095..283b3aa 100644
--- a/conf/machine/qemu-arm64.conf
+++ b/conf/machine/qemu-arm64.conf
@@ -12,3 +12,4 @@
 require qemu-machine.inc
 
 DISTRO_ARCH = "arm64"
+PREFERRED_VERSION_linux-xenomai = "4.14.%"
diff --git a/recipes-kernel/linux/linux-xenomai_4.14.bb 
b/recipes-kernel/linux/linux-xenomai_4.14.bb
index 49ede27..14030d6 100644
--- a/recipes-kernel/linux/linux-xenomai_4.14.bb
+++ b/recipes-kernel/linux/linux-xenomai_4.14.bb
@@ -12,15 +12,15 @@
 require recipes-kernel/linux/linux-xenomai.inc
 
 SRC_URI_append_amd64 = " 
git://gitlab.denx.de/Xenomai/ipipe-x86.git;protocol=https;branch=ipipe-x86-4.14.y"
-SRCREV_amd64 = "eb0ab801116e0268358f1ca250251f02e82eed4a"
-PV_amd64 = "4.14.111+"
+SRCREV_amd64 = "fdfa1aff4578edf6a03e2e77ea20bf7f97863954"
+PV_amd64 = "4.14.134+"
 
 SRC_URI_append_arm64 = " 
git://gitlab.denx.de/Xenomai/ipipe-arm64.git;protocol=https;branch=stable/4.14.78-arm64"
 SRCREV_arm64 = "dec5e42fd43de238df816b31cadfb83b268b7136"
 PV_arm64 = "4.14.78+"
 
-SRC_URI_append_armhf = " 
git://gitlab.denx.de/Xenomai/ipipe-arm.git;protocol=https;branch=stable/4.14.85-arm"
-SRCREV_armhf = "35a84af5b7e3193e90ee129a91054657c02e8248"
-PV_armhf = "4.14.85+"
+SRC_URI_append_armhf = " 
git://gitlab.denx.de/Xenomai/ipipe-arm.git;protocol=https;branch=stable/4.14.96-arm"
+SRCREV_armhf = "723539db0d5a1c995c9bb5524abe311a97b33e43"
+PV_armhf = "4.14.96+"
 
 S = "${WORKDIR}/git"
diff --git a/recipes-kernel/linux/linux-xenomai_4.19.bb 
b/recipes-kernel/linux/linux-xenomai_4.19.bb
new file mode 100644
index 000..9af5659
--- /dev/null
+++ b/recipes-kernel/linux/linux-xenomai_4.19.bb
@@ -0,0 +1,21 @@
+#
+# Xenomai Real-Time System
+#
+# Copyright (c) Siemens AG, 2019
+#
+# Authors:
+#  Quirin Gylstorff 
+#
+# SPDX-License-Identifier: MIT
+#
+
+require recipes-kernel/linux/linux-xenomai.inc
+
+SRC_URI_append_amd64 = " 
git://gitlab.denx.de/Xenomai/ipipe-x86.git;protocol=https;branch=ipipe-x86-4.19.y"
+SRCREV_amd64 = "d8ca6738bdff660d033ce755db55e7fe5210379a"
+PV_amd64 = "4.19.60+"
+
+SRC_URI_append_armhf = " 
git://gitlab.denx.de/Xenomai/ipipe-arm.git;protocol=https;nobranch=1;tag=ipipe-core-4.19.33-arm-2"
+PV_armhf = "4.19.33+"
+
+S = "${WORKDIR}/git"
-- 
2.20.1




Re: [PATCH v3] recipes-xenomai: Add recipes for all major branches

2019-08-14 Thread Jan Kiszka via Xenomai

On 14.08.19 13:21, Jan Kiszka via Xenomai wrote:

On 13.08.19 17:28, Q. Gylstorff wrote:

From: Quirin Gylstorff 

For testing it should be possible to switch between different
xenomai versions. Select the version by adding the
following line to kas.yml with:
   xenomai-version: |
 PREFERRED_VERSION_xenomai = ""
  e.g. the latest master branch with:
   xenomai-version: |
 PREFERRED_VERSION_xenomai = "master"

Signed-off-by: Quirin Gylstorff 
---
Changes:
v3:
  - fix newlines
  - use patches instead of sed
v2:
  - fix identation
  - move functions to xenomai.inc
  - use bitbake to get commitid
  - add enable-smp to stable
  - remove AUTOINC from version - feature is not yet available in ISAR

  kas.yml   |  2 ++
  ...nfig-folder-to-xenomai-kernel-source.patch | 29 +
  ...bian-Enable-SMP-in-userspace-package.patch | 31 +++
  recipes-xenomai/xenomai/xenomai.inc   | 10 ++
  recipes-xenomai/xenomai/xenomai_3.0.9.bb  | 18 +++
  recipes-xenomai/xenomai/xenomai_master.bb | 19 
  recipes-xenomai/xenomai/xenomai_next.bb   | 10 ++
  recipes-xenomai/xenomai/xenomai_stable.bb | 22 +
  8 files changed, 133 insertions(+), 8 deletions(-)
  create mode 100644 
recipes-xenomai/xenomai/files/0001-debian-Add-config-folder-to-xenomai-kernel-source.patch 

  create mode 100644 
recipes-xenomai/xenomai/files/0001-debian-Enable-SMP-in-userspace-package.patch

  create mode 100644 recipes-xenomai/xenomai/xenomai_3.0.9.bb
  create mode 100644 recipes-xenomai/xenomai/xenomai_master.bb
  create mode 100644 recipes-xenomai/xenomai/xenomai_stable.bb

diff --git a/kas.yml b/kas.yml
index 3694bcc..2bf62d4 100644
--- a/kas.yml
+++ b/kas.yml
@@ -35,3 +35,5 @@ local_conf_header:
  CONF_VERSION = "1"
    cross: |
  ISAR_CROSS_COMPILE = "1"
+  xenomai-version: |
+    PREFERRED_VERSION_xenomai = "stable"
diff --git 
a/recipes-xenomai/xenomai/files/0001-debian-Add-config-folder-to-xenomai-kernel-source.patch 
b/recipes-xenomai/xenomai/files/0001-debian-Add-config-folder-to-xenomai-kernel-source.patch 


new file mode 100644
index 000..3be4fb3
--- /dev/null
+++ 
b/recipes-xenomai/xenomai/files/0001-debian-Add-config-folder-to-xenomai-kernel-source.patch 


@@ -0,0 +1,29 @@
+From 07d87b9b2ca45f81024056720b28f6cdbcb3b9c7 Mon Sep 17 00:00:00 2001
+From: Jan Kiszka 
+Date: Tue, 6 Nov 2018 13:37:21 +0100
+Subject: [PATCH] debian: Add config folder to xenomai-kernel-source
+
+Meanwhile required for prepare-kernel.sh.
+
+Signed-off-by: Jan Kiszka 
+Signed-off-by: Quirin Gylstorff 
+---
+ debian/rules | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/debian/rules b/debian/rules
+index 8b871a488..99ed8982c 100755
+--- a/debian/rules
 b/debian/rules
+@@ -73,7 +73,7 @@ install: build
+ cp debian/libxenomai1.lintian 
$(CURDIR)/debian/libxenomai1/usr/share/lintian/overrides/libxenomai1
+ cp debian/libxenomai-dev.lintian 
$(CURDIR)/debian/libxenomai-dev/usr/share/lintian/overrides/libxenomai-dev
+ mkdir -p 
$(CURDIR)/debian/xenomai-kernel-source/usr/src/xenomai-kernel-source 
$(CURDIR)/debian/xenomai-kernel-source/usr/share/doc/xenomai-kernel-source
+-    cp -a kernel include scripts 
$(CURDIR)/debian/xenomai-kernel-source/usr/src/xenomai-kernel-source
++    cp -a config kernel include scripts 
$(CURDIR)/debian/xenomai-kernel-source/usr/src/xenomai-kernel-source

+
+ # Build architecture-independent files here.
+ binary-indep: build install
+--
+2.20.1
+
diff --git 
a/recipes-xenomai/xenomai/files/0001-debian-Enable-SMP-in-userspace-package.patch 
b/recipes-xenomai/xenomai/files/0001-debian-Enable-SMP-in-userspace-package.patch

new file mode 100644
index 000..6a63a92
--- /dev/null
+++ 
b/recipes-xenomai/xenomai/files/0001-debian-Enable-SMP-in-userspace-package.patch

@@ -0,0 +1,31 @@
+From a4ec3f654a4be50aaf268c3a540e8b110ad2ded3 Mon Sep 17 00:00:00 2001
+From: Jan Kiszka 
+Date: Tue, 6 Nov 2018 18:59:47 +0100
+Subject: [PATCH] debian: Enable SMP in userspace package
+
+Hard to find a UP target these days, and we definitely want to be
+generic with Debian packages.
+
+Signed-off-by: Jan Kiszka 
+Signed-off-by: Quirin Gylstorff 
+---
+ debian/rules | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/debian/rules b/debian/rules
+index 99ed8982c..883ae3ed8 100755
+--- a/debian/rules
 b/debian/rules
+@@ -16,7 +16,8 @@ DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture 
-qDEB_BUILD_GNU_TYPE)

+ CONFIG_OPTS = --prefix=/usr \
+ --includedir=/usr/include/xenomai \
+ --mandir=/usr/share/man \
+-    --with-testdir=/usr/lib/xenomai/testsuite
++    --with-testdir=/usr/lib/xenomai/testsuite \
++    --enable-smp
+
+ ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+ CONFIG_OPTS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+--
+2.20.1
+
diff --git a/recipes-xenomai/xenomai/xenomai.inc 

Spitest with xeno_spi rtdm driver locks up on raspberry PI 3

2019-08-14 Thread Nitin Kulkarni via Xenomai
Hi,

I just want to know has anyone successfully used spi rtdm driver on a
raspberry pi 3 ?
Because I am trying to use the spi rtdm driver on bcm2837 soc (Raspbery pi
3 B+ model)
It seems like the spi rtdm locks up.

When the driver is loaded I see the device is setup correctly:
[  168.556792] spi-bcm2835 3f204000.spi: bcm2835_spi_probe: entered
Aug 14 13:03:06 raspberrypi kernel: [  168.592569] rtdm_spi_device spi0.0:
using GPIO8 for CS0

When I run the spitest standalone from the smokey test suite using the
below command
 spitest --run=0 device=/dev/rtdm/spi0/slave0.0 speed=1
[  890.847619] spi0 slave0.0: mapping created
Aug 14 12:56:27 raspberrypi kernel: [  890.848112] configured mode 0, 8
bits/w, 1 Hz max

The system locks up and after a while the watch dog kicks in to dump this:
[ 1084.021563] watchdog: BUG: soft lockup - CPU#1 stuck for 22s!
[migration/1:15]
[ 1084.021572] watchdog: BUG: soft lockup - CPU#2 stuck for 22s!
[migration/2:21]
[ 1084.021627] Modules linked in: xeno_spi_bcm2835 xeno_spi brcmfmac
brcmutil cfg80211 rfkill i2c_bcm2835 uio_pdrv_genirq fixed uio ip_tables
x_tables ipv6
...

I changed the rtdm interrupt handler in spi-bcm2835.c to a normal non
real-time linux interrupt and it seems to work fine !
I suspect the rtdm interrupt in the driver is not working.

It would be great if some one can verify or debunk my theory if they have
EVER successfully used this driver on a RPI 3 machine.

My machine specs:
RPI 3 B+
Kernel version: Linux raspberrypi 4.14.85-v7+ (Raspbian distro with I-pipe
patch)
Xenomai ver 3.0.8

Thank you
Nitin


Re: [PATCH v3] recipes-xenomai: Add recipes for all major branches

2019-08-14 Thread Jan Kiszka via Xenomai

On 13.08.19 17:28, Q. Gylstorff wrote:

From: Quirin Gylstorff 

For testing it should be possible to switch between different
xenomai versions. Select the version by adding the
following line to kas.yml with:
   xenomai-version: |
 PREFERRED_VERSION_xenomai = ""
  e.g. the latest master branch with:
   xenomai-version: |
 PREFERRED_VERSION_xenomai = "master"

Signed-off-by: Quirin Gylstorff 
---
Changes:
v3:
  - fix newlines
  - use patches instead of sed
v2:
  - fix identation
  - move functions to xenomai.inc
  - use bitbake to get commitid
  - add enable-smp to stable
  - remove AUTOINC from version - feature is not yet available in ISAR

  kas.yml   |  2 ++
  ...nfig-folder-to-xenomai-kernel-source.patch | 29 +
  ...bian-Enable-SMP-in-userspace-package.patch | 31 +++
  recipes-xenomai/xenomai/xenomai.inc   | 10 ++
  recipes-xenomai/xenomai/xenomai_3.0.9.bb  | 18 +++
  recipes-xenomai/xenomai/xenomai_master.bb | 19 
  recipes-xenomai/xenomai/xenomai_next.bb   | 10 ++
  recipes-xenomai/xenomai/xenomai_stable.bb | 22 +
  8 files changed, 133 insertions(+), 8 deletions(-)
  create mode 100644 
recipes-xenomai/xenomai/files/0001-debian-Add-config-folder-to-xenomai-kernel-source.patch
  create mode 100644 
recipes-xenomai/xenomai/files/0001-debian-Enable-SMP-in-userspace-package.patch
  create mode 100644 recipes-xenomai/xenomai/xenomai_3.0.9.bb
  create mode 100644 recipes-xenomai/xenomai/xenomai_master.bb
  create mode 100644 recipes-xenomai/xenomai/xenomai_stable.bb

diff --git a/kas.yml b/kas.yml
index 3694bcc..2bf62d4 100644
--- a/kas.yml
+++ b/kas.yml
@@ -35,3 +35,5 @@ local_conf_header:
  CONF_VERSION = "1"
cross: |
  ISAR_CROSS_COMPILE = "1"
+  xenomai-version: |
+PREFERRED_VERSION_xenomai = "stable"
diff --git 
a/recipes-xenomai/xenomai/files/0001-debian-Add-config-folder-to-xenomai-kernel-source.patch
 
b/recipes-xenomai/xenomai/files/0001-debian-Add-config-folder-to-xenomai-kernel-source.patch
new file mode 100644
index 000..3be4fb3
--- /dev/null
+++ 
b/recipes-xenomai/xenomai/files/0001-debian-Add-config-folder-to-xenomai-kernel-source.patch
@@ -0,0 +1,29 @@
+From 07d87b9b2ca45f81024056720b28f6cdbcb3b9c7 Mon Sep 17 00:00:00 2001
+From: Jan Kiszka 
+Date: Tue, 6 Nov 2018 13:37:21 +0100
+Subject: [PATCH] debian: Add config folder to xenomai-kernel-source
+
+Meanwhile required for prepare-kernel.sh.
+
+Signed-off-by: Jan Kiszka 
+Signed-off-by: Quirin Gylstorff 
+---
+ debian/rules | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/debian/rules b/debian/rules
+index 8b871a488..99ed8982c 100755
+--- a/debian/rules
 b/debian/rules
+@@ -73,7 +73,7 @@ install: build
+   cp debian/libxenomai1.lintian 
$(CURDIR)/debian/libxenomai1/usr/share/lintian/overrides/libxenomai1
+   cp debian/libxenomai-dev.lintian 
$(CURDIR)/debian/libxenomai-dev/usr/share/lintian/overrides/libxenomai-dev
+   mkdir -p 
$(CURDIR)/debian/xenomai-kernel-source/usr/src/xenomai-kernel-source 
$(CURDIR)/debian/xenomai-kernel-source/usr/share/doc/xenomai-kernel-source
+-  cp -a kernel include scripts 
$(CURDIR)/debian/xenomai-kernel-source/usr/src/xenomai-kernel-source
++  cp -a config kernel include scripts 
$(CURDIR)/debian/xenomai-kernel-source/usr/src/xenomai-kernel-source
+
+ # Build architecture-independent files here.
+ binary-indep: build install
+--
+2.20.1
+
diff --git 
a/recipes-xenomai/xenomai/files/0001-debian-Enable-SMP-in-userspace-package.patch
 
b/recipes-xenomai/xenomai/files/0001-debian-Enable-SMP-in-userspace-package.patch
new file mode 100644
index 000..6a63a92
--- /dev/null
+++ 
b/recipes-xenomai/xenomai/files/0001-debian-Enable-SMP-in-userspace-package.patch
@@ -0,0 +1,31 @@
+From a4ec3f654a4be50aaf268c3a540e8b110ad2ded3 Mon Sep 17 00:00:00 2001
+From: Jan Kiszka 
+Date: Tue, 6 Nov 2018 18:59:47 +0100
+Subject: [PATCH] debian: Enable SMP in userspace package
+
+Hard to find a UP target these days, and we definitely want to be
+generic with Debian packages.
+
+Signed-off-by: Jan Kiszka 
+Signed-off-by: Quirin Gylstorff 
+---
+ debian/rules | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/debian/rules b/debian/rules
+index 99ed8982c..883ae3ed8 100755
+--- a/debian/rules
 b/debian/rules
+@@ -16,7 +16,8 @@ DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture 
-qDEB_BUILD_GNU_TYPE)
+ CONFIG_OPTS = --prefix=/usr \
+ --includedir=/usr/include/xenomai \
+ --mandir=/usr/share/man \
+-  --with-testdir=/usr/lib/xenomai/testsuite
++--with-testdir=/usr/lib/xenomai/testsuite \
++--enable-smp
+
+ ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+   CONFIG_OPTS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+--
+2.20.1
+
diff --git a/recipes-xenomai/xenomai/xenomai.inc 
b/recipes-xenomai/xenomai/xenomai.inc
index 

Re: [PATCH] debian/rules: dh_strip exclude smokey

2019-08-14 Thread Jan Kiszka via Xenomai

On 13.08.19 18:56, Q. Gylstorff wrote:

From: Quirin Gylstorff 

To execute the smokey testsuite it is necessary to hold debug dbg
symbols to test gdb. Debian normally strips all debug symbols from
all build results. Exclude all components containing smokey from
stripping.

Signed-off-by: Quirin Gylstorff 
---
  debian/rules | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 883ae3ed8..3d5729c22 100755
--- a/debian/rules
+++ b/debian/rules
@@ -102,7 +102,7 @@ binary-arch: build install
dh_installdocs -s -A README
dh_link -s
dh_installchangelogs -s
-   dh_strip -s
+   dh_strip -s --exclude=smokey
dh_compress -s
dh_fixperms -s
dh_makeshlibs -s



Applied to next.

Thanks,
Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux



Xenomai - RTNet - patch error

2019-08-14 Thread Laurentiu-Cristian Duca via Xenomai
Hello xenomai community,

  I am an open source enthusiast interested in Xenomai and RTNet.
I have the RTNet modules successfully installed on BeagleBone black
and now I want to install RTNet on qemu-system-x86_64
in order to do more tests with bbb and x86_64.

  I have tried to compile the project
https://github.com/jan-kiszka/xenomai-images
with the command
kas-docker --isar build kas.yml:board-qemu-amd64.yml
and it returns the below copied error.
Do you have any ideas how to get over it? Maybe to transform it into an warning,
or by automatically/manually answer  to patch anyway.

ERROR: xenomai--next-r0 do_patch: patching failed
ERROR: xenomai--next-r0 do_patch: Function failed: do_patch
ERROR: Logfile of failure stored in:
/work/build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/temp/log.do_patch.123
ERROR: Task (/repo/recipes-xenomai/xenomai/xenomai_next.bb:do_patch)
failed with exit code '1'
NOTE: Tasks Summary: Attempted 46 tasks of which 45 didn't need to be
rerun and 1 failed.

Summary: 1 task failed:
  /repo/recipes-xenomai/xenomai/xenomai_next.bb:do_patch
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

$ cat build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/temp/log.do_patch
DEBUG: Executing python function do_patch
DEBUG: Fetcher accessed the network with the command git -c
core.fsyncobjectfiles=0 ls-remote
https://gitlab.denx.de/Xenomai/xenomai.git
DEBUG: Running export PSEUDO_DISABLED=1; export
GIT_PROXY_COMMAND="oe-git-proxy"; export NO_PROXY="*"; export
PATH="/work/isar/bitbake/bin:/work/isar/scripts:/usr/sbin:/usr/bin:/sbin:/bin";
export HOME="/tmp/tmp89g2x4r8"; git -c core.fsyncobjectfiles=0
ls-remote https://gitlab.denx.de/Xenomai/xenomai.git
NOTE: patch --no-backup-if-mismatch -p 1 --directory
/work/build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/git
--input 
/work/build/tmp/work/xenomai-demo-amd64/xenomai--next-r0/0001-debian-Add-config-folder-to-xenomai-kernel-source.patch
patching file debian/rules

Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file debian/rules.rej
ERROR: patching failed
DEBUG: Python function do_patch finished
ERROR: Function failed: do_patch


Thank you and kind regards,
L-C. Duca



Re: [xenomai-images] smokey with qemu-arm and qemu-arm64 stalls gdb test

2019-08-14 Thread Jan Kiszka via Xenomai

On 14.08.19 12:21, Quirin Gylstorff wrote:



On 8/14/19 11:46 AM, Jan Kiszka wrote:

On 14.08.19 10:02, Quirin Gylstorff wrote:

Hi,

I tested smokey with qemu-amd64, qemu-arm and qemu-arm64 from xenomai-images 
with the dh_strip patch active against master and had following results:

qemu-amd64 - smokey run
qemu-arm and qemu-arm64 stall with the attached output.

Kind regards,
Quirin


Which kernel version(s) are showing this issue on arm[64]?



On arm:
Linux demo 4.14.85+ #1 SMP Tue Aug 13 16:57:48 UTC 2019 armv7l GNU/Linux


We need ipipe-core-4.14.96-arm-6 at least.


On arm64:
Linux demo 4.14.78+ #1 SMP PREEMPT Wed Aug 14 07:11:31 UTC 2019 aarch64 
GNU/Linux



Yeah, and we still need patches for arm64 in fact, analogously to 
https://gitlab.denx.de/Xenomai/ipipe-arm/commit/d36ce64b54b9f763fc337e70ebb313fba63f944a.


Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux



Re: [xenomai-images] smokey with qemu-arm and qemu-arm64 stalls gdb test

2019-08-14 Thread Quirin Gylstorff via Xenomai




On 8/14/19 11:46 AM, Jan Kiszka wrote:

On 14.08.19 10:02, Quirin Gylstorff wrote:

Hi,

I tested smokey with qemu-amd64, qemu-arm and qemu-arm64 from 
xenomai-images with the dh_strip patch active against master and had 
following results:

qemu-amd64 - smokey run
qemu-arm and qemu-arm64 stall with the attached output.

Kind regards,
Quirin


Which kernel version(s) are showing this issue on arm[64]?



On arm:
Linux demo 4.14.85+ #1 SMP Tue Aug 13 16:57:48 UTC 2019 armv7l GNU/Linux
On arm64:
Linux demo 4.14.78+ #1 SMP PREEMPT Wed Aug 14 07:11:31 UTC 2019 aarch64 
GNU/Linux


Quirin



Re: [xenomai-images] smokey with qemu-arm and qemu-arm64 stalls gdb test

2019-08-14 Thread Jan Kiszka via Xenomai

On 14.08.19 10:02, Quirin Gylstorff wrote:

Hi,

I tested smokey with qemu-amd64, qemu-arm and qemu-arm64 from xenomai-images 
with the dh_strip patch active against master and had following results:

qemu-amd64 - smokey run
qemu-arm and qemu-arm64 stall with the attached output.

Kind regards,
Quirin


Which kernel version(s) are showing this issue on arm[64]?

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux



[xenomai-images] smokey with qemu-arm and qemu-arm64 stalls gdb test

2019-08-14 Thread Quirin Gylstorff via Xenomai

Hi,

I tested smokey with qemu-amd64, qemu-arm and qemu-arm64 from 
xenomai-images with the dh_strip patch active against master and had 
following results:

qemu-amd64 - smokey run
qemu-arm and qemu-arm64 stall with the attached output.

Kind regards,
Quirin
-- next part --
root@demo:~# /usr/lib/xenomai/testsuite/smokey --run --verbose=7 --vm
mul: 0x79364d93, shft: 26

signed positive operation: 0x03ff * 10 / 3300
inline calibration: 0x: 133.825 ns, rejected 1/1
inlined llimd: 0x79364d9364d9362f: 29.692 ns, rejected 1/1
inlined llmulshft: 0x79364d92ffe1: 12.006 ns, rejected 19/1
out of line calibration: 0x: 158.547 ns, rejected 3/1
out of line llimd: 0x79364d9364d9362f: 27.067 ns, rejected 9/1
out of line llmulshft: 0x79364d92ffe1: 18.120 ns, rejected 8/1

signed negative operation: 0xfc01 * 10 / 3300
inline calibration: 0x: 137.803 ns, rejected 8/1
inlined llimd: 0x86c9b26c9b26c9d1: 32.240 ns, rejected 2/1
inlined llmulshft: 0x86c9b26d001e: 12.976 ns, rejected 13/1
out of line calibration: 0x: 164.960 ns, rejected 14/1
out of line llimd: 0x86c9b26c9b26c9d1: 21.379 ns, rejected 1/1
out of line llmulshft: 0x86c9b26d001e: 7.305 ns, rejected 11/1
arith OK
bufp skipped (no kernel support)
.. CPU0 is available
.. CPU1 is available
.. CPU2 is available
.. CPU3 is available
no CPU restriction with xenomai.supported_cpus
cpu_affinity skipped (no kernel support)
running for 3 seconds
fpu_stress OK
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib/xenomai/testsuite/smokey...done.
(gdb) Breakpoint 1 at 0xa6bc: file gdb.c, line 168.
(gdb) Starting program: /usr/lib/xenomai/testsuite/smokey --run=4 run_target
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
[New Thread 0xbf247200 (LWP 1548)]
-- next part --
root@demo:~# /usr/lib/xenomai/testsuite/smokey --run --vm --verbose=7
mul: 0x79364d93, shft: 26
integ: 30, frac: 0x4d9364d9364d9364

signed positive operation: 0x03ff * 10 / 3300
inline calibration: 0x: 152.640 ns, rejected 2/1
inlined llimd: 0x79364d9364d9362f: 924.195 ns, rejected 8/1
inlined llmulshft: 0x79364d92ffe1: 35.678 ns, rejected 7/1
inlined nodiv_llimd: 0x79364d9364d9362f: 36.872 ns, rejected 25/1
out of line calibration: 0x: 203.620 ns, rejected 9/1
out of line llimd: 0x79364d9364d9362f: 866.105 ns, rejected 6/1
out of line llmulshft: 0x79364d92ffe1: 21.792 ns, rejected 3/1
out of line nodiv_llimd: 0x79364d9364d9362f: 47.353 ns, rejected 5/1

signed negative operation: 0xfc01 * 10 / 3300
inline calibration: 0x: 150.280 ns, rejected 0/1
inlined llimd: 0x86c9b26c9b26c9d1: 791.769 ns, rejected 8/1
inlined llmulshft: 0x86c9b26d001e: 20.446 ns, rejected 6/1
inlined nodiv_llimd: 0x86c9b26c9b26c9d1: 39.472 ns, rejected 5/1
out of line calibration: 0x: 202.985 ns, rejected 9/1
out of line llimd: 0x86c9b26c9b26c9d1: 931.355 ns, rejected 7/1
out of line llmulshft: 0x86c9b26d001e: 8.812 ns, rejected 11/1
out of line nodiv_llimd: 0x86c9b26c9b26c9d1: 39.187 ns, rejected 18/1

unsigned operation: 0x03ff * 10 / 3300
inline calibration: 0x: 159.776 ns, rejected 11/1
inlined nodiv_ullimd: 0x79364d9364d9362f: 25.969 ns, rejected 7/1
out of line calibration: 0x: 199.057 ns, rejected 7/1
out of line nodiv_ullimd: 0x79364d9364d9362f: 30.038 ns, rejected 8/1
arith OK
bufp skipped (no kernel support)
.. CPU0 is available
.. CPU1 is available
.. CPU2 is available
.. CPU3 is available
no CPU restriction with xenomai.supported_cpus
cpu_affinity skipped (no kernel support)
running for 3 seconds
fpu_stress OK
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the