From: Greg Kroah-Hartman Date: Tue, 20 Feb 2018 11:11:04 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v4.15.5~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e35ab3411f4ea66d0bb03339f557e1087d75f35f;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: console-dummy-leave-.con_font_get-set-to-null.patch drm-radeon-adjust-tested-variable.patch ext4-correct-documentation-for-grpid-mount-option.patch ext4-save-error-to-disk-in-__ext4_grp_locked_error.patch mm-hide-a-warning-for-compile_test.patch rtc-opal-fix-handling-of-firmware-error-codes-prevent-busy-loops.patch video-fbdev-atmel_lcdfb-fix-display-timings-lookup.patch --- diff --git a/queue-4.4/console-dummy-leave-.con_font_get-set-to-null.patch b/queue-4.4/console-dummy-leave-.con_font_get-set-to-null.patch new file mode 100644 index 00000000000..d5eb129e3d4 --- /dev/null +++ b/queue-4.4/console-dummy-leave-.con_font_get-set-to-null.patch @@ -0,0 +1,32 @@ +From 724ba8b30b044aa0d94b1cd374fc15806cdd6f18 Mon Sep 17 00:00:00 2001 +From: Nicolas Pitre +Date: Mon, 15 Jan 2018 17:04:22 +0100 +Subject: console/dummy: leave .con_font_get set to NULL + +From: Nicolas Pitre + +commit 724ba8b30b044aa0d94b1cd374fc15806cdd6f18 upstream. + +When this method is set, the caller expects struct console_font fields +to be properly initialized when it returns. Leave it unset otherwise +nonsensical (leaked kernel stack) values are returned to user space. + +Signed-off-by: Nicolas Pitre +Cc: stable@vger.kernel.org +Signed-off-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/video/console/dummycon.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/video/console/dummycon.c ++++ b/drivers/video/console/dummycon.c +@@ -68,7 +68,6 @@ const struct consw dummy_con = { + .con_switch = DUMMY, + .con_blank = DUMMY, + .con_font_set = DUMMY, +- .con_font_get = DUMMY, + .con_font_default = DUMMY, + .con_font_copy = DUMMY, + .con_set_palette = DUMMY, diff --git a/queue-4.4/drm-radeon-adjust-tested-variable.patch b/queue-4.4/drm-radeon-adjust-tested-variable.patch new file mode 100644 index 00000000000..bcbf626f811 --- /dev/null +++ b/queue-4.4/drm-radeon-adjust-tested-variable.patch @@ -0,0 +1,57 @@ +From 3a61b527b4e1f285d21b6e9e623dc45cf8bb391f Mon Sep 17 00:00:00 2001 +From: Julia Lawall +Date: Sat, 27 Jan 2018 15:28:15 +0100 +Subject: drm/radeon: adjust tested variable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Julia Lawall + +commit 3a61b527b4e1f285d21b6e9e623dc45cf8bb391f upstream. + +Check the variable that was most recently initialized. + +The semantic match that finds this problem is as follows: +(http://coccinelle.lip6.fr/) + +// +@@ +expression x, y, f, g, e, m; +statement S1,S2,S3,S4; +@@ + +x = f(...); +if (\(<+...x...+>\&e\)) S1 else S2 +( +x = g(...); +| +m = g(...,&x,...); +| +y = g(...); +*if (e) + S3 else S4 +) +// + +Signed-off-by: Julia Lawall +Reviewed-by: Christian König +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/radeon_uvd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/radeon/radeon_uvd.c ++++ b/drivers/gpu/drm/radeon/radeon_uvd.c +@@ -946,7 +946,7 @@ int radeon_uvd_calc_upll_dividers(struct + /* calc dclk divider with current vco freq */ + dclk_div = radeon_uvd_calc_upll_post_div(vco_freq, dclk, + pd_min, pd_even); +- if (vclk_div > pd_max) ++ if (dclk_div > pd_max) + break; /* vco is too big, it has to stop */ + + /* calc score with current vco freq */ diff --git a/queue-4.4/ext4-correct-documentation-for-grpid-mount-option.patch b/queue-4.4/ext4-correct-documentation-for-grpid-mount-option.patch new file mode 100644 index 00000000000..7611c58df4d --- /dev/null +++ b/queue-4.4/ext4-correct-documentation-for-grpid-mount-option.patch @@ -0,0 +1,35 @@ +From 9f0372488cc9243018a812e8cfbf27de650b187b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ernesto=20A=2E=20Fern=C3=A1ndez?= + +Date: Thu, 11 Jan 2018 13:43:33 -0500 +Subject: ext4: correct documentation for grpid mount option +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ernesto A. Fernández + +commit 9f0372488cc9243018a812e8cfbf27de650b187b upstream. + +The grpid option is currently described as being the same as nogrpid. + +Signed-off-by: Ernesto A. Fernández +Signed-off-by: Theodore Ts'o +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + Documentation/filesystems/ext4.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/Documentation/filesystems/ext4.txt ++++ b/Documentation/filesystems/ext4.txt +@@ -233,7 +233,7 @@ data_err=ignore(*) Just print an error m + data_err=abort Abort the journal if an error occurs in a file + data buffer in ordered mode. + +-grpid Give objects the same group ID as their creator. ++grpid New objects have the group ID of their parent. + bsdgroups + + nogrpid (*) New objects have the group ID of their creator. diff --git a/queue-4.4/ext4-save-error-to-disk-in-__ext4_grp_locked_error.patch b/queue-4.4/ext4-save-error-to-disk-in-__ext4_grp_locked_error.patch new file mode 100644 index 00000000000..af55b877da8 --- /dev/null +++ b/queue-4.4/ext4-save-error-to-disk-in-__ext4_grp_locked_error.patch @@ -0,0 +1,37 @@ +From 06f29cc81f0350261f59643a505010531130eea0 Mon Sep 17 00:00:00 2001 +From: Zhouyi Zhou +Date: Wed, 10 Jan 2018 00:34:19 -0500 +Subject: ext4: save error to disk in __ext4_grp_locked_error() + +From: Zhouyi Zhou + +commit 06f29cc81f0350261f59643a505010531130eea0 upstream. + +In the function __ext4_grp_locked_error(), __save_error_info() +is called to save error info in super block block, but does not sync +that information to disk to info the subsequence fsck after reboot. + +This patch writes the error information to disk. After this patch, +I think there is no obvious EXT4 error handle branches which leads to +"Remounting filesystem read-only" will leave the disk partition miss +the subsequence fsck. + +Signed-off-by: Zhouyi Zhou +Signed-off-by: Theodore Ts'o +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/super.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -688,6 +688,7 @@ __acquires(bitlock) + } + + ext4_unlock_group(sb, grp); ++ ext4_commit_super(sb, 1); + ext4_handle_error(sb); + /* + * We only get here in the ERRORS_RO case; relocking the group diff --git a/queue-4.4/mm-hide-a-warning-for-compile_test.patch b/queue-4.4/mm-hide-a-warning-for-compile_test.patch new file mode 100644 index 00000000000..9239788423a --- /dev/null +++ b/queue-4.4/mm-hide-a-warning-for-compile_test.patch @@ -0,0 +1,39 @@ +From af27d9403f5b80685b79c88425086edccecaf711 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Fri, 16 Feb 2018 16:25:53 +0100 +Subject: mm: hide a #warning for COMPILE_TEST + +From: Arnd Bergmann + +commit af27d9403f5b80685b79c88425086edccecaf711 upstream. + +We get a warning about some slow configurations in randconfig kernels: + + mm/memory.c:83:2: error: #warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid. [-Werror=cpp] + +The warning is reasonable by itself, but gets in the way of randconfig +build testing, so I'm hiding it whenever CONFIG_COMPILE_TEST is set. + +The warning was added in 2013 in commit 75980e97dacc ("mm: fold +page->_last_nid into page->flags where possible"). + +Cc: stable@vger.kernel.org +Signed-off-by: Arnd Bergmann +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/memory.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/mm/memory.c ++++ b/mm/memory.c +@@ -72,7 +72,7 @@ + + #include "internal.h" + +-#ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS ++#if defined(LAST_CPUPID_NOT_IN_PAGE_FLAGS) && !defined(CONFIG_COMPILE_TEST) + #warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid. + #endif + diff --git a/queue-4.4/rtc-opal-fix-handling-of-firmware-error-codes-prevent-busy-loops.patch b/queue-4.4/rtc-opal-fix-handling-of-firmware-error-codes-prevent-busy-loops.patch new file mode 100644 index 00000000000..5ef0b926964 --- /dev/null +++ b/queue-4.4/rtc-opal-fix-handling-of-firmware-error-codes-prevent-busy-loops.patch @@ -0,0 +1,82 @@ +From 5b8b58063029f02da573120ef4dc9079822e3cda Mon Sep 17 00:00:00 2001 +From: Stewart Smith +Date: Tue, 2 Aug 2016 11:50:16 +1000 +Subject: rtc-opal: Fix handling of firmware error codes, prevent busy loops + +From: Stewart Smith + +commit 5b8b58063029f02da573120ef4dc9079822e3cda upstream. + +According to the OPAL docs: + skiboot-5.2.5/doc/opal-api/opal-rtc-read-3.txt + skiboot-5.2.5/doc/opal-api/opal-rtc-write-4.txt + +OPAL_HARDWARE may be returned from OPAL_RTC_READ or OPAL_RTC_WRITE and +this indicates either a transient or permanent error. + +Prior to this patch, Linux was not dealing with OPAL_HARDWARE being a +permanent error particularly well, in that you could end up in a busy +loop. + +This was not too hard to trigger on an AMI BMC based OpenPOWER machine +doing a continuous "ipmitool mc reset cold" to the BMC, the result of +that being that we'd get stuck in an infinite loop in +opal_get_rtc_time(). + +We now retry a few times before returning the error higher up the +stack. + +Fixes: 16b1d26e77b1 ("rtc/tpo: Driver to support rtc and wakeup on PowerNV platform") +Cc: stable@vger.kernel.org # v3.19+ +Signed-off-by: Stewart Smith +Signed-off-by: Michael Ellerman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/rtc/rtc-opal.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +--- a/drivers/rtc/rtc-opal.c ++++ b/drivers/rtc/rtc-opal.c +@@ -58,6 +58,7 @@ static void tm_to_opal(struct rtc_time * + static int opal_get_rtc_time(struct device *dev, struct rtc_time *tm) + { + long rc = OPAL_BUSY; ++ int retries = 10; + u32 y_m_d; + u64 h_m_s_ms; + __be32 __y_m_d; +@@ -67,8 +68,11 @@ static int opal_get_rtc_time(struct devi + rc = opal_rtc_read(&__y_m_d, &__h_m_s_ms); + if (rc == OPAL_BUSY_EVENT) + opal_poll_events(NULL); +- else ++ else if (retries-- && (rc == OPAL_HARDWARE ++ || rc == OPAL_INTERNAL_ERROR)) + msleep(10); ++ else if (rc != OPAL_BUSY && rc != OPAL_BUSY_EVENT) ++ break; + } + + if (rc != OPAL_SUCCESS) +@@ -84,6 +88,7 @@ static int opal_get_rtc_time(struct devi + static int opal_set_rtc_time(struct device *dev, struct rtc_time *tm) + { + long rc = OPAL_BUSY; ++ int retries = 10; + u32 y_m_d = 0; + u64 h_m_s_ms = 0; + +@@ -92,8 +97,11 @@ static int opal_set_rtc_time(struct devi + rc = opal_rtc_write(y_m_d, h_m_s_ms); + if (rc == OPAL_BUSY_EVENT) + opal_poll_events(NULL); +- else ++ else if (retries-- && (rc == OPAL_HARDWARE ++ || rc == OPAL_INTERNAL_ERROR)) + msleep(10); ++ else if (rc != OPAL_BUSY && rc != OPAL_BUSY_EVENT) ++ break; + } + + return rc == OPAL_SUCCESS ? 0 : -EIO; diff --git a/queue-4.4/series b/queue-4.4/series index e1f5b68d809..d1abfa7a51f 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -8,3 +8,10 @@ arm-spear13xx-fix-spics-gpio-controller-s-warning.patch alsa-seq-fix-regression-by-incorrect-ioctl_mutex-usages.patch kvm-x86-reduce-retpoline-performance-impact-in-slot_handle_level_range-by-always-inlining-iterator-helper-methods.patch x86-cpu-change-type-of-x86_cache_size-variable-to-unsigned-int.patch +drm-radeon-adjust-tested-variable.patch +rtc-opal-fix-handling-of-firmware-error-codes-prevent-busy-loops.patch +ext4-save-error-to-disk-in-__ext4_grp_locked_error.patch +ext4-correct-documentation-for-grpid-mount-option.patch +mm-hide-a-warning-for-compile_test.patch +video-fbdev-atmel_lcdfb-fix-display-timings-lookup.patch +console-dummy-leave-.con_font_get-set-to-null.patch diff --git a/queue-4.4/video-fbdev-atmel_lcdfb-fix-display-timings-lookup.patch b/queue-4.4/video-fbdev-atmel_lcdfb-fix-display-timings-lookup.patch new file mode 100644 index 00000000000..075078f5a45 --- /dev/null +++ b/queue-4.4/video-fbdev-atmel_lcdfb-fix-display-timings-lookup.patch @@ -0,0 +1,57 @@ +From 9cb18db0701f6b74f0c45c23ad767b3ebebe37f6 Mon Sep 17 00:00:00 2001 +From: Johan Hovold +Date: Fri, 29 Dec 2017 19:48:43 +0100 +Subject: video: fbdev: atmel_lcdfb: fix display-timings lookup + +From: Johan Hovold + +commit 9cb18db0701f6b74f0c45c23ad767b3ebebe37f6 upstream. + +Fix child-node lookup during probe, which ended up searching the whole +device tree depth-first starting at the parent rather than just matching +on its children. + +To make things worse, the parent display node was also prematurely +freed. + +Note that the display and timings node references are never put after a +successful dt-initialisation so the nodes would leak on later probe +deferrals and on driver unbind. + +Fixes: b985172b328a ("video: atmel_lcdfb: add device tree suport") +Cc: stable # 3.13 +Cc: Jean-Christophe PLAGNIOL-VILLARD +Cc: Nicolas Ferre +Cc: Alexandre Belloni +Signed-off-by: Johan Hovold +Signed-off-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/video/fbdev/atmel_lcdfb.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/video/fbdev/atmel_lcdfb.c ++++ b/drivers/video/fbdev/atmel_lcdfb.c +@@ -1120,7 +1120,7 @@ static int atmel_lcdfb_of_init(struct at + goto put_display_node; + } + +- timings_np = of_find_node_by_name(display_np, "display-timings"); ++ timings_np = of_get_child_by_name(display_np, "display-timings"); + if (!timings_np) { + dev_err(dev, "failed to find display-timings node\n"); + ret = -ENODEV; +@@ -1141,6 +1141,12 @@ static int atmel_lcdfb_of_init(struct at + fb_add_videomode(&fb_vm, &info->modelist); + } + ++ /* ++ * FIXME: Make sure we are not referencing any fields in display_np ++ * and timings_np and drop our references to them before returning to ++ * avoid leaking the nodes on probe deferral and driver unbind. ++ */ ++ + return 0; + + put_timings_node: