Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Which kernel?

Mon Sep 11, 2017 1:14 pm

It seems Debian (and hence RPi) will be sticking with kernel 4.9 for foreseeable future.

There's one really nice feature in 4.10, patch for (sdcard) writebacks. Basically what this does is throttle the writes so that filesystem operations on a slow block device (sdcard) will not pile up on a long queue and essentially stop the OS from functioning properly. Being able to use chrome while apt is doing it's stuff? No, not science fiction!

4.12 adds BFQ scheduler that should further help with filesystem I/O.

Now 4.13 is brand shiny new but would it make more sense to stick with 4.12 that has been patched already several times (now at sublevel 11)..

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23366
Joined: Sat Jul 30, 2011 7:41 pm

Re: Which kernel?

Mon Sep 11, 2017 1:27 pm

We generally stick with LTS kernels, so 4.14 will be the next one I suspect. This is currently under development, so we will probably be using it internally fairly soon. When that appears in the wild I don't know - no schedule.

I'm using 4.12/3 from our github branch, works fine for me. Fairly easy to build your own.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7140
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Which kernel?

Mon Sep 11, 2017 2:05 pm

Statement from the powers that be at kernel.org that 4.14 will be LTS - https://plus.google.com/u/0/+gregkroahh ... mKQJZMVTXG and http://kroah.com/log/blog/2017/09/06/4- ... ts-kernel/

No release candidates as yet, so expect it to be a few more weeks away.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Re: Which kernel?

Mon Sep 11, 2017 2:24 pm

Well, I went with 4.12.

This is actually for (internal) production use so I'm creating an sdcard which will be cloned to all new pis' we use for RnD purposes. It just seemed that 4.12 with it's bugfixes is probably safer than 4.13 which has not been patched at all yet.

Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Re: Which kernel?

Tue Sep 19, 2017 12:02 pm

Looks like the kernels above 4.9.y are not really fully functional.. I had 4.12.y compiled and booting ok but I noticed bluetooth and wifi do not work, also the desktop menubar would freeze after a bit.

So better to use 4.9.y and patch whatever extra functionality you're after.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7140
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Which kernel?

Tue Sep 19, 2017 12:43 pm

Ollittm wrote:
Tue Sep 19, 2017 12:02 pm
Looks like the kernels above 4.9.y are not really fully functional.. I had 4.12.y compiled and booting ok but I noticed bluetooth and wifi do not work, also the desktop menubar would freeze after a bit.
Curious as jamesh has 4.13.0 running here and quite happily connecting to wifi. IIRC Either OpenElec or LibreElec tend to run the absolute latest kernel and would be screaming if wifi was really that broken.

You've checked out the kernel from https://github.com/raspberrypi/linux/ and built it according to the instructions at https://www.raspberrypi.org/documentati ... uilding.md ?
What does "uname -a" give you?

If you're only after trivial changes then cherry-picking is generally easier, but dependencies can often get you.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Re: Which kernel?

Tue Sep 19, 2017 1:38 pm

6by9 wrote:
Ollittm wrote:
Tue Sep 19, 2017 12:02 pm
Looks like the kernels above 4.9.y are not really fully functional.. I had 4.12.y compiled and booting ok but I noticed bluetooth and wifi do not work, also the desktop menubar would freeze after a bit.
Curious as jamesh has 4.13.0 running here and quite happily connecting to wifi. IIRC Either OpenElec or LibreElec tend to run the absolute latest kernel and would be screaming if wifi was really that broken.

You've checked out the kernel from https://github.com/raspberrypi/linux/ and built it according to the instructions at https://www.raspberrypi.org/documentati ... uilding.md ?
What does "uname -a" give you?

If you're only after trivial changes then cherry-picking is generally easier, but dependencies can often get you.
Yes, that's the instructions I followed except I of course add -b <branchname> to get rpi-4.12.y or rpi-4.13.y branch instead of the rpi-4.9.y branch.

It does look like that it's not working with 4.9.y kernel patched with BFQ and writeback throttling either. So perhaps the BFQ is killing wifi for some reason? It's getting a bit old downloading, patching, compiling, testing, wiping and redoing it like this..

I had at one point no bluetooth or wifi (4.13 kernel) but with the 4.9.y + writeback + bfq patches I have open right now on RDP has no wifi but bluetooth is OK.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7140
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Which kernel?

Tue Sep 19, 2017 1:48 pm

Ollittm wrote:
Tue Sep 19, 2017 1:38 pm
Yes, that's the instructions I followed except I of course add -b <branchname> to get rpi-4.12.y or rpi-4.13.y branch instead of the rpi-4.9.y branch.

It does look like that it's not working with 4.9.y kernel patched with BFQ and writeback throttling either. So perhaps the BFQ is killing wifi for some reason? It's getting a bit old downloading, patching, compiling, testing, wiping and redoing it like this..

