dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5171
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Linux kernel is now 4.1

Thu Aug 06, 2015 4:59 pm

The default firmware branch has been updated to use the 4.1 kernel.
The source tree has been available for a few months and is being used by OpenELEC and OSMC amongst others.

Update with:

Code: Select all

sudo rpi-update
Ideally nothing much will change. The newer kernel tree does support more devices (e.g. USB devices like wifi and dvb).

Please report if there are any regressions compared to the 4.0 kernel. If testing is positive it will appear in "apt-get upgrade" and on new raspbian images in the near future.

The default source tree on https://github.com/raspberrypi/linux is now rpi-4.1.y. This tree is now considered the stable kernel source tree and will merge in minor bumps to the kernel version, rather than rebase.
There is now a 4.2 kernel tree where more experimental kernel commits may go (in general moving closer to upstream).

User avatar
joan
Posts: 13612
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Linux kernel is now 4.1

Thu Aug 06, 2015 5:47 pm

Something appears to have changed in the VC mailbox area.

My pigpio daemon fails to initialise.

It falls over when attempting to open the mailbox file even though the file exists.

#define MB_DEV "/dev/pigpio-mb"

mknod(MB_DEV, S_IFCHR|0600, makedev(MB_DEV_MAJOR, 0));

gives

crw------- 1 root root 100, 0 Aug 6 17:37 /dev/pigpio-mb

open(MB_DEV, 0)

gives

mbox open failed(No such device or address)

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5171
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Linux kernel is now 4.1

Thu Aug 06, 2015 6:47 pm

You should really be using:
ls -l /dev/vcio
crw-rw---T 1 root video 249, 0 Jan 1 1970 /dev/vcio

which recent kernels should create and udev rule give correct permissions to:
/lib/udev/rules.d/10-local-rpi.rules

User avatar
joan
Posts: 13612
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Linux kernel is now 4.1

Thu Aug 06, 2015 6:56 pm

dom wrote:You should really be using:
ls -l /dev/vcio
crw-rw---T 1 root video 249, 0 Jan 1 1970 /dev/vcio

which recent kernels should create and udev rule give correct permissions to:
/lib/udev/rules.d/10-local-rpi.rules
Off the top of your head do you know how recent the kernel needs to be? Some people haven't updated for years, so I'm wondering how much that change would break.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5171
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Linux kernel is now 4.1

Thu Aug 06, 2015 6:59 pm

Was added to 3.18 tree:

Code: Select all

commit c799e6e411861187d16cd88676a91d1ad37c28cf
Author: android <[email protected]>
Date:   Mon Aug 25 13:18:21 2014 +0100

    BCM2708_VCIO : Add automatic creation of device node
You could test if /dev/vcio works and fall back to your existing node creation if you want to be sure.

Not sure yet why your node creation doesn't work with new kernel. I'll have a look tomorrow. We are now using the upstream mailbox driver.

User avatar
joan
Posts: 13612
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Linux kernel is now 4.1

Thu Aug 06, 2015 7:09 pm

dom wrote:Was added to 3.18 tree:
...
You could test if /dev/vcio works and fall back to your existing node creation if you want to be sure.
...
Thanks. Yes, that is what I will do.

Edited to add.

As expected the above works.

Until I update pigpio you'll have to use page map allocation of DMA in kernel 4.1. To do that use the -a option to pigpiod.

sudo pigpiod -a1 # allocate DMA memory using page map rather than mailbox

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5171
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Linux kernel is now 4.1

Fri Aug 07, 2015 10:57 am

I suspect changing:

Code: Select all

#define MB_DEV_MAJOR 100
to

Code: Select all

#define MB_DEV_MAJOR 249
would make your node creation work with the new kernel.
You still want 100 in the fallback case, and you don't need to create it with a recent kernel, so that's just academic, but explains the issue.

A little annoying that it's changed, but I think we do want to use the upstream's node number, as that has presumable been officially allocated.

User avatar
joan
Posts: 13612
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Linux kernel is now 4.1

Fri Aug 07, 2015 11:11 am

dom wrote:I suspect changing:

Code: Select all

#define MB_DEV_MAJOR 100
to

Code: Select all

#define MB_DEV_MAJOR 249
would make your node creation work with the new kernel.
You still want 100 in the fallback case, and you don't need to create it with a recent kernel, so that's just academic, but explains the issue.

