From: Sasha Levin Date: Mon, 5 Oct 2020 01:50:04 +0000 (-0400) Subject: Fixes for 4.4 X-Git-Tag: v4.19.150~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=200c2c0ea6b6ee2bf4a6025ab53b46b4f596b578;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.4 Signed-off-by: Sasha Levin --- diff --git a/queue-4.4/clk-samsung-exynos4-mark-chipid-clock-as-clk_ignore_.patch b/queue-4.4/clk-samsung-exynos4-mark-chipid-clock-as-clk_ignore_.patch new file mode 100644 index 00000000000..6430771f4dd --- /dev/null +++ b/queue-4.4/clk-samsung-exynos4-mark-chipid-clock-as-clk_ignore_.patch @@ -0,0 +1,52 @@ +From bd1763a22dbaeff6b9eb228411c021de56af6f57 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 22 Sep 2020 14:40:46 +0200 +Subject: clk: samsung: exynos4: mark 'chipid' clock as CLK_IGNORE_UNUSED + +From: Marek Szyprowski + +[ Upstream commit f3bb0f796f5ffe32f0fbdce5b1b12eb85511158f ] + +The ChipID IO region has it's own clock, which is being disabled while +scanning for unused clocks. It turned out that some CPU hotplug, CPU idle +or even SOC firmware code depends on the reads from that area. Fix the +mysterious hang caused by entering deep CPU idle state by ignoring the +'chipid' clock during unused clocks scan, as there are no direct clients +for it which will keep it enabled. + +Fixes: e062b571777f ("clk: exynos4: register clocks using common clock framework") +Signed-off-by: Marek Szyprowski +Link: https://lore.kernel.org/r/20200922124046.10496-1-m.szyprowski@samsung.com +Reviewed-by: Krzysztof Kozlowski +Acked-by: Sylwester Nawrocki +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/samsung/clk-exynos4.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c +index 6c8e45e007c84..8edbb20ccff5e 100644 +--- a/drivers/clk/samsung/clk-exynos4.c ++++ b/drivers/clk/samsung/clk-exynos4.c +@@ -1059,7 +1059,7 @@ static struct samsung_gate_clock exynos4210_gate_clks[] __initdata = { + GATE(CLK_PCIE, "pcie", "aclk133", GATE_IP_FSYS, 14, 0, 0), + GATE(CLK_SMMU_PCIE, "smmu_pcie", "aclk133", GATE_IP_FSYS, 18, 0, 0), + GATE(CLK_MODEMIF, "modemif", "aclk100", GATE_IP_PERIL, 28, 0, 0), +- GATE(CLK_CHIPID, "chipid", "aclk100", E4210_GATE_IP_PERIR, 0, 0, 0), ++ GATE(CLK_CHIPID, "chipid", "aclk100", E4210_GATE_IP_PERIR, 0, CLK_IGNORE_UNUSED, 0), + GATE(CLK_SYSREG, "sysreg", "aclk100", E4210_GATE_IP_PERIR, 0, + CLK_IGNORE_UNUSED, 0), + GATE(CLK_HDMI_CEC, "hdmi_cec", "aclk100", E4210_GATE_IP_PERIR, 11, 0, +@@ -1100,7 +1100,7 @@ static struct samsung_gate_clock exynos4x12_gate_clks[] __initdata = { + 0), + GATE(CLK_TSADC, "tsadc", "aclk133", E4X12_GATE_BUS_FSYS1, 16, 0, 0), + GATE(CLK_MIPI_HSI, "mipi_hsi", "aclk133", GATE_IP_FSYS, 10, 0, 0), +- GATE(CLK_CHIPID, "chipid", "aclk100", E4X12_GATE_IP_PERIR, 0, 0, 0), ++ GATE(CLK_CHIPID, "chipid", "aclk100", E4X12_GATE_IP_PERIR, 0, CLK_IGNORE_UNUSED, 0), + GATE(CLK_SYSREG, "sysreg", "aclk100", E4X12_GATE_IP_PERIR, 1, + CLK_IGNORE_UNUSED, 0), + GATE(CLK_HDMI_CEC, "hdmi_cec", "aclk100", E4X12_GATE_IP_PERIR, 11, 0, +-- +2.25.1 + diff --git a/queue-4.4/i2c-cpm-fix-i2c_ram-structure.patch b/queue-4.4/i2c-cpm-fix-i2c_ram-structure.patch new file mode 100644 index 00000000000..faf126e5d1f --- /dev/null +++ b/queue-4.4/i2c-cpm-fix-i2c_ram-structure.patch @@ -0,0 +1,45 @@ +From 4a145c46e408b2a7b7ec1d8ba4e9e1b761e0b3da Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 23 Sep 2020 16:08:40 +0200 +Subject: i2c: cpm: Fix i2c_ram structure + +From: Nicolas VINCENT + +[ Upstream commit a2bd970aa62f2f7f80fd0d212b1d4ccea5df4aed ] + +the i2c_ram structure is missing the sdmatmp field mentionned in +datasheet for MPC8272 at paragraph 36.5. With this field missing, the +hardware would write past the allocated memory done through +cpm_muram_alloc for the i2c_ram structure and land in memory allocated +for the buffers descriptors corrupting the cbd_bufaddr field. Since this +field is only set during setup(), the first i2c transaction would work +and the following would send data read from an arbitrary memory +location. + +Fixes: 61045dbe9d8d ("i2c: Add support for I2C bus on Freescale CPM1/CPM2 controllers") +Signed-off-by: Nicolas VINCENT +Acked-by: Jochen Friedrich +Acked-by: Christophe Leroy +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-cpm.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c +index b167ab25310a3..34a35e927fc6d 100644 +--- a/drivers/i2c/busses/i2c-cpm.c ++++ b/drivers/i2c/busses/i2c-cpm.c +@@ -74,6 +74,9 @@ struct i2c_ram { + char res1[4]; /* Reserved */ + ushort rpbase; /* Relocation pointer */ + char res2[2]; /* Reserved */ ++ /* The following elements are only for CPM2 */ ++ char res3[4]; /* Reserved */ ++ uint sdmatmp; /* Internal */ + }; + + #define I2COM_START 0x80 +-- +2.25.1 + diff --git a/queue-4.4/iommu-exynos-add-missing-put_device-call-in-exynos_i.patch b/queue-4.4/iommu-exynos-add-missing-put_device-call-in-exynos_i.patch new file mode 100644 index 00000000000..f85b13446f2 --- /dev/null +++ b/queue-4.4/iommu-exynos-add-missing-put_device-call-in-exynos_i.patch @@ -0,0 +1,51 @@ +From 15f9eda503b4e8181be72fc82b6160553dfa67e4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 18 Sep 2020 09:13:35 +0800 +Subject: iommu/exynos: add missing put_device() call in + exynos_iommu_of_xlate() + +From: Yu Kuai + +[ Upstream commit 1a26044954a6d1f4d375d5e62392446af663be7a ] + +if of_find_device_by_node() succeed, exynos_iommu_of_xlate() doesn't have +a corresponding put_device(). Thus add put_device() to fix the exception +handling for this function implementation. + +Fixes: aa759fd376fb ("iommu/exynos: Add callback for initializing devices from device tree") +Signed-off-by: Yu Kuai +Acked-by: Marek Szyprowski +Link: https://lore.kernel.org/r/20200918011335.909141-1-yukuai3@huawei.com +Signed-off-by: Joerg Roedel +Signed-off-by: Sasha Levin +--- + drivers/iommu/exynos-iommu.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c +index 29a31eb9ace3e..02df8d9dc842a 100644 +--- a/drivers/iommu/exynos-iommu.c ++++ b/drivers/iommu/exynos-iommu.c +@@ -1158,13 +1158,17 @@ static int exynos_iommu_of_xlate(struct device *dev, + return -ENODEV; + + data = platform_get_drvdata(sysmmu); +- if (!data) ++ if (!data) { ++ put_device(&sysmmu->dev); + return -ENODEV; ++ } + + if (!owner) { + owner = kzalloc(sizeof(*owner), GFP_KERNEL); +- if (!owner) ++ if (!owner) { ++ put_device(&sysmmu->dev); + return -ENOMEM; ++ } + + INIT_LIST_HEAD(&owner->controllers); + dev->archdata.iommu = owner; +-- +2.25.1 + diff --git a/queue-4.4/nfs-fix-security-label-length-not-being-reset.patch b/queue-4.4/nfs-fix-security-label-length-not-being-reset.patch new file mode 100644 index 00000000000..a4f811c1440 --- /dev/null +++ b/queue-4.4/nfs-fix-security-label-length-not-being-reset.patch @@ -0,0 +1,50 @@ +From 256bd0df073c79b6a927879419237cc5fc4b56fe Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 15 Sep 2020 16:42:52 -0500 +Subject: nfs: Fix security label length not being reset + +From: Jeffrey Mitchell + +[ Upstream commit d33030e2ee3508d65db5644551435310df86010e ] + +nfs_readdir_page_filler() iterates over entries in a directory, reusing +the same security label buffer, but does not reset the buffer's length. +This causes decode_attr_security_label() to return -ERANGE if an entry's +security label is longer than the previous one's. This error, in +nfs4_decode_dirent(), only gets passed up as -EAGAIN, which causes another +failed attempt to copy into the buffer. The second error is ignored and +the remaining entries do not show up in ls, specifically the getdents64() +syscall. + +Reproduce by creating multiple files in NFS and giving one of the later +files a longer security label. ls will not see that file nor any that are +added afterwards, though they will exist on the backend. + +In nfs_readdir_page_filler(), reset security label buffer length before +every reuse + +Signed-off-by: Jeffrey Mitchell +Fixes: b4487b935452 ("nfs: Fix getxattr kernel panic and memory overflow") +Signed-off-by: Trond Myklebust +Signed-off-by: Sasha Levin +--- + fs/nfs/dir.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c +index 21e5fcbcb2272..ba7e98d8ce098 100644 +--- a/fs/nfs/dir.c ++++ b/fs/nfs/dir.c +@@ -562,6 +562,9 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en + xdr_set_scratch_buffer(&stream, page_address(scratch), PAGE_SIZE); + + do { ++ if (entry->label) ++ entry->label->len = NFS4_MAXLABELLEN; ++ + status = xdr_decode(desc, entry, &stream); + if (status != 0) { + if (status == -EAGAIN) +-- +2.25.1 + diff --git a/queue-4.4/series b/queue-4.4/series index d78b1f84d13..b6e4fde7b92 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -5,3 +5,7 @@ net-dec-de2104x-increase-receive-ring-size-for-tulip.patch rndis_host-increase-sleep-time-in-the-query-response.patch drivers-net-wan-lapbether-make-skb-protocol-consiste.patch drivers-net-wan-hdlc-set-skb-protocol-before-transmi.patch +nfs-fix-security-label-length-not-being-reset.patch +clk-samsung-exynos4-mark-chipid-clock-as-clk_ignore_.patch +iommu-exynos-add-missing-put_device-call-in-exynos_i.patch +i2c-cpm-fix-i2c_ram-structure.patch