From: Greg Kroah-Hartman Date: Thu, 12 May 2022 13:43:47 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.9.314~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7bd56d1ad8550e87e68937929785663b2fdd8d9e;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: block-drbd-drbd_nl-make-conversion-to-enum-drbd_ret_code-explicit.patch drm-amd-display-dc-gpio-gpio_service-pass-around-correct-dce_-version-environment-types.patch mips-use-address-of-operator-on-section-symbols.patch nfp-bpf-silence-bitwise-vs.-logical-or-warning.patch regulator-consumer-add-missing-stubs-to-regulator-consumer.h.patch --- diff --git a/queue-5.10/block-drbd-drbd_nl-make-conversion-to-enum-drbd_ret_code-explicit.patch b/queue-5.10/block-drbd-drbd_nl-make-conversion-to-enum-drbd_ret_code-explicit.patch new file mode 100644 index 00000000000..f7ad776d3b8 --- /dev/null +++ b/queue-5.10/block-drbd-drbd_nl-make-conversion-to-enum-drbd_ret_code-explicit.patch @@ -0,0 +1,83 @@ +From 1f1e87b4dc4598eac57a69868534b92d65e47e82 Mon Sep 17 00:00:00 2001 +From: Lee Jones +Date: Fri, 12 Mar 2021 10:55:26 +0000 +Subject: block: drbd: drbd_nl: Make conversion to 'enum drbd_ret_code' explicit +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Lee Jones + +commit 1f1e87b4dc4598eac57a69868534b92d65e47e82 upstream. + +Fixes the following W=1 kernel build warning(s): + + from drivers/block/drbd/drbd_nl.c:24: + drivers/block/drbd/drbd_nl.c: In function ‘drbd_adm_set_role’: + drivers/block/drbd/drbd_nl.c:793:11: warning: implicit conversion from ‘enum drbd_state_rv’ to ‘enum drbd_ret_code’ [-Wenum-conversion] + drivers/block/drbd/drbd_nl.c:795:11: warning: implicit conversion from ‘enum drbd_state_rv’ to ‘enum drbd_ret_code’ [-Wenum-conversion] + drivers/block/drbd/drbd_nl.c: In function ‘drbd_adm_attach’: + drivers/block/drbd/drbd_nl.c:1965:10: warning: implicit conversion from ‘enum drbd_state_rv’ to ‘enum drbd_ret_code’ [-Wenum-conversion] + drivers/block/drbd/drbd_nl.c: In function ‘drbd_adm_connect’: + drivers/block/drbd/drbd_nl.c:2690:10: warning: implicit conversion from ‘enum drbd_state_rv’ to ‘enum drbd_ret_code’ [-Wenum-conversion] + drivers/block/drbd/drbd_nl.c: In function ‘drbd_adm_disconnect’: + drivers/block/drbd/drbd_nl.c:2803:11: warning: implicit conversion from ‘enum drbd_state_rv’ to ‘enum drbd_ret_code’ [-Wenum-conversion] + +Cc: Philipp Reisner +Cc: Lars Ellenberg +Cc: Jens Axboe +Cc: drbd-dev@lists.linbit.com +Cc: linux-block@vger.kernel.org +Signed-off-by: Lee Jones +Link: https://lore.kernel.org/r/20210312105530.2219008-8-lee.jones@linaro.org +Signed-off-by: Jens Axboe +Cc: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + drivers/block/drbd/drbd_nl.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +--- a/drivers/block/drbd/drbd_nl.c ++++ b/drivers/block/drbd/drbd_nl.c +@@ -790,9 +790,11 @@ int drbd_adm_set_role(struct sk_buff *sk + mutex_lock(&adm_ctx.resource->adm_mutex); + + if (info->genlhdr->cmd == DRBD_ADM_PRIMARY) +- retcode = drbd_set_role(adm_ctx.device, R_PRIMARY, parms.assume_uptodate); ++ retcode = (enum drbd_ret_code)drbd_set_role(adm_ctx.device, ++ R_PRIMARY, parms.assume_uptodate); + else +- retcode = drbd_set_role(adm_ctx.device, R_SECONDARY, 0); ++ retcode = (enum drbd_ret_code)drbd_set_role(adm_ctx.device, ++ R_SECONDARY, 0); + + mutex_unlock(&adm_ctx.resource->adm_mutex); + genl_lock(); +@@ -1962,7 +1964,7 @@ int drbd_adm_attach(struct sk_buff *skb, + drbd_flush_workqueue(&connection->sender_work); + + rv = _drbd_request_state(device, NS(disk, D_ATTACHING), CS_VERBOSE); +- retcode = rv; /* FIXME: Type mismatch. */ ++ retcode = (enum drbd_ret_code)rv; + drbd_resume_io(device); + if (rv < SS_SUCCESS) + goto fail; +@@ -2687,7 +2689,8 @@ int drbd_adm_connect(struct sk_buff *skb + } + rcu_read_unlock(); + +- retcode = conn_request_state(connection, NS(conn, C_UNCONNECTED), CS_VERBOSE); ++ retcode = (enum drbd_ret_code)conn_request_state(connection, ++ NS(conn, C_UNCONNECTED), CS_VERBOSE); + + conn_reconfig_done(connection); + mutex_unlock(&adm_ctx.resource->adm_mutex); +@@ -2800,7 +2803,7 @@ int drbd_adm_disconnect(struct sk_buff * + mutex_lock(&adm_ctx.resource->adm_mutex); + rv = conn_try_disconnect(connection, parms.force_disconnect); + if (rv < SS_SUCCESS) +- retcode = rv; /* FIXME: Type mismatch. */ ++ retcode = (enum drbd_ret_code)rv; + else + retcode = NO_ERROR; + mutex_unlock(&adm_ctx.resource->adm_mutex); diff --git a/queue-5.10/drm-amd-display-dc-gpio-gpio_service-pass-around-correct-dce_-version-environment-types.patch b/queue-5.10/drm-amd-display-dc-gpio-gpio_service-pass-around-correct-dce_-version-environment-types.patch new file mode 100644 index 00000000000..85b5df14f0d --- /dev/null +++ b/queue-5.10/drm-amd-display-dc-gpio-gpio_service-pass-around-correct-dce_-version-environment-types.patch @@ -0,0 +1,80 @@ +From 353f7f3a9dd5fd2833b6462bac89ec1654c9c3aa Mon Sep 17 00:00:00 2001 +From: Lee Jones +Date: Wed, 26 May 2021 09:47:06 +0100 +Subject: drm/amd/display/dc/gpio/gpio_service: Pass around correct dce_{version, environment} types +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Lee Jones + +commit 353f7f3a9dd5fd2833b6462bac89ec1654c9c3aa upstream. + +Fixes the following W=1 kernel build warning(s): + + drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/gpio_service.c: In function ‘dal_gpio_service_create’: + drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/gpio_service.c:71:4: warning: implicit conversion from ‘enum dce_version’ to ‘enum dce_environment’ [-Wenum-conversion] + drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/gpio_service.c:77:4: warning: implicit conversion from ‘enum dce_version’ to ‘enum dce_environment’ [-Wenum-conversion] + +Cc: Harry Wentland +Cc: Leo Li +Cc: Alex Deucher +Cc: "Christian König" +Cc: David Airlie +Cc: Daniel Vetter +Cc: amd-gfx@lists.freedesktop.org +Cc: dri-devel@lists.freedesktop.org +Signed-off-by: Lee Jones +Signed-off-by: Alex Deucher +Cc: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c | 12 +++++------ + drivers/gpu/drm/amd/display/include/gpio_service_interface.h | 4 +-- + 2 files changed, 8 insertions(+), 8 deletions(-) + +--- a/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c ++++ b/drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c +@@ -53,8 +53,8 @@ + */ + + struct gpio_service *dal_gpio_service_create( +- enum dce_version dce_version_major, +- enum dce_version dce_version_minor, ++ enum dce_version dce_version, ++ enum dce_environment dce_environment, + struct dc_context *ctx) + { + struct gpio_service *service; +@@ -67,14 +67,14 @@ struct gpio_service *dal_gpio_service_cr + return NULL; + } + +- if (!dal_hw_translate_init(&service->translate, dce_version_major, +- dce_version_minor)) { ++ if (!dal_hw_translate_init(&service->translate, dce_version, ++ dce_environment)) { + BREAK_TO_DEBUGGER(); + goto failure_1; + } + +- if (!dal_hw_factory_init(&service->factory, dce_version_major, +- dce_version_minor)) { ++ if (!dal_hw_factory_init(&service->factory, dce_version, ++ dce_environment)) { + BREAK_TO_DEBUGGER(); + goto failure_1; + } +--- a/drivers/gpu/drm/amd/display/include/gpio_service_interface.h ++++ b/drivers/gpu/drm/amd/display/include/gpio_service_interface.h +@@ -42,8 +42,8 @@ void dal_gpio_destroy( + struct gpio **ptr); + + struct gpio_service *dal_gpio_service_create( +- enum dce_version dce_version_major, +- enum dce_version dce_version_minor, ++ enum dce_version dce_version, ++ enum dce_environment dce_environment, + struct dc_context *ctx); + + struct gpio *dal_gpio_service_create_irq( diff --git a/queue-5.10/mips-use-address-of-operator-on-section-symbols.patch b/queue-5.10/mips-use-address-of-operator-on-section-symbols.patch new file mode 100644 index 00000000000..6df69c9e061 --- /dev/null +++ b/queue-5.10/mips-use-address-of-operator-on-section-symbols.patch @@ -0,0 +1,81 @@ +From d422c6c0644bccbb1ebeefffa51f35cec3019517 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Tue, 5 Jan 2021 13:18:27 -0700 +Subject: MIPS: Use address-of operator on section symbols + +From: Nathan Chancellor + +commit d422c6c0644bccbb1ebeefffa51f35cec3019517 upstream. + +When building xway_defconfig with clang: + +arch/mips/lantiq/prom.c:82:23: error: array comparison always evaluates +to true [-Werror,-Wtautological-compare] + else if (__dtb_start != __dtb_end) + ^ +1 error generated. + +These are not true arrays, they are linker defined symbols, which are +just addresses. Using the address of operator silences the warning +and does not change the resulting assembly with either clang/ld.lld +or gcc/ld (tested with diff + objdump -Dr). Do the same thing across +the entire MIPS subsystem to ensure there are no more warnings around +this type of comparison. + +Link: https://github.com/ClangBuiltLinux/linux/issues/1232 +Signed-off-by: Nathan Chancellor +Acked-by: Florian Fainelli +Signed-off-by: Thomas Bogendoerfer +Cc: Sudip Mukherjee +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/bmips/setup.c | 2 +- + arch/mips/lantiq/prom.c | 2 +- + arch/mips/pic32/pic32mzda/init.c | 2 +- + arch/mips/ralink/of.c | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +--- a/arch/mips/bmips/setup.c ++++ b/arch/mips/bmips/setup.c +@@ -167,7 +167,7 @@ void __init plat_mem_setup(void) + dtb = phys_to_virt(fw_arg2); + else if (fw_passed_dtb) /* UHI interface or appended dtb */ + dtb = (void *)fw_passed_dtb; +- else if (__dtb_start != __dtb_end) ++ else if (&__dtb_start != &__dtb_end) + dtb = (void *)__dtb_start; + else + panic("no dtb found"); +--- a/arch/mips/lantiq/prom.c ++++ b/arch/mips/lantiq/prom.c +@@ -79,7 +79,7 @@ void __init plat_mem_setup(void) + + if (fw_passed_dtb) /* UHI interface */ + dtb = (void *)fw_passed_dtb; +- else if (__dtb_start != __dtb_end) ++ else if (&__dtb_start != &__dtb_end) + dtb = (void *)__dtb_start; + else + panic("no dtb found"); +--- a/arch/mips/pic32/pic32mzda/init.c ++++ b/arch/mips/pic32/pic32mzda/init.c +@@ -28,7 +28,7 @@ static ulong get_fdtaddr(void) + if (fw_passed_dtb && !fw_arg2 && !fw_arg3) + return (ulong)fw_passed_dtb; + +- if (__dtb_start < __dtb_end) ++ if (&__dtb_start < &__dtb_end) + ftaddr = (ulong)__dtb_start; + + return ftaddr; +--- a/arch/mips/ralink/of.c ++++ b/arch/mips/ralink/of.c +@@ -77,7 +77,7 @@ void __init plat_mem_setup(void) + */ + if (fw_passed_dtb) + dtb = (void *)fw_passed_dtb; +- else if (__dtb_start != __dtb_end) ++ else if (&__dtb_start != &__dtb_end) + dtb = (void *)__dtb_start; + + __dt_setup_arch(dtb); diff --git a/queue-5.10/nfp-bpf-silence-bitwise-vs.-logical-or-warning.patch b/queue-5.10/nfp-bpf-silence-bitwise-vs.-logical-or-warning.patch new file mode 100644 index 00000000000..0131ed83caf --- /dev/null +++ b/queue-5.10/nfp-bpf-silence-bitwise-vs.-logical-or-warning.patch @@ -0,0 +1,61 @@ +From 8a64ef042eab8a6cec04a6c79d44d1af79b628ca Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Mon, 18 Oct 2021 12:31:01 -0700 +Subject: nfp: bpf: silence bitwise vs. logical OR warning + +From: Nathan Chancellor + +commit 8a64ef042eab8a6cec04a6c79d44d1af79b628ca upstream. + +A new warning in clang points out two places in this driver where +boolean expressions are being used with a bitwise OR instead of a +logical one: + +drivers/net/ethernet/netronome/nfp/nfp_asm.c:199:20: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical] + reg->src_lmextn = swreg_lmextn(lreg) | swreg_lmextn(rreg); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + || +drivers/net/ethernet/netronome/nfp/nfp_asm.c:199:20: note: cast one or both operands to int to silence this warning +drivers/net/ethernet/netronome/nfp/nfp_asm.c:280:20: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical] + reg->src_lmextn = swreg_lmextn(lreg) | swreg_lmextn(rreg); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + || +drivers/net/ethernet/netronome/nfp/nfp_asm.c:280:20: note: cast one or both operands to int to silence this warning +2 errors generated. + +The motivation for the warning is that logical operations short circuit +while bitwise operations do not. In this case, it does not seem like +short circuiting is harmful so implement the suggested fix of changing +to a logical operation to fix the warning. + +Link: https://github.com/ClangBuiltLinux/linux/issues/1479 +Reported-by: Nick Desaulniers +Signed-off-by: Nathan Chancellor +Reviewed-by: Nick Desaulniers +Link: https://lore.kernel.org/r/20211018193101.2340261-1-nathan@kernel.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/netronome/nfp/nfp_asm.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/netronome/nfp/nfp_asm.c ++++ b/drivers/net/ethernet/netronome/nfp/nfp_asm.c +@@ -196,7 +196,7 @@ int swreg_to_unrestricted(swreg dst, swr + } + + reg->dst_lmextn = swreg_lmextn(dst); +- reg->src_lmextn = swreg_lmextn(lreg) | swreg_lmextn(rreg); ++ reg->src_lmextn = swreg_lmextn(lreg) || swreg_lmextn(rreg); + + return 0; + } +@@ -277,7 +277,7 @@ int swreg_to_restricted(swreg dst, swreg + } + + reg->dst_lmextn = swreg_lmextn(dst); +- reg->src_lmextn = swreg_lmextn(lreg) | swreg_lmextn(rreg); ++ reg->src_lmextn = swreg_lmextn(lreg) || swreg_lmextn(rreg); + + return 0; + } diff --git a/queue-5.10/regulator-consumer-add-missing-stubs-to-regulator-consumer.h.patch b/queue-5.10/regulator-consumer-add-missing-stubs-to-regulator-consumer.h.patch new file mode 100644 index 00000000000..525e20db5c6 --- /dev/null +++ b/queue-5.10/regulator-consumer-add-missing-stubs-to-regulator-consumer.h.patch @@ -0,0 +1,77 @@ +From 51dfb6ca3728bd0a0a3c23776a12d2a15a1d2457 Mon Sep 17 00:00:00 2001 +From: Dmitry Osipenko +Date: Wed, 20 Jan 2021 23:58:44 +0300 +Subject: regulator: consumer: Add missing stubs to regulator/consumer.h + +From: Dmitry Osipenko + +commit 51dfb6ca3728bd0a0a3c23776a12d2a15a1d2457 upstream. + +Add missing stubs to regulator/consumer.h in order to fix COMPILE_TEST +of the kernel. In particular this should fix compile-testing of OPP core +because of a missing stub for regulator_sync_voltage(). + +Reported-by: kernel test robot +Signed-off-by: Dmitry Osipenko +Link: https://lore.kernel.org/r/20210120205844.12658-1-digetx@gmail.com +Signed-off-by: Mark Brown +Cc: Bjørn Mork +Cc: Sudip Mukherjee +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/regulator/consumer.h | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +--- a/include/linux/regulator/consumer.h ++++ b/include/linux/regulator/consumer.h +@@ -332,6 +332,12 @@ regulator_get_exclusive(struct device *d + } + + static inline struct regulator *__must_check ++devm_regulator_get_exclusive(struct device *dev, const char *id) ++{ ++ return ERR_PTR(-ENODEV); ++} ++ ++static inline struct regulator *__must_check + regulator_get_optional(struct device *dev, const char *id) + { + return ERR_PTR(-ENODEV); +@@ -486,6 +492,11 @@ static inline int regulator_get_voltage( + return -EINVAL; + } + ++static inline int regulator_sync_voltage(struct regulator *regulator) ++{ ++ return -EINVAL; ++} ++ + static inline int regulator_is_supported_voltage(struct regulator *regulator, + int min_uV, int max_uV) + { +@@ -578,6 +589,25 @@ static inline int devm_regulator_unregis + return 0; + } + ++static inline int regulator_suspend_enable(struct regulator_dev *rdev, ++ suspend_state_t state) ++{ ++ return -EINVAL; ++} ++ ++static inline int regulator_suspend_disable(struct regulator_dev *rdev, ++ suspend_state_t state) ++{ ++ return -EINVAL; ++} ++ ++static inline int regulator_set_suspend_voltage(struct regulator *regulator, ++ int min_uV, int max_uV, ++ suspend_state_t state) ++{ ++ return -EINVAL; ++} ++ + static inline void *regulator_get_drvdata(struct regulator *regulator) + { + return NULL; diff --git a/queue-5.10/series b/queue-5.10/series new file mode 100644 index 00000000000..a22e23975e5 --- /dev/null +++ b/queue-5.10/series @@ -0,0 +1,5 @@ +mips-use-address-of-operator-on-section-symbols.patch +regulator-consumer-add-missing-stubs-to-regulator-consumer.h.patch +block-drbd-drbd_nl-make-conversion-to-enum-drbd_ret_code-explicit.patch +drm-amd-display-dc-gpio-gpio_service-pass-around-correct-dce_-version-environment-types.patch +nfp-bpf-silence-bitwise-vs.-logical-or-warning.patch diff --git a/queue-5.17/series b/queue-5.17/series new file mode 100644 index 00000000000..e69de29bb2d