From: Greg Kroah-Hartman Date: Sun, 4 Oct 2020 10:39:55 +0000 (+0200) Subject: 5.8-stable patches X-Git-Tag: v4.19.150~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=042f30f912d4d512c71eb941c881b6e09516ae05;p=thirdparty%2Fkernel%2Fstable-queue.git 5.8-stable patches added patches: clk-samsung-keep-top-bpll-mux-on-exynos542x-enabled.patch clk-socfpga-stratix10-fix-the-divider-for-the-emac_ptp_free_clk.patch gpio-amd-fch-correct-logic-of-gpio_line_direction.patch gpio-mockup-fix-resource-leak-in-error-path.patch gpio-siox-explicitly-support-only-threaded-irqs.patch gpio-tc35894-fix-up-tc35894-interrupt-configuration.patch scsi-iscsi-iscsi_tcp-avoid-holding-spinlock-while-calling-getpeername.patch --- diff --git a/queue-5.8/clk-samsung-keep-top-bpll-mux-on-exynos542x-enabled.patch b/queue-5.8/clk-samsung-keep-top-bpll-mux-on-exynos542x-enabled.patch new file mode 100644 index 00000000000..7ebd461c3c5 --- /dev/null +++ b/queue-5.8/clk-samsung-keep-top-bpll-mux-on-exynos542x-enabled.patch @@ -0,0 +1,43 @@ +From 0212a0483b0a36cc94cfab882b3edbb41fcfe1cd Mon Sep 17 00:00:00 2001 +From: Marek Szyprowski +Date: Fri, 7 Aug 2020 15:31:43 +0200 +Subject: clk: samsung: Keep top BPLL mux on Exynos542x enabled + +From: Marek Szyprowski + +commit 0212a0483b0a36cc94cfab882b3edbb41fcfe1cd upstream. + +BPLL clock must not be disabled because it is needed for proper DRAM +operation. This is normally handled by respective memory devfreq driver, +but when that driver is not yet probed or its probe has been deferred +the clock might get disabled what causes board hang. Fix this by calling +clk_prepare_enable() directly from the clock provider driver. + +Cc: stable@vger.kernel.org +Signed-off-by: Marek Szyprowski +Reviewed-by: Lukasz Luba +Tested-by: Lukasz Luba +Acked-by: Krzysztof Kozlowski +Link: https://lore.kernel.org/r/20200807133143.22748-1-m.szyprowski@samsung.com +Fixes: 6e7674c3c6df ("memory: Add DMC driver for Exynos5422") +Signed-off-by: Sylwester Nawrocki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/samsung/clk-exynos5420.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/clk/samsung/clk-exynos5420.c ++++ b/drivers/clk/samsung/clk-exynos5420.c +@@ -1655,6 +1655,11 @@ static void __init exynos5x_clk_init(str + * main G3D clock enablement status. + */ + clk_prepare_enable(__clk_lookup("mout_sw_aclk_g3d")); ++ /* ++ * Keep top BPLL mux enabled permanently to ensure that DRAM operates ++ * properly. ++ */ ++ clk_prepare_enable(__clk_lookup("mout_bpll")); + + samsung_clk_of_add_provider(np, ctx); + } diff --git a/queue-5.8/clk-socfpga-stratix10-fix-the-divider-for-the-emac_ptp_free_clk.patch b/queue-5.8/clk-socfpga-stratix10-fix-the-divider-for-the-emac_ptp_free_clk.patch new file mode 100644 index 00000000000..f685b5885ee --- /dev/null +++ b/queue-5.8/clk-socfpga-stratix10-fix-the-divider-for-the-emac_ptp_free_clk.patch @@ -0,0 +1,34 @@ +From b02cf0c4736c65c6667f396efaae6b5521e82abf Mon Sep 17 00:00:00 2001 +From: Dinh Nguyen +Date: Mon, 31 Aug 2020 15:26:57 -0500 +Subject: clk: socfpga: stratix10: fix the divider for the emac_ptp_free_clk + +From: Dinh Nguyen + +commit b02cf0c4736c65c6667f396efaae6b5521e82abf upstream. + +The fixed divider the emac_ptp_free_clk should be 2, not 4. + +Fixes: 07afb8db7340 ("clk: socfpga: stratix10: add clock driver for +Stratix10 platform") +Cc: stable@vger.kernel.org +Signed-off-by: Dinh Nguyen +Link: https://lore.kernel.org/r/20200831202657.8224-1-dinguyen@kernel.org +Signed-off-by: Stephen Boyd +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/socfpga/clk-s10.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/clk/socfpga/clk-s10.c ++++ b/drivers/clk/socfpga/clk-s10.c +@@ -209,7 +209,7 @@ static const struct stratix10_perip_cnt_ + { STRATIX10_EMAC_B_FREE_CLK, "emacb_free_clk", NULL, emacb_free_mux, ARRAY_SIZE(emacb_free_mux), + 0, 0, 2, 0xB0, 1}, + { STRATIX10_EMAC_PTP_FREE_CLK, "emac_ptp_free_clk", NULL, emac_ptp_free_mux, +- ARRAY_SIZE(emac_ptp_free_mux), 0, 0, 4, 0xB0, 2}, ++ ARRAY_SIZE(emac_ptp_free_mux), 0, 0, 2, 0xB0, 2}, + { STRATIX10_GPIO_DB_FREE_CLK, "gpio_db_free_clk", NULL, gpio_db_free_mux, + ARRAY_SIZE(gpio_db_free_mux), 0, 0, 0, 0xB0, 3}, + { STRATIX10_SDMMC_FREE_CLK, "sdmmc_free_clk", NULL, sdmmc_free_mux, diff --git a/queue-5.8/gpio-amd-fch-correct-logic-of-gpio_line_direction.patch b/queue-5.8/gpio-amd-fch-correct-logic-of-gpio_line_direction.patch new file mode 100644 index 00000000000..9cd94b6b86f --- /dev/null +++ b/queue-5.8/gpio-amd-fch-correct-logic-of-gpio_line_direction.patch @@ -0,0 +1,34 @@ +From d25e8fdebdad84219b498873300b7f11dd915b88 Mon Sep 17 00:00:00 2001 +From: Ed Wildgoose +Date: Mon, 28 Sep 2020 10:44:52 +0100 +Subject: gpio: amd-fch: correct logic of GPIO_LINE_DIRECTION + +From: Ed Wildgoose + +commit d25e8fdebdad84219b498873300b7f11dd915b88 upstream. + +The original commit appears to have the logic reversed in +amd_fch_gpio_get_direction. Also confirmed by observing the value of +"direction" in the sys tree. + +Signed-off-by: Ed Wildgoose +Fixes: e09d168f13f0 ("gpio: AMD G-Series PCH gpio driver") +Cc: stable@vger.kernel.org +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpio-amd-fch.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpio/gpio-amd-fch.c ++++ b/drivers/gpio/gpio-amd-fch.c +@@ -92,7 +92,7 @@ static int amd_fch_gpio_get_direction(st + ret = (readl_relaxed(ptr) & AMD_FCH_GPIO_FLAG_DIRECTION); + spin_unlock_irqrestore(&priv->lock, flags); + +- return ret ? GPIO_LINE_DIRECTION_IN : GPIO_LINE_DIRECTION_OUT; ++ return ret ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN; + } + + static void amd_fch_gpio_set(struct gpio_chip *gc, diff --git a/queue-5.8/gpio-mockup-fix-resource-leak-in-error-path.patch b/queue-5.8/gpio-mockup-fix-resource-leak-in-error-path.patch new file mode 100644 index 00000000000..39a406a54ca --- /dev/null +++ b/queue-5.8/gpio-mockup-fix-resource-leak-in-error-path.patch @@ -0,0 +1,41 @@ +From 1b02d9e770cd7087f34c743f85ccf5ea8372b047 Mon Sep 17 00:00:00 2001 +From: Bartosz Golaszewski +Date: Tue, 8 Sep 2020 15:07:49 +0200 +Subject: gpio: mockup: fix resource leak in error path + +From: Bartosz Golaszewski + +commit 1b02d9e770cd7087f34c743f85ccf5ea8372b047 upstream. + +If the module init function fails after creating the debugs directory, +it's never removed. Add proper cleanup calls to avoid this resource +leak. + +Fixes: 9202ba2397d1 ("gpio: mockup: implement event injecting over debugfs") +Cc: +Signed-off-by: Bartosz Golaszewski +Reviewed-by: Andy Shevchenko +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpio-mockup.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/gpio/gpio-mockup.c ++++ b/drivers/gpio/gpio-mockup.c +@@ -552,6 +552,7 @@ static int __init gpio_mockup_init(void) + err = platform_driver_register(&gpio_mockup_driver); + if (err) { + gpio_mockup_err("error registering platform driver\n"); ++ debugfs_remove_recursive(gpio_mockup_dbg_dir); + return err; + } + +@@ -582,6 +583,7 @@ static int __init gpio_mockup_init(void) + gpio_mockup_err("error registering device"); + platform_driver_unregister(&gpio_mockup_driver); + gpio_mockup_unregister_pdevs(); ++ debugfs_remove_recursive(gpio_mockup_dbg_dir); + return PTR_ERR(pdev); + } + diff --git a/queue-5.8/gpio-siox-explicitly-support-only-threaded-irqs.patch b/queue-5.8/gpio-siox-explicitly-support-only-threaded-irqs.patch new file mode 100644 index 00000000000..258b9595fb8 --- /dev/null +++ b/queue-5.8/gpio-siox-explicitly-support-only-threaded-irqs.patch @@ -0,0 +1,42 @@ +From 45ccf6556720293323c20cda717756014ff63007 Mon Sep 17 00:00:00 2001 +From: Ahmad Fatoum +Date: Mon, 7 Sep 2020 17:31:35 +0200 +Subject: gpio: siox: explicitly support only threaded irqs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ahmad Fatoum + +commit 45ccf6556720293323c20cda717756014ff63007 upstream. + +The gpio-siox driver uses handle_nested_irq() to implement its +interrupt support. This is only capable of handling threaded irq +actions. For a hardirq action it triggers a NULL pointer oops. +(It calls action->thread_fn which is NULL then.) + +Prevent registration of a hardirq action by setting +gpio_irq_chip::threaded to true. + +Cc: u.kleine-koenig@pengutronix.de +Fixes: be8c8facc707 ("gpio: new driver to work with a 8x12 siox") +Cc: stable@vger.kernel.org +Signed-off-by: Ahmad Fatoum +Acked-by: Uwe Kleine-König +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpio-siox.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/gpio/gpio-siox.c ++++ b/drivers/gpio/gpio-siox.c +@@ -245,6 +245,7 @@ static int gpio_siox_probe(struct siox_d + girq->chip = &ddata->ichip; + girq->default_type = IRQ_TYPE_NONE; + girq->handler = handle_level_irq; ++ girq->threaded = true; + + ret = devm_gpiochip_add_data(dev, &ddata->gchip, NULL); + if (ret) diff --git a/queue-5.8/gpio-tc35894-fix-up-tc35894-interrupt-configuration.patch b/queue-5.8/gpio-tc35894-fix-up-tc35894-interrupt-configuration.patch new file mode 100644 index 00000000000..adc32655a03 --- /dev/null +++ b/queue-5.8/gpio-tc35894-fix-up-tc35894-interrupt-configuration.patch @@ -0,0 +1,40 @@ +From 214b0e1ad01abf4c1f6d8d28fa096bf167e47cef Mon Sep 17 00:00:00 2001 +From: dillon min +Date: Thu, 3 Sep 2020 15:30:21 +0800 +Subject: gpio: tc35894: fix up tc35894 interrupt configuration + +From: dillon min + +commit 214b0e1ad01abf4c1f6d8d28fa096bf167e47cef upstream. + +The offset of regmap is incorrect, j * 8 is move to the +wrong register. + +for example: + +asume i = 0, j = 1. we want to set KPY5 as interrupt +falling edge mode, regmap[0][1] should be TC3589x_GPIOIBE1 0xcd +but, regmap[i] + j * 8 = TC3589x_GPIOIBE0 + 8 ,point to 0xd4, +this is TC3589x_GPIOIE2 not TC3589x_GPIOIBE1. + +Fixes: d88b25be3584 ("gpio: Add TC35892 GPIO driver") +Cc: Cc: stable@vger.kernel.org +Signed-off-by: dillon min +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpio/gpio-tc3589x.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpio/gpio-tc3589x.c ++++ b/drivers/gpio/gpio-tc3589x.c +@@ -212,7 +212,7 @@ static void tc3589x_gpio_irq_sync_unlock + continue; + + tc3589x_gpio->oldregs[i][j] = new; +- tc3589x_reg_write(tc3589x, regmap[i] + j * 8, new); ++ tc3589x_reg_write(tc3589x, regmap[i] + j, new); + } + } + diff --git a/queue-5.8/scsi-iscsi-iscsi_tcp-avoid-holding-spinlock-while-calling-getpeername.patch b/queue-5.8/scsi-iscsi-iscsi_tcp-avoid-holding-spinlock-while-calling-getpeername.patch new file mode 100644 index 00000000000..4e02d154236 --- /dev/null +++ b/queue-5.8/scsi-iscsi-iscsi_tcp-avoid-holding-spinlock-while-calling-getpeername.patch @@ -0,0 +1,105 @@ +From bcf3a2953d36bbfb9bd44ccb3db0897d935cc485 Mon Sep 17 00:00:00 2001 +From: Mark Mielke +Date: Mon, 28 Sep 2020 00:33:29 -0400 +Subject: scsi: iscsi: iscsi_tcp: Avoid holding spinlock while calling getpeername() + +From: Mark Mielke + +commit bcf3a2953d36bbfb9bd44ccb3db0897d935cc485 upstream. + +The kernel may fail to boot or devices may fail to come up when +initializing iscsi_tcp devices starting with Linux 5.8. + +Commit a79af8a64d39 ("[SCSI] iscsi_tcp: use iscsi_conn_get_addr_param +libiscsi function") introduced getpeername() within the session spinlock. + +Commit 1b66d253610c ("bpf: Add get{peer, sock}name attach types for +sock_addr") introduced BPF_CGROUP_RUN_SA_PROG_LOCK() within getpeername(), +which acquires a mutex and when used from iscsi_tcp devices can now lead to +"BUG: scheduling while atomic:" and subsequent damage. + +Ensure that the spinlock is released before calling getpeername() or +getsockname(). sock_hold() and sock_put() are used to ensure that the +socket reference is preserved until after the getpeername() or +getsockname() complete. + +Link: https://bugzilla.redhat.com/show_bug.cgi?id=1877345 +Link: https://lkml.org/lkml/2020/7/28/1085 +Link: https://lkml.org/lkml/2020/8/31/459 +Link: https://lore.kernel.org/r/20200928043329.606781-1-mark.mielke@gmail.com +Fixes: a79af8a64d39 ("[SCSI] iscsi_tcp: use iscsi_conn_get_addr_param libiscsi function") +Fixes: 1b66d253610c ("bpf: Add get{peer, sock}name attach types for sock_addr") +Cc: stable@vger.kernel.org +Reported-by: Marc Dionne +Tested-by: Marc Dionne +Reviewed-by: Mike Christie +Signed-off-by: Mark Mielke +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/iscsi_tcp.c | 22 +++++++++++++++------- + 1 file changed, 15 insertions(+), 7 deletions(-) + +--- a/drivers/scsi/iscsi_tcp.c ++++ b/drivers/scsi/iscsi_tcp.c +@@ -736,6 +736,7 @@ static int iscsi_sw_tcp_conn_get_param(s + struct iscsi_tcp_conn *tcp_conn = conn->dd_data; + struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data; + struct sockaddr_in6 addr; ++ struct socket *sock; + int rc; + + switch(param) { +@@ -747,13 +748,17 @@ static int iscsi_sw_tcp_conn_get_param(s + spin_unlock_bh(&conn->session->frwd_lock); + return -ENOTCONN; + } ++ sock = tcp_sw_conn->sock; ++ sock_hold(sock->sk); ++ spin_unlock_bh(&conn->session->frwd_lock); ++ + if (param == ISCSI_PARAM_LOCAL_PORT) +- rc = kernel_getsockname(tcp_sw_conn->sock, ++ rc = kernel_getsockname(sock, + (struct sockaddr *)&addr); + else +- rc = kernel_getpeername(tcp_sw_conn->sock, ++ rc = kernel_getpeername(sock, + (struct sockaddr *)&addr); +- spin_unlock_bh(&conn->session->frwd_lock); ++ sock_put(sock->sk); + if (rc < 0) + return rc; + +@@ -775,6 +780,7 @@ static int iscsi_sw_tcp_host_get_param(s + struct iscsi_tcp_conn *tcp_conn; + struct iscsi_sw_tcp_conn *tcp_sw_conn; + struct sockaddr_in6 addr; ++ struct socket *sock; + int rc; + + switch (param) { +@@ -789,16 +795,18 @@ static int iscsi_sw_tcp_host_get_param(s + return -ENOTCONN; + } + tcp_conn = conn->dd_data; +- + tcp_sw_conn = tcp_conn->dd_data; +- if (!tcp_sw_conn->sock) { ++ sock = tcp_sw_conn->sock; ++ if (!sock) { + spin_unlock_bh(&session->frwd_lock); + return -ENOTCONN; + } ++ sock_hold(sock->sk); ++ spin_unlock_bh(&session->frwd_lock); + +- rc = kernel_getsockname(tcp_sw_conn->sock, ++ rc = kernel_getsockname(sock, + (struct sockaddr *)&addr); +- spin_unlock_bh(&session->frwd_lock); ++ sock_put(sock->sk); + if (rc < 0) + return rc; + diff --git a/queue-5.8/series b/queue-5.8/series index 5182bc39a3d..21219af2e84 100644 --- a/queue-5.8/series +++ b/queue-5.8/series @@ -6,3 +6,10 @@ revert-usbip-implement-a-match-function-to-fix-usbip.patch usbcore-driver-fix-specific-driver-selection.patch usbcore-driver-fix-incorrect-downcast.patch usbcore-driver-accommodate-usbip.patch +gpio-siox-explicitly-support-only-threaded-irqs.patch +gpio-mockup-fix-resource-leak-in-error-path.patch +gpio-tc35894-fix-up-tc35894-interrupt-configuration.patch +gpio-amd-fch-correct-logic-of-gpio_line_direction.patch +clk-samsung-keep-top-bpll-mux-on-exynos542x-enabled.patch +clk-socfpga-stratix10-fix-the-divider-for-the-emac_ptp_free_clk.patch +scsi-iscsi-iscsi_tcp-avoid-holding-spinlock-while-calling-getpeername.patch