A little annoying that it's changed, but I think we do want to use the upstream's node number, as that has presumable been officially allocated.
Thanks. Yes, I can see that would explain the behaviour. I'll just leave the code as it now is, i.e. try /dev/vcio and failing that create a node as before with 100.

sbp
Posts: 128
Joined: Wed Sep 26, 2012 7:54 pm

Re: Linux kernel is now 4.1

Sun Aug 09, 2015 8:19 am

Hi

I would like to build a new kernel and modules based on the 4.1.y.

In order to do so I would like to know if your standard kernel which you provide are build on the bcm2835_defconfig or you are using the bcm2709_defconfig.

Thanks
Steen
piCorePlayer webpage: https://sites.google.com/site/picoreplayer/home

feverish
Posts: 486
Joined: Wed Jun 27, 2012 2:29 pm

Re: Linux kernel is now 4.1

Sun Aug 09, 2015 9:22 am

This expert diver into a pool of ignorance did the upgrade without the tedious necessity of advance comprehension. Everything I have checked since works. Raspi continues to be the spice of life. Salaams to all those who understood what was happening.
If discrimination is not challenged then we are effectively in collusion with the perpetrators of such behaviour:-Oxford dictionaries

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5171
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Linux kernel is now 4.1

Sun Aug 09, 2015 4:50 pm

sbp wrote: In order to do so I would like to know if your standard kernel which you provide are build on the bcm2835_defconfig or you are using the bcm2709_defconfig.
For p1 use bcmrpi_defconfig and for pi2 use bcm2709_defconfig.

bcm2835_defconfig is the upstream kernel config which isn't very usable on the Pi.

jarif
Posts: 7
Joined: Tue Nov 11, 2014 7:10 pm

Re: Linux kernel is now 4.1

Sun Aug 09, 2015 6:44 pm

Works nicely!

I had to go back from 4.0.7-9+ to vmlinuz-3.19.3-v7+ because vdr and video streaming was not optimal for some reason. Now it works perfect.

Happy camper. :D

jofemodo
Posts: 8
Joined: Tue Aug 04, 2015 4:01 am

Re: Linux kernel is now 4.1

Sun Aug 09, 2015 10:09 pm

Hi!

I just updated from 3.18.14 to 4.1 and I can't change the UART clock. I've tried everything and i can't figure what is the problem.
I've readed this thread viewtopic.php?f=29&t=113753. I've tried the "dtparam=uart0_clkrate=2441000" hack in config.txt, etc.
Nothing! The UART's clock is fixed to 3000000. I'm testing with a Oscilloscope.

My system is a Raspberry Pi 2, with PiTFT and HifiBerry.

My config.txt:

Code: Select all

# HifiBerry driver:
dtoverlay=hifiberry-dacplus

# PiTFT Config
[pi1]
device_tree=bcm2708-rpi-b-plus.dtb
[pi2]
device_tree=bcm2709-rpi-2-b.dtb
[all]
dtparam=spi=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=pitft28r,rotate=90,speed=32000000,fps=20

# Adjust Serial Port Clock to allow MIDI baudrate 31250 
init_uart_clock=2441000
init_uart_baud=38400
#dtparam=uart0_clkrate=2441000
My cmdline.txt:

Code: Select all

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait bcm2708.uart_clock=3000000 fbcon=map:10 fbcon=font:VGA8x8
Because I need to use the UART as MIDI port, I've returned to 3.18.14, but i would like to change to 4.1 when the problem is solved.

Thank you!

gadgetoid
Posts: 152
Joined: Wed Mar 07, 2012 9:58 pm

Re: Linux kernel is now 4.1

Mon Aug 24, 2015 3:01 pm

@joan I don't know if it's related, but I'm also now having woes with the Mailbox and the slightly funky way it's used to drive ws281x pixels on the Raspberry Pi- the ws281x library seems to have conked out. It can apparently create a device at /tmp/mailbox-XXXX but not read it.

https://github.com/jgarff/rpi_ws281x/issues/41

User avatar
joan
Posts: 13612
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Linux kernel is now 4.1

Mon Aug 24, 2015 3:11 pm

