raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
Other
11.18k stars 5.02k forks source link

Updating to 3.8? #225

Closed Ferroin closed 10 years ago

Ferroin commented 11 years ago

Are there any plans to update the tree to Linux 3.8?

There are a number of updates that would be nice to have, especially the stuff in the EXT4 drivers.

While I would be happy to merge the kernel.org mainline into a new branch and submit a pull request, I don't know if there is some special way that people might want it done.

popcornmix commented 11 years ago

Yes, 3.8 is interesting. For me, mostly due to F2FS.

I'd prefer a new branch (e.g. 3.8.y). I'd prefer it to be rebased on remotes/stable/linux-3.8.y, which I don't think is available yet.

There's normally a few gotchas of APIs that have changed, or worse APIs that haven't changed but things that need to be done differently. Finding NEED_MACH_MEMORY_H and NEED_MACH_IO_H took me a long time to find last time....

So, if you can get a 3.8 tree up and running, and fix the gotchas, that would be useful. We can then work out if a PR or some other scheme is best to get it into this repo.

Initially prebuilt firmware with 3.8 will be released to "next" tree until it is deemed stable.

Another question is whether some squashing of commits (particularly dwc_otg and the addition and removal of the 64-bit crypto functions) that produce a lot of conflicts when rebasing is worthwhile.

There's also the question of using mach-bcm2835 as the machine driver, but I accept that's a much harder merge.

(neither of these two point is required for a move to 3.8).

Ferroin commented 11 years ago

I can definitely get started on it.

Currently, it really isn't all that feasible for me to debug built kernels, but I can almost certainly get 3.8 to build without problems.

N8Fear commented 11 years ago

I have 3.8.0 building and booting (at least for me, did the same for 3.7 before). I started from a kernel tarball and ported most stuff from this repo over to it. If you want I could surely help. If you want to take a look my repo is here: git://github.com/N8Fear/rpi-sources.git

Ferroin commented 11 years ago

Thanks, I'd love some help.

This is the first time I've rebased anything, and I just had to start over because I realized halfway thru (at commit 179 of 323) that I had misunderstood the relation between LOCAL, BASE, and HEAD.

@popcornmix Do you have any problem with just starting a new branch based on git://github.com/N8Fear/rpi-sources.git? If not, that would be much easier than a rebase.

popcornmix commented 11 years ago

@Ferroin Unfortunately not. The commit history has to be preserved (for many reasons). One being that commits may be cherry-picked into the upstream kernel.

N8Fear commented 11 years ago

@popcornmix If you can tell me how to start best (clean remotes/stable/linux-3.8.y I presume) and then apply patches on top of that, I can do that. Is there a way to preserve both the commit history of remotes/stable/linux-3.8.y and of this repo?

popcornmix commented 11 years ago

