Bug#845422: [PATCH] Please add BCM2835 MMC driver for Raspberry Pi 3

2016-11-23 Thread Michael Stapelberg
Source: linux
Severity: wishlist
Tags: patch

Thank you for your work on maintaining the Linux kernel in Debian, I really
appreciate it!

I am interested in running Debian on the Raspberry Pi 3.

As per https://github.com/anholt/linux/wiki/Raspberry-Pi-3, the mainline Linux
kernel in version 4.8 includes support for the Raspberry Pi 3, so we are in
pretty good shape already.

However, when trying to boot linux-image-4.8.0-1-arm64 version 4.8.5-1, I
noticed that the kernel can’t find any block devices (and hence no root file
system). This is because the bcm2835-sdhost MMC driver has not actually made it
into Linux 4.8; it is still under review:
https://www.spinics.net/lists/arm-kernel/msg513433.html

The driver is based on the work by Phil Elwell (from Raspberry Pi Ltd.), shipped
in https://github.com/raspberrypi/linux, i.e. used by Raspbian and other
distributions. Eric Anholt and Gerd Hoffmann are working upstreaming the driver.

In the meantime, Gerd Hoffmann has included the current patches in his
Raspberry Pi Fedora images; the source of the kernel RPMs can be found at
https://www.kraxel.org/repos/rpi2/kernel-main/kernel-main-4.9-0.4.src.rpm

I have applied these patches as-is to the Debian linux 4.8.5-1 package and can
confirm that the resulting kernel boots on the Raspberry Pi 3 and seems to work
perfectly fine.

Therefore, could you please:

  1. Add the attached patch series to the linux-image-4.8.0-1-arm64 build.
  2. Enable the CONFIG_MMC_BCM2835=y option.

Let me know whether you’d prefer me to squash these patches into a single patch
file. I chose to attach the patch series as-is because that should make it
easier to compare it with upstream and update it (should that become necessary).

It would be brilliant to get this in before the freeze, so that people can soon
run Debian stable on their Raspberry Pi 3s and get security updates :).

Thank you so much!

P.S.: In case you are interested, I am using the following parameters in
config.txt on the FAT32 boot partition to make the Raspberry Pi bootloader load
my kernel:

# Switch the CPU from ARMv7 into ARMv8 (aarch64) mode
arm_control=0x200

# From /usr/lib/linux-image-4.8.0-1-arm64/broadcom/bcm2837-rpi-3-b.dtb
device_tree=bcm2837-rpi-3-b.dtb

kernel=vmlinuz-4.8.0-1-arm64

# For details on the initramfs directive, see
# https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=10532
initramfs initrd.img-4.8.0-1-arm64

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armel, mipsel

Kernel: Linux 4.6.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
>From 48ec9c44ea4d650d0d673c3a9df918152007e8e7 Mon Sep 17 00:00:00 2001
From: Eric Anholt 
Date: Mon, 22 Feb 2016 12:44:55 -0800
Subject: [PATCH 23/43] mmc: bcm2835-sdhost: Add new driver for the internal SD
 controller.

The 2835 has two SD controllers: The Arasan SDHCI controller that we
currently use, and a custom SD controller.  The custom one runs faster

The code was originally written by Phil Elwell in the downstream
Rasbperry Pi tree, and I did a major cleanup on it (+319, -707 lines
out of the original 2055) for inclusion.

Signed-off-by: Eric Anholt 
---
 drivers/mmc/host/Kconfig  |9 +
 drivers/mmc/host/Makefile |1 +
 drivers/mmc/host/bcm2835-sdhost.c | 1666 +
 3 files changed, 1676 insertions(+)
 create mode 100644 drivers/mmc/host/bcm2835-sdhost.c

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 5274f50..e928160 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -769,6 +769,15 @@ config MMC_TOSHIBA_PCI
 	depends on PCI
 	help
 
+config MMC_BCM2835_SDHOST
+	tristate "platform support for the BCM2835 SDHOST MMC Controller"
+	depends on ARCH_BCM2835 || COMPILE_TEST
+	help
+	  This selects the BCM2835 SDHOST MMC controller. If you have a BCM2835
+	  platform with SD or MMC devices, say Y or M here.
+
+	  If unsure, say N.
+
 config MMC_MTK
 	tristate "MediaTek SD/MMC Card Interface support"
 	depends on HAS_DMA
diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
index e2bdaaf4..2fb3f36 100644
--- a/drivers/mmc/host/Makefile
+++ b/drivers/mmc/host/Makefile
@@ -57,6 +57,7 @@ obj-$(CONFIG_MMC_MOXART)	+= moxart-mmc.o
 obj-$(CONFIG_MMC_SUNXI)		+= sunxi-mmc.o
 obj-$(CONFIG_MMC_USDHI6ROL0)	+= usdhi6rol0.o
 obj-$(CONFIG_MMC_TOSHIBA_PCI)	+= toshsd.o
+obj-$(CONFIG_MMC_BCM2835_SDHOST)	+= bcm2835-sdhost.o
 
 obj-$(CONFIG_MMC_REALTEK_PCI)	+= rtsx_pci_sdmmc.o
 obj-$(CONFIG_MMC_REALTEK_USB)	+= rtsx_usb_sdmmc.o
diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c
new file mode 100644
index 000..cafe6ad
--- /dev/null
+++ b/drivers/mmc/host/bcm2835-sdhost.c
@@ -0,0 +1,1666 @@
+/*
+ * BCM2835 SD host driver.
+ *
+ * Aut

Processed: your mail

2016-11-23 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> reassign 839381 linux
Bug #839381 [xserver-xorg-video-amdgpu] xserver-xorg-video-amdgpu: very long 
Xorg initilization time in recent kernels
Bug reassigned from package 'xserver-xorg-video-amdgpu' to 'linux'.
No longer marked as found in versions xserver-xorg-video-amdgpu/1.1.2-1.
Ignoring request to alter fixed versions of bug #839381 to the same values 
previously set
>
End of message, stopping processing here.

Please contact me if you need assistance.
-- 
839381: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839381
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Processed: your mail

2016-11-23 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> tags 839381 +patch
Bug #839381 [linux] xserver-xorg-video-amdgpu: very long Xorg initilization 
time in recent kernels
Added tag(s) patch.
>
End of message, stopping processing here.

Please contact me if you need assistance.
-- 
839381: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839381
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Re: cross building linux-image packages

2016-11-23 Thread Andrew Worsley
> From: Ben Hutchings 
> >
> > In particular trying to do
> >
> >   fakeroot make -f debian/rules.gen binary-arch_armel_none
> >
> > but that doesn't seem work  (gcc-5 command not found?) under jessie -
> > now looking at under stretch...
> >
> > But I think I am straying too far from the beaten track and hitting
> > lots of problems - hence the question about where information on what
> > people are normally doing to cross build the kernel using debian
> > packages.
>
> Using the stretch branch you should use something like:
>
> dpkg-buildpackage -Pcross,nopython -aarmel -B -uc -us
>
> I got that working (except with armhf as the target) a few months back.
>
> You can also add 'notools' to the -P option if you don't need the
> userland packages; this will reduce the build-dependencies.
>
> Ben.

  Thank-you very much Ben - got that approach to work (eventually :-)

  I tried:
  dpkg-buildpackage  -Pcross,nopython -aarmel -B -uc -us

  First I got several dependancy complaints that were not valid. The
components that
  dpkg-buildpackage complained about were apparently already installed
according to

apt-get install libssl-dev libglib2.0-dev libudev-dev libwrap0-dev
libpci-dev gcc-5-arm-linux-gnueabi:native

  So I tried it with -d  and got *lot* of compiling ending with the failures and
  requiring some missing parts to be installed...

  * missing arm-linux-gnueabi-gcc - installed the package gcc-arm-linux-gnueabi
  * missing openssl/opensslconf.h: - installed libssl-dev:armel
  * missing libpci - installed libpci-dev:armel
  * missing libwrap - installed libwrap0-dev:armel

Glad I found out about the -nc option to avoid the lengthy
rebuilding from scratch...

  * Hmm apparently the complaints were valid - but for the armel packages!

Thanks again.

Andrew



Bug#845382: more boot BUG logs

2016-11-23 Thread Václav Ovsík
I added netconsole into /boot/grub/grub.cfg and did more attempts to
boot. Logs are attached in the archive.

 zito@bobek:~$ fgrep -m 1 BUG radeon-kms-messages*
 radeon-kms-messages.txt:[   64.148004] NMI watchdog: BUG: soft lockup - CPU#1 
stuck for 22s! [kworker/1:2:51]
 radeon-kms-messages1.txt:[   14.147686] BUG: unable to handle kernel NULL 
pointer dereference at 006c
 radeon-kms-messages2.txt:[   15.379376] BUG: unable to handle kernel NULL 
pointer dereference at 006c
 radeon-kms-messages3.txt:[   13.890714] BUG: unable to handle kernel NULL 
pointer dereference at 006c
 radeon-kms-messages4.txt:[   14.579563] BUG: unable to handle kernel NULL 
pointer dereference at 006c
 radeon-kms-messages5.txt:[   15.651245] BUG: unable to handle kernel NULL 
pointer dereference at 006c
 radeon-kms-messages6.txt:[   48.148004] NMI watchdog: BUG: soft lockup - CPU#1 
stuck for 22s! [smartd:457]
 radeon-kms-messages7.txt:[   15.472800] BUG: unable to handle kernel NULL 
pointer dereference at 006c
 radeon-kms-messages8.txt:[   14.282438] BUG: unable to handle kernel NULL 
pointer dereference at 006c
 radeon-kms-messages9.txt:[   14.860173] BUG: unable to handle kernel NULL 
pointer dereference at 006c

There is NULL pointer dereference in most cases.
-- 
Zito


radeon-kms-messages.tar.xz
Description: application/xz


Processed: retitle 845302 to used mount implementations are incomplete, fails to mount /usr

2016-11-23 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> retitle 845302 used mount implementations are incomplete, fails to mount /usr
Bug #845302 [initramfs-tools] systemd: 232-6:Failed to boot, makes kernel panic 
when starting /sbin/init.
Changed Bug title to 'used mount implementations are incomplete, fails to mount 
/usr' from 'systemd: 232-6:Failed to boot, makes kernel panic when starting 
/sbin/init.'.
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
845302: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845302
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Re: Bug#845302: systemd: 232-6:Failed to boot, makes kernel panic when starting /sbin/init.

2016-11-23 Thread Michael Biebl
Control: reassign -1 initramfs-tools 0.125


Am 23.11.2016 um 11:25 schrieb K.Ohta:
> Not mounted /usr and made kernel panic still longer sleep.
> 
> Then booting with "init=/bin/bash" , check dmesg (attached).
> Below message was wrote when trying to mount /usr :
>> [   15.958645] EXT4-fs (sde3): Unrecognized mount option "auto" or missing 
>> value
> 
> If this message is correct, mount program included by initramfs
> has not recognized "auto" (or some another) option(s), regardless
> /bin/mount (or /sbin/mount/ext4) recognize this option(s) :-(


I'm going to reassign this to initramfs-tools as it uses mount
implementations from either klibc-utils or busybox which are both
incomplete and as a result, fail to mount /usr.

I decided against reassigning this to busybox and klibc-utils.
I think it's preferable, if initramfs-tools simply uses the mount
implementation from the real systemd, i.e. util-linux. This guarantees
that we won't run into such problems again in the future.

The mount utility is tiny, all its library dependencies are already in
the initramfs. Rebuilding the initramfs with mount from u-l increases
the size by 17K.

We would also have to make sure to use mount --move in
/usr/share/initramfs-tools/init for /run, /sys and /proc

Ben, what's your take on this?

Regards,
Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Processed: Re: Bug#845302: systemd: 232-6:Failed to boot, makes kernel panic when starting /sbin/init.

2016-11-23 Thread Debian Bug Tracking System
Processing control commands:

> reassign -1 initramfs-tools 0.125
Bug #845302 [systemd] systemd: 232-6:Failed to boot, makes kernel panic when 
starting /sbin/init.
Bug reassigned from package 'systemd' to 'initramfs-tools'.
No longer marked as found in versions systemd/232-6.
Ignoring request to alter fixed versions of bug #845302 to the same values 
previously set
Bug #845302 [initramfs-tools] systemd: 232-6:Failed to boot, makes kernel panic 
when starting /sbin/init.
Marked as found in versions initramfs-tools/0.125.

-- 
845302: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845302
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Processed: tagging 845302

2016-11-23 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> tags 845302 - moreinfo unreproducible confirmed
Bug #845302 [initramfs-tools] used mount implementations are incomplete, fails 
to mount /usr
Removed tag(s) moreinfo and unreproducible.
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
845302: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845302
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#845302: systemd: 232-6:Failed to boot, makes kernel panic when starting /sbin/init.

2016-11-23 Thread Michael Biebl
Am 23.11.2016 um 14:30 schrieb Michael Biebl:

> I'm going to reassign this to initramfs-tools as it uses mount
> implementations from either klibc-utils or busybox which are both
> incomplete and as a result, fail to mount /usr.
> 
> I decided against reassigning this to busybox and klibc-utils.
> I think it's preferable, if initramfs-tools simply uses the mount
> implementation from the real systemd, i.e. util-linux. This guarantees
> that we won't run into such problems again in the future.
> 
> The mount utility is tiny, all its library dependencies are already in
> the initramfs. Rebuilding the initramfs with mount from u-l increases
> the size by 17K.
> 
> We would also have to make sure to use mount --move in
> /usr/share/initramfs-tools/init for /run, /sys and /proc
> 
> Ben, what's your take on this?

Something like the attached patch should do the trick.
I wonder though, if we should use the other tools from mount as well,
like umount, swapon/off

Feedback welcome.


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
From dd370d9b7242624f67e6263177997446e01705ba Mon Sep 17 00:00:00 2001
From: Michael Biebl 
Date: Wed, 23 Nov 2016 15:54:38 +0100
Subject: [PATCH] Use mount implementation from util-linux

It's also used on the real system and seems to be the only complete
implementation.

Closes: #845302
---
 debian/control |  2 +-
 hooks/mount| 23 +++
 init   |  6 +++---
 3 files changed, 27 insertions(+), 4 deletions(-)
 create mode 100755 hooks/mount

diff --git a/debian/control b/debian/control
index fc9cb7b..813fde5 100644
--- a/debian/control
+++ b/debian/control
@@ -25,7 +25,7 @@ Package: initramfs-tools-core
 Architecture: all
 Multi-Arch: foreign
 Recommends: ${busybox:Recommends}
-Depends: klibc-utils (>= 2.0.4-8~), cpio, kmod | module-init-tools, udev, ${misc:Depends}
+Depends: klibc-utils (>= 2.0.4-8~), mount, cpio, kmod | module-init-tools, udev, ${misc:Depends}
 Suggests: bash-completion
 Breaks: initramfs-tools (<< 0.121~)
 Replaces: initramfs-tools (<< 0.121~)
diff --git a/hooks/mount b/hooks/mount
new file mode 100755
index 000..1464533
--- /dev/null
+++ b/hooks/mount
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+PREREQ="klibc-utils"
+
+prereqs()
+{
+	echo "$PREREQ"
+}
+
+case $1 in
+prereqs)
+	prereqs
+	exit 0
+	;;
+esac
+
+. /usr/share/initramfs-tools/hook-functions
+
+# We pulled in klibc-utils, to make sure we run after it,
+# so we can replace the symlink
+rm -f ${DESTDIR}/bin/mount
+copy_exec /bin/mount
+
diff --git a/init b/init
index 9552e5c..886a55e 100755
--- a/init
+++ b/init
@@ -248,7 +248,7 @@ run_scripts /scripts/init-bottom
 [ "$quiet" != "y" ] && log_end_msg
 
 # Move /run to the root
-mount -n -o move /run ${rootmnt}/run
+mount -n --move /run ${rootmnt}/run
 
 validate_init() {
 	run-init -n "${rootmnt}" "${1}"
@@ -299,8 +299,8 @@ unset forcefsck
 unset fsckfix
 
 # Move virtual filesystems over to the real filesystem
-mount -n -o move /sys ${rootmnt}/sys
-mount -n -o move /proc ${rootmnt}/proc
+mount -n --move /sys ${rootmnt}/sys
+mount -n --move /proc ${rootmnt}/proc
 
 # Chain to real filesystem
 exec run-init ${drop_caps} ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console 2>&1
-- 
2.10.2



signature.asc
Description: OpenPGP digital signature


Processed: affects 845500

2016-11-23 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> affects 845500 nftables
Bug #845500 [linux] nftables: notrack target fails with No such file or 
directory
Added indication that 845500 affects nftables
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
845500: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845500
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Processed: Re: nftables: notrack target fails with No such file or directory

2016-11-23 Thread Debian Bug Tracking System
Processing control commands:

> reassign -1 linux 4.9~rc5-1~exp1
Bug #845500 [nftables] nftables: notrack target fails with No such file or 
directory
Bug reassigned from package 'nftables' to 'linux'.
No longer marked as found in versions nftables/0.6+snapshot20161117-2.
Ignoring request to alter fixed versions of bug #845500 to the same values 
previously set
Bug #845500 [linux] nftables: notrack target fails with No such file or 
directory
There is no source info for the package 'linux' at version '4.9~rc5-1~exp1' 
with architecture ''
Unable to make a source version for version '4.9~rc5-1~exp1'
Marked as found in versions 4.9~rc5-1~exp1.

-- 
845500: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845500
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#845500: nftables: notrack target fails with No such file or directory

2016-11-23 Thread Jens Reyer
On 24.11.2016 01:34, Peter Colberg wrote:
> Assuming 4.9 becomes the stretch kernel, could you backport the patch?

According to
https://lists.debian.org/debian-devel-announce/2016/03/msg0.html it
will be 4.10.

Greets
jre



Bug#845500: nftables: notrack target fails with No such file or directory

2016-11-23 Thread Peter Colberg
On Wed, Nov 23, 2016 at 07:34:42PM -0500, Peter Colberg wrote:
> Assuming 4.9 becomes the stretch kernel, could you backport the patch?

The same applies to kernel support for the "fib" expression that may
be used for reverse path filtering (analogous to iptables rp_filter).

https://git.kernel.org/cgit/linux/kernel/git/pablo/nf-next.git/commit?id=f6d0cbcf09c506b9b022df8f9d7693a7cec3c732

That patch is more extensive and there are many more commits needed to
sync nftables kernel support with userspace. Backporting does not make
much sense. I am crossing fingers for 4.10 making it into stretch.

Peter



Bug#845500: nftables: notrack target fails with No such file or directory

2016-11-23 Thread Peter Colberg
On Thu, Nov 24, 2016 at 01:55:01AM +0100, Jens Reyer wrote:
> According to
> https://lists.debian.org/debian-devel-announce/2016/03/msg0.html it
> will be 4.10.

That would be great. After the recent announcement that 4.9 will
probably be the next LTS kernel I assumed that the same version
would also be shipped with stretch.

http://kroah.com/log/blog/2016/09/06/4-dot-9-equals-equals-next-lts-kernel/

Peter



Processed: retitle 845302 to mount implementations from busybox and klibc-utils incomplete, fail to mount /usr when using auto option

2016-11-23 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> retitle 845302 mount implementations from busybox and klibc-utils incomplete, 
> fail to mount /usr when using auto option
Bug #845302 [initramfs-tools] used mount implementations are incomplete, fails 
to mount /usr
Changed Bug title to 'mount implementations from busybox and klibc-utils 
incomplete, fail to mount /usr when using auto option' from 'used mount 
implementations are incomplete, fails to mount /usr'.
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
845302: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845302
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#838887: please dont bomb out on nofail option

2016-11-23 Thread Michael Biebl
On Mon, 26 Sep 2016 07:02:01 +0200 Marc Haber
 wrote:
> Package: initramfs-tools
> Severity: wishlist
> 
> Hi,
> 
> when I looked for the last time (a few months ago), fstab entries
> parsed by initramfs-tools or in initramfs MUST NOT contain the
> "nofail" option. This is kind of surprising since some other fstab
> entries MUST contain the "nofail" option to avoid systemd from bombing
> out on boot.
> 
> This inconsistence makey it necessary to think in which lines to put
> the nofail option and in which lines not.
> 
> Please consider tweaking initramfs-tools so that "nofail" can be in
> all lines, with it being ignored in initramfs.

This looks like a duplicate of #845302.

In this bug report a user had the "auto" option for /usr in /etc/fstab.
The busybox and klibc-utils mount implementations did not cope with this
and failed to mount /usr as a result

In https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845302#161 I have a
proposed patch which uses the mount implmentation from util-linux, which
is also used on the real system.

This should avoid issues like Mark or the bug reporter from  #845302 are
encountering.




-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#845500: nftables: notrack target fails with No such file or directory

2016-11-23 Thread Arturo Borrero Gonzalez
On 24 November 2016 at 01:34, Peter Colberg  wrote:
>
> While the nftables package in Debian stretch will support notrack, the
> corresponding kernel support was committed after the 4.9 merge window:
>
> https://git.kernel.org/cgit/linux/kernel/git/pablo/nf-next.git/commit/net/netfilter/nft_ct.c?id=254432613c588640f8b8b5c3641a3c27bbe14688
>
> Assuming 4.9 becomes the stretch kernel, could you backport the patch?


Debian stretch will include linux 4.10 [0], so no problem.


[0] https://lists.debian.org/debian-devel-announce/2016/03/msg0.html