gadgetoid wrote:@joan I don't know if it's related, but I'm also now having woes with the Mailbox and the slightly funky way it's used to drive ws281x pixels on the Raspberry Pi- the ws281x library seems to have conked out. It can apparently create a device at /tmp/mailbox-XXXX but not read it.

https://github.com/jgarff/rpi_ws281x/issues/41
It will be the same problem. This snippet shows what I currently do. I try /dev/vcio and if that fails fall-back to the earlier method.

Code: Select all

/*
https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface
*/
#define MB_DEV_MAJOR 100

#define MB_IOCTL _IOWR(MB_DEV_MAJOR, 0, char *)

#define MB_DEV1 "/dev/vcio"
#define MB_DEV2 "/dev/pigpio-mb"

static int mbCreate(char *dev)
{
   /* <0 error */

   unlink(dev);

   return mknod(dev, S_IFCHR|0600, makedev(MB_DEV_MAJOR, 0));
}

static int mbOpen(void)
{
   /* <0 error */

   int fd;

   fd = open(MB_DEV1, 0);

   if (fd < 0)
   {
      mbCreate(MB_DEV2);
      fd = open(MB_DEV2, 0);
   }
   return fd;
}

static void mbClose(int fd)
{
   close(fd);
}

gadgetoid
Posts: 152
Joined: Wed Mar 07, 2012 9:58 pm

Re: Linux kernel is now 4.1

Mon Aug 24, 2015 3:51 pm

You're a flippin' legend. That worked a treat. I didn't understand the implications of using /dev/vcio beforehand, but it seems to work. I'll compile the Python bindings and see how it fares.

Relevant commit here, a little messy at the moment since I commented out a bunch of seemingly irrelevant calls to "unlink": https://github.com/pimoroni/unicorn-hat ... d90dc3d7a7

brchiu
Posts: 1
Joined: Wed Sep 09, 2015 1:27 pm

Re: Linux kernel is now 4.1

Wed Sep 09, 2015 1:37 pm

Hi, All,

I tried to use linux perf utility program to gather some data of my own program,
however, it showed no perf of current linux kernel version installed.
Searching apt-cache gave me no luck, only Linux 3-18 available.

Is there any repository I can get linux-tools-4.1 package ?

Thanks very much !

---------------------------------------------------
[email protected]:~$ perf
/usr/bin/perf: line 24: exec: perf_4.1: not found
E: linux-tools-4.1 is not installed.

[email protected]:~$ apt-cache search linux-tools
linux-tools - Performance analysis tools for Linux (meta-package)
linux-tools-2.6 - Performance analysis tools for Linux (dummy package)
linux-tools-3.10 - Performance analysis tools for Linux 3.10
linux-tools-3.12 - Performance analysis tools for Linux 3.12
linux-tools-3.18 - Performance analysis tools for Linux 3.18
linux-tools-3.2 - Performance analysis tools for Linux 3.2
linux-tools-3.6 - Performance analysis tools for Linux 3.6

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5171
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Linux kernel is now 4.1

Fri Sep 11, 2015 2:43 pm

brchiu wrote: I tried to use linux perf utility program to gather some data of my own program,
however, it showed no perf of current linux kernel version installed.
Searching apt-cache gave me no luck, only Linux 3-18 available.
I think you'll have to build from source as the kernel is newer than the debian repo.

Clone linux repo and then build with something like:

Code: Select all

make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm -C tools/perf/
(assuming you are cross compiling - skip the CROSS_COMPILE if building on Pi).

ilbarone92
Posts: 4
Joined: Fri Oct 23, 2015 10:26 pm

Re: Linux kernel is now 4.1

Fri Oct 23, 2015 10:33 pm

hi everybody,
i'm interested in the same issue!!
i have to run perf tool on my raspberry 1 model b with kernel 4.1.7+
can you confirm that the steps here above worked for you brchiu?
or even u dom can u help me with building perf?
sorry but im new with raspberry and i have to do some profiling on raspberry and ozw for my major thesis!!
if this doesn't work can somebody help me suggesting some profiling tools for raspberry?
somebody told me something bout kprobes but they looks though!!!
thanks a lot for caring,
AM

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5171
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Linux kernel is now 4.1

Sat Oct 24, 2015 5:13 pm