I had at one point no bluetooth or wifi (4.13 kernel) but with the 4.9.y + writeback + bfq patches I have open right now on RDP has no wifi but bluetooth is OK.
Sorry, can't really help you with BFQ or writeback - I have no ideas what they're trying to achieve.

If you're doing more than a couple of rebuilds then look at NFS mounting the Pi root directory from your build machine. The build sequence then ends with doing a local copy of all the modules, pushing kernel7.img to the Pi (using scp if networking is working), and rebooting.
Look at the "Set up NFS root" section of https://www.raspberrypi.org/documentati ... utorial.md, although I cheat and use a "cp -a" from a working SD card rather than copying off the local running machine and resetting SSH keys etc.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Re: Which kernel?

Tue Sep 19, 2017 2:04 pm

6by9 wrote:
Tue Sep 19, 2017 1:48 pm
Ollittm wrote:
Tue Sep 19, 2017 1:38 pm
Yes, that's the instructions I followed except I of course add -b <branchname> to get rpi-4.12.y or rpi-4.13.y branch instead of the rpi-4.9.y branch.

It does look like that it's not working with 4.9.y kernel patched with BFQ and writeback throttling either. So perhaps the BFQ is killing wifi for some reason? It's getting a bit old downloading, patching, compiling, testing, wiping and redoing it like this..

I had at one point no bluetooth or wifi (4.13 kernel) but with the 4.9.y + writeback + bfq patches I have open right now on RDP has no wifi but bluetooth is OK.
Sorry, can't really help you with BFQ or writeback - I have no ideas what they're trying to achieve.

If you're doing more than a couple of rebuilds then look at NFS mounting the Pi root directory from your build machine. The build sequence then ends with doing a local copy of all the modules, pushing kernel7.img to the Pi (using scp if networking is working), and rebooting.
Look at the "Set up NFS root" section of https://www.raspberrypi.org/documentati ... utorial.md, although I cheat and use a "cp -a" from a working SD card rather than copying off the local running machine and resetting SSH keys etc.
I'm actually not copying files directly to sdcard but copying them into a temporary folder (~/kernel/boot and ~/kernel/ext4) and making my own tarballs for /boot and /
The I extract the tarball to the sdcard. This is supposed to be a reusable kernel package after all so hence the tarball.

I wonder if make bcm2709_defconfig actually does create valid "default config" for >4.9.y kernels. Also I wonder if I'm not supposed to patch in the couple of thousands of patches 4.9.y has that the newer kernel versions do not.

BFQ is io scheduler and writeback throttling throttles background writes so they don't fill IO buffer. Former is in kernel 4.12 and the latter in 4.10 but patches exist for 4.9

Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Re: Which kernel?

Tue Sep 19, 2017 2:23 pm

With regards to uname, right now
2017-09-19-152015_1920x1080_scrot.png
2017-09-19-152015_1920x1080_scrot.png (41.34 KiB) Viewed 2075 times

Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Re: Which kernel?

Tue Sep 19, 2017 3:15 pm

A-ha! dmesg actually shows the brcmfmac croaks. Too bad I don't know how to fix it :-\

Code: Select all

[    2.772358] systemd[1]: Starting Remote File Systems (Pre).
[    2.975170] fuse init (API version 7.26)
[    3.006400] i2c /dev entries driver
[    3.252127] systemd-udevd[121]: starting version 215
[    4.100458] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    4.145403] usbcore: registered new interface driver brcmfmac
[    4.148128] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.bin failed with error -2
[    4.609743] systemd-journald[114]: Received request to flush runtime journal from PID 1
[    5.201089] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
[    5.868876] uart-pl011 3f201000.serial: no DMA platform data
[    6.035169] Bluetooth: Core ver 2.22
[    6.035219] NET: Registered protocol family 31
[    6.035222] Bluetooth: HCI device and connection manager initialized
[    6.035234] Bluetooth: HCI socket layer initialized
[    6.035241] Bluetooth: L2CAP socket layer initialized
[    6.035258] Bluetooth: SCO socket layer initialized
[    6.054396] Bluetooth: HCI UART driver ver 2.3

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7140
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Which kernel?

Tue Sep 19, 2017 3:17 pm

Ollittm wrote:
Tue Sep 19, 2017 2:04 pm
I wonder if make bcm2709_defconfig actually does create valid "default config" for >4.9.y kernels. Also I wonder if I'm not supposed to patch in the couple of thousands of patches 4.9.y has that the newer kernel versions do not.
bcm2709_defconfig does create a valid build, so I suspect that it is pulling thousands of patches forward that is your problem. This is why LTS is such a significant thing - security fixes will be back ported to LTS branches.
Ollittm wrote:BFQ is io scheduler and writeback throttling throttles background writes so they don't fill IO buffer. Former is in kernel 4.12 and the latter in 4.10 but patches exist for 4.9
TBH I'd take 4.13 then as it should have all the fixes that have been backported to 4.9 and AIUI will keep being updated until 4.14 is released (probably about 6 weeks time). Build the clean tree, test it, then enable any extra magic you want and test that. At least that way you know whether the failure is in the base tree or with your changes. There shouldn't need to be any patches applied if the functionality you want was released in 4.12.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7140
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Which kernel?

