From: Sasha Levin Date: Thu, 2 Apr 2020 21:35:21 +0000 (-0400) Subject: Fixes for 4.14 X-Git-Tag: v5.4.31~47^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=83c0ed033c0738cb1bdef6af4a4247c63d47725d;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.14 Signed-off-by: Sasha Levin --- diff --git a/queue-4.14/drm-bochs-downgrade-pci_request_region-failure-from-.patch b/queue-4.14/drm-bochs-downgrade-pci_request_region-failure-from-.patch new file mode 100644 index 00000000000..aa5c249c2dd --- /dev/null +++ b/queue-4.14/drm-bochs-downgrade-pci_request_region-failure-from-.patch @@ -0,0 +1,48 @@ +From 0355c385f574401a5077d047e602688a18daf7f8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 13 Mar 2020 09:41:52 +0100 +Subject: drm/bochs: downgrade pci_request_region failure from error to warning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Gerd Hoffmann + +[ Upstream commit 8c34cd1a7f089dc03933289c5d4a4d1489549828 ] + +Shutdown of firmware framebuffer has a bunch of problems. Because +of this the framebuffer region might still be reserved even after +drm_fb_helper_remove_conflicting_pci_framebuffers() returned. + +Don't consider pci_request_region() failure for the framebuffer +region as fatal error to workaround this issue. + +Reported-by: Marek Marczykowski-Górecki +Signed-off-by: Gerd Hoffmann +Acked-by: Sam Ravnborg +Link: http://patchwork.freedesktop.org/patch/msgid/20200313084152.2734-1-kraxel@redhat.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/bochs/bochs_hw.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c +index a39b0343c197d..401c218567af9 100644 +--- a/drivers/gpu/drm/bochs/bochs_hw.c ++++ b/drivers/gpu/drm/bochs/bochs_hw.c +@@ -97,10 +97,8 @@ int bochs_hw_init(struct drm_device *dev, uint32_t flags) + size = min(size, mem); + } + +- if (pci_request_region(pdev, 0, "bochs-drm") != 0) { +- DRM_ERROR("Cannot request framebuffer\n"); +- return -EBUSY; +- } ++ if (pci_request_region(pdev, 0, "bochs-drm") != 0) ++ DRM_WARN("Cannot request framebuffer, boot fb still active?\n"); + + bochs->fb_map = ioremap(addr, size); + if (bochs->fb_map == NULL) { +-- +2.20.1 + diff --git a/queue-4.14/initramfs-restore-default-compression-behavior.patch b/queue-4.14/initramfs-restore-default-compression-behavior.patch new file mode 100644 index 00000000000..34e2eb3d4aa --- /dev/null +++ b/queue-4.14/initramfs-restore-default-compression-behavior.patch @@ -0,0 +1,79 @@ +From b833781f96b22d22d2e92f269a10831b4e8fb9fb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 16 Mar 2020 14:25:19 +0300 +Subject: initramfs: restore default compression behavior + +From: Eugeniy Paltsev + +[ Upstream commit 785d74ec3bbf26ac7f6e92e6e96a259aec0f107a ] + +Even though INITRAMFS_SOURCE kconfig option isn't set in most of +defconfigs it is used (set) extensively by various build systems. +Commit f26661e12765 ("initramfs: make initramfs compression choice +non-optional") has changed default compression mode. Previously we +compress initramfs using available compression algorithm. Now +we don't use any compression at all by default. +It significantly increases the image size in case of build system +chooses embedded initramfs. Initially I faced with this issue while +using buildroot. + +As of today it's not possible to set preferred compression mode +in target defconfig as this option depends on INITRAMFS_SOURCE +being set. Modification of all build systems either doesn't look +like good option. + +Let's instead rewrite initramfs compression mode choices list +the way that "INITRAMFS_COMPRESSION_NONE" will be the last option +in the list. In that case it will be chosen only if all other +options (which implements any compression) are not available. + +Signed-off-by: Eugeniy Paltsev +Signed-off-by: Masahiro Yamada +Signed-off-by: Sasha Levin +--- + usr/Kconfig | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/usr/Kconfig b/usr/Kconfig +index 43658b8a975e5..8b4826de1189f 100644 +--- a/usr/Kconfig ++++ b/usr/Kconfig +@@ -131,17 +131,6 @@ choice + + If in doubt, select 'None' + +-config INITRAMFS_COMPRESSION_NONE +- bool "None" +- help +- Do not compress the built-in initramfs at all. This may sound wasteful +- in space, but, you should be aware that the built-in initramfs will be +- compressed at a later stage anyways along with the rest of the kernel, +- on those architectures that support this. However, not compressing the +- initramfs may lead to slightly higher memory consumption during a +- short time at boot, while both the cpio image and the unpacked +- filesystem image will be present in memory simultaneously +- + config INITRAMFS_COMPRESSION_GZIP + bool "Gzip" + depends on RD_GZIP +@@ -214,6 +203,17 @@ config INITRAMFS_COMPRESSION_LZ4 + If you choose this, keep in mind that most distros don't provide lz4 + by default which could cause a build failure. + ++config INITRAMFS_COMPRESSION_NONE ++ bool "None" ++ help ++ Do not compress the built-in initramfs at all. This may sound wasteful ++ in space, but, you should be aware that the built-in initramfs will be ++ compressed at a later stage anyways along with the rest of the kernel, ++ on those architectures that support this. However, not compressing the ++ initramfs may lead to slightly higher memory consumption during a ++ short time at boot, while both the cpio image and the unpacked ++ filesystem image will be present in memory simultaneously ++ + endchoice + + config INITRAMFS_COMPRESSION +-- +2.20.1 + diff --git a/queue-4.14/series b/queue-4.14/series new file mode 100644 index 00000000000..fde77a8f521 --- /dev/null +++ b/queue-4.14/series @@ -0,0 +1,3 @@ +drm-bochs-downgrade-pci_request_region-failure-from-.patch +initramfs-restore-default-compression-behavior.patch +tools-power-turbostat-fix-gcc-build-warnings.patch diff --git a/queue-4.14/tools-power-turbostat-fix-gcc-build-warnings.patch b/queue-4.14/tools-power-turbostat-fix-gcc-build-warnings.patch new file mode 100644 index 00000000000..49ba168c75b --- /dev/null +++ b/queue-4.14/tools-power-turbostat-fix-gcc-build-warnings.patch @@ -0,0 +1,43 @@ +From 8d96d8c8f94431a3466997801527f8b03017174c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 19 Mar 2020 18:33:12 -0400 +Subject: tools/power turbostat: Fix gcc build warnings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Len Brown + +[ Upstream commit d8d005ba6afa502ca37ced5782f672c4d2fc1515 ] + +Warning: ‘__builtin_strncpy’ specified bound 20 equals destination size + [-Wstringop-truncation] + +reduce param to strncpy, to guarantee that a null byte is always copied +into destination buffer. + +Signed-off-by: Len Brown +Signed-off-by: Sasha Levin +--- + tools/power/x86/turbostat/turbostat.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c +index 19e345cf8193e..0692f2efc25ef 100644 +--- a/tools/power/x86/turbostat/turbostat.c ++++ b/tools/power/x86/turbostat/turbostat.c +@@ -4650,9 +4650,9 @@ int add_counter(unsigned int msr_num, char *path, char *name, + } + + msrp->msr_num = msr_num; +- strncpy(msrp->name, name, NAME_BYTES); ++ strncpy(msrp->name, name, NAME_BYTES - 1); + if (path) +- strncpy(msrp->path, path, PATH_BYTES); ++ strncpy(msrp->path, path, PATH_BYTES - 1); + msrp->width = width; + msrp->type = type; + msrp->format = format; +-- +2.20.1 +