ilbarone92 wrote:hi everybody,
or even u dom can u help me with building perf?
I've just tried the lines I quoted and they still work.
You can try running the perf I built: https://dl.dropboxusercontent.com/u/3669512/temp/perf

ilbarone92
Posts: 4
Joined: Fri Oct 23, 2015 10:26 pm

Re: Linux kernel is now 4.1

Mon Oct 26, 2015 3:18 pm

ok thanks a lot dom!!:D
but i have another question: on raspberry i need to copy just the perf file u llinked me??
i mean, clone the repo was necessary just to build the perf file right?
AM

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5171
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Linux kernel is now 4.1

Mon Oct 26, 2015 4:36 pm

ilbarone92 wrote:ok thanks a lot dom!!:D
but i have another question: on raspberry i need to copy just the perf file u llinked me??
i mean, clone the repo was necessary just to build the perf file right?
AM
Try it. The repo clone is only needed for building, so just running the binary will hopefully work.

ilbarone92
Posts: 4
Joined: Fri Oct 23, 2015 10:26 pm

Re: Linux kernel is now 4.1

Mon Oct 26, 2015 5:59 pm

ok thanks!!
so i just have to copy this binary on my rpi and execute it???
i can copy it everywhere right?
in few hours i will try and tell u the response :D
just one more question, before u linked me the binary perf i tried to cross compile it on my mac but i had

Code: Select all

BUILD:   Doing 'make -j2' parallel build
/bin/sh: arm-linux-gnueabihf-gcc: command not found

Auto-detecting system features:
...                         dwarf: [ OFF ]
...                         glibc: [ OFF ]
...                          gtk2: [ OFF ]
...                      libaudit: [ OFF ]
...                        libbfd: [ OFF ]
...                        libelf: [ OFF ]
...                       libnuma: [ OFF ]
...                       libperl: [ OFF ]
...                     libpython: [ OFF ]
...                      libslang: [ OFF ]
...                     libunwind: [ OFF ]
...            libdw-dwarf-unwind: [ OFF ]
...                          zlib: [ OFF ]
...                          lzma: [ OFF ]

config/Makefile:254: *** No gnu/libc-version.h found, please install glibc-dev[el].  Stop.
make: *** [all] Error 2
MacBook-di-Alessio-Milani:tesi start$ make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm -C linux/tools/perf/
  BUILD:   Doing 'make -j2' parallel build
/bin/sh: arm-linux-gnueabihf-gcc: command not found
config/Makefile:254: *** No gnu/libc-version.h found, please install glibc-dev[el].  Stop.
make: *** [all] Error 2

even if i installed a cross compiler for arm, to be specific this pkg "gcc-linaro-arm-linux-gnueabihf-raspbian-2014.05_mac"!!
can u suggest me where to find a good cross compiler for raspberry?
AM

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5171
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Linux kernel is now 4.1

Tue Oct 27, 2015 10:21 pm

ilbarone92 wrote:even if i installed a cross compiler for arm, to be specific this pkg "gcc-linaro-arm-linux-gnueabihf-raspbian-2014.05_mac"!!
can u suggest me where to find a good cross compiler for raspberry?
AM
From here: https://github.com/raspberrypi/tools/
Use the gcc-linaro-arm-linux-gnueabihf-raspbian-x64 one.

You will only be able to build on linux, but you can do that on a mac. You'll need to install VirtualBox and then install Ubuntu inside it.

ilbarone92
Posts: 4
Joined: Fri Oct 23, 2015 10:26 pm

Re: Linux kernel is now 4.1

Fri Nov 06, 2015 12:03 am

hi again dom,
sorry for delay but i was a bit busy, thanks again for all the suggest but i have still a problem in running perf,
i copied the binary u sent me on RPI but if i try to run perf or just perf list , this is the result:

Code: Select all

perf stat -e open-zwave-control-panel/ozwcp -d -p 11111
/usr/bin/perf: line 24: exec: perf_4.1: not found
E: linux-tools-4.1 is not installed.
[email protected] ~ $ perf list
/usr/bin/perf: line 24: exec: perf_4.1: not found
E: linux-tools-4.1 is not installed.
do u know where can i find linux tools?
maybe have i to compile the https://github.com/torvalds/linux/tree/master/tools link?
can u help me please in some way?
i'd really appreciate!!
thanks a lot in advance,
AM

Return to “Advanced users”