arc770: move arc patches to taregt/linux/generic
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/2 arc770: move arc patches to taregt/linux/generic
Hi Felix,
Quoted 41 lines · Felix Fietkau
Quoted 40 lines · Alexey Brodkin
Given those patches are relevant to any ARC platform and even ISA version it makes perfect sense for patches to exist
in one place instead of being duplicated for each new ARC-based ASIC.Note this is a prerequisite for upstreaming of ARC HS38 support in OpenWRT.
Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>Cc Felix Fietkau <nbd at openwrt.org>Cc Jo-Philipp Wich <jow at openwrt.org>Cc Jonas Gorski <jogo at openwrt.org>target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch new file +26
-0@@ -0,0 +1,36 @@ +From adfbf9e6cad93281cffceab078e7f6f2a8e094f9 Mon Sep 17 00:00:00 2001 +From: Alexey Brodkin <abrodkin at synopsys.com> +Date: Thu, 13 Aug 2015 01:56:02 +0300 +Subject: [PATCH 1/2] openwrt: arc - remove dependency on DEVTMPFS + +OpenWRT builds initramfs so that it doesn't require DEVTMPFS so dropping +this dependency. That helps to escape 2 separate kernel rebuilds with +and without initramfs. + +2 builds happen because OpenWRT first builds kernel and later modules. +When building entire kernel with simple "make" INITRAMFS sets to a real +value and so was triggering DEVTMPFS selection. Then when building only +modules with "make modules" command INITRAMFS is zeroed and so kernel +config was changing that lead to full kernel rebuild. + +Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com> +--- + arch/arc/Kconfig | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig +index 6312f60..a95bab3 100644 +--- a/arch/arc/Kconfig ++++ b/arch/arc/Kconfig +@@ -12,8 +12,6 @@ config ARC + select BUILDTIME_EXTABLE_SORT
Quoted 8 lines
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch line 33
Quoted 7 lines
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch new file +7
-0+ select COMMON_CLK + select CLONE_BACKWARDS +- # ARC Busybox based initramfs absolutely relies on DEVTMPFS for /dev +- select DEVTMPFS if !INITRAMFS_SOURCE="" + select GENERIC_ATOMIC64 + select GENERIC_CLOCKEVENTS + select GENERIC_FIND_FIRST_BITCould you please send this one upstream as well?
Adding Vineet so he may comment if that change makes sense upstream.
-Alexey
PATCH 2/2 arc770: move arc patches to taregt/linux/generic
+CC Thomas, Peter
Quoted 11 lines · Alexey Brodkin
Hi Felix,
Quoted 8 lines · Felix Fietkau
Quoted 7 lines · Alexey Brodkin
Given those patches are relevant to any ARC platform and even ISA version it makes perfect sense for patches to exist
in one place instead of being duplicated for each new ARC-based ASIC.Note this is a prerequisite for upstreaming of ARC HS38 support in OpenWRT.
Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>Cc Felix Fietkau <nbd at openwrt.org>Cc Jo-Philipp Wich <jow at openwrt.org>Cc Jonas Gorski <jogo at openwrt.org>target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch new file +0
-0Quoted 8 lines
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch line 7
Quoted 8 lines
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch new file +7
-0@@ -0,0 +1,36 @@ +From adfbf9e6cad93281cffceab078e7f6f2a8e094f9 Mon Sep 17 00:00:00 2001 +From: Alexey Brodkin <abrodkin at synopsys.com> +Date: Thu, 13 Aug 2015 01:56:02 +0300 +Subject: [PATCH 1/2] openwrt: arc - remove dependency on DEVTMPFS + +OpenWRT builds initramfs so that it doesn't require DEVTMPFS so dropping +this dependency.
Really ? AFAIKR (circa 2012) DEVTMPFS was *needed* for dynamic device nodes and that included the common case of initramfs NOT having static device nodes.
So back then I added the code in question to kernel Kconfig because initramfs was my primary workflow and occassionally I would fail to include DEVTMPFS causing userspace boot to go bonkers (FWIW I was using the buildroot trick of a pre-init script which would automount devtmpfs before exec'ing the real init)
Now arguably I can add DEVTMPFS to defconfigs, but then we don't need the kconfig dependency framework at all.
Another idea is to add DEVTMPFS unconditionally to Kconfig, but I fail to remember why I didn't do it at the time. Does anyone know if it interferes with real rootfs backed by real devices ?
Quoted 8 lines
Quoted 8 lines
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch
Quoted 8 lines
That helps to escape 2 separate kernel rebuilds with
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch new file +7
-0+and without initramfs. + +2 builds happen because OpenWRT first builds kernel and later modules. +When building entire kernel with simple "make" INITRAMFS sets to a real +value and so was triggering DEVTMPFS selection. Then when building only +modules with "make modules" command INITRAMFS is zeroed and so kernel +config was changing that lead to full kernel rebuild.
Just curious, why does make module zero out INITRAMFS - to save a bit of build time ?
-Vineet
Quoted 23 lines
Quoted 12 lines
Quoted 12 lines
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch new file +12
-0+ +Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com> +--- + arch/arc/Kconfig | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig +index 6312f60..a95bab3 100644 +--- a/arch/arc/Kconfig ++++ b/arch/arc/Kconfig +@@ -12,8 +12,6 @@ config ARC + select BUILDTIME_EXTABLE_SORTQuoted 8 lines
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch
Quoted 7 lines
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch new file +7
-0+ select COMMON_CLK + select CLONE_BACKWARDS +- # ARC Busybox based initramfs absolutely relies on DEVTMPFS for /dev +- select DEVTMPFS if !INITRAMFS_SOURCE="" + select GENERIC_ATOMIC64 + select GENERIC_CLOCKEVENTS + select GENERIC_FIND_FIRST_BITCould you please send this one upstream as well?
Adding Vineet so he may comment if that change makes sense upstream.
-Alexey
PATCH 2/2 arc770: move arc patches to taregt/linux/generic
Quoted 37 lines · Vineet Gupta
+CC Thomas, Peter
Quoted 11 lines · Alexey Brodkin
Hi Felix,
Quoted 8 lines · Felix Fietkau
Quoted 7 lines · Alexey Brodkin
Given those patches are relevant to any ARC platform and even ISA version it makes perfect sense for patches to exist
in one place instead of being duplicated for each new ARC-based ASIC.Note this is a prerequisite for upstreaming of ARC HS38 support in OpenWRT.
Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>Cc Felix Fietkau <nbd at openwrt.org>Cc Jo-Philipp Wich <jow at openwrt.org>Cc Jonas Gorski <jogo at openwrt.org>target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch new file +0
-0Quoted 8 lines
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch line 7
Quoted 8 lines
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch new file +7
-0@@ -0,0 +1,36 @@ +From adfbf9e6cad93281cffceab078e7f6f2a8e094f9 Mon Sep 17 00:00:00 2001 +From: Alexey Brodkin <abrodkin at synopsys.com> +Date: Thu, 13 Aug 2015 01:56:02 +0300 +Subject: [PATCH 1/2] openwrt: arc - remove dependency on DEVTMPFS + +OpenWRT builds initramfs so that it doesn't require DEVTMPFS so dropping +this dependency.Really ? AFAIKR (circa 2012) DEVTMPFS was *needed* for dynamic device nodes and that included the common case of initramfs NOT having static device nodes.
So back then I added the code in question to kernel
Kconfigbecause initramfs was my primary workflow and occassionally I would fail to include DEVTMPFS causing userspace boot to go bonkers (FWIW I was using the buildroot trick of a pre-init script which would automount devtmpfs before exec'ing the real init)
Quoted 6 lines
Now arguably I can add DEVTMPFS to defconfigs, but then we don't need the kconfig dependency framework at all.
Another idea is to add DEVTMPFS unconditionally to
Kconfig, but I fail to remember why I didn't do it at the time. Does anyone know if it interferes with real rootfs backed by real devices ?
OpenWrt works just fine without DEVTMPFS - doesn't matter if initramfs is enabled or not. I also don't think there's anything architecture specific about requiring DEVTMPFS or not, so I'd say it doesn't make any sense to select it from arch/arc/Kconfig.
Quoted 10 lines
Quoted 8 lines
Quoted 8 lines
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch
Quoted 8 lines
That helps to escape 2 separate kernel rebuilds with
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch new file +7
-0+and without initramfs. + +2 builds happen because OpenWRT first builds kernel and later modules. +When building entire kernel with simple "make" INITRAMFS sets to a real +value and so was triggering DEVTMPFS selection. Then when building only +modules with "make modules" command INITRAMFS is zeroed and so kernel +config was changing that lead to full kernel rebuild.Just curious, why does make module zero out INITRAMFS - to save a bit of build time ?
OpenWrt builds both initramfs and non-initramfs images, so it resets the INITRAMFS config item when it generates the kernel config for the first time.
- Felix
PATCH 2/2 arc770: move arc patches to taregt/linux/generic
Quoted 13 lines · Felix Fietkau
Quoted 13 lines
Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
+Subject: [PATCH 1/2] openwrt: arc - remove dependency on DEVTMPFS
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Review
Quoted 3 lines
(quoted diff) +3
-0+ +OpenWRT builds initramfs so that it doesn't require DEVTMPFS so dropping +this dependency.Really ? AFAIKR (circa 2012) DEVTMPFS was *needed* for dynamic device nodes and that included the common case of initramfs NOT having static device nodes.
So back then I added the code in question to kernel
Kconfigbecause initramfs was my primary workflow and occassionally I would fail to include DEVTMPFS causing userspace boot to go bonkers (FWIW I was using the buildroot trick of a pre-init script which would automount devtmpfs before exec'ing the real init)
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Now arguably I can add DEVTMPFS to defconfigs, but then we don't need the kconfig dependency framework at all.
Another idea is to add DEVTMPFS unconditionally to
Kconfig, but I fail to remember why I didn't do it at the time. Does anyone know if it interferes with real rootfs backed by real devices ?OpenWrt works just fine without DEVTMPFS - doesn't matter if initramfs is enabled or not.
The discussion is about adding a patch to up upstream ARC kernel, not specific to openwrt.
BTW if openwrt builds for initramfs, it has to enable DEVTMPFS under the hood. Perhaps there are dependencies in openwrt build system which take care of that already - o/w it just won't work (assuming dynamic dev nodes).
Quoted 3 lines
I also don't think there's anything architecture
specific about requiring DEVTMPFS or not, so I'd say it doesn't make any sense to select it fromarch/arc/Kconfig.
You are indeed right - Kconfig is not the "ideal" place to add this (it's not like we support PCI or not) and it best belongs to *defconfigs.
-Vineet
PATCH 2/2 arc770: move arc patches to taregt/linux/generic
Quoted 17 lines · Vineet Gupta
Quoted 16 lines · Felix Fietkau
Quoted 16 lines
Quoted 16 lines
Quoted 4 lines
Quoted 4 lines
+Subject: [PATCH 1/2] openwrt: arc - remove dependency on DEVTMPFS
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Review
Quoted 3 lines
(quoted diff) +3
-0+ +OpenWRT builds initramfs so that it doesn't require DEVTMPFS so dropping +this dependency.Really ? AFAIKR (circa 2012) DEVTMPFS was *needed* for dynamic device nodes and that included the common case of initramfs NOT having static device nodes.
So back then I added the code in question to kernel
Kconfigbecause initramfs was my primary workflow and occassionally I would fail to include DEVTMPFS causing userspace boot to go bonkers (FWIW I was using the buildroot trick of a pre-init script which would automount devtmpfs before exec'ing the real init)Now arguably I can add DEVTMPFS to defconfigs, but then we don't need the kconfig dependency framework at all.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Another idea is to add DEVTMPFS unconditionally to
Kconfig, but I fail to remember why I didn't do it at the time. Does anyone know if it interferes with real rootfs backed by real devices ?OpenWrt works just fine without DEVTMPFS - doesn't matter if initramfs is enabled or not.
The discussion is about adding a patch to up upstream ARC kernel, not specific to openwrt.
Right. I belive that the upstream kernel should not arbitrarily force DEVTMPFS support for some architectures, as long as there are user space implementations (such as OpenWrt) that can do without it.
Quoted 3 lines
BTW if openwrt builds for initramfs, it has to enable DEVTMPFS under the hood. Perhaps there are dependencies in openwrt build system which take care of that already - o/w it just won't work (assuming dynamic dev nodes).
Incorrect. OpenWrt does not use DEVTMPFS, it does not even get compiled into the image. We would like to keep it that way.
Our user space takes care of creating all required device nodes very early during boot.
- Felix
PATCH 2/2 arc770: move arc patches to taregt/linux/generic
Quoted 10 lines
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
"Felix" == Felix Fietkau <nbd at openwrt.org> writes:
OpenWrt works just fine without DEVTMPFS - doesn't matter if initramfs is enabled or not.
The discussion is about adding a patch to up upstream ARC kernel, not specific to openwrt.
Right. I belive that the upstream kernel should not arbitrarily force DEVTMPFS support for some architectures, as long as there are user space implementations (such as OpenWrt) that can do without it.
Agreed, only the options absolutely needed should be forced on.
Quoted 7 lines
Quoted 3 lines
BTW if openwrt builds for initramfs, it has to enable DEVTMPFS under the hood. Perhaps there are dependencies in openwrt build system which take care of that already - o/w it just won't work (assuming dynamic dev nodes).
Incorrect. OpenWrt does not use DEVTMPFS, it does not even get compiled into the image. We would like to keep it that way.
Our user space takes care of creating all required device nodes very early during boot.
Out of interest, why is that? Devtmpfs got added 7 years ago (2.6.32) - And is easy to backport if really needed, is easier and more flexible than a bunch of static mknods, and probably smaller as well.
We changed to devtmpfs by default in Buildroot quite some time ago, and I'm pretty happy with it.
Signature · 2 lines
Venlig hilsen, Peter Korsgaard
PATCH 2/2 arc770: move arc patches to taregt/linux/generic
Quoted 16 lines · Peter Korsgaard
Quoted 10 lines
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
"Felix" == Felix Fietkau <nbd at openwrt.org> writes:
OpenWrt works just fine without DEVTMPFS - doesn't matter if initramfs is enabled or not.
The discussion is about adding a patch to up upstream ARC kernel, not specific to openwrt.
Right. I belive that the upstream kernel should not arbitrarily force DEVTMPFS support for some architectures, as long as there are user space implementations (such as OpenWrt) that can do without it.
Agreed, only the options absolutely needed should be forced on.
Quoted 3 lines
Quoted 3 lines
BTW if openwrt builds for initramfs, it has to enable DEVTMPFS under the hood. Perhaps there are dependencies in openwrt build system which take care of that already - o/w it just won't work (assuming dynamic dev nodes).
Quoted 8 lines
Quoted 4 lines
Incorrect. OpenWrt does not use DEVTMPFS, it does not even get compiled into the image. We would like to keep it that way.
Our user space takes care of creating all required device nodes very early during boot.Out of interest, why is that? Devtmpfs got added 7 years ago (2.6.32) - And is easy to backport if really needed, is easier and more flexible than a bunch of static mknods, and probably smaller as well.
We don't need to backport anything. Our oldest kernel is 3.18, and we're going to move everything to 4.4 soon ;)
Quoted 2 lines
We changed to devtmpfs by default in Buildroot quite some time ago, and I'm pretty happy with it.
We need to have dynamically created device nodes anyway - for managing permissions, being able to change names, etc. Because of that, devtmpfs is not enough to provide a full /dev. Since it's not enough, and creating the initial device nodes from our custom init is easy, we see little value in keeping it. So we got rid of the extra bloat :)
- Felix
PATCH 2/2 arc770: move arc patches to taregt/linux/generic
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Felix" == Felix Fietkau <nbd at openwrt.org> writes:
Hi,
Quoted 5 lines
Quoted 3 lines
Out of interest, why is that? Devtmpfs got added 7 years ago (2.6.32) - And is easy to backport if really needed, is easier and more flexible than a bunch of static mknods, and probably smaller as well.
We don't need to backport anything. Our oldest kernel is 3.18, and we're going to move everything to 4.4 soon ;)
Good!
Quoted 7 lines
Quoted 2 lines
We changed to devtmpfs by default in Buildroot quite some time ago, and I'm pretty happy with it.
We need to have dynamically created device nodes anyway - for managing permissions, being able to change names, etc. Because of that, devtmpfs is not enough to provide a full /dev. Since it's not enough, and creating the initial device nodes from our custom init is easy, we see little value in keeping it. So we got rid of the extra bloat :)
Heh, "bloat":
arm-none-eabi-size drivers/base/devtmpfs.o
text data bss dec hex filename
1568 64 4 1636 664 drivers/base/devtmpfs.o
Compared to the extra inodes and/or the busybox mknod applet + script, it isn't too bad.
In Buildroot we support pure devtmpfs, mdev or udev (both with devtmpfs) or static /dev for legacy setups.
Signature · 2 lines
Venlig hilsen, Peter Korsgaard
PATCH 2/2 arc770: move arc patches to taregt/linux/generic
Quoted 8 lines · Peter Korsgaard
Quoted 7 lines
Quoted 2 lines
We changed to devtmpfs by default in Buildroot quite some time ago, and I'm pretty happy with it.
We need to have dynamically created device nodes anyway - for managing permissions, being able to change names, etc. Because of that, devtmpfs is not enough to provide a full /dev. Since it's not enough, and creating the initial device nodes from our custom init is easy, we see little value in keeping it. So we got rid of the extra bloat :)
Quoted 8 lines
Heh, "bloat":
arm-none-eabi-size
drivers/base/devtmpfs.o
text data bss dec hex filename
1568 64 4 1636 664drivers/base/devtmpfs.oCompared to the extra inodes and/or the busybox mknod applet + script, it isn't too bad.
I know it's not much, but we do like to disable anything that's completely useless for our purposes. :)
Our code doesn't use busybox mknod. The stuff that creates the device nodes is written in C.
Quoted 2 lines
In Buildroot we support pure devtmpfs, mdev or udev (both with devtmpfs) or static /dev for legacy setups.
Yeah, for Buildroot devtmpfs makes sense. We don't use or support mdev, udev or static /dev. We also got rid of hotplug2 a while back ;)
- Felix
PATCH 2/2 arc770: move arc patches to taregt/linux/generic
In reply to Vineet GuptaQuoted 5 lines · Vineet Gupta
Quoted 3 lines
I also don't think there's anything architecture
Quoted 2 lines
specific about requiring DEVTMPFS or not, so I'd say it doesn't make any sense to select it from
arch/arc/Kconfig.You are indeed right -
Kconfigis not the "ideal" place to add this (it's not like we support PCI or not) and it best belongs to *defconfigs.
Alexey do u mind spinning a patchset which
1. Adds DEVTMFS to our defconfigs where we need them
2. Removes the select for same from Kconfig
-Vineet