From 02ae13e45ec2c1868dd782fe583cbebe076866a8 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Mon, 21 Sep 2020 06:41:15 -0400 Subject: [PATCH] Fixes for 4.9 Signed-off-by: Sasha Levin --- ...-initialization-of-mux_pll_src_4plls.patch | 58 ++++++++ ...-add-timeout-to-vmbus_wait_for_unloa.patch | 54 ++++++++ ...-exception-handing-in-mtk_drm_probe-.patch | 46 ++++++ ...-font-detection-test-at-fbcon_resize.patch | 52 +++++++ ...reapply-i2c-bus-settings-after-reset.patch | 131 ++++++++++++++++++ .../mips-sni-fix-mips_l1_cache_shift.patch | 35 +++++ .../mips-sni-fix-spurious-interrupts.patch | 58 ++++++++ ...rr_delay-error-reclaiming-locking-st.patch | 45 ++++++ ...free-formats-for-perf-pmu-parse-test.patch | 94 +++++++++++++ ...ce-select-dmaengines-with-depends-on.patch | 37 +++++ ...ogi-plogi-receive-race-condition-in-.patch | 62 +++++++++ ...memleak-in-pm8001_exec_internal_task.patch | 37 +++++ queue-4.9/series | 14 ++ ...loopback-test-fix-out-of-bounds-read.patch | 65 +++++++++ ...op-printk-reading-past-end-of-string.patch | 39 ++++++ 15 files changed, 827 insertions(+) create mode 100644 queue-4.9/clk-rockchip-fix-initialization-of-mux_pll_src_4plls.patch create mode 100644 queue-4.9/drivers-hv-vmbus-add-timeout-to-vmbus_wait_for_unloa.patch create mode 100644 queue-4.9/drm-mediatek-add-exception-handing-in-mtk_drm_probe-.patch create mode 100644 queue-4.9/fbcon-fix-user-font-detection-test-at-fbcon_resize.patch create mode 100644 queue-4.9/i2c-algo-pca-reapply-i2c-bus-settings-after-reset.patch create mode 100644 queue-4.9/mips-sni-fix-mips_l1_cache_shift.patch create mode 100644 queue-4.9/mips-sni-fix-spurious-interrupts.patch create mode 100644 queue-4.9/nfsv4.1-handle-err_delay-error-reclaiming-locking-st.patch create mode 100644 queue-4.9/perf-test-free-formats-for-perf-pmu-parse-test.patch create mode 100644 queue-4.9/rapidio-replace-select-dmaengines-with-depends-on.patch create mode 100644 queue-4.9/scsi-lpfc-fix-flogi-plogi-receive-race-condition-in-.patch create mode 100644 queue-4.9/scsi-pm8001-fix-memleak-in-pm8001_exec_internal_task.patch create mode 100644 queue-4.9/spi-spi-loopback-test-fix-out-of-bounds-read.patch create mode 100644 queue-4.9/sunrpc-stop-printk-reading-past-end-of-string.patch diff --git a/queue-4.9/clk-rockchip-fix-initialization-of-mux_pll_src_4plls.patch b/queue-4.9/clk-rockchip-fix-initialization-of-mux_pll_src_4plls.patch new file mode 100644 index 00000000000..0471ec93aad --- /dev/null +++ b/queue-4.9/clk-rockchip-fix-initialization-of-mux_pll_src_4plls.patch @@ -0,0 +1,58 @@ +From 80c9a4ccb708e634d1134e488f9ec2db8d322013 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 9 Aug 2020 21:40:20 -0700 +Subject: clk: rockchip: Fix initialization of mux_pll_src_4plls_p +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Nathan Chancellor + +[ Upstream commit e9c006bc782c488f485ffe50de20b44e1e3daa18 ] + +A new warning in Clang points out that the initialization of +mux_pll_src_4plls_p appears incorrect: + +../drivers/clk/rockchip/clk-rk3228.c:140:58: warning: suspicious +concatenation of string literals in an array initialization; did you +mean to separate the elements with a comma? [-Wstring-concatenation] +PNAME(mux_pll_src_4plls_p) = { "cpll", "gpll", "hdmiphy" "usb480m" }; + ^ + , +../drivers/clk/rockchip/clk-rk3228.c:140:48: note: place parentheses +around the string literal to silence warning +PNAME(mux_pll_src_4plls_p) = { "cpll", "gpll", "hdmiphy" "usb480m" }; + ^ +1 warning generated. + +Given the name of the variable and the same variable name in rv1108, it +seems that this should have been four distinct elements. Fix it up by +adding the comma as suggested. + +Fixes: 307a2e9ac524 ("clk: rockchip: add clock controller for rk3228") +Link: https://github.com/ClangBuiltLinux/linux/issues/1123 +Signed-off-by: Nathan Chancellor +Link: https://lore.kernel.org/r/20200810044020.2063350-1-natechancellor@gmail.com +Reviewed-by: Heiko Stübner +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/rockchip/clk-rk3228.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/clk/rockchip/clk-rk3228.c b/drivers/clk/rockchip/clk-rk3228.c +index 53f16efbb8f4f..31785b3abac50 100644 +--- a/drivers/clk/rockchip/clk-rk3228.c ++++ b/drivers/clk/rockchip/clk-rk3228.c +@@ -126,7 +126,7 @@ PNAME(mux_usb480m_p) = { "usb480m_phy", "xin24m" }; + PNAME(mux_hdmiphy_p) = { "hdmiphy_phy", "xin24m" }; + PNAME(mux_aclk_cpu_src_p) = { "cpll_aclk_cpu", "gpll_aclk_cpu", "hdmiphy_aclk_cpu" }; + +-PNAME(mux_pll_src_4plls_p) = { "cpll", "gpll", "hdmiphy" "usb480m" }; ++PNAME(mux_pll_src_4plls_p) = { "cpll", "gpll", "hdmiphy", "usb480m" }; + PNAME(mux_pll_src_3plls_p) = { "cpll", "gpll", "hdmiphy" }; + PNAME(mux_pll_src_2plls_p) = { "cpll", "gpll" }; + PNAME(mux_sclk_hdmi_cec_p) = { "cpll", "gpll", "xin24m" }; +-- +2.25.1 + diff --git a/queue-4.9/drivers-hv-vmbus-add-timeout-to-vmbus_wait_for_unloa.patch b/queue-4.9/drivers-hv-vmbus-add-timeout-to-vmbus_wait_for_unloa.patch new file mode 100644 index 00000000000..aec177cf993 --- /dev/null +++ b/queue-4.9/drivers-hv-vmbus-add-timeout-to-vmbus_wait_for_unloa.patch @@ -0,0 +1,54 @@ +From c229aca8420b395de74869ecb6e712f9c625a1e8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 13 Sep 2020 12:47:29 -0700 +Subject: Drivers: hv: vmbus: Add timeout to vmbus_wait_for_unload + +From: Michael Kelley + +[ Upstream commit 911e1987efc8f3e6445955fbae7f54b428b92bd3 ] + +vmbus_wait_for_unload() looks for a CHANNELMSG_UNLOAD_RESPONSE message +coming from Hyper-V. But if the message isn't found for some reason, +the panic path gets hung forever. Add a timeout of 10 seconds to prevent +this. + +Fixes: 415719160de3 ("Drivers: hv: vmbus: avoid scheduling in interrupt context in vmbus_initiate_unload()") +Signed-off-by: Michael Kelley +Reviewed-by: Dexuan Cui +Reviewed-by: Vitaly Kuznetsov +Link: https://lore.kernel.org/r/1600026449-23651-1-git-send-email-mikelley@microsoft.com +Signed-off-by: Wei Liu +Signed-off-by: Sasha Levin +--- + drivers/hv/channel_mgmt.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c +index 9360cdce740e8..7bf5e2fe17516 100644 +--- a/drivers/hv/channel_mgmt.c ++++ b/drivers/hv/channel_mgmt.c +@@ -681,7 +681,7 @@ static void vmbus_wait_for_unload(void) + void *page_addr; + struct hv_message *msg; + struct vmbus_channel_message_header *hdr; +- u32 message_type; ++ u32 message_type, i; + + /* + * CHANNELMSG_UNLOAD_RESPONSE is always delivered to the CPU which was +@@ -691,8 +691,11 @@ static void vmbus_wait_for_unload(void) + * functional and vmbus_unload_response() will complete + * vmbus_connection.unload_event. If not, the last thing we can do is + * read message pages for all CPUs directly. ++ * ++ * Wait no more than 10 seconds so that the panic path can't get ++ * hung forever in case the response message isn't seen. + */ +- while (1) { ++ for (i = 0; i < 1000; i++) { + if (completion_done(&vmbus_connection.unload_event)) + break; + +-- +2.25.1 + diff --git a/queue-4.9/drm-mediatek-add-exception-handing-in-mtk_drm_probe-.patch b/queue-4.9/drm-mediatek-add-exception-handing-in-mtk_drm_probe-.patch new file mode 100644 index 00000000000..2c057e4a47d --- /dev/null +++ b/queue-4.9/drm-mediatek-add-exception-handing-in-mtk_drm_probe-.patch @@ -0,0 +1,46 @@ +From ab150683e85cc26b26f395d4fe8602f3ea8bc071 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 9 Sep 2020 16:49:42 +0800 +Subject: drm/mediatek: Add exception handing in mtk_drm_probe() if component + init fail + +From: Yu Kuai + +[ Upstream commit 64c194c00789889b0f9454f583712f079ba414ee ] + +mtk_ddp_comp_init() is called in a loop in mtk_drm_probe(), if it +fail, previous successive init component is not proccessed. + +Thus uninitialize valid component and put their device if component +init failed. + +Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") +Signed-off-by: Yu Kuai +Signed-off-by: Chun-Kuang Hu +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/mediatek/mtk_drm_drv.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c +index 2865876079315..0f8f9a784b1be 100644 +--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c ++++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c +@@ -457,8 +457,13 @@ err_pm: + pm_runtime_disable(dev); + err_node: + of_node_put(private->mutex_node); +- for (i = 0; i < DDP_COMPONENT_ID_MAX; i++) ++ for (i = 0; i < DDP_COMPONENT_ID_MAX; i++) { + of_node_put(private->comp_node[i]); ++ if (private->ddp_comp[i]) { ++ put_device(private->ddp_comp[i]->larb_dev); ++ private->ddp_comp[i] = NULL; ++ } ++ } + return ret; + } + +-- +2.25.1 + diff --git a/queue-4.9/fbcon-fix-user-font-detection-test-at-fbcon_resize.patch b/queue-4.9/fbcon-fix-user-font-detection-test-at-fbcon_resize.patch new file mode 100644 index 00000000000..7be76c9a298 --- /dev/null +++ b/queue-4.9/fbcon-fix-user-font-detection-test-at-fbcon_resize.patch @@ -0,0 +1,52 @@ +From cc27f625caa4040027e902f482848d5693461eb8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 11 Sep 2020 07:57:06 +0900 +Subject: fbcon: Fix user font detection test at fbcon_resize(). + +From: Tetsuo Handa + +[ Upstream commit ec0972adecb391a8d8650832263a4790f3bfb4df ] + +syzbot is reporting OOB read at fbcon_resize() [1], for +commit 39b3cffb8cf31117 ("fbcon: prevent user font height or width change + from causing potential out-of-bounds access") is by error using +registered_fb[con2fb_map[vc->vc_num]]->fbcon_par->p->userfont (which was +set to non-zero) instead of fb_display[vc->vc_num].userfont (which remains +zero for that display). + +We could remove tricky userfont flag [2], for we can determine it by +comparing address of the font data and addresses of built-in font data. +But since that commit is failing to fix the original OOB read [3], this +patch keeps the change minimal in case we decide to revert altogether. + +[1] https://syzkaller.appspot.com/bug?id=ebcbbb6576958a496500fee9cf7aa83ea00b5920 +[2] https://syzkaller.appspot.com/text?tag=Patch&x=14030853900000 +[3] https://syzkaller.appspot.com/bug?id=6fba8c186d97cf1011ab17660e633b1cc4e080c9 + +Reported-by: syzbot +Signed-off-by: Tetsuo Handa +Fixes: 39b3cffb8cf31117 ("fbcon: prevent user font height or width change from causing potential out-of-bounds access") +Cc: George Kennedy +Link: https://lore.kernel.org/r/f6e3e611-8704-1263-d163-f52c906a4f06@I-love.SAKURA.ne.jp +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/video/console/fbcon.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c +index fedf50e091bab..4b7d0f9a820aa 100644 +--- a/drivers/video/console/fbcon.c ++++ b/drivers/video/console/fbcon.c +@@ -1943,7 +1943,7 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width, + struct fb_var_screeninfo var = info->var; + int x_diff, y_diff, virt_w, virt_h, virt_fw, virt_fh; + +- if (ops->p && ops->p->userfont && FNTSIZE(vc->vc_font.data)) { ++ if (p->userfont && FNTSIZE(vc->vc_font.data)) { + int size; + int pitch = PITCH(vc->vc_font.width); + +-- +2.25.1 + diff --git a/queue-4.9/i2c-algo-pca-reapply-i2c-bus-settings-after-reset.patch b/queue-4.9/i2c-algo-pca-reapply-i2c-bus-settings-after-reset.patch new file mode 100644 index 00000000000..cd565ac44eb --- /dev/null +++ b/queue-4.9/i2c-algo-pca-reapply-i2c-bus-settings-after-reset.patch @@ -0,0 +1,131 @@ +From eb228b5dc04fa91c7079a410bb410c639ec81df1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 9 Sep 2020 08:32:47 +1200 +Subject: i2c: algo: pca: Reapply i2c bus settings after reset + +From: Evan Nimmo + +[ Upstream commit 0a355aeb24081e4538d4d424cd189f16c0bbd983 ] + +If something goes wrong (such as the SCL being stuck low) then we need +to reset the PCA chip. The issue with this is that on reset we lose all +config settings and the chip ends up in a disabled state which results +in a lock up/high CPU usage. We need to re-apply any configuration that +had previously been set and re-enable the chip. + +Signed-off-by: Evan Nimmo +Reviewed-by: Chris Packham +Reviewed-by: Andy Shevchenko +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + drivers/i2c/algos/i2c-algo-pca.c | 35 +++++++++++++++++++++----------- + include/linux/i2c-algo-pca.h | 15 ++++++++++++++ + 2 files changed, 38 insertions(+), 12 deletions(-) + +diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c +index 3a9db4626cb60..1886588b9ea3e 100644 +--- a/drivers/i2c/algos/i2c-algo-pca.c ++++ b/drivers/i2c/algos/i2c-algo-pca.c +@@ -50,8 +50,22 @@ static void pca_reset(struct i2c_algo_pca_data *adap) + pca_outw(adap, I2C_PCA_INDPTR, I2C_PCA_IPRESET); + pca_outw(adap, I2C_PCA_IND, 0xA5); + pca_outw(adap, I2C_PCA_IND, 0x5A); ++ ++ /* ++ * After a reset we need to re-apply any configuration ++ * (calculated in pca_init) to get the bus in a working state. ++ */ ++ pca_outw(adap, I2C_PCA_INDPTR, I2C_PCA_IMODE); ++ pca_outw(adap, I2C_PCA_IND, adap->bus_settings.mode); ++ pca_outw(adap, I2C_PCA_INDPTR, I2C_PCA_ISCLL); ++ pca_outw(adap, I2C_PCA_IND, adap->bus_settings.tlow); ++ pca_outw(adap, I2C_PCA_INDPTR, I2C_PCA_ISCLH); ++ pca_outw(adap, I2C_PCA_IND, adap->bus_settings.thi); ++ ++ pca_set_con(adap, I2C_PCA_CON_ENSIO); + } else { + adap->reset_chip(adap->data); ++ pca_set_con(adap, I2C_PCA_CON_ENSIO | adap->bus_settings.clock_freq); + } + } + +@@ -435,13 +449,14 @@ static int pca_init(struct i2c_adapter *adap) + " Use the nominal frequency.\n", adap->name); + } + +- pca_reset(pca_data); +- + clock = pca_clock(pca_data); + printk(KERN_INFO "%s: Clock frequency is %dkHz\n", + adap->name, freqs[clock]); + +- pca_set_con(pca_data, I2C_PCA_CON_ENSIO | clock); ++ /* Store settings as these will be needed when the PCA chip is reset */ ++ pca_data->bus_settings.clock_freq = clock; ++ ++ pca_reset(pca_data); + } else { + int clock; + int mode; +@@ -508,19 +523,15 @@ static int pca_init(struct i2c_adapter *adap) + thi = tlow * min_thi / min_tlow; + } + ++ /* Store settings as these will be needed when the PCA chip is reset */ ++ pca_data->bus_settings.mode = mode; ++ pca_data->bus_settings.tlow = tlow; ++ pca_data->bus_settings.thi = thi; ++ + pca_reset(pca_data); + + printk(KERN_INFO + "%s: Clock frequency is %dHz\n", adap->name, clock * 100); +- +- pca_outw(pca_data, I2C_PCA_INDPTR, I2C_PCA_IMODE); +- pca_outw(pca_data, I2C_PCA_IND, mode); +- pca_outw(pca_data, I2C_PCA_INDPTR, I2C_PCA_ISCLL); +- pca_outw(pca_data, I2C_PCA_IND, tlow); +- pca_outw(pca_data, I2C_PCA_INDPTR, I2C_PCA_ISCLH); +- pca_outw(pca_data, I2C_PCA_IND, thi); +- +- pca_set_con(pca_data, I2C_PCA_CON_ENSIO); + } + udelay(500); /* 500 us for oscillator to stabilise */ + +diff --git a/include/linux/i2c-algo-pca.h b/include/linux/i2c-algo-pca.h +index a3c3ecd59f08c..7a43afd273655 100644 +--- a/include/linux/i2c-algo-pca.h ++++ b/include/linux/i2c-algo-pca.h +@@ -52,6 +52,20 @@ + #define I2C_PCA_CON_SI 0x08 /* Serial Interrupt */ + #define I2C_PCA_CON_CR 0x07 /* Clock Rate (MASK) */ + ++/** ++ * struct pca_i2c_bus_settings - The configured PCA i2c bus settings ++ * @mode: Configured i2c bus mode ++ * @tlow: Configured SCL LOW period ++ * @thi: Configured SCL HIGH period ++ * @clock_freq: The configured clock frequency ++ */ ++struct pca_i2c_bus_settings { ++ int mode; ++ int tlow; ++ int thi; ++ int clock_freq; ++}; ++ + struct i2c_algo_pca_data { + void *data; /* private low level data */ + void (*write_byte) (void *data, int reg, int val); +@@ -63,6 +77,7 @@ struct i2c_algo_pca_data { + * For PCA9665, use the frequency you want here. */ + unsigned int i2c_clock; + unsigned int chip; ++ struct pca_i2c_bus_settings bus_settings; + }; + + int i2c_pca_add_bus(struct i2c_adapter *); +-- +2.25.1 + diff --git a/queue-4.9/mips-sni-fix-mips_l1_cache_shift.patch b/queue-4.9/mips-sni-fix-mips_l1_cache_shift.patch new file mode 100644 index 00000000000..00bd30a20c6 --- /dev/null +++ b/queue-4.9/mips-sni-fix-mips_l1_cache_shift.patch @@ -0,0 +1,35 @@ +From 0d1eed09675208c2b518a04290ee5432155c0a32 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 14 Sep 2020 18:05:00 +0200 +Subject: MIPS: SNI: Fix MIPS_L1_CACHE_SHIFT + +From: Thomas Bogendoerfer + +[ Upstream commit 564c836fd945a94b5dd46597d6b7adb464092650 ] + +Commit 930beb5ac09a ("MIPS: introduce MIPS_L1_CACHE_SHIFT_") forgot +to select the correct MIPS_L1_CACHE_SHIFT for SNI RM. This breaks non +coherent DMA because of a wrong allocation alignment. + +Fixes: 930beb5ac09a ("MIPS: introduce MIPS_L1_CACHE_SHIFT_") +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Sasha Levin +--- + arch/mips/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig +index f8a529c852795..24eb7fe7922e6 100644 +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -848,6 +848,7 @@ config SNI_RM + select I8253 + select I8259 + select ISA ++ select MIPS_L1_CACHE_SHIFT_6 + select SWAP_IO_SPACE if CPU_BIG_ENDIAN + select SYS_HAS_CPU_R4X00 + select SYS_HAS_CPU_R5000 +-- +2.25.1 + diff --git a/queue-4.9/mips-sni-fix-spurious-interrupts.patch b/queue-4.9/mips-sni-fix-spurious-interrupts.patch new file mode 100644 index 00000000000..6ea7c7277be --- /dev/null +++ b/queue-4.9/mips-sni-fix-spurious-interrupts.patch @@ -0,0 +1,58 @@ +From 39664fbc13850d4af642a220ed129187f420dc79 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 16 Sep 2020 15:54:37 +0200 +Subject: MIPS: SNI: Fix spurious interrupts + +From: Thomas Bogendoerfer + +[ Upstream commit b959b97860d0fee8c8f6a3e641d3c2ad76eab6be ] + +On A20R machines the interrupt pending bits in cause register need to be +updated by requesting the chipset to do it. This needs to be done to +find the interrupt cause and after interrupt service. In +commit 0b888c7f3a03 ("MIPS: SNI: Convert to new irq_chip functions") the +function to do after service update got lost, which caused spurious +interrupts. + +Fixes: 0b888c7f3a03 ("MIPS: SNI: Convert to new irq_chip functions") +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Sasha Levin +--- + arch/mips/sni/a20r.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/arch/mips/sni/a20r.c b/arch/mips/sni/a20r.c +index f9407e1704762..c6af7047eb0d2 100644 +--- a/arch/mips/sni/a20r.c ++++ b/arch/mips/sni/a20r.c +@@ -143,7 +143,10 @@ static struct platform_device sc26xx_pdev = { + }, + }; + +-static u32 a20r_ack_hwint(void) ++/* ++ * Trigger chipset to update CPU's CAUSE IP field ++ */ ++static u32 a20r_update_cause_ip(void) + { + u32 status = read_c0_status(); + +@@ -205,12 +208,14 @@ static void a20r_hwint(void) + int irq; + + clear_c0_status(IE_IRQ0); +- status = a20r_ack_hwint(); ++ status = a20r_update_cause_ip(); + cause = read_c0_cause(); + + irq = ffs(((cause & status) >> 8) & 0xf8); + if (likely(irq > 0)) + do_IRQ(SNI_A20R_IRQ_BASE + irq - 1); ++ ++ a20r_update_cause_ip(); + set_c0_status(IE_IRQ0); + } + +-- +2.25.1 + diff --git a/queue-4.9/nfsv4.1-handle-err_delay-error-reclaiming-locking-st.patch b/queue-4.9/nfsv4.1-handle-err_delay-error-reclaiming-locking-st.patch new file mode 100644 index 00000000000..668b7134952 --- /dev/null +++ b/queue-4.9/nfsv4.1-handle-err_delay-error-reclaiming-locking-st.patch @@ -0,0 +1,45 @@ +From 9716a8a93f15ae7f9650611c58560b6470323e67 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 20 Aug 2020 18:52:43 -0400 +Subject: NFSv4.1 handle ERR_DELAY error reclaiming locking state on delegation + recall + +From: Olga Kornievskaia + +[ Upstream commit 3d7a9520f0c3e6a68b6de8c5812fc8b6d7a52626 ] + +A client should be able to handle getting an ERR_DELAY error +while doing a LOCK call to reclaim state due to delegation being +recalled. This is a transient error that can happen due to server +moving its volumes and invalidating its file location cache and +upon reference to it during the LOCK call needing to do an +expensive lookup (leading to an ERR_DELAY error on a PUTFH). + +Signed-off-by: Olga Kornievskaia +Signed-off-by: Trond Myklebust +Signed-off-by: Sasha Levin +--- + fs/nfs/nfs4proc.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c +index 714457bb1440a..4e2f18c26535d 100644 +--- a/fs/nfs/nfs4proc.c ++++ b/fs/nfs/nfs4proc.c +@@ -6527,7 +6527,12 @@ int nfs4_lock_delegation_recall(struct file_lock *fl, struct nfs4_state *state, + err = nfs4_set_lock_state(state, fl); + if (err != 0) + return err; +- err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW); ++ do { ++ err = _nfs4_do_setlk(state, F_SETLK, fl, NFS_LOCK_NEW); ++ if (err != -NFS4ERR_DELAY) ++ break; ++ ssleep(1); ++ } while (err == -NFS4ERR_DELAY); + return nfs4_handle_delegation_recall_error(server, state, stateid, fl, err); + } + +-- +2.25.1 + diff --git a/queue-4.9/perf-test-free-formats-for-perf-pmu-parse-test.patch b/queue-4.9/perf-test-free-formats-for-perf-pmu-parse-test.patch new file mode 100644 index 00000000000..d6b2574dfe0 --- /dev/null +++ b/queue-4.9/perf-test-free-formats-for-perf-pmu-parse-test.patch @@ -0,0 +1,94 @@ +From 9dc2656dd048981f9f1fbb7bfe554d51e785caf4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 15 Sep 2020 12:18:19 +0900 +Subject: perf test: Free formats for perf pmu parse test + +From: Namhyung Kim + +[ Upstream commit d26383dcb2b4b8629fde05270b4e3633be9e3d4b ] + +The following leaks were detected by ASAN: + + Indirect leak of 360 byte(s) in 9 object(s) allocated from: + #0 0x7fecc305180e in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10780e) + #1 0x560578f6dce5 in perf_pmu__new_format util/pmu.c:1333 + #2 0x560578f752fc in perf_pmu_parse util/pmu.y:59 + #3 0x560578f6a8b7 in perf_pmu__format_parse util/pmu.c:73 + #4 0x560578e07045 in test__pmu tests/pmu.c:155 + #5 0x560578de109b in run_test tests/builtin-test.c:410 + #6 0x560578de109b in test_and_print tests/builtin-test.c:440 + #7 0x560578de401a in __cmd_test tests/builtin-test.c:661 + #8 0x560578de401a in cmd_test tests/builtin-test.c:807 + #9 0x560578e49354 in run_builtin /home/namhyung/project/linux/tools/perf/perf.c:312 + #10 0x560578ce71a8 in handle_internal_command /home/namhyung/project/linux/tools/perf/perf.c:364 + #11 0x560578ce71a8 in run_argv /home/namhyung/project/linux/tools/perf/perf.c:408 + #12 0x560578ce71a8 in main /home/namhyung/project/linux/tools/perf/perf.c:538 + #13 0x7fecc2b7acc9 in __libc_start_main ../csu/libc-start.c:308 + +Fixes: cff7f956ec4a1 ("perf tests: Move pmu tests into separate object") +Signed-off-by: Namhyung Kim +Acked-by: Jiri Olsa +Cc: Alexander Shishkin +Cc: Andi Kleen +Cc: Ian Rogers +Cc: Mark Rutland +Cc: Peter Zijlstra +Cc: Stephane Eranian +Link: http://lore.kernel.org/lkml/20200915031819.386559-12-namhyung@kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Sasha Levin +--- + tools/perf/tests/pmu.c | 1 + + tools/perf/util/pmu.c | 11 +++++++++++ + tools/perf/util/pmu.h | 1 + + 3 files changed, 13 insertions(+) + +diff --git a/tools/perf/tests/pmu.c b/tools/perf/tests/pmu.c +index 1802ad3f45b63..e2fab5229ec08 100644 +--- a/tools/perf/tests/pmu.c ++++ b/tools/perf/tests/pmu.c +@@ -169,6 +169,7 @@ int test__pmu(int subtest __maybe_unused) + ret = 0; + } while (0); + ++ perf_pmu__del_formats(&formats); + test_format_dir_put(format); + return ret; + } +diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c +index 39abbf8276464..5f1ba6f84f5f7 100644 +--- a/tools/perf/util/pmu.c ++++ b/tools/perf/util/pmu.c +@@ -1018,6 +1018,17 @@ void perf_pmu__set_format(unsigned long *bits, long from, long to) + set_bit(b, bits); + } + ++void perf_pmu__del_formats(struct list_head *formats) ++{ ++ struct perf_pmu_format *fmt, *tmp; ++ ++ list_for_each_entry_safe(fmt, tmp, formats, list) { ++ list_del(&fmt->list); ++ free(fmt->name); ++ free(fmt); ++ } ++} ++ + static int sub_non_neg(int a, int b) + { + if (b > a) +diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h +index 25712034c815b..fed6c3b56ce75 100644 +--- a/tools/perf/util/pmu.h ++++ b/tools/perf/util/pmu.h +@@ -71,6 +71,7 @@ int perf_pmu__new_format(struct list_head *list, char *name, + int config, unsigned long *bits); + void perf_pmu__set_format(unsigned long *bits, long from, long to); + int perf_pmu__format_parse(char *dir, struct list_head *head); ++void perf_pmu__del_formats(struct list_head *formats); + + struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu); + +-- +2.25.1 + diff --git a/queue-4.9/rapidio-replace-select-dmaengines-with-depends-on.patch b/queue-4.9/rapidio-replace-select-dmaengines-with-depends-on.patch new file mode 100644 index 00000000000..9f80a89a36d --- /dev/null +++ b/queue-4.9/rapidio-replace-select-dmaengines-with-depends-on.patch @@ -0,0 +1,37 @@ +From 3087ecc221b97d25bf383a255702d40c48ae2dc3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 29 Jul 2020 01:19:40 +0300 +Subject: rapidio: Replace 'select' DMAENGINES 'with depends on' + +From: Laurent Pinchart + +[ Upstream commit d2b86100245080cfdf1e95e9e07477474c1be2bd ] + +Enabling a whole subsystem from a single driver 'select' is frowned +upon and won't be accepted in new drivers, that need to use 'depends on' +instead. Existing selection of DMAENGINES will then cause circular +dependencies. Replace them with a dependency. + +Signed-off-by: Laurent Pinchart +Acked-by: Randy Dunlap +Signed-off-by: Sasha Levin +--- + drivers/rapidio/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/rapidio/Kconfig b/drivers/rapidio/Kconfig +index d6d2f20c45977..21df2816def76 100644 +--- a/drivers/rapidio/Kconfig ++++ b/drivers/rapidio/Kconfig +@@ -25,7 +25,7 @@ config RAPIDIO_ENABLE_RX_TX_PORTS + config RAPIDIO_DMA_ENGINE + bool "DMA Engine support for RapidIO" + depends on RAPIDIO +- select DMADEVICES ++ depends on DMADEVICES + select DMA_ENGINE + help + Say Y here if you want to use DMA Engine frameork for RapidIO data +-- +2.25.1 + diff --git a/queue-4.9/scsi-lpfc-fix-flogi-plogi-receive-race-condition-in-.patch b/queue-4.9/scsi-lpfc-fix-flogi-plogi-receive-race-condition-in-.patch new file mode 100644 index 00000000000..b946018390b --- /dev/null +++ b/queue-4.9/scsi-lpfc-fix-flogi-plogi-receive-race-condition-in-.patch @@ -0,0 +1,62 @@ +From 02d9f89fbed5f2b9bcff8af4db4257f0cfac2063 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 28 Aug 2020 10:53:30 -0700 +Subject: scsi: lpfc: Fix FLOGI/PLOGI receive race condition in pt2pt discovery + +From: James Smart + +[ Upstream commit 7b08e89f98cee9907895fabb64cf437bc505ce9a ] + +The driver is unable to successfully login with remote device. During pt2pt +login, the driver completes its FLOGI request with the remote device having +WWN precedence. The remote device issues its own (delayed) FLOGI after +accepting the driver's and, upon transmitting the FLOGI, immediately +recognizes it has already processed the driver's FLOGI thus it transitions +to sending a PLOGI before waiting for an ACC to its FLOGI. + +In the driver, the FLOGI is received and an ACC sent, followed by the PLOGI +being received and an ACC sent. The issue is that the PLOGI reception +occurs before the response from the adapter from the FLOGI ACC is +received. Processing of the PLOGI sets state flags to perform the REG_RPI +mailbox command and proceed with the rest of discovery on the port. The +same completion routine used by both FLOGI and PLOGI is generic in +nature. One of the things it does is clear flags, and those flags happen to +drive the rest of discovery. So what happened was the PLOGI processing set +the flags, the FLOGI ACC completion cleared them, thus when the PLOGI ACC +completes it doesn't see the flags and stops. + +Fix by modifying the generic completion routine to not clear the rest of +discovery flag (NLP_ACC_REGLOGIN) unless the completion is also associated +with performing a mailbox command as part of its handling. For things such +as FLOGI ACC, there isn't a subsequent action to perform with the adapter, +thus there is no mailbox cmd ptr. PLOGI ACC though will perform REG_RPI +upon completion, thus there is a mailbox cmd ptr. + +Link: https://lore.kernel.org/r/20200828175332.130300-3-james.smart@broadcom.com +Co-developed-by: Dick Kennedy +Signed-off-by: Dick Kennedy +Signed-off-by: James Smart +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/lpfc/lpfc_els.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c +index 09dbf3021bb0b..7d4a5bb916062 100644 +--- a/drivers/scsi/lpfc/lpfc_els.c ++++ b/drivers/scsi/lpfc/lpfc_els.c +@@ -3865,7 +3865,9 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, + out: + if (ndlp && NLP_CHK_NODE_ACT(ndlp) && shost) { + spin_lock_irq(shost->host_lock); +- ndlp->nlp_flag &= ~(NLP_ACC_REGLOGIN | NLP_RM_DFLT_RPI); ++ if (mbox) ++ ndlp->nlp_flag &= ~NLP_ACC_REGLOGIN; ++ ndlp->nlp_flag &= ~NLP_RM_DFLT_RPI; + spin_unlock_irq(shost->host_lock); + + /* If the node is not being used by another discovery thread, +-- +2.25.1 + diff --git a/queue-4.9/scsi-pm8001-fix-memleak-in-pm8001_exec_internal_task.patch b/queue-4.9/scsi-pm8001-fix-memleak-in-pm8001_exec_internal_task.patch new file mode 100644 index 00000000000..44c6309fbdd --- /dev/null +++ b/queue-4.9/scsi-pm8001-fix-memleak-in-pm8001_exec_internal_task.patch @@ -0,0 +1,37 @@ +From f71d5acaa579b31b9a5f05a1b2dc9185a3227fa6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 23 Aug 2020 17:14:53 +0800 +Subject: scsi: pm8001: Fix memleak in pm8001_exec_internal_task_abort + +From: Dinghao Liu + +[ Upstream commit ea403fde7552bd61bad6ea45e3feb99db77cb31e ] + +When pm8001_tag_alloc() fails, task should be freed just like it is done in +the subsequent error paths. + +Link: https://lore.kernel.org/r/20200823091453.4782-1-dinghao.liu@zju.edu.cn +Acked-by: Jack Wang +Signed-off-by: Dinghao Liu +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/pm8001/pm8001_sas.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c +index e64a13f0bce17..61a2da30f94b7 100644 +--- a/drivers/scsi/pm8001/pm8001_sas.c ++++ b/drivers/scsi/pm8001/pm8001_sas.c +@@ -795,7 +795,7 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha, + + res = pm8001_tag_alloc(pm8001_ha, &ccb_tag); + if (res) +- return res; ++ goto ex_err; + ccb = &pm8001_ha->ccb_info[ccb_tag]; + ccb->device = pm8001_dev; + ccb->ccb_tag = ccb_tag; +-- +2.25.1 + diff --git a/queue-4.9/series b/queue-4.9/series index 5882b85c036..675445cadc2 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -46,3 +46,17 @@ ib-rxe-remove-a-pointless-indirection-layer.patch rdma-rxe-fix-the-parent-sysfs-read-when-the-interfac.patch gcov-add-support-for-gcc-10.1.patch net-handle-the-return-value-of-pskb_carve_frag_list-correctly.patch +nfsv4.1-handle-err_delay-error-reclaiming-locking-st.patch +scsi-pm8001-fix-memleak-in-pm8001_exec_internal_task.patch +scsi-lpfc-fix-flogi-plogi-receive-race-condition-in-.patch +spi-spi-loopback-test-fix-out-of-bounds-read.patch +sunrpc-stop-printk-reading-past-end-of-string.patch +rapidio-replace-select-dmaengines-with-depends-on.patch +i2c-algo-pca-reapply-i2c-bus-settings-after-reset.patch +clk-rockchip-fix-initialization-of-mux_pll_src_4plls.patch +drivers-hv-vmbus-add-timeout-to-vmbus_wait_for_unloa.patch +mips-sni-fix-mips_l1_cache_shift.patch +perf-test-free-formats-for-perf-pmu-parse-test.patch +fbcon-fix-user-font-detection-test-at-fbcon_resize.patch +mips-sni-fix-spurious-interrupts.patch +drm-mediatek-add-exception-handing-in-mtk_drm_probe-.patch diff --git a/queue-4.9/spi-spi-loopback-test-fix-out-of-bounds-read.patch b/queue-4.9/spi-spi-loopback-test-fix-out-of-bounds-read.patch new file mode 100644 index 00000000000..f2af3b38781 --- /dev/null +++ b/queue-4.9/spi-spi-loopback-test-fix-out-of-bounds-read.patch @@ -0,0 +1,65 @@ +From bce1f783fd61c9e298defa7ac2a62479627b0523 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 2 Sep 2020 15:23:41 +0200 +Subject: spi: spi-loopback-test: Fix out-of-bounds read + +From: Vincent Whitchurch + +[ Upstream commit 837ba18dfcd4db21ad58107c65bfe89753aa56d7 ] + +The "tx/rx-transfer - crossing PAGE_SIZE" test always fails when +len=131071 and rx_offset >= 5: + + spi-loopback-test spi0.0: Running test tx/rx-transfer - crossing PAGE_SIZE + ... + with iteration values: len = 131071, tx_off = 0, rx_off = 3 + with iteration values: len = 131071, tx_off = 0, rx_off = 4 + with iteration values: len = 131071, tx_off = 0, rx_off = 5 + loopback strangeness - rx changed outside of allowed range at: ...a4321000 + spi_msg@ffffffd5a4157690 + frame_length: 131071 + actual_length: 131071 + spi_transfer@ffffffd5a41576f8 + len: 131071 + tx_buf: ffffffd5a4340ffc + +Note that rx_offset > 3 can only occur if the SPI controller driver sets +->dma_alignment to a higher value than 4, so most SPI controller drivers +are not affect. + +The allocated Rx buffer is of size SPI_TEST_MAX_SIZE_PLUS, which is 132 +KiB (assuming 4 KiB pages). This test uses an initial offset into the +rx_buf of PAGE_SIZE - 4, and a len of 131071, so the range expected to +be written in this transfer ends at (4096 - 4) + 5 + 131071 == 132 KiB, +which is also the end of the allocated buffer. But the code which +verifies the content of the buffer reads a byte beyond the allocated +buffer and spuriously fails because this out-of-bounds read doesn't +return the expected value. + +Fix this by using ITERATE_LEN instead of ITERATE_MAX_LEN to avoid +testing sizes which cause out-of-bounds reads. + +Signed-off-by: Vincent Whitchurch +Link: https://lore.kernel.org/r/20200902132341.7079-1-vincent.whitchurch@axis.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/spi/spi-loopback-test.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c +index 50e620f4e8fe2..7120083fe7610 100644 +--- a/drivers/spi/spi-loopback-test.c ++++ b/drivers/spi/spi-loopback-test.c +@@ -74,7 +74,7 @@ static struct spi_test spi_tests[] = { + { + .description = "tx/rx-transfer - crossing PAGE_SIZE", + .fill_option = FILL_COUNT_8, +- .iterate_len = { ITERATE_MAX_LEN }, ++ .iterate_len = { ITERATE_LEN }, + .iterate_tx_align = ITERATE_ALIGN, + .iterate_rx_align = ITERATE_ALIGN, + .transfers = { +-- +2.25.1 + diff --git a/queue-4.9/sunrpc-stop-printk-reading-past-end-of-string.patch b/queue-4.9/sunrpc-stop-printk-reading-past-end-of-string.patch new file mode 100644 index 00000000000..2dc09466c32 --- /dev/null +++ b/queue-4.9/sunrpc-stop-printk-reading-past-end-of-string.patch @@ -0,0 +1,39 @@ +From fb6c78e7ad22eef5b6083b7bd6bdb48fa795ad44 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 5 Sep 2020 10:03:26 -0400 +Subject: SUNRPC: stop printk reading past end of string + +From: J. Bruce Fields + +[ Upstream commit 8c6b6c793ed32b8f9770ebcdf1ba99af423c303b ] + +Since p points at raw xdr data, there's no guarantee that it's NULL +terminated, so we should give a length. And probably escape any special +characters too. + +Reported-by: Zhi Li +Signed-off-by: J. Bruce Fields +Signed-off-by: Trond Myklebust +Signed-off-by: Sasha Levin +--- + net/sunrpc/rpcb_clnt.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c +index eafc78e063f1d..185441d7a2814 100644 +--- a/net/sunrpc/rpcb_clnt.c ++++ b/net/sunrpc/rpcb_clnt.c +@@ -975,8 +975,8 @@ static int rpcb_dec_getaddr(struct rpc_rqst *req, struct xdr_stream *xdr, + p = xdr_inline_decode(xdr, len); + if (unlikely(p == NULL)) + goto out_fail; +- dprintk("RPC: %5u RPCB_%s reply: %s\n", req->rq_task->tk_pid, +- req->rq_task->tk_msg.rpc_proc->p_name, (char *)p); ++ dprintk("RPC: %5u RPCB_%s reply: %*pE\n", req->rq_task->tk_pid, ++ req->rq_task->tk_msg.rpc_proc->p_name, len, (char *)p); + + if (rpc_uaddr2sockaddr(req->rq_xprt->xprt_net, (char *)p, len, + sap, sizeof(address)) == 0) +-- +2.25.1 + -- 2.47.3