This is how I did one of the early rebases: git clone git@github.com:popcornmix/linux.git git remote add -f stable git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git git rebase --onto v3.2.27 v3.1.9 rpi-patches (fix conflict) git rebase --continue and repeat (you'll get at leats a dozen conflicts)

You'll obviously need to change the tags in the rebase. However this is quite a tricky procedure. You end up fixing the same lines of code multiple times. One reason why squashing commits can make life easier.

It may be more useful to take N8Fear's tree, and give it a good test.

N8Fear commented 11 years ago

I'm about 3/4 through the rebase. Not sure how it will all come together afterwards. I think somewhen tonight I should have a buildable tree, if I don't hit anything major...

N8Fear commented 11 years ago

Hi, it took me a little while longer than expected, but here is my repo with (most likely most of) the commit history: git://github.com/N8Fear/linux.git

To get it build (except for one WLAN driver - still working on that) I had to hack it a bit:

IMPORTANT: CONFIG_RTL8192CU does not build right now - needs fix

Everything should be tested / get a sanity check - with some more time some of the more "hacky" fixes could surly be replaced by something proper...

avesal commented 11 years ago

Hi N8Fear, I've downloaded and compiled kernel using your git, but from usb doesn't boot. I see:" Waiting for root device /dev/sda1". If I use as root my SD card, it boots, but with a lot of errors. Can you post me your .config?

Thanks you for your work

N8Fear commented 11 years ago

I never tried booting from USB, sdcard worked fine for me, though (I just did a quick "testboot" and rebooted to 3.7.9 again afterwards, because there was no grsecpatch for 3.8.0 at that time). IIRC I used bcmrpi_defconfig without CONFIG_RTL8192CU - my normal config wouldn't help you much (as it is with grsec enabled). I'm in the process of getting a grsec enabled 3.8.0 right now, but afterwards I can try to replicate you issues. Maybe you could post some logs so that I can take a look at the errors?

avesal commented 11 years ago

how can I post logs if system doesn't boot? Should I add any string to cmdline.txt? Sorry, but I'm a very newbie.

Maybe the problem of "waiting for root device.." is that kernel loads pendrive after init?

licaon-kter commented 11 years ago

@avesal : did you use a known working .config ? say from your working kernel zcat /proc/config > ~/.config copy it and then use /make oldconfig

N8Fear commented 11 years ago

I was able to boot into 3.8.0. It's running without a serious problem so far. As stated aboce CONFIG_RTL8192CU needs to be disabled to be able to successfully build the kernel and i get an issue with THERMAL_BCM2835 (NULL pointer dereference at boot - seems like the API changed somewhat) - you should disable that one too. I boot from an sd-card so I don't know, if booting from a pendrive works. You said it booted (with errors) from sd-card: you could post that errors and you config - maybe that would give some hints about your problem. Other than that: try what licaon-kter wrote or try bcmrpi_defconfig (and disable the aforementioned two options).

N8Fear commented 11 years ago

The issue with THERMAL_BCM2835 should be fixed (at least the null pointer dereference). I have to check for correct function, though...

avesal commented 11 years ago

@licaon-kter I used this commands:

root # ARCH=arm make bcmrpi_cutdown_defconfig root # ARCH=arm CROSS_COMPILE=/usr/bin/armv6j-hardfloat-linux-gnueabi- make oldconfig root # ARCH=arm CROSS_COMPILE=/usr/bin/armv6j-hardfloat-linux-gnueabi- make -j2

licaon-kter commented 11 years ago

Use a working config extracted like I pointed out.

avesal commented 11 years ago

tryed with zcat /proc/config > ~/.config, but nothing: from usb doesn't boot, from sd card boots.

IMHO, I think it's a kernel problem, not a config problem

licaon-kter commented 11 years ago

what chipset? is the module being build?

N8Fear commented 11 years ago

can you try to add rootdelay= n to your kernel commandline? (n is the delay in seconds the kernel should wait to mount the rootfs). Start with something higher (maybe 15 or the like) and reduce it, if it works with a delay.

popcornmix commented 11 years ago

I can confirm that nfs boot hangs: http://pastebin.com/2yxvaGBB

N8Fear commented 11 years ago

Fixed build of rtl8192cu

N8Fear commented 11 years ago

@popcornmix : I can see an error in the paste - most likely I will have to try different bootdevices myself...

avesal commented 11 years ago

@N8Fear Yes, I've tried rootdelay, but doesn't resolv

kzemek commented 11 years ago

I've backported F2FS to Raspberry's rpi-3.6.y . I completly removed ACL support and had to revert one minor enhancement, both due to being dependent on some newer features, but otherwise everything seems to be working fine (I'm using it as I write). The changes backported are all of the F2FS commits from current git kernel, so it may be a bit newer than what's in current 3.8 . So of course treat this as triple-experimental: one because it's an experimental filesystem, two because it's backported, and three because it may contain changes not yet in stable.

https://github.com/kzemek/rpi-linux

popcornmix commented 11 years ago

@kzemek Have you measured any improvements or degredations in performance with f2fs on Pi?

kzemek commented 11 years ago

Only anecdotal, but I find it to be generally more responsive (which would be consistent with f2fs' features). I'm having a hard time to run actual benchmarks, as I have only one SD to experiment with, and that's the one running "main" system.

licaon-kter commented 11 years ago

Should general f2fs benchmarks apply to Pi as well? 'Cause we have: 160GB INTEL SSDSA2M160: http://www.phoronix.com/scan.php?page=article&item=linux_f2fs_benchmarks&num=1 Patriot LX Series 16GB Class 10 SDHC card: http://www.phoronix.com/scan.php?page=article&item=linux_f2fs_sdhc&num=1 160GB INTEL SSDSA2M160: http://www.phoronix.com/scan.php?page=article&item=linux_38_nilfs2&num=1 as data points ;)

kzemek commented 11 years ago

Sooman Jeong ran some simple benchmarks on an earlier version of F2FS, for a desktop and Galaxy S3: http://lkml.indiana.edu/hypermail/linux/kernel/1210.2/00005.html

licaon-kter commented 11 years ago

And from today: http://www.phoronix.com/scan.php?page=article&item=linux_f2fs_usb3&num=1

avesal commented 11 years ago

@kzemek It's possible backport driver ar5523 to 3.6.11?

popcornmix commented 11 years ago

@N8Fear any luck investigating the NFS boot hang?

N8Fear commented 11 years ago

No - I was stricken down by some kind of illness for the whole week. I guess I'll find time for it tomorrow night.

kzemek commented 11 years ago

@avesal I'll take a look at it once I have time. Rare luxury these days.

popcornmix commented 11 years ago

I've done my own rebase to 3.8.4. Unfortunately it has the same issue as @N8Fear's with the NFS boot hang. https://github.com/raspberrypi/linux/tree/rpi-3.8.y-temp

Did anyone get anywhere with debugging this?

popcornmix commented 11 years ago

dwc_otg.fiq_fix_enable=0 allows the nfs boot to work again. Looks like something has changed in kernel FIQ handling, but this provides a workaround for now.

popcornmix commented 11 years ago

A prebuilt 3.8.4 is available on next tree. It has f2fs support built in, and fiq_fix_enable defaults to off. sudo rpi-update 2c4e92c01ff14d8f3e1ee35b995d430b4e6d1e1b should get you it. Not much testing it but appears to work.

hvenzke commented 11 years ago

I report that prebuilt 3.8.4 works fine on my kingston /sandisk SDHDC/SDHDX 16/32 & 64 G SD cards .

licaon-kter commented 11 years ago

Calibrating delay using timer specific routine.. 2.00 BogoMIPS (lpj=10011) on

Linux raspberrypi 3.8.4+ #406 PREEMPT Mon Apr 8 21:59:50 BST 2013 armv6l GNU/Linux BogoMIPS : 2.00 CONFIG_NO_HZ=y CONFIG_HZ=100 Apr 2 2013 23:03:25 Copyright (c) 2012 Broadcom version 381148 (release)

hvenzke commented 11 years ago

report : Patched rpi-3.8.y-temp up with patch-3.8.4-5 & patch-3.8.5-6 without issues.. if nothing went wrong at compile ,then my 3.8.6 got ready by Tommorrow.

rbej commented 11 years ago

Working fine on OpenElec Rpi.

Popcornmix. Please update to 3.8.6

popcornmix commented 11 years ago

@rbej Note: that the usb fiq is disabled which will probably cost you about 10% in performance. Should have a solution for that soon, but for now xbmc may be a bit slower.

rbej commented 11 years ago

Few fps in menu less than kernel 3.6.11. When i play mkv dts 1080p NFS i dont see any difference. Very stable kernel.

popcornmix commented 11 years ago

@rbej Updated to 3.8.6. Also updated the rtl8192cu wifi driver. It's a rebase so "git pull --rebase" or clean checkout to update source. "next" rpi-update firmware will be pushed soon.

hvenzke commented 11 years ago

nfs & nilfs2 : i see only an few uninitialized und unused warings at my 3.8.6 compile .. maybe harmless. as this been upstream kernel code fix them may not an RPI part..

popcornmix commented 11 years ago

rpi-3.8.y is updated (another rebase). I think I've fixed the gpio crash. Also more tidying.

licaon-kter commented 11 years ago

bogoMIPS still bugged

pi@raspberrypi:~/ > uname -a ; cat /proc/cpuinfo | grep BogoMIPS ; \ zcat /proc/config.gz | grep HZ;vcgencmd version Linux raspberrypi 3.8.6+ #410 PREEMPT Thu Apr 11 17:28:47 BST 2013 armv6l GNU/Linux BogoMIPS : 2.00 CONFIG_NO_HZ=y CONFIG_HZ=100 Apr 11 2013 17:43:15 Copyright (c) 2012 Broadcom version 383188 (release)

rbej commented 11 years ago

Only fixed usb fiq (10% less performance) is important. Yesterday i tested new kernel very carefully and i observe few times buffering and stutters when play mkv dts 1080p movies from NFS. Memory usage is little to high, but is acceptable.

popcornmix commented 11 years ago

@licaon-kter I'm afraid bogomips is correct. They are now 2 on raspberry pi. See these threads: http://comments.gmane.org/gmane.linux.ports.arm.kernel/174598 http://www.spinics.net/lists/sparclinux/msg08550.html

For platforms that use a fixed timer for delays bogomips is now defined to be: TIMER_FREQ/500000. We have TIMER_FREQ=1000000 and so bogomips = 2.

It's certainly going to cause confusion.

licaon-kter commented 11 years ago

@popcornmix: Oh, so I see, I though this might point to some timer issues, but since this the intended behaviour it's OK. 10x for the heads up.