Tue Sep 19, 2017 3:18 pm

Ollittm wrote:
Tue Sep 19, 2017 3:15 pm
A-ha! dmesg actually shows the brcmfmac croaks. Too bad I don't know how to fix it :-\

Code: Select all

[    2.772358] systemd[1]: Starting Remote File Systems (Pre).
[    2.975170] fuse init (API version 7.26)
[    3.006400] i2c /dev entries driver
[    3.252127] systemd-udevd[121]: starting version 215
[    4.100458] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    4.145403] usbcore: registered new interface driver brcmfmac
[    4.148128] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.bin failed with error -2
[    4.609743] systemd-journald[114]: Received request to flush runtime journal from PID 1
[    5.201089] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
[    5.868876] uart-pl011 3f201000.serial: no DMA platform data
[    6.035169] Bluetooth: Core ver 2.22
[    6.035219] NET: Registered protocol family 31
[    6.035222] Bluetooth: HCI device and connection manager initialized
[    6.035234] Bluetooth: HCI socket layer initialized
[    6.035241] Bluetooth: L2CAP socket layer initialized
[    6.035258] Bluetooth: SCO socket layer initialized
[    6.054396] Bluetooth: HCI UART driver ver 2.3
Check for the firmware in /lib/firmware/brcm.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Re: Which kernel?

Tue Sep 19, 2017 4:01 pm

6by9 wrote:
Tue Sep 19, 2017 3:17 pm
Ollittm wrote:
Tue Sep 19, 2017 2:04 pm
I wonder if make bcm2709_defconfig actually does create valid "default config" for >4.9.y kernels. Also I wonder if I'm not supposed to patch in the couple of thousands of patches 4.9.y has that the newer kernel versions do not.
bcm2709_defconfig does create a valid build, so I suspect that it is pulling thousands of patches forward that is your problem. This is why LTS is such a significant thing - security fixes will be back ported to LTS branches.
Ollittm wrote:BFQ is io scheduler and writeback throttling throttles background writes so they don't fill IO buffer. Former is in kernel 4.12 and the latter in 4.10 but patches exist for 4.9
TBH I'd take 4.13 then as it should have all the fixes that have been backported to 4.9 and AIUI will keep being updated until 4.14 is released (probably about 6 weeks time). Build the clean tree, test it, then enable any extra magic you want and test that. At least that way you know whether the failure is in the base tree or with your changes. There shouldn't need to be any patches applied if the functionality you want was released in 4.12.
I haven't done any manual patching for the 4.13 kernel I have in the RPi right now or pulling commits from 4.9.y. I killed linux directory, pulled fresh copy of git clone -b rpi-4.13.y https://foo/bar and did the stuff in the kernel compilation guide. Only thing I did differently was to go to menuconfig and enable that writeback throttling thing.

/lib/firmware/brcm does not exist.. in fact the entire filesystem doesn't have "brcmfmac43430-sdio.bin". And, yeah, the laptop where I built the kernel doesn't have that in the $INSTALL_MOD_PATH either. That box does have this file thought but, no, not compiled today before you ask..

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23366
Joined: Sat Jul 30, 2011 7:41 pm

Re: Which kernel?

Tue Sep 19, 2017 4:15 pm

Not sure why you are seeing problems. I run a standard 4.13 and "it just works".

You are ensuring all the modules are copied across? The modules need to match the kernel build.

Clone a new tree. Follow the build instruction, don't make any changes to the Pi config. Put on SD card. Does that work?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Re: Which kernel?

Tue Sep 19, 2017 5:02 pm

jamesh wrote:
Tue Sep 19, 2017 4:15 pm
Not sure why you are seeing problems. I run a standard 4.13 and "it just works".

You are ensuring all the modules are copied across? The modules need to match the kernel build.

Clone a new tree. Follow the build instruction, don't make any changes to the Pi config. Put on SD card. Does that work?
I partially figured this out. It seems I managed to kill the entire /lib/firmware folder in the RPi I was working with at some point and the kernel compilation result does have half of the stuff.

I have several other raspberrys so pushing the 4.13.2 kernel to another "box" resulted in a working wifi. However now the bluetooth does not work... I guess that's less of a problem really.

Ollittm
Posts: 32
Joined: Wed Mar 02, 2016 9:07 am

Re: Which kernel?

Tue Sep 19, 2017 5:34 pm

I restored the firmware folder from another RPi, cloned 4.9.y, applied the bfq and throttling patches plus did compilation and installation. The result is fully working RPi. Yay.

Even the BFQ scheduler is working unlike with the 4.1x MQ version.

Return to “Advanced users”