As discussed with Greg, I've had my randconfig builder build 4.9-stable kernels over the weekend, here is what it found missing. There are 45 patches that can be backported cleanly from mainline, plus another 9 that are either not part of mainline because the problem no longer exists there (e.g. file was removed), or the backport required context changes.
Most of these should also apply to 4.4, but I have not tried that yet.
Arnd
ac29fc66855b drm/i915: fix intel_backlight_device_register declaration 23f919d4ad0e shmem: avoid maybe-uninitialized warning aa01338c0184 clk: sunxi-ng: fix build error without CONFIG_RESET_CONTROLLER fbdf0e28d061 vmxnet3: prevent building with 64K pages 11d8b05855f3 perf/x86: Shut up false-positive -Wmaybe-uninitialized warning 42db500a551f PCI: vmd: Fix suspend handlers defined-but-not-used warning fbc2a294f29e gpio: intel-mid: Fix build warning when !CONFIG_PM b4aca383f9af platform/x86: intel_mid_thermal: Fix suspend handlers unused warning c8bd2ac3b4c6 usb: musb: fix compilation warning on unused function de5bbdd01cf9 PCI: Change pci_host_common_probe() visibility c0bfc549e962 perf: xgene: Include module.h 484c7bbf2649 video: fbdev: via: remove possibly unused variables 067fdeb2f391 dmaengine: zx: fix build warning f46e7cd36b5f scsi: advansys: fix build warning for PCI=n d4b2ac63b0ea x86/ras/inject: Make it depend on X86_LOCAL_APIC=y b115bebc07f2 gpio: xgene: mark PM functions as __maybe_unused f13d52cb3fad arm64: define BUG() instruction without CONFIG_BUG 75e2f0a6b161 x86/fpu/math-emu: Fix possible uninitialized variable use e572d0887137 tools build: Add tools tree support for 'make -s' d460131dd505 x86/build: Silence the build with "make -s" 68fd77cf8a4b thermal: fix INTEL_SOC_DTS_IOSF_CORE dependencies c2ce3f5d89d5 x86: add MULTIUSER dependency for KVM d689c64d189e x86/platform: Add PCI dependency for PUNIT_ATOM_DEBUG 3ba5b5ea7dc3 x86/vm86: Fix unused variable warning if THP is disabled 44a5b977128c scsi: advansys: fix uninitialized data access 2e449048a25e arm64: Kconfig: select COMPAT_BINFMT_ELF only when BINFMT_ELF is set 46a049dae771 ALSA: hda/ca0132 - fix possible NULL pointer use ab4949640d66 reiserfs: avoid a -Wmaybe-uninitialized warning 7fc1503c906f cw1200: fix bogus maybe-uninitialized warning 3cd18d198173 security/keys: BIG_KEY requires CONFIG_CRYPTO 7e1751001818 drm: exynos: mark pm functions as __maybe_unused 9e343e87d2c4 mtd: cfi: convert inline functions to macros 3cd890dbe2a4 media: dvb-frontends: fix i2c access helpers for KASAN d4c2269b3d5d rbd: silence bogus -Wmaybe-uninitialized warning b74c0a9969f2 drm/nouveau: hide gcc-4.9 -Wmaybe-uninitialized ea4348c8462a Input: tca8418_keypad - hide gcc-4.9 -Wmaybe-uninitialized warning 16c3ada89cff media: r820t: fix r820t_write_reg for KASAN e42eef4ba388 KVM: add X86_LOCAL_APIC dependency f1f5929cd971 shmem: fix compilation warnings on unused functions 3538aa6ecfb2 [media] tc358743: fix register i2c_rd/wr functions fa6317eedd63 [media] go7007: add MEDIA_CAMERA_SUPPORT dependency 190b23b4eb99 [media] em28xx: only use mt9v011 if camera support is enabled 27430d19a916 [media] tw5864: use dev_warn instead of WARN to shut up warning 27d807180ae0 ISDN: eicon: reduce stack size of sig_ind function dbed87a9d3a8 clk: meson: gxbb: fix build error without RESET_CONTROLLER
Arnd Bergmann (8): kasan: rework Kconfig settings drm/i915: hide unused intel_panel_set_backlight function arm64: sunxi: always enable reset controller binfmt_elf: compat: avoid unused function warning spi: bcm-qspi: shut up warning about cfi header inclusion idle: i7300: add PCI dependency arm64: fix warning about swapper_pg_dir overflow usb: phy: msm add regulator dependency
Borislav Petkov (1): x86/microcode/AMD: Change load_microcode_amd()'s param to bool to fix preemptibility bug
arch/arm64/Kconfig.platforms | 2 + arch/arm64/mm/mmu.c | 2 +- arch/x86/include/asm/microcode_amd.h | 1 - arch/x86/kernel/cpu/microcode/amd.c | 17 ++++--- drivers/gpu/drm/i915/intel_panel.c | 86 ++++++++++++++++++------------------ drivers/idle/Kconfig | 1 + drivers/spi/Kconfig | 1 + drivers/usb/phy/Kconfig | 1 + fs/compat_binfmt_elf.c | 2 + lib/Kconfig.debug | 1 - 10 files changed, 62 insertions(+), 52 deletions(-)
We get a lot of very large stack frames using gcc-7.0.1 with the default -fsanitize-address-use-after-scope --param asan-stack=1 options, which can easily cause an overflow of the kernel stack, e.g.
drivers/gpu/drm/i915/gvt/handlers.c:2434:1: warning: the frame size of 46176 bytes is larger than 3072 bytes drivers/net/wireless/ralink/rt2x00/rt2800lib.c:5650:1: warning: the frame size of 23632 bytes is larger than 3072 bytes lib/atomic64_test.c:250:1: warning: the frame size of 11200 bytes is larger than 3072 bytes drivers/gpu/drm/i915/gvt/handlers.c:2621:1: warning: the frame size of 9208 bytes is larger than 3072 bytes drivers/media/dvb-frontends/stv090x.c:3431:1: warning: the frame size of 6816 bytes is larger than 3072 bytes fs/fscache/stats.c:287:1: warning: the frame size of 6536 bytes is larger than 3072 bytes
To reduce this risk, -fsanitize-address-use-after-scope is now split out into a separate CONFIG_KASAN_EXTRA Kconfig option, leading to stack frames that are smaller than 2 kilobytes most of the time on x86_64. An earlier version of this patch also prevented combining KASAN_EXTRA with KASAN_INLINE, but that is no longer necessary with gcc-7.0.1.
All patches to get the frame size below 2048 bytes with CONFIG_KASAN=y and CONFIG_KASAN_EXTRA=n have been merged by maintainers now, so we can bring back that default now. KASAN_EXTRA=y still causes lots of warnings but now defaults to !COMPILE_TEST to disable it in allmodconfig, and it remains disabled in all other defconfigs since it is a new option. I arbitrarily raise the warning limit for KASAN_EXTRA to 3072 to reduce the noise, but an allmodconfig kernel still has around 50 warnings on gcc-7.
I experimented a bit more with smaller stack frames and have another follow-up series that reduces the warning limit for 64-bit architectures to 1280 bytes (without CONFIG_KASAN).
With earlier versions of this patch series, I also had patches to address the warnings we get with KASAN and/or KASAN_EXTRA, using a "noinline_if_stackbloat" annotation.
That annotation now got replaced with a gcc-8 bugfix (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715) and a workaround for older compilers, which means that KASAN_EXTRA is now just as bad as before and will lead to an instant stack overflow in a few extreme cases.
This reverts parts of commit 3f181b4d8652 ("lib/Kconfig.debug: disable -Wframe-larger-than warnings with KASAN=y"). Two patches in linux-next should be merged first to avoid introducing warnings in an allmodconfig build: 3cd890dbe2a4 ("media: dvb-frontends: fix i2c access helpers for KASAN") 16c3ada89cff ("media: r820t: fix r820t_write_reg for KASAN")
Do we really need to backport this?
I think we do: without this patch, enabling KASAN will lead to unavoidable kernel stack overflow in certain device drivers when built with gcc-7 or higher on linux-4.10+ or any version that contains a backport of commit c5caf21ab0cf8. Most people are probably still on older compilers, but it will get worse over time as they upgrade their distros.
The warnings we get on kernels older than this should all be for code that uses dangerously large stack frames, though most of them do not cause an actual stack overflow by themselves.The asan-stack option was added in linux-4.0, and commit 3f181b4d8652 ("lib/Kconfig.debug: disable -Wframe-larger-than warnings with KASAN=y") effectively turned off the warning for allmodconfig kernels, so I would like to see this fix backported to any kernels later than 4.0.
I have done dozens of fixes for individual functions with stack frames larger than 2048 bytes with asan-stack, and I plan to make sure that all those fixes make it into the stable kernels as well (most are already there).
Part of the complication here is that asan-stack (from 4.0) was originally assumed to always require much larger stacks, but that turned out to be a combination of multiple gcc bugs that we have now worked around and fixed, but sanitize-address-use-after-scope (from v4.10) has a much higher inherent stack usage and also suffers from at least three other problems that we have analyzed but not yet fixed upstream, each of them makes the stack usage more severe than it should be.
Link: http://lkml.kernel.org/r/20171221134744.2295529-1-arnd@arndb.de Signed-off-by: Arnd Bergmann arnd@arndb.de Acked-by: Andrey Ryabinin aryabinin@virtuozzo.com Cc: Mauro Carvalho Chehab mchehab@kernel.org Cc: Andrey Ryabinin aryabinin@virtuozzo.com Cc: Alexander Potapenko glider@google.com Cc: Dmitry Vyukov dvyukov@google.com Cc: Andrey Konovalov andreyknvl@google.com Cc: stable@vger.kernel.org Signed-off-by: Andrew Morton akpm@linux-foundation.org Signed-off-by: Linus Torvalds torvalds@linux-foundation.org [arnd: rebase to v4.9; only re-enable warning] Signed-off-by: Arnd Bergmann arnd@arndb.de --- lib/Kconfig.debug | 1 - 1 file changed, 1 deletion(-)
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index f60e67217f18..58a22ca10f33 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -197,7 +197,6 @@ config ENABLE_MUST_CHECK config FRAME_WARN int "Warn for stack frames larger than (needs gcc 4.4)" range 0 8192 - default 0 if KASAN default 2048 if GCC_PLUGIN_LATENT_ENTROPY default 1024 if !64BIT default 2048 if 64BIT
This is a note to let you know that I've just added the patch titled
kasan: rework Kconfig settings
to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
The filename of the patch is: kasan-rework-kconfig-settings.patch and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let stable@vger.kernel.org know about it.
From foo@baz Fri Feb 23 16:40:21 CET 2018
From: Arnd Bergmann arnd@arndb.de Date: Mon, 19 Feb 2018 11:13:20 +0100 Subject: kasan: rework Kconfig settings To: stable@vger.kernel.org Cc: Greg KH gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Arnd Bergmann arnd@arndb.de, Mauro Carvalho Chehab mchehab@kernel.org, Andrey Ryabinin aryabinin@virtuozzo.com, Alexander Potapenko glider@google.com, Dmitry Vyukov dvyukov@google.com, Andrey Konovalov andreyknvl@google.com, Andrew Morton akpm@linux-foundation.org, Linus Torvalds torvalds@linux-foundation.org, Sasha Levin alexander.levin@verizon.com, Sudip Mukherjee sudipm.mukherjee@gmail.com Message-ID: 20180219101343.2922561-2-arnd@arndb.de
From: Arnd Bergmann arnd@arndb.de
commit e7c52b84fb18f08ce49b6067ae6285aca79084a8 upstream.
We get a lot of very large stack frames using gcc-7.0.1 with the default -fsanitize-address-use-after-scope --param asan-stack=1 options, which can easily cause an overflow of the kernel stack, e.g.
drivers/gpu/drm/i915/gvt/handlers.c:2434:1: warning: the frame size of 46176 bytes is larger than 3072 bytes drivers/net/wireless/ralink/rt2x00/rt2800lib.c:5650:1: warning: the frame size of 23632 bytes is larger than 3072 bytes lib/atomic64_test.c:250:1: warning: the frame size of 11200 bytes is larger than 3072 bytes drivers/gpu/drm/i915/gvt/handlers.c:2621:1: warning: the frame size of 9208 bytes is larger than 3072 bytes drivers/media/dvb-frontends/stv090x.c:3431:1: warning: the frame size of 6816 bytes is larger than 3072 bytes fs/fscache/stats.c:287:1: warning: the frame size of 6536 bytes is larger than 3072 bytes
To reduce this risk, -fsanitize-address-use-after-scope is now split out into a separate CONFIG_KASAN_EXTRA Kconfig option, leading to stack frames that are smaller than 2 kilobytes most of the time on x86_64. An earlier version of this patch also prevented combining KASAN_EXTRA with KASAN_INLINE, but that is no longer necessary with gcc-7.0.1.
All patches to get the frame size below 2048 bytes with CONFIG_KASAN=y and CONFIG_KASAN_EXTRA=n have been merged by maintainers now, so we can bring back that default now. KASAN_EXTRA=y still causes lots of warnings but now defaults to !COMPILE_TEST to disable it in allmodconfig, and it remains disabled in all other defconfigs since it is a new option. I arbitrarily raise the warning limit for KASAN_EXTRA to 3072 to reduce the noise, but an allmodconfig kernel still has around 50 warnings on gcc-7.
I experimented a bit more with smaller stack frames and have another follow-up series that reduces the warning limit for 64-bit architectures to 1280 bytes (without CONFIG_KASAN).
With earlier versions of this patch series, I also had patches to address the warnings we get with KASAN and/or KASAN_EXTRA, using a "noinline_if_stackbloat" annotation.
That annotation now got replaced with a gcc-8 bugfix (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715) and a workaround for older compilers, which means that KASAN_EXTRA is now just as bad as before and will lead to an instant stack overflow in a few extreme cases.
This reverts parts of commit 3f181b4d8652 ("lib/Kconfig.debug: disable -Wframe-larger-than warnings with KASAN=y"). Two patches in linux-next should be merged first to avoid introducing warnings in an allmodconfig build: 3cd890dbe2a4 ("media: dvb-frontends: fix i2c access helpers for KASAN") 16c3ada89cff ("media: r820t: fix r820t_write_reg for KASAN")
Do we really need to backport this?
I think we do: without this patch, enabling KASAN will lead to unavoidable kernel stack overflow in certain device drivers when built with gcc-7 or higher on linux-4.10+ or any version that contains a backport of commit c5caf21ab0cf8. Most people are probably still on older compilers, but it will get worse over time as they upgrade their distros.
The warnings we get on kernels older than this should all be for code that uses dangerously large stack frames, though most of them do not cause an actual stack overflow by themselves.The asan-stack option was added in linux-4.0, and commit 3f181b4d8652 ("lib/Kconfig.debug: disable -Wframe-larger-than warnings with KASAN=y") effectively turned off the warning for allmodconfig kernels, so I would like to see this fix backported to any kernels later than 4.0.
I have done dozens of fixes for individual functions with stack frames larger than 2048 bytes with asan-stack, and I plan to make sure that all those fixes make it into the stable kernels as well (most are already there).
Part of the complication here is that asan-stack (from 4.0) was originally assumed to always require much larger stacks, but that turned out to be a combination of multiple gcc bugs that we have now worked around and fixed, but sanitize-address-use-after-scope (from v4.10) has a much higher inherent stack usage and also suffers from at least three other problems that we have analyzed but not yet fixed upstream, each of them makes the stack usage more severe than it should be.
Link: http://lkml.kernel.org/r/20171221134744.2295529-1-arnd@arndb.de Signed-off-by: Arnd Bergmann arnd@arndb.de Acked-by: Andrey Ryabinin aryabinin@virtuozzo.com Cc: Mauro Carvalho Chehab mchehab@kernel.org Cc: Andrey Ryabinin aryabinin@virtuozzo.com Cc: Alexander Potapenko glider@google.com Cc: Dmitry Vyukov dvyukov@google.com Cc: Andrey Konovalov andreyknvl@google.com Cc: stable@vger.kernel.org Signed-off-by: Andrew Morton akpm@linux-foundation.org Signed-off-by: Linus Torvalds torvalds@linux-foundation.org [arnd: rebase to v4.9; only re-enable warning] Signed-off-by: Arnd Bergmann arnd@arndb.de Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- lib/Kconfig.debug | 1 - 1 file changed, 1 deletion(-)
--- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -197,7 +197,6 @@ config ENABLE_MUST_CHECK config FRAME_WARN int "Warn for stack frames larger than (needs gcc 4.4)" range 0 8192 - default 0 if KASAN default 2048 if GCC_PLUGIN_LATENT_ENTROPY default 1024 if !64BIT default 2048 if 64BIT
Patches currently in stable-queue which might be from arnd@arndb.de are
queue-4.9/kasan-rework-kconfig-settings.patch queue-4.9/tw5864-use-dev_warn-instead-of-warn-to-shut-up-warning.patch queue-4.9/perf-x86-shut-up-false-positive-wmaybe-uninitialized-warning.patch queue-4.9/go7007-add-media_camera_support-dependency.patch queue-4.9/scsi-advansys-fix-build-warning-for-pci-n.patch queue-4.9/video-fbdev-via-remove-possibly-unused-variables.patch queue-4.9/drm-exynos-mark-pm-functions-as-__maybe_unused.patch queue-4.9/binfmt_elf-compat-avoid-unused-function-warning.patch queue-4.9/idle-i7300-add-pci-dependency.patch queue-4.9/cw1200-fix-bogus-maybe-uninitialized-warning.patch queue-4.9/x86-build-silence-the-build-with-make-s.patch queue-4.9/gpio-xgene-mark-pm-functions-as-__maybe_unused.patch queue-4.9/kvm-add-x86_local_apic-dependency.patch queue-4.9/reiserfs-avoid-a-wmaybe-uninitialized-warning.patch queue-4.9/scsi-advansys-fix-uninitialized-data-access.patch queue-4.9/drm-i915-fix-intel_backlight_device_register-declaration.patch queue-4.9/spi-bcm-qspi-shut-up-warning-about-cfi-header-inclusion.patch queue-4.9/asoc-ux500-add-module_license-tag.patch queue-4.9/x86-microcode-amd-change-load_microcode_amd-s-param-to-bool-to-fix-preemptibility-bug.patch queue-4.9/video-fbdev-mmp-add-module_license.patch queue-4.9/usb-phy-msm-add-regulator-dependency.patch queue-4.9/arm64-dts-add-cooling-cells-to-cpu-nodes.patch queue-4.9/vmxnet3-prevent-building-with-64k-pages.patch queue-4.9/x86-platform-add-pci-dependency-for-punit_atom_debug.patch queue-4.9/alsa-hda-ca0132-fix-possible-null-pointer-use.patch queue-4.9/thermal-fix-intel_soc_dts_iosf_core-dependencies.patch queue-4.9/arm64-define-bug-instruction-without-config_bug.patch queue-4.9/arm64-sunxi-always-enable-reset-controller.patch queue-4.9/tc358743-fix-register-i2c_rd-wr-functions.patch queue-4.9/security-keys-big_key-requires-config_crypto.patch queue-4.9/drm-i915-hide-unused-intel_panel_set_backlight-function.patch queue-4.9/x86-fpu-math-emu-fix-possible-uninitialized-variable-use.patch queue-4.9/arm-8743-1-bl_switcher-add-module_license-tag.patch queue-4.9/em28xx-only-use-mt9v011-if-camera-support-is-enabled.patch queue-4.9/arm64-fix-warning-about-swapper_pg_dir-overflow.patch queue-4.9/shmem-avoid-maybe-uninitialized-warning.patch queue-4.9/input-tca8418_keypad-hide-gcc-4.9-wmaybe-uninitialized-warning.patch queue-4.9/drm-nouveau-hide-gcc-4.9-wmaybe-uninitialized.patch queue-4.9/x86-add-multiuser-dependency-for-kvm.patch queue-4.9/isdn-eicon-reduce-stack-size-of-sig_ind-function.patch
commit fd94d53e55bd487368dfee9f1af24da78b2bb582 upstream.
Building i915 without backlight support results in a harmless warning for intel_panel_set_backlight:
drivers/gpu/drm/i915/intel_panel.c:653:13: error: 'intel_panel_set_backlight' defined but not used [-Werror=unused-function]
This moves it into the CONFIG_BACKLIGHT_CLASS_DEVICE section that its caller is in.
Signed-off-by: Arnd Bergmann arnd@arndb.de Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch Link: https://patchwork.freedesktop.org/patch/msgid/20171127151239.1813673-2-arnd@... [arnd: manually rebased to 4.9] Signed-off-by: Arnd Bergmann arnd@arndb.de --- drivers/gpu/drm/i915/intel_panel.c | 86 +++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 43 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index be4b4d546fd9..1cb1b01e4471 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -544,25 +544,6 @@ static u32 pwm_get_backlight(struct intel_connector *connector) return DIV_ROUND_UP(duty_ns * 100, CRC_PMIC_PWM_PERIOD_NS); }
-static u32 intel_panel_get_backlight(struct intel_connector *connector) -{ - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct intel_panel *panel = &connector->panel; - u32 val = 0; - - mutex_lock(&dev_priv->backlight_lock); - - if (panel->backlight.enabled) { - val = panel->backlight.get(connector); - val = intel_panel_compute_brightness(connector, val); - } - - mutex_unlock(&dev_priv->backlight_lock); - - DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val); - return val; -} - static void lpt_set_backlight(struct intel_connector *connector, u32 level) { struct drm_i915_private *dev_priv = to_i915(connector->base.dev); @@ -646,30 +627,6 @@ intel_panel_actually_set_backlight(struct intel_connector *connector, u32 level) panel->backlight.set(connector, level); }
-/* set backlight brightness to level in range [0..max], scaling wrt hw min */ -static void intel_panel_set_backlight(struct intel_connector *connector, - u32 user_level, u32 user_max) -{ - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct intel_panel *panel = &connector->panel; - u32 hw_level; - - if (!panel->backlight.present) - return; - - mutex_lock(&dev_priv->backlight_lock); - - WARN_ON(panel->backlight.max == 0); - - hw_level = scale_user_to_hw(connector, user_level, user_max); - panel->backlight.level = hw_level; - - if (panel->backlight.enabled) - intel_panel_actually_set_backlight(connector, hw_level); - - mutex_unlock(&dev_priv->backlight_lock); -} - /* set backlight brightness to level in range [0..max], assuming hw min is * respected. */ @@ -1122,6 +1079,49 @@ void intel_panel_enable_backlight(struct intel_connector *connector) }
#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) +static u32 intel_panel_get_backlight(struct intel_connector *connector) +{ + struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct intel_panel *panel = &connector->panel; + u32 val = 0; + + mutex_lock(&dev_priv->backlight_lock); + + if (panel->backlight.enabled) { + val = panel->backlight.get(connector); + val = intel_panel_compute_brightness(connector, val); + } + + mutex_unlock(&dev_priv->backlight_lock); + + DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val); + return val; +} + +/* set backlight brightness to level in range [0..max], scaling wrt hw min */ +static void intel_panel_set_backlight(struct intel_connector *connector, + u32 user_level, u32 user_max) +{ + struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct intel_panel *panel = &connector->panel; + u32 hw_level; + + if (!panel->backlight.present) + return; + + mutex_lock(&dev_priv->backlight_lock); + + WARN_ON(panel->backlight.max == 0); + + hw_level = scale_user_to_hw(connector, user_level, user_max); + panel->backlight.level = hw_level; + + if (panel->backlight.enabled) + intel_panel_actually_set_backlight(connector, hw_level); + + mutex_unlock(&dev_priv->backlight_lock); +} + static int intel_backlight_device_update_status(struct backlight_device *bd) { struct intel_connector *connector = bl_get_data(bd);
This is a note to let you know that I've just added the patch titled
drm/i915: hide unused intel_panel_set_backlight function
to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
The filename of the patch is: drm-i915-hide-unused-intel_panel_set_backlight-function.patch and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let stable@vger.kernel.org know about it.
From foo@baz Fri Feb 23 16:40:21 CET 2018
From: Arnd Bergmann arnd@arndb.de Date: Mon, 19 Feb 2018 11:13:21 +0100 Subject: drm/i915: hide unused intel_panel_set_backlight function To: stable@vger.kernel.org Cc: Greg KH gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Arnd Bergmann arnd@arndb.de, Daniel Vetter daniel.vetter@ffwll.ch, Daniel Vetter daniel.vetter@intel.com, Jani Nikula jani.nikula@linux.intel.com, David Airlie airlied@linux.ie, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Message-ID: 20180219101343.2922561-3-arnd@arndb.de
From: Arnd Bergmann arnd@arndb.de
commit fd94d53e55bd487368dfee9f1af24da78b2bb582 upstream.
Building i915 without backlight support results in a harmless warning for intel_panel_set_backlight:
drivers/gpu/drm/i915/intel_panel.c:653:13: error: 'intel_panel_set_backlight' defined but not used [-Werror=unused-function]
This moves it into the CONFIG_BACKLIGHT_CLASS_DEVICE section that its caller is in.
Signed-off-by: Arnd Bergmann arnd@arndb.de Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch Link: https://patchwork.freedesktop.org/patch/msgid/20171127151239.1813673-2-arnd@... [arnd: manually rebased to 4.9] Signed-off-by: Arnd Bergmann arnd@arndb.de Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- drivers/gpu/drm/i915/intel_panel.c | 86 ++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 43 deletions(-)
--- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -544,25 +544,6 @@ static u32 pwm_get_backlight(struct inte return DIV_ROUND_UP(duty_ns * 100, CRC_PMIC_PWM_PERIOD_NS); }
-static u32 intel_panel_get_backlight(struct intel_connector *connector) -{ - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct intel_panel *panel = &connector->panel; - u32 val = 0; - - mutex_lock(&dev_priv->backlight_lock); - - if (panel->backlight.enabled) { - val = panel->backlight.get(connector); - val = intel_panel_compute_brightness(connector, val); - } - - mutex_unlock(&dev_priv->backlight_lock); - - DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val); - return val; -} - static void lpt_set_backlight(struct intel_connector *connector, u32 level) { struct drm_i915_private *dev_priv = to_i915(connector->base.dev); @@ -646,30 +627,6 @@ intel_panel_actually_set_backlight(struc panel->backlight.set(connector, level); }
-/* set backlight brightness to level in range [0..max], scaling wrt hw min */ -static void intel_panel_set_backlight(struct intel_connector *connector, - u32 user_level, u32 user_max) -{ - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct intel_panel *panel = &connector->panel; - u32 hw_level; - - if (!panel->backlight.present) - return; - - mutex_lock(&dev_priv->backlight_lock); - - WARN_ON(panel->backlight.max == 0); - - hw_level = scale_user_to_hw(connector, user_level, user_max); - panel->backlight.level = hw_level; - - if (panel->backlight.enabled) - intel_panel_actually_set_backlight(connector, hw_level); - - mutex_unlock(&dev_priv->backlight_lock); -} - /* set backlight brightness to level in range [0..max], assuming hw min is * respected. */ @@ -1122,6 +1079,49 @@ void intel_panel_enable_backlight(struct }
#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) +static u32 intel_panel_get_backlight(struct intel_connector *connector) +{ + struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct intel_panel *panel = &connector->panel; + u32 val = 0; + + mutex_lock(&dev_priv->backlight_lock); + + if (panel->backlight.enabled) { + val = panel->backlight.get(connector); + val = intel_panel_compute_brightness(connector, val); + } + + mutex_unlock(&dev_priv->backlight_lock); + + DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val); + return val; +} + +/* set backlight brightness to level in range [0..max], scaling wrt hw min */ +static void intel_panel_set_backlight(struct intel_connector *connector, + u32 user_level, u32 user_max) +{ + struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct intel_panel *panel = &connector->panel; + u32 hw_level; + + if (!panel->backlight.present) + return; + + mutex_lock(&dev_priv->backlight_lock); + + WARN_ON(panel->backlight.max == 0); + + hw_level = scale_user_to_hw(connector, user_level, user_max); + panel->backlight.level = hw_level; + + if (panel->backlight.enabled) + intel_panel_actually_set_backlight(connector, hw_level); + + mutex_unlock(&dev_priv->backlight_lock); +} + static int intel_backlight_device_update_status(struct backlight_device *bd) { struct intel_connector *connector = bl_get_data(bd);
Patches currently in stable-queue which might be from arnd@arndb.de are
queue-4.9/kasan-rework-kconfig-settings.patch queue-4.9/tw5864-use-dev_warn-instead-of-warn-to-shut-up-warning.patch queue-4.9/perf-x86-shut-up-false-positive-wmaybe-uninitialized-warning.patch queue-4.9/go7007-add-media_camera_support-dependency.patch queue-4.9/scsi-advansys-fix-build-warning-for-pci-n.patch queue-4.9/video-fbdev-via-remove-possibly-unused-variables.patch queue-4.9/drm-exynos-mark-pm-functions-as-__maybe_unused.patch queue-4.9/binfmt_elf-compat-avoid-unused-function-warning.patch queue-4.9/idle-i7300-add-pci-dependency.patch queue-4.9/cw1200-fix-bogus-maybe-uninitialized-warning.patch queue-4.9/x86-build-silence-the-build-with-make-s.patch queue-4.9/gpio-xgene-mark-pm-functions-as-__maybe_unused.patch queue-4.9/kvm-add-x86_local_apic-dependency.patch queue-4.9/reiserfs-avoid-a-wmaybe-uninitialized-warning.patch queue-4.9/scsi-advansys-fix-uninitialized-data-access.patch queue-4.9/drm-i915-fix-intel_backlight_device_register-declaration.patch queue-4.9/spi-bcm-qspi-shut-up-warning-about-cfi-header-inclusion.patch queue-4.9/asoc-ux500-add-module_license-tag.patch queue-4.9/x86-microcode-amd-change-load_microcode_amd-s-param-to-bool-to-fix-preemptibility-bug.patch queue-4.9/video-fbdev-mmp-add-module_license.patch queue-4.9/usb-phy-msm-add-regulator-dependency.patch queue-4.9/arm64-dts-add-cooling-cells-to-cpu-nodes.patch queue-4.9/vmxnet3-prevent-building-with-64k-pages.patch queue-4.9/x86-platform-add-pci-dependency-for-punit_atom_debug.patch queue-4.9/alsa-hda-ca0132-fix-possible-null-pointer-use.patch queue-4.9/thermal-fix-intel_soc_dts_iosf_core-dependencies.patch queue-4.9/arm64-define-bug-instruction-without-config_bug.patch queue-4.9/arm64-sunxi-always-enable-reset-controller.patch queue-4.9/tc358743-fix-register-i2c_rd-wr-functions.patch queue-4.9/security-keys-big_key-requires-config_crypto.patch queue-4.9/drm-i915-hide-unused-intel_panel_set_backlight-function.patch queue-4.9/x86-fpu-math-emu-fix-possible-uninitialized-variable-use.patch queue-4.9/arm-8743-1-bl_switcher-add-module_license-tag.patch queue-4.9/em28xx-only-use-mt9v011-if-camera-support-is-enabled.patch queue-4.9/arm64-fix-warning-about-swapper_pg_dir-overflow.patch queue-4.9/shmem-avoid-maybe-uninitialized-warning.patch queue-4.9/input-tca8418_keypad-hide-gcc-4.9-wmaybe-uninitialized-warning.patch queue-4.9/drm-nouveau-hide-gcc-4.9-wmaybe-uninitialized.patch queue-4.9/x86-add-multiuser-dependency-for-kvm.patch queue-4.9/isdn-eicon-reduce-stack-size-of-sig_ind-function.patch
commit 900a9020af7a023f9b64c919fddf8a7486108962 upstream.
The sunxi clk driver causes a link error when the reset controller subsystem is disabled:
drivers/clk/built-in.o: In function `sun4i_ve_clk_setup': :(.init.text+0xd040): undefined reference to `reset_controller_register' drivers/clk/built-in.o: In function `sun4i_a10_display_init': :(.init.text+0xe5e0): undefined reference to `reset_controller_register' drivers/clk/built-in.o: In function `sunxi_usb_clk_setup': :(.init.text+0x10074): undefined reference to `reset_controller_register'
We already force it to be enabled on arm32 and some other arm64 platforms, but not on arm64/sunxi. This adds the respective Kconfig statements to also select it here.
Signed-off-by: Arnd Bergmann arnd@arndb.de Acked-by: Maxime Ripard maxime.ripard@free-electrons.com [arnd: manually rebased to 4.9] Signed-off-by: Arnd Bergmann arnd@arndb.de --- arch/arm64/Kconfig.platforms | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms index 101794f5ce10..08a4497f70a6 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -2,9 +2,11 @@ menu "Platform selection"
config ARCH_SUNXI bool "Allwinner sunxi 64-bit SoC Family" + select ARCH_HAS_RESET_CONTROLLER select GENERIC_IRQ_CHIP select PINCTRL select PINCTRL_SUN50I_A64 + select RESET_CONTROLLER help This enables support for Allwinner sunxi based SoCs like the A64.
This is a note to let you know that I've just added the patch titled
arm64: sunxi: always enable reset controller
to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
The filename of the patch is: arm64-sunxi-always-enable-reset-controller.patch and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let stable@vger.kernel.org know about it.
From foo@baz Fri Feb 23 16:40:21 CET 2018
From: Arnd Bergmann arnd@arndb.de Date: Mon, 19 Feb 2018 11:13:22 +0100 Subject: arm64: sunxi: always enable reset controller To: stable@vger.kernel.org Cc: Greg KH gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Arnd Bergmann arnd@arndb.de, Catalin Marinas catalin.marinas@arm.com, Will Deacon will.deacon@arm.com, Maxime Ripard maxime.ripard@free-electrons.com, linux-arm-kernel@lists.infradead.org Message-ID: 20180219101343.2922561-4-arnd@arndb.de
From: Arnd Bergmann arnd@arndb.de
commit 900a9020af7a023f9b64c919fddf8a7486108962 upstream.
The sunxi clk driver causes a link error when the reset controller subsystem is disabled:
drivers/clk/built-in.o: In function `sun4i_ve_clk_setup': :(.init.text+0xd040): undefined reference to `reset_controller_register' drivers/clk/built-in.o: In function `sun4i_a10_display_init': :(.init.text+0xe5e0): undefined reference to `reset_controller_register' drivers/clk/built-in.o: In function `sunxi_usb_clk_setup': :(.init.text+0x10074): undefined reference to `reset_controller_register'
We already force it to be enabled on arm32 and some other arm64 platforms, but not on arm64/sunxi. This adds the respective Kconfig statements to also select it here.
Signed-off-by: Arnd Bergmann arnd@arndb.de Acked-by: Maxime Ripard maxime.ripard@free-electrons.com [arnd: manually rebased to 4.9] Signed-off-by: Arnd Bergmann arnd@arndb.de Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- arch/arm64/Kconfig.platforms | 2 ++ 1 file changed, 2 insertions(+)
--- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -2,9 +2,11 @@ menu "Platform selection"
config ARCH_SUNXI bool "Allwinner sunxi 64-bit SoC Family" + select ARCH_HAS_RESET_CONTROLLER select GENERIC_IRQ_CHIP select PINCTRL select PINCTRL_SUN50I_A64 + select RESET_CONTROLLER help This enables support for Allwinner sunxi based SoCs like the A64.
Patches currently in stable-queue which might be from arnd@arndb.de are
queue-4.9/kasan-rework-kconfig-settings.patch queue-4.9/tw5864-use-dev_warn-instead-of-warn-to-shut-up-warning.patch queue-4.9/perf-x86-shut-up-false-positive-wmaybe-uninitialized-warning.patch queue-4.9/go7007-add-media_camera_support-dependency.patch queue-4.9/scsi-advansys-fix-build-warning-for-pci-n.patch queue-4.9/video-fbdev-via-remove-possibly-unused-variables.patch queue-4.9/drm-exynos-mark-pm-functions-as-__maybe_unused.patch queue-4.9/binfmt_elf-compat-avoid-unused-function-warning.patch queue-4.9/idle-i7300-add-pci-dependency.patch queue-4.9/cw1200-fix-bogus-maybe-uninitialized-warning.patch queue-4.9/x86-build-silence-the-build-with-make-s.patch queue-4.9/gpio-xgene-mark-pm-functions-as-__maybe_unused.patch queue-4.9/kvm-add-x86_local_apic-dependency.patch queue-4.9/reiserfs-avoid-a-wmaybe-uninitialized-warning.patch queue-4.9/scsi-advansys-fix-uninitialized-data-access.patch queue-4.9/drm-i915-fix-intel_backlight_device_register-declaration.patch queue-4.9/spi-bcm-qspi-shut-up-warning-about-cfi-header-inclusion.patch queue-4.9/asoc-ux500-add-module_license-tag.patch queue-4.9/x86-microcode-amd-change-load_microcode_amd-s-param-to-bool-to-fix-preemptibility-bug.patch queue-4.9/video-fbdev-mmp-add-module_license.patch queue-4.9/usb-phy-msm-add-regulator-dependency.patch queue-4.9/arm64-dts-add-cooling-cells-to-cpu-nodes.patch queue-4.9/vmxnet3-prevent-building-with-64k-pages.patch queue-4.9/x86-platform-add-pci-dependency-for-punit_atom_debug.patch queue-4.9/alsa-hda-ca0132-fix-possible-null-pointer-use.patch queue-4.9/thermal-fix-intel_soc_dts_iosf_core-dependencies.patch queue-4.9/arm64-define-bug-instruction-without-config_bug.patch queue-4.9/arm64-sunxi-always-enable-reset-controller.patch queue-4.9/tc358743-fix-register-i2c_rd-wr-functions.patch queue-4.9/security-keys-big_key-requires-config_crypto.patch queue-4.9/drm-i915-hide-unused-intel_panel_set_backlight-function.patch queue-4.9/x86-fpu-math-emu-fix-possible-uninitialized-variable-use.patch queue-4.9/arm-8743-1-bl_switcher-add-module_license-tag.patch queue-4.9/em28xx-only-use-mt9v011-if-camera-support-is-enabled.patch queue-4.9/arm64-fix-warning-about-swapper_pg_dir-overflow.patch queue-4.9/shmem-avoid-maybe-uninitialized-warning.patch queue-4.9/input-tca8418_keypad-hide-gcc-4.9-wmaybe-uninitialized-warning.patch queue-4.9/drm-nouveau-hide-gcc-4.9-wmaybe-uninitialized.patch queue-4.9/x86-add-multiuser-dependency-for-kvm.patch queue-4.9/isdn-eicon-reduce-stack-size-of-sig_ind-function.patch
When CONFIG_ELF_CORE is disabled, we get a harmless warning in the compat version of binfmt_elf:
fs/compat_binfmt_elf.c:58:13: error: 'cputime_to_compat_timeval' defined but not used [-Werror=unused-function]
This was addressed in mainline Linux as part of a larger rework with commit cd19c364b313 ("fs/binfmt: Convert obsolete cputime type to nsecs").
For 4.9 and earlier, this just shuts up the warning by adding an #ifdef around the function definition.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- fs/compat_binfmt_elf.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/fs/compat_binfmt_elf.c b/fs/compat_binfmt_elf.c index 4d24d17bcfc1..943be5ecfcd9 100644 --- a/fs/compat_binfmt_elf.c +++ b/fs/compat_binfmt_elf.c @@ -51,6 +51,7 @@ #define elf_prstatus compat_elf_prstatus #define elf_prpsinfo compat_elf_prpsinfo
+#ifdef CONFIG_ELF_CORE /* * Compat version of cputime_to_compat_timeval, perhaps this * should be an inline in <linux/compat.h>. @@ -63,6 +64,7 @@ static void cputime_to_compat_timeval(const cputime_t cputime, value->tv_sec = tv.tv_sec; value->tv_usec = tv.tv_usec; } +#endif
#undef cputime_to_timeval #define cputime_to_timeval cputime_to_compat_timeval
This is a note to let you know that I've just added the patch titled
binfmt_elf: compat: avoid unused function warning
to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
The filename of the patch is: binfmt_elf-compat-avoid-unused-function-warning.patch and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let stable@vger.kernel.org know about it.
From foo@baz Fri Feb 23 16:40:21 CET 2018
From: Arnd Bergmann arnd@arndb.de Date: Mon, 19 Feb 2018 11:13:23 +0100 Subject: binfmt_elf: compat: avoid unused function warning To: stable@vger.kernel.org Cc: Greg KH gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Arnd Bergmann arnd@arndb.de, Alexander Viro viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org Message-ID: 20180219101343.2922561-5-arnd@arndb.de
From: Arnd Bergmann arnd@arndb.de
When CONFIG_ELF_CORE is disabled, we get a harmless warning in the compat version of binfmt_elf:
fs/compat_binfmt_elf.c:58:13: error: 'cputime_to_compat_timeval' defined but not used [-Werror=unused-function]
This was addressed in mainline Linux as part of a larger rework with commit cd19c364b313 ("fs/binfmt: Convert obsolete cputime type to nsecs").
For 4.9 and earlier, this just shuts up the warning by adding an #ifdef around the function definition.
Signed-off-by: Arnd Bergmann arnd@arndb.de Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- fs/compat_binfmt_elf.c | 2 ++ 1 file changed, 2 insertions(+)
--- a/fs/compat_binfmt_elf.c +++ b/fs/compat_binfmt_elf.c @@ -51,6 +51,7 @@ #define elf_prstatus compat_elf_prstatus #define elf_prpsinfo compat_elf_prpsinfo
+#ifdef CONFIG_ELF_CORE /* * Compat version of cputime_to_compat_timeval, perhaps this * should be an inline in <linux/compat.h>. @@ -63,6 +64,7 @@ static void cputime_to_compat_timeval(co value->tv_sec = tv.tv_sec; value->tv_usec = tv.tv_usec; } +#endif
#undef cputime_to_timeval #define cputime_to_timeval cputime_to_compat_timeval
Patches currently in stable-queue which might be from arnd@arndb.de are
queue-4.9/kasan-rework-kconfig-settings.patch queue-4.9/tw5864-use-dev_warn-instead-of-warn-to-shut-up-warning.patch queue-4.9/perf-x86-shut-up-false-positive-wmaybe-uninitialized-warning.patch queue-4.9/go7007-add-media_camera_support-dependency.patch queue-4.9/scsi-advansys-fix-build-warning-for-pci-n.patch queue-4.9/video-fbdev-via-remove-possibly-unused-variables.patch queue-4.9/drm-exynos-mark-pm-functions-as-__maybe_unused.patch queue-4.9/binfmt_elf-compat-avoid-unused-function-warning.patch queue-4.9/idle-i7300-add-pci-dependency.patch queue-4.9/cw1200-fix-bogus-maybe-uninitialized-warning.patch queue-4.9/x86-build-silence-the-build-with-make-s.patch queue-4.9/gpio-xgene-mark-pm-functions-as-__maybe_unused.patch queue-4.9/kvm-add-x86_local_apic-dependency.patch queue-4.9/reiserfs-avoid-a-wmaybe-uninitialized-warning.patch queue-4.9/scsi-advansys-fix-uninitialized-data-access.patch queue-4.9/drm-i915-fix-intel_backlight_device_register-declaration.patch queue-4.9/spi-bcm-qspi-shut-up-warning-about-cfi-header-inclusion.patch queue-4.9/asoc-ux500-add-module_license-tag.patch queue-4.9/x86-microcode-amd-change-load_microcode_amd-s-param-to-bool-to-fix-preemptibility-bug.patch queue-4.9/video-fbdev-mmp-add-module_license.patch queue-4.9/usb-phy-msm-add-regulator-dependency.patch queue-4.9/arm64-dts-add-cooling-cells-to-cpu-nodes.patch queue-4.9/vmxnet3-prevent-building-with-64k-pages.patch queue-4.9/x86-platform-add-pci-dependency-for-punit_atom_debug.patch queue-4.9/alsa-hda-ca0132-fix-possible-null-pointer-use.patch queue-4.9/thermal-fix-intel_soc_dts_iosf_core-dependencies.patch queue-4.9/arm64-define-bug-instruction-without-config_bug.patch queue-4.9/arm64-sunxi-always-enable-reset-controller.patch queue-4.9/tc358743-fix-register-i2c_rd-wr-functions.patch queue-4.9/security-keys-big_key-requires-config_crypto.patch queue-4.9/drm-i915-hide-unused-intel_panel_set_backlight-function.patch queue-4.9/x86-fpu-math-emu-fix-possible-uninitialized-variable-use.patch queue-4.9/arm-8743-1-bl_switcher-add-module_license-tag.patch queue-4.9/em28xx-only-use-mt9v011-if-camera-support-is-enabled.patch queue-4.9/arm64-fix-warning-about-swapper_pg_dir-overflow.patch queue-4.9/shmem-avoid-maybe-uninitialized-warning.patch queue-4.9/input-tca8418_keypad-hide-gcc-4.9-wmaybe-uninitialized-warning.patch queue-4.9/drm-nouveau-hide-gcc-4.9-wmaybe-uninitialized.patch queue-4.9/x86-add-multiuser-dependency-for-kvm.patch queue-4.9/isdn-eicon-reduce-stack-size-of-sig_ind-function.patch
When CONFIG_MTD_CFI is disabled, we get a warning for this spi driver:
include/linux/mtd/cfi.h:76:2: #warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can work. [-Werror=cpp]
The problem here is a layering violation that was fixed in mainline kernels with a larger rework in commit 054e532f8f90 ("spi: bcm-qspi: Remove hardcoded settings and spi-nor.h dependency"). We can't really backport that to stable kernels, so this just adds a Kconfig dependency to make it either build cleanly or force it to be disabled.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- drivers/spi/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index b7995474148c..0e7415f6d093 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -156,6 +156,7 @@ config SPI_BCM63XX_HSSPI config SPI_BCM_QSPI tristate "Broadcom BSPI and MSPI controller support" depends on ARCH_BRCMSTB || ARCH_BCM || ARCH_BCM_IPROC || COMPILE_TEST + depends on MTD_NORFLASH default ARCH_BCM_IPROC help Enables support for the Broadcom SPI flash and MSPI controller.
This is a note to let you know that I've just added the patch titled
spi: bcm-qspi: shut up warning about cfi header inclusion
to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
The filename of the patch is: spi-bcm-qspi-shut-up-warning-about-cfi-header-inclusion.patch and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let stable@vger.kernel.org know about it.
From foo@baz Fri Feb 23 16:40:21 CET 2018
From: Arnd Bergmann arnd@arndb.de Date: Mon, 19 Feb 2018 11:13:24 +0100 Subject: spi: bcm-qspi: shut up warning about cfi header inclusion To: stable@vger.kernel.org Cc: Greg KH gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Arnd Bergmann arnd@arndb.de, Mark Brown broonie@kernel.org, Sasha Levin alexander.levin@verizon.com, Geert Uytterhoeven geert@linux-m68k.org, linux-spi@vger.kernel.org Message-ID: 20180219101343.2922561-6-arnd@arndb.de
From: Arnd Bergmann arnd@arndb.de
When CONFIG_MTD_CFI is disabled, we get a warning for this spi driver:
include/linux/mtd/cfi.h:76:2: #warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can work. [-Werror=cpp]
The problem here is a layering violation that was fixed in mainline kernels with a larger rework in commit 054e532f8f90 ("spi: bcm-qspi: Remove hardcoded settings and spi-nor.h dependency"). We can't really backport that to stable kernels, so this just adds a Kconfig dependency to make it either build cleanly or force it to be disabled.
Signed-off-by: Arnd Bergmann arnd@arndb.de Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- drivers/spi/Kconfig | 1 + 1 file changed, 1 insertion(+)
--- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -156,6 +156,7 @@ config SPI_BCM63XX_HSSPI config SPI_BCM_QSPI tristate "Broadcom BSPI and MSPI controller support" depends on ARCH_BRCMSTB || ARCH_BCM || ARCH_BCM_IPROC || COMPILE_TEST + depends on MTD_NORFLASH default ARCH_BCM_IPROC help Enables support for the Broadcom SPI flash and MSPI controller.
Patches currently in stable-queue which might be from arnd@arndb.de are
queue-4.9/kasan-rework-kconfig-settings.patch queue-4.9/tw5864-use-dev_warn-instead-of-warn-to-shut-up-warning.patch queue-4.9/perf-x86-shut-up-false-positive-wmaybe-uninitialized-warning.patch queue-4.9/go7007-add-media_camera_support-dependency.patch queue-4.9/scsi-advansys-fix-build-warning-for-pci-n.patch queue-4.9/video-fbdev-via-remove-possibly-unused-variables.patch queue-4.9/drm-exynos-mark-pm-functions-as-__maybe_unused.patch queue-4.9/binfmt_elf-compat-avoid-unused-function-warning.patch queue-4.9/idle-i7300-add-pci-dependency.patch queue-4.9/cw1200-fix-bogus-maybe-uninitialized-warning.patch queue-4.9/x86-build-silence-the-build-with-make-s.patch queue-4.9/gpio-xgene-mark-pm-functions-as-__maybe_unused.patch queue-4.9/kvm-add-x86_local_apic-dependency.patch queue-4.9/reiserfs-avoid-a-wmaybe-uninitialized-warning.patch queue-4.9/scsi-advansys-fix-uninitialized-data-access.patch queue-4.9/drm-i915-fix-intel_backlight_device_register-declaration.patch queue-4.9/spi-bcm-qspi-shut-up-warning-about-cfi-header-inclusion.patch queue-4.9/asoc-ux500-add-module_license-tag.patch queue-4.9/x86-microcode-amd-change-load_microcode_amd-s-param-to-bool-to-fix-preemptibility-bug.patch queue-4.9/video-fbdev-mmp-add-module_license.patch queue-4.9/usb-phy-msm-add-regulator-dependency.patch queue-4.9/arm64-dts-add-cooling-cells-to-cpu-nodes.patch queue-4.9/vmxnet3-prevent-building-with-64k-pages.patch queue-4.9/x86-platform-add-pci-dependency-for-punit_atom_debug.patch queue-4.9/alsa-hda-ca0132-fix-possible-null-pointer-use.patch queue-4.9/thermal-fix-intel_soc_dts_iosf_core-dependencies.patch queue-4.9/arm64-define-bug-instruction-without-config_bug.patch queue-4.9/arm64-sunxi-always-enable-reset-controller.patch queue-4.9/tc358743-fix-register-i2c_rd-wr-functions.patch queue-4.9/security-keys-big_key-requires-config_crypto.patch queue-4.9/drm-i915-hide-unused-intel_panel_set_backlight-function.patch queue-4.9/x86-fpu-math-emu-fix-possible-uninitialized-variable-use.patch queue-4.9/arm-8743-1-bl_switcher-add-module_license-tag.patch queue-4.9/em28xx-only-use-mt9v011-if-camera-support-is-enabled.patch queue-4.9/arm64-fix-warning-about-swapper_pg_dir-overflow.patch queue-4.9/shmem-avoid-maybe-uninitialized-warning.patch queue-4.9/input-tca8418_keypad-hide-gcc-4.9-wmaybe-uninitialized-warning.patch queue-4.9/drm-nouveau-hide-gcc-4.9-wmaybe-uninitialized.patch queue-4.9/x86-add-multiuser-dependency-for-kvm.patch queue-4.9/isdn-eicon-reduce-stack-size-of-sig_ind-function.patch
GCC correctly points out an uninitialized variable use when CONFIG_PCI is disabled.
drivers/idle/i7300_idle.c: In function 'i7300_idle_notifier': include/asm-generic/bug.h:119:5: error: 'got_ctl' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (unlikely(__ret_warn_once && !__warned)) { \ ^ drivers/idle/i7300_idle.c:415:5: note: 'got_ctl' was declared here u8 got_ctl; ^~~~~~~
The driver no longer exists in later kernels, so this patch only appplies to linux-4.9.y and earlier.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- drivers/idle/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/idle/Kconfig b/drivers/idle/Kconfig index 4732dfc15447..331adc509f3a 100644 --- a/drivers/idle/Kconfig +++ b/drivers/idle/Kconfig @@ -17,6 +17,7 @@ config I7300_IDLE_IOAT_CHANNEL
config I7300_IDLE tristate "Intel chipset idle memory power saving driver" + depends on PCI select I7300_IDLE_IOAT_CHANNEL help Enable memory power savings when idle with certain Intel server
This is a note to let you know that I've just added the patch titled
idle: i7300: add PCI dependency
to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
The filename of the patch is: idle-i7300-add-pci-dependency.patch and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let stable@vger.kernel.org know about it.
From foo@baz Fri Feb 23 16:40:21 CET 2018
From: Arnd Bergmann arnd@arndb.de Date: Mon, 19 Feb 2018 11:13:25 +0100 Subject: idle: i7300: add PCI dependency To: stable@vger.kernel.org Cc: Greg KH gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Arnd Bergmann arnd@arndb.de Message-ID: 20180219101343.2922561-7-arnd@arndb.de
From: Arnd Bergmann arnd@arndb.de
GCC correctly points out an uninitialized variable use when CONFIG_PCI is disabled.
drivers/idle/i7300_idle.c: In function 'i7300_idle_notifier': include/asm-generic/bug.h:119:5: error: 'got_ctl' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (unlikely(__ret_warn_once && !__warned)) { \ ^ drivers/idle/i7300_idle.c:415:5: note: 'got_ctl' was declared here u8 got_ctl; ^~~~~~~
The driver no longer exists in later kernels, so this patch only appplies to linux-4.9.y and earlier.
Signed-off-by: Arnd Bergmann arnd@arndb.de Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- drivers/idle/Kconfig | 1 + 1 file changed, 1 insertion(+)
--- a/drivers/idle/Kconfig +++ b/drivers/idle/Kconfig @@ -17,6 +17,7 @@ config I7300_IDLE_IOAT_CHANNEL
config I7300_IDLE tristate "Intel chipset idle memory power saving driver" + depends on PCI select I7300_IDLE_IOAT_CHANNEL help Enable memory power savings when idle with certain Intel server
Patches currently in stable-queue which might be from arnd@arndb.de are
queue-4.9/kasan-rework-kconfig-settings.patch queue-4.9/tw5864-use-dev_warn-instead-of-warn-to-shut-up-warning.patch queue-4.9/perf-x86-shut-up-false-positive-wmaybe-uninitialized-warning.patch queue-4.9/go7007-add-media_camera_support-dependency.patch queue-4.9/scsi-advansys-fix-build-warning-for-pci-n.patch queue-4.9/video-fbdev-via-remove-possibly-unused-variables.patch queue-4.9/drm-exynos-mark-pm-functions-as-__maybe_unused.patch queue-4.9/binfmt_elf-compat-avoid-unused-function-warning.patch queue-4.9/idle-i7300-add-pci-dependency.patch queue-4.9/cw1200-fix-bogus-maybe-uninitialized-warning.patch queue-4.9/x86-build-silence-the-build-with-make-s.patch queue-4.9/gpio-xgene-mark-pm-functions-as-__maybe_unused.patch queue-4.9/kvm-add-x86_local_apic-dependency.patch queue-4.9/reiserfs-avoid-a-wmaybe-uninitialized-warning.patch queue-4.9/scsi-advansys-fix-uninitialized-data-access.patch queue-4.9/drm-i915-fix-intel_backlight_device_register-declaration.patch queue-4.9/spi-bcm-qspi-shut-up-warning-about-cfi-header-inclusion.patch queue-4.9/asoc-ux500-add-module_license-tag.patch queue-4.9/x86-microcode-amd-change-load_microcode_amd-s-param-to-bool-to-fix-preemptibility-bug.patch queue-4.9/video-fbdev-mmp-add-module_license.patch queue-4.9/usb-phy-msm-add-regulator-dependency.patch queue-4.9/arm64-dts-add-cooling-cells-to-cpu-nodes.patch queue-4.9/vmxnet3-prevent-building-with-64k-pages.patch queue-4.9/x86-platform-add-pci-dependency-for-punit_atom_debug.patch queue-4.9/alsa-hda-ca0132-fix-possible-null-pointer-use.patch queue-4.9/thermal-fix-intel_soc_dts_iosf_core-dependencies.patch queue-4.9/arm64-define-bug-instruction-without-config_bug.patch queue-4.9/arm64-sunxi-always-enable-reset-controller.patch queue-4.9/tc358743-fix-register-i2c_rd-wr-functions.patch queue-4.9/security-keys-big_key-requires-config_crypto.patch queue-4.9/drm-i915-hide-unused-intel_panel_set_backlight-function.patch queue-4.9/x86-fpu-math-emu-fix-possible-uninitialized-variable-use.patch queue-4.9/arm-8743-1-bl_switcher-add-module_license-tag.patch queue-4.9/em28xx-only-use-mt9v011-if-camera-support-is-enabled.patch queue-4.9/arm64-fix-warning-about-swapper_pg_dir-overflow.patch queue-4.9/shmem-avoid-maybe-uninitialized-warning.patch queue-4.9/input-tca8418_keypad-hide-gcc-4.9-wmaybe-uninitialized-warning.patch queue-4.9/drm-nouveau-hide-gcc-4.9-wmaybe-uninitialized.patch queue-4.9/x86-add-multiuser-dependency-for-kvm.patch queue-4.9/isdn-eicon-reduce-stack-size-of-sig_ind-function.patch
commit 12f043ff2b28fa64c9123b454cbe30a8a9e1967e upstream.
With 4 levels of 16KB pages, we get this warning about the fact that we are copying a whole page into an array that is declared as having only two pointers for the top level of the page table:
arch/arm64/mm/mmu.c: In function 'paging_init': arch/arm64/mm/mmu.c:528:2: error: 'memcpy' writing 16384 bytes into a region of size 16 overflows the destination [-Werror=stringop-overflow=]
This is harmless since we actually reserve a whole page in the definition of the array that comes from, and just the extern declaration is short. The pgdir is initialized to zero either way, so copying the actual entries here seems like the best solution.
Acked-by: Ard Biesheuvel ard.biesheuvel@linaro.org Acked-by: Mark Rutland mark.rutland@arm.com Signed-off-by: Arnd Bergmann arnd@arndb.de Signed-off-by: Will Deacon will.deacon@arm.com [slightly adapted to apply on 4.9] Signed-off-by: Arnd Bergmann arnd@arndb.de --- arch/arm64/mm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 05615a3fdc6f..d5cc6d73c2c4 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -479,7 +479,7 @@ void __init paging_init(void) * To do this we need to go via a temporary pgd. */ cpu_replace_ttbr1(__va(pgd_phys)); - memcpy(swapper_pg_dir, pgd, PAGE_SIZE); + memcpy(swapper_pg_dir, pgd, PGD_SIZE); cpu_replace_ttbr1(swapper_pg_dir);
pgd_clear_fixmap();
This is a note to let you know that I've just added the patch titled
arm64: fix warning about swapper_pg_dir overflow
to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
The filename of the patch is: arm64-fix-warning-about-swapper_pg_dir-overflow.patch and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let stable@vger.kernel.org know about it.
From foo@baz Fri Feb 23 16:40:21 CET 2018
From: Arnd Bergmann arnd@arndb.de Date: Mon, 19 Feb 2018 11:13:26 +0100 Subject: arm64: fix warning about swapper_pg_dir overflow To: stable@vger.kernel.org Cc: Greg KH gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Arnd Bergmann arnd@arndb.de, Will Deacon will.deacon@arm.com, Catalin Marinas catalin.marinas@arm.com, Ard Biesheuvel ard.biesheuvel@linaro.org, Mark Rutland mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org Message-ID: 20180219101343.2922561-8-arnd@arndb.de
From: Arnd Bergmann arnd@arndb.de
commit 12f043ff2b28fa64c9123b454cbe30a8a9e1967e upstream.
With 4 levels of 16KB pages, we get this warning about the fact that we are copying a whole page into an array that is declared as having only two pointers for the top level of the page table:
arch/arm64/mm/mmu.c: In function 'paging_init': arch/arm64/mm/mmu.c:528:2: error: 'memcpy' writing 16384 bytes into a region of size 16 overflows the destination [-Werror=stringop-overflow=]
This is harmless since we actually reserve a whole page in the definition of the array that comes from, and just the extern declaration is short. The pgdir is initialized to zero either way, so copying the actual entries here seems like the best solution.
Acked-by: Ard Biesheuvel ard.biesheuvel@linaro.org Acked-by: Mark Rutland mark.rutland@arm.com Signed-off-by: Arnd Bergmann arnd@arndb.de Signed-off-by: Will Deacon will.deacon@arm.com [slightly adapted to apply on 4.9] Signed-off-by: Arnd Bergmann arnd@arndb.de Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- arch/arm64/mm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -479,7 +479,7 @@ void __init paging_init(void) * To do this we need to go via a temporary pgd. */ cpu_replace_ttbr1(__va(pgd_phys)); - memcpy(swapper_pg_dir, pgd, PAGE_SIZE); + memcpy(swapper_pg_dir, pgd, PGD_SIZE); cpu_replace_ttbr1(swapper_pg_dir);
pgd_clear_fixmap();
Patches currently in stable-queue which might be from arnd@arndb.de are
queue-4.9/kasan-rework-kconfig-settings.patch queue-4.9/tw5864-use-dev_warn-instead-of-warn-to-shut-up-warning.patch queue-4.9/perf-x86-shut-up-false-positive-wmaybe-uninitialized-warning.patch queue-4.9/go7007-add-media_camera_support-dependency.patch queue-4.9/scsi-advansys-fix-build-warning-for-pci-n.patch queue-4.9/video-fbdev-via-remove-possibly-unused-variables.patch queue-4.9/drm-exynos-mark-pm-functions-as-__maybe_unused.patch queue-4.9/binfmt_elf-compat-avoid-unused-function-warning.patch queue-4.9/idle-i7300-add-pci-dependency.patch queue-4.9/cw1200-fix-bogus-maybe-uninitialized-warning.patch queue-4.9/x86-build-silence-the-build-with-make-s.patch queue-4.9/gpio-xgene-mark-pm-functions-as-__maybe_unused.patch queue-4.9/kvm-add-x86_local_apic-dependency.patch queue-4.9/reiserfs-avoid-a-wmaybe-uninitialized-warning.patch queue-4.9/scsi-advansys-fix-uninitialized-data-access.patch queue-4.9/drm-i915-fix-intel_backlight_device_register-declaration.patch queue-4.9/spi-bcm-qspi-shut-up-warning-about-cfi-header-inclusion.patch queue-4.9/asoc-ux500-add-module_license-tag.patch queue-4.9/x86-microcode-amd-change-load_microcode_amd-s-param-to-bool-to-fix-preemptibility-bug.patch queue-4.9/video-fbdev-mmp-add-module_license.patch queue-4.9/usb-phy-msm-add-regulator-dependency.patch queue-4.9/arm64-dts-add-cooling-cells-to-cpu-nodes.patch queue-4.9/vmxnet3-prevent-building-with-64k-pages.patch queue-4.9/x86-platform-add-pci-dependency-for-punit_atom_debug.patch queue-4.9/alsa-hda-ca0132-fix-possible-null-pointer-use.patch queue-4.9/thermal-fix-intel_soc_dts_iosf_core-dependencies.patch queue-4.9/arm64-define-bug-instruction-without-config_bug.patch queue-4.9/arm64-sunxi-always-enable-reset-controller.patch queue-4.9/tc358743-fix-register-i2c_rd-wr-functions.patch queue-4.9/security-keys-big_key-requires-config_crypto.patch queue-4.9/drm-i915-hide-unused-intel_panel_set_backlight-function.patch queue-4.9/x86-fpu-math-emu-fix-possible-uninitialized-variable-use.patch queue-4.9/arm-8743-1-bl_switcher-add-module_license-tag.patch queue-4.9/em28xx-only-use-mt9v011-if-camera-support-is-enabled.patch queue-4.9/arm64-fix-warning-about-swapper_pg_dir-overflow.patch queue-4.9/shmem-avoid-maybe-uninitialized-warning.patch queue-4.9/input-tca8418_keypad-hide-gcc-4.9-wmaybe-uninitialized-warning.patch queue-4.9/drm-nouveau-hide-gcc-4.9-wmaybe-uninitialized.patch queue-4.9/x86-add-multiuser-dependency-for-kvm.patch queue-4.9/isdn-eicon-reduce-stack-size-of-sig_ind-function.patch
On linux-4.4 and linux-4.9 we get a warning about an array that is never initialized when CONFIG_REGULATOR is disabled:
drivers/usb/phy/phy-msm-usb.c: In function 'msm_otg_probe': drivers/usb/phy/phy-msm-usb.c:1911:14: error: 'regs[0].consumer' may be used uninitialized in this function [-Werror=maybe-uninitialized] motg->vddcx = regs[0].consumer; ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ drivers/usb/phy/phy-msm-usb.c:1912:14: error: 'regs[1].consumer' may be used uninitialized in this function [-Werror=maybe-uninitialized] motg->v3p3 = regs[1].consumer; ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ drivers/usb/phy/phy-msm-usb.c:1913:14: error: 'regs[2].consumer' may be used uninitialized in this function [-Werror=maybe-uninitialized] motg->v1p8 = regs[2].consumer;
This adds a Kconfig dependency for it. In newer kernels, the driver no longer exists, so this is only needed for stable kernels.
Signed-off-by: Arnd Bergmann arnd@arndb.de --- drivers/usb/phy/Kconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index b9c409a18faa..125cea1c3c8d 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig @@ -147,6 +147,7 @@ config USB_MSM_OTG depends on (USB || USB_GADGET) && (ARCH_QCOM || COMPILE_TEST) depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y' depends on RESET_CONTROLLER + depends on REGULATOR depends on EXTCON select USB_PHY help
This is a note to let you know that I've just added the patch titled
usb: phy: msm add regulator dependency
to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
The filename of the patch is: usb-phy-msm-add-regulator-dependency.patch and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let stable@vger.kernel.org know about it.
From foo@baz Fri Feb 23 16:40:21 CET 2018
From: Arnd Bergmann arnd@arndb.de Date: Mon, 19 Feb 2018 11:13:27 +0100 Subject: usb: phy: msm add regulator dependency To: stable@vger.kernel.org Cc: Greg KH gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Arnd Bergmann arnd@arndb.de, Felipe Balbi balbi@kernel.org, linux-usb@vger.kernel.org Message-ID: 20180219101343.2922561-9-arnd@arndb.de
From: Arnd Bergmann arnd@arndb.de
On linux-4.4 and linux-4.9 we get a warning about an array that is never initialized when CONFIG_REGULATOR is disabled:
drivers/usb/phy/phy-msm-usb.c: In function 'msm_otg_probe': drivers/usb/phy/phy-msm-usb.c:1911:14: error: 'regs[0].consumer' may be used uninitialized in this function [-Werror=maybe-uninitialized] motg->vddcx = regs[0].consumer; ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ drivers/usb/phy/phy-msm-usb.c:1912:14: error: 'regs[1].consumer' may be used uninitialized in this function [-Werror=maybe-uninitialized] motg->v3p3 = regs[1].consumer; ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ drivers/usb/phy/phy-msm-usb.c:1913:14: error: 'regs[2].consumer' may be used uninitialized in this function [-Werror=maybe-uninitialized] motg->v1p8 = regs[2].consumer;
This adds a Kconfig dependency for it. In newer kernels, the driver no longer exists, so this is only needed for stable kernels.
Signed-off-by: Arnd Bergmann arnd@arndb.de Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- drivers/usb/phy/Kconfig | 1 + 1 file changed, 1 insertion(+)
--- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig @@ -147,6 +147,7 @@ config USB_MSM_OTG depends on (USB || USB_GADGET) && (ARCH_QCOM || COMPILE_TEST) depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y' depends on RESET_CONTROLLER + depends on REGULATOR depends on EXTCON select USB_PHY help
Patches currently in stable-queue which might be from arnd@arndb.de are
queue-4.9/kasan-rework-kconfig-settings.patch queue-4.9/tw5864-use-dev_warn-instead-of-warn-to-shut-up-warning.patch queue-4.9/perf-x86-shut-up-false-positive-wmaybe-uninitialized-warning.patch queue-4.9/go7007-add-media_camera_support-dependency.patch queue-4.9/scsi-advansys-fix-build-warning-for-pci-n.patch queue-4.9/video-fbdev-via-remove-possibly-unused-variables.patch queue-4.9/drm-exynos-mark-pm-functions-as-__maybe_unused.patch queue-4.9/binfmt_elf-compat-avoid-unused-function-warning.patch queue-4.9/idle-i7300-add-pci-dependency.patch queue-4.9/cw1200-fix-bogus-maybe-uninitialized-warning.patch queue-4.9/x86-build-silence-the-build-with-make-s.patch queue-4.9/gpio-xgene-mark-pm-functions-as-__maybe_unused.patch queue-4.9/kvm-add-x86_local_apic-dependency.patch queue-4.9/reiserfs-avoid-a-wmaybe-uninitialized-warning.patch queue-4.9/scsi-advansys-fix-uninitialized-data-access.patch queue-4.9/drm-i915-fix-intel_backlight_device_register-declaration.patch queue-4.9/spi-bcm-qspi-shut-up-warning-about-cfi-header-inclusion.patch queue-4.9/asoc-ux500-add-module_license-tag.patch queue-4.9/x86-microcode-amd-change-load_microcode_amd-s-param-to-bool-to-fix-preemptibility-bug.patch queue-4.9/video-fbdev-mmp-add-module_license.patch queue-4.9/usb-phy-msm-add-regulator-dependency.patch queue-4.9/arm64-dts-add-cooling-cells-to-cpu-nodes.patch queue-4.9/vmxnet3-prevent-building-with-64k-pages.patch queue-4.9/x86-platform-add-pci-dependency-for-punit_atom_debug.patch queue-4.9/alsa-hda-ca0132-fix-possible-null-pointer-use.patch queue-4.9/thermal-fix-intel_soc_dts_iosf_core-dependencies.patch queue-4.9/arm64-define-bug-instruction-without-config_bug.patch queue-4.9/arm64-sunxi-always-enable-reset-controller.patch queue-4.9/tc358743-fix-register-i2c_rd-wr-functions.patch queue-4.9/security-keys-big_key-requires-config_crypto.patch queue-4.9/drm-i915-hide-unused-intel_panel_set_backlight-function.patch queue-4.9/x86-fpu-math-emu-fix-possible-uninitialized-variable-use.patch queue-4.9/arm-8743-1-bl_switcher-add-module_license-tag.patch queue-4.9/em28xx-only-use-mt9v011-if-camera-support-is-enabled.patch queue-4.9/arm64-fix-warning-about-swapper_pg_dir-overflow.patch queue-4.9/shmem-avoid-maybe-uninitialized-warning.patch queue-4.9/input-tca8418_keypad-hide-gcc-4.9-wmaybe-uninitialized-warning.patch queue-4.9/drm-nouveau-hide-gcc-4.9-wmaybe-uninitialized.patch queue-4.9/x86-add-multiuser-dependency-for-kvm.patch queue-4.9/isdn-eicon-reduce-stack-size-of-sig_ind-function.patch
From: Borislav Petkov bp@suse.de
commit dac6ca243c4c49a9ca7507d3d66140ebfac8b04b upstream.
With CONFIG_DEBUG_PREEMPT enabled, I get:
BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1 caller is debug_smp_processor_id CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.12.0-rc2+ #2 Call Trace: dump_stack check_preemption_disabled debug_smp_processor_id save_microcode_in_initrd_amd ? microcode_init save_microcode_in_initrd ...
because, well, it says it above, we're using smp_processor_id() in preemptible code.
But passing the CPU number is not really needed. It is only used to determine whether we're on the BSP, and, if so, to save the microcode patch for early loading.
[ We don't absolutely need to do it on the BSP but we do that customarily there. ]
Instead, convert that function parameter to a boolean which denotes whether the patch should be saved or not, thereby avoiding the use of smp_processor_id() in preemptible code.
Signed-off-by: Borislav Petkov bp@suse.de Cc: Linus Torvalds torvalds@linux-foundation.org Cc: Peter Zijlstra peterz@infradead.org Cc: Thomas Gleixner tglx@linutronix.de Link: http://lkml.kernel.org/r/20170528200414.31305-1-bp@alien8.de Signed-off-by: Ingo Molnar mingo@kernel.org [arnd: rebased to 4.9, after running into warning: arch/x86/kernel/cpu/microcode/amd.c:881:30: self-comparison always evaluates to true] Signed-off-by: Arnd Bergmann arnd@arndb.de --- arch/x86/include/asm/microcode_amd.h | 1 - arch/x86/kernel/cpu/microcode/amd.c | 17 +++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/arch/x86/include/asm/microcode_amd.h b/arch/x86/include/asm/microcode_amd.h index 15eb75484cc0..98ccbd1dbb01 100644 --- a/arch/x86/include/asm/microcode_amd.h +++ b/arch/x86/include/asm/microcode_amd.h @@ -59,7 +59,6 @@ static inline u16 find_equiv_id(struct equiv_cpu_entry *equiv_cpu_table,
extern int __apply_microcode_amd(struct microcode_amd *mc_amd); extern int apply_microcode_amd(int cpu); -extern enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, size_t size);
#define PATCH_MAX_SIZE PAGE_SIZE
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index b74bb29db6b9..732bb03fcf91 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -135,6 +135,9 @@ static size_t compute_container_size(u8 *data, u32 total_size) return size; }
+static enum ucode_state +load_microcode_amd(bool save, u8 family, const u8 *data, size_t size); + /* * Early load occurs before we can vmalloc(). So we look for the microcode * patch container file in initrd, traverse equivalent cpu table, look for a @@ -451,7 +454,7 @@ int __init save_microcode_in_initrd_amd(void) eax = cpuid_eax(0x00000001); eax = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff);
- ret = load_microcode_amd(smp_processor_id(), eax, container, container_size); + ret = load_microcode_amd(true, eax, container, container_size); if (ret != UCODE_OK) retval = -EINVAL;
@@ -864,7 +867,8 @@ static enum ucode_state __load_microcode_amd(u8 family, const u8 *data, return UCODE_OK; }
-enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, size_t size) +static enum ucode_state +load_microcode_amd(bool save, u8 family, const u8 *data, size_t size) { enum ucode_state ret;
@@ -878,8 +882,8 @@ enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, size_t s
#ifdef CONFIG_X86_32 /* save BSP's matching patch for early load */ - if (cpu_data(cpu).cpu_index == boot_cpu_data.cpu_index) { - struct ucode_patch *p = find_patch(cpu); + if (save) { + struct ucode_patch *p = find_patch(0); if (p) { memset(amd_ucode_patch, 0, PATCH_MAX_SIZE); memcpy(amd_ucode_patch, p->data, min_t(u32, ksize(p->data), @@ -911,11 +915,12 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device, { char fw_name[36] = "amd-ucode/microcode_amd.bin"; struct cpuinfo_x86 *c = &cpu_data(cpu); + bool bsp = c->cpu_index == boot_cpu_data.cpu_index; enum ucode_state ret = UCODE_NFOUND; const struct firmware *fw;
/* reload ucode container only on the boot cpu */ - if (!refresh_fw || c->cpu_index != boot_cpu_data.cpu_index) + if (!refresh_fw || !bsp) return UCODE_OK;
if (c->x86 >= 0x15) @@ -932,7 +937,7 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device, goto fw_release; }
- ret = load_microcode_amd(cpu, c->x86, fw->data, fw->size); + ret = load_microcode_amd(bsp, c->x86, fw->data, fw->size);
fw_release: release_firmware(fw);
This is a note to let you know that I've just added the patch titled
x86/microcode/AMD: Change load_microcode_amd()'s param to bool to fix preemptibility bug
to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git%3Ba=su...
The filename of the patch is: x86-microcode-amd-change-load_microcode_amd-s-param-to-bool-to-fix-preemptibility-bug.patch and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let stable@vger.kernel.org know about it.
From foo@baz Fri Feb 23 16:40:21 CET 2018
From: Arnd Bergmann arnd@arndb.de Date: Mon, 19 Feb 2018 11:13:28 +0100 Subject: x86/microcode/AMD: Change load_microcode_amd()'s param to bool to fix preemptibility bug To: stable@vger.kernel.org Cc: Greg KH gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Borislav Petkov bp@suse.de, Linus Torvalds torvalds@linux-foundation.org, Peter Zijlstra peterz@infradead.org, Thomas Gleixner tglx@linutronix.de, Ingo Molnar mingo@kernel.org, Arnd Bergmann arnd@arndb.de, Ingo Molnar mingo@redhat.com, "H. Peter Anvin" hpa@zytor.com, x86@kernel.org, Borislav Petkov bp@alien8.de, Tom Lendacky thomas.lendacky@amd.com Message-ID: 20180219101343.2922561-10-arnd@arndb.de
From: Borislav Petkov bp@suse.de
commit dac6ca243c4c49a9ca7507d3d66140ebfac8b04b upstream.
With CONFIG_DEBUG_PREEMPT enabled, I get:
BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1 caller is debug_smp_processor_id CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.12.0-rc2+ #2 Call Trace: dump_stack check_preemption_disabled debug_smp_processor_id save_microcode_in_initrd_amd ? microcode_init save_microcode_in_initrd ...
because, well, it says it above, we're using smp_processor_id() in preemptible code.
But passing the CPU number is not really needed. It is only used to determine whether we're on the BSP, and, if so, to save the microcode patch for early loading.
[ We don't absolutely need to do it on the BSP but we do that customarily there. ]
Instead, convert that function parameter to a boolean which denotes whether the patch should be saved or not, thereby avoiding the use of smp_processor_id() in preemptible code.
Signed-off-by: Borislav Petkov bp@suse.de Cc: Linus Torvalds torvalds@linux-foundation.org Cc: Peter Zijlstra peterz@infradead.org Cc: Thomas Gleixner tglx@linutronix.de Link: http://lkml.kernel.org/r/20170528200414.31305-1-bp@alien8.de Signed-off-by: Ingo Molnar mingo@kernel.org [arnd: rebased to 4.9, after running into warning: arch/x86/kernel/cpu/microcode/amd.c:881:30: self-comparison always evaluates to true] Signed-off-by: Arnd Bergmann arnd@arndb.de Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org --- arch/x86/include/asm/microcode_amd.h | 1 - arch/x86/kernel/cpu/microcode/amd.c | 17 +++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-)
--- a/arch/x86/include/asm/microcode_amd.h +++ b/arch/x86/include/asm/microcode_amd.h @@ -59,7 +59,6 @@ static inline u16 find_equiv_id(struct e
extern int __apply_microcode_amd(struct microcode_amd *mc_amd); extern int apply_microcode_amd(int cpu); -extern enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, size_t size);
#define PATCH_MAX_SIZE PAGE_SIZE
--- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -135,6 +135,9 @@ static size_t compute_container_size(u8 return size; }
+static enum ucode_state +load_microcode_amd(bool save, u8 family, const u8 *data, size_t size); + /* * Early load occurs before we can vmalloc(). So we look for the microcode * patch container file in initrd, traverse equivalent cpu table, look for a @@ -451,7 +454,7 @@ int __init save_microcode_in_initrd_amd( eax = cpuid_eax(0x00000001); eax = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff);
- ret = load_microcode_amd(smp_processor_id(), eax, container, container_size); + ret = load_microcode_amd(true, eax, container, container_size); if (ret != UCODE_OK) retval = -EINVAL;
@@ -864,7 +867,8 @@ static enum ucode_state __load_microcode return UCODE_OK; }
-enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, size_t size) +static enum ucode_state +load_microcode_amd(bool save, u8 family, const u8 *data, size_t size) { enum ucode_state ret;
@@ -878,8 +882,8 @@ enum ucode_state load_microcode_amd(int
#ifdef CONFIG_X86_32 /* save BSP's matching patch for early load */ - if (cpu_data(cpu).cpu_index == boot_cpu_data.cpu_index) { - struct ucode_patch *p = find_patch(cpu); + if (save) { + struct ucode_patch *p = find_patch(0); if (p) { memset(amd_ucode_patch, 0, PATCH_MAX_SIZE); memcpy(amd_ucode_patch, p->data, min_t(u32, ksize(p->data), @@ -911,11 +915,12 @@ static enum ucode_state request_microcod { char fw_name[36] = "amd-ucode/microcode_amd.bin"; struct cpuinfo_x86 *c = &cpu_data(cpu); + bool bsp = c->cpu_index == boot_cpu_data.cpu_index; enum ucode_state ret = UCODE_NFOUND; const struct firmware *fw;
/* reload ucode container only on the boot cpu */ - if (!refresh_fw || c->cpu_index != boot_cpu_data.cpu_index) + if (!refresh_fw || !bsp) return UCODE_OK;
if (c->x86 >= 0x15) @@ -932,7 +937,7 @@ static enum ucode_state request_microcod goto fw_release; }
- ret = load_microcode_amd(cpu, c->x86, fw->data, fw->size); + ret = load_microcode_amd(bsp, c->x86, fw->data, fw->size);
fw_release: release_firmware(fw);
Patches currently in stable-queue which might be from arnd@arndb.de are
queue-4.9/kasan-rework-kconfig-settings.patch queue-4.9/tw5864-use-dev_warn-instead-of-warn-to-shut-up-warning.patch queue-4.9/perf-x86-shut-up-false-positive-wmaybe-uninitialized-warning.patch queue-4.9/go7007-add-media_camera_support-dependency.patch queue-4.9/scsi-advansys-fix-build-warning-for-pci-n.patch queue-4.9/video-fbdev-via-remove-possibly-unused-variables.patch queue-4.9/drm-exynos-mark-pm-functions-as-__maybe_unused.patch queue-4.9/binfmt_elf-compat-avoid-unused-function-warning.patch queue-4.9/idle-i7300-add-pci-dependency.patch queue-4.9/cw1200-fix-bogus-maybe-uninitialized-warning.patch queue-4.9/x86-build-silence-the-build-with-make-s.patch queue-4.9/gpio-xgene-mark-pm-functions-as-__maybe_unused.patch queue-4.9/kvm-add-x86_local_apic-dependency.patch queue-4.9/reiserfs-avoid-a-wmaybe-uninitialized-warning.patch queue-4.9/scsi-advansys-fix-uninitialized-data-access.patch queue-4.9/drm-i915-fix-intel_backlight_device_register-declaration.patch queue-4.9/spi-bcm-qspi-shut-up-warning-about-cfi-header-inclusion.patch queue-4.9/asoc-ux500-add-module_license-tag.patch queue-4.9/x86-microcode-amd-change-load_microcode_amd-s-param-to-bool-to-fix-preemptibility-bug.patch queue-4.9/video-fbdev-mmp-add-module_license.patch queue-4.9/usb-phy-msm-add-regulator-dependency.patch queue-4.9/arm64-dts-add-cooling-cells-to-cpu-nodes.patch queue-4.9/vmxnet3-prevent-building-with-64k-pages.patch queue-4.9/x86-platform-add-pci-dependency-for-punit_atom_debug.patch queue-4.9/alsa-hda-ca0132-fix-possible-null-pointer-use.patch queue-4.9/thermal-fix-intel_soc_dts_iosf_core-dependencies.patch queue-4.9/arm64-define-bug-instruction-without-config_bug.patch queue-4.9/arm64-sunxi-always-enable-reset-controller.patch queue-4.9/tc358743-fix-register-i2c_rd-wr-functions.patch queue-4.9/security-keys-big_key-requires-config_crypto.patch queue-4.9/drm-i915-hide-unused-intel_panel_set_backlight-function.patch queue-4.9/x86-fpu-math-emu-fix-possible-uninitialized-variable-use.patch queue-4.9/arm-8743-1-bl_switcher-add-module_license-tag.patch queue-4.9/em28xx-only-use-mt9v011-if-camera-support-is-enabled.patch queue-4.9/arm64-fix-warning-about-swapper_pg_dir-overflow.patch queue-4.9/shmem-avoid-maybe-uninitialized-warning.patch queue-4.9/input-tca8418_keypad-hide-gcc-4.9-wmaybe-uninitialized-warning.patch queue-4.9/drm-nouveau-hide-gcc-4.9-wmaybe-uninitialized.patch queue-4.9/x86-add-multiuser-dependency-for-kvm.patch queue-4.9/isdn-eicon-reduce-stack-size-of-sig_ind-function.patch
On Mon, Feb 19, 2018 at 11:13:19AM +0100, Arnd Bergmann wrote:
As discussed with Greg, I've had my randconfig builder build 4.9-stable kernels over the weekend, here is what it found missing. There are 45 patches that can be backported cleanly from mainline, plus another 9 that are either not part of mainline because the problem no longer exists there (e.g. file was removed), or the backport required context changes.
Most of these should also apply to 4.4, but I have not tried that yet.
Arnd
ac29fc66855b drm/i915: fix intel_backlight_device_register declaration 23f919d4ad0e shmem: avoid maybe-uninitialized warning aa01338c0184 clk: sunxi-ng: fix build error without CONFIG_RESET_CONTROLLER fbdf0e28d061 vmxnet3: prevent building with 64K pages 11d8b05855f3 perf/x86: Shut up false-positive -Wmaybe-uninitialized warning 42db500a551f PCI: vmd: Fix suspend handlers defined-but-not-used warning fbc2a294f29e gpio: intel-mid: Fix build warning when !CONFIG_PM b4aca383f9af platform/x86: intel_mid_thermal: Fix suspend handlers unused warning c8bd2ac3b4c6 usb: musb: fix compilation warning on unused function de5bbdd01cf9 PCI: Change pci_host_common_probe() visibility c0bfc549e962 perf: xgene: Include module.h 484c7bbf2649 video: fbdev: via: remove possibly unused variables 067fdeb2f391 dmaengine: zx: fix build warning f46e7cd36b5f scsi: advansys: fix build warning for PCI=n d4b2ac63b0ea x86/ras/inject: Make it depend on X86_LOCAL_APIC=y b115bebc07f2 gpio: xgene: mark PM functions as __maybe_unused f13d52cb3fad arm64: define BUG() instruction without CONFIG_BUG 75e2f0a6b161 x86/fpu/math-emu: Fix possible uninitialized variable use e572d0887137 tools build: Add tools tree support for 'make -s' d460131dd505 x86/build: Silence the build with "make -s" 68fd77cf8a4b thermal: fix INTEL_SOC_DTS_IOSF_CORE dependencies c2ce3f5d89d5 x86: add MULTIUSER dependency for KVM d689c64d189e x86/platform: Add PCI dependency for PUNIT_ATOM_DEBUG 3ba5b5ea7dc3 x86/vm86: Fix unused variable warning if THP is disabled 44a5b977128c scsi: advansys: fix uninitialized data access 2e449048a25e arm64: Kconfig: select COMPAT_BINFMT_ELF only when BINFMT_ELF is set 46a049dae771 ALSA: hda/ca0132 - fix possible NULL pointer use ab4949640d66 reiserfs: avoid a -Wmaybe-uninitialized warning 7fc1503c906f cw1200: fix bogus maybe-uninitialized warning 3cd18d198173 security/keys: BIG_KEY requires CONFIG_CRYPTO 7e1751001818 drm: exynos: mark pm functions as __maybe_unused 9e343e87d2c4 mtd: cfi: convert inline functions to macros 3cd890dbe2a4 media: dvb-frontends: fix i2c access helpers for KASAN d4c2269b3d5d rbd: silence bogus -Wmaybe-uninitialized warning b74c0a9969f2 drm/nouveau: hide gcc-4.9 -Wmaybe-uninitialized ea4348c8462a Input: tca8418_keypad - hide gcc-4.9 -Wmaybe-uninitialized warning 16c3ada89cff media: r820t: fix r820t_write_reg for KASAN e42eef4ba388 KVM: add X86_LOCAL_APIC dependency f1f5929cd971 shmem: fix compilation warnings on unused functions 3538aa6ecfb2 [media] tc358743: fix register i2c_rd/wr functions fa6317eedd63 [media] go7007: add MEDIA_CAMERA_SUPPORT dependency 190b23b4eb99 [media] em28xx: only use mt9v011 if camera support is enabled 27430d19a916 [media] tw5864: use dev_warn instead of WARN to shut up warning 27d807180ae0 ISDN: eicon: reduce stack size of sig_ind function dbed87a9d3a8 clk: meson: gxbb: fix build error without RESET_CONTROLLER
All of those patches are now queued up, along with the 9 you attached "by hand" here. Many thanks for them.
greg k-h
linux-stable-mirror@lists.linaro.org