From: Sasha Levin Date: Mon, 5 Oct 2020 01:50:02 +0000 (-0400) Subject: Fixes for 4.19 X-Git-Tag: v4.19.150~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=66e73fae4159795856ad6fd500831375369b89e8;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/clk-samsung-exynos4-mark-chipid-clock-as-clk_ignore_.patch b/queue-4.19/clk-samsung-exynos4-mark-chipid-clock-as-clk_ignore_.patch new file mode 100644 index 00000000000..aa6e6d3352f --- /dev/null +++ b/queue-4.19/clk-samsung-exynos4-mark-chipid-clock-as-clk_ignore_.patch @@ -0,0 +1,52 @@ +From 1ce0b362ccba974c4ab5d54fef548773ff03c0d9 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 442309b569203..8086756e7f076 100644 +--- a/drivers/clk/samsung/clk-exynos4.c ++++ b/drivers/clk/samsung/clk-exynos4.c +@@ -1072,7 +1072,7 @@ static const struct samsung_gate_clock exynos4210_gate_clks[] __initconst = { + 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, +@@ -1113,7 +1113,7 @@ static const struct samsung_gate_clock exynos4x12_gate_clks[] __initconst = { + 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.19/gpio-sprd-clear-interrupt-when-setting-the-type-as-e.patch b/queue-4.19/gpio-sprd-clear-interrupt-when-setting-the-type-as-e.patch new file mode 100644 index 00000000000..df45c9a81f7 --- /dev/null +++ b/queue-4.19/gpio-sprd-clear-interrupt-when-setting-the-type-as-e.patch @@ -0,0 +1,64 @@ +From 51f54f660c7356abdf51c560c31e72f5ea13d990 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 31 Aug 2020 17:09:47 +0800 +Subject: gpio: sprd: Clear interrupt when setting the type as edge + +From: Taiping Lai + +[ Upstream commit 5fcface659aab7eac4bd65dd116d98b8f7bb88d5 ] + +The raw interrupt status of GPIO maybe set before the interrupt is enabled, +which would trigger the interrupt event once enabled it from user side. +This is the case for edge interrupts only. Adding a clear operation when +setting interrupt type can avoid that. + +There're a few considerations for the solution: +1) This issue is for edge interrupt only; The interrupts requested by users + are IRQ_TYPE_LEVEL_HIGH as default, so clearing interrupt when request + is useless. +2) The interrupt type can be set to edge when request and following up + with clearing it though, but the problem is still there once users set + the interrupt type to level trggier. +3) We can add a clear operation after each time of setting interrupt + enable bit, but it is redundant for level trigger interrupt. + +Therefore, the solution is this patch seems the best for now. + +Fixes: 9a3821c2bb47 ("gpio: Add GPIO driver for Spreadtrum SC9860 platform") +Signed-off-by: Taiping Lai +Signed-off-by: Chunyan Zhang +Reviewed-by: Baolin Wang +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + drivers/gpio/gpio-sprd.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c +index 55072d2b367fa..4d53347adcafa 100644 +--- a/drivers/gpio/gpio-sprd.c ++++ b/drivers/gpio/gpio-sprd.c +@@ -149,17 +149,20 @@ static int sprd_gpio_irq_set_type(struct irq_data *data, + sprd_gpio_update(chip, offset, SPRD_GPIO_IS, 0); + sprd_gpio_update(chip, offset, SPRD_GPIO_IBE, 0); + sprd_gpio_update(chip, offset, SPRD_GPIO_IEV, 1); ++ sprd_gpio_update(chip, offset, SPRD_GPIO_IC, 1); + irq_set_handler_locked(data, handle_edge_irq); + break; + case IRQ_TYPE_EDGE_FALLING: + sprd_gpio_update(chip, offset, SPRD_GPIO_IS, 0); + sprd_gpio_update(chip, offset, SPRD_GPIO_IBE, 0); + sprd_gpio_update(chip, offset, SPRD_GPIO_IEV, 0); ++ sprd_gpio_update(chip, offset, SPRD_GPIO_IC, 1); + irq_set_handler_locked(data, handle_edge_irq); + break; + case IRQ_TYPE_EDGE_BOTH: + sprd_gpio_update(chip, offset, SPRD_GPIO_IS, 0); + sprd_gpio_update(chip, offset, SPRD_GPIO_IBE, 1); ++ sprd_gpio_update(chip, offset, SPRD_GPIO_IC, 1); + irq_set_handler_locked(data, handle_edge_irq); + break; + case IRQ_TYPE_LEVEL_HIGH: +-- +2.25.1 + diff --git a/queue-4.19/i2c-cpm-fix-i2c_ram-structure.patch b/queue-4.19/i2c-cpm-fix-i2c_ram-structure.patch new file mode 100644 index 00000000000..38fc93cb9b9 --- /dev/null +++ b/queue-4.19/i2c-cpm-fix-i2c_ram-structure.patch @@ -0,0 +1,45 @@ +From ca1980694a844f36caa915abebbd8e5e4f431acb 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 8a8ca945561b0..7eba874a981d3 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.19/input-trackpoint-enable-synaptics-trackpoints.patch b/queue-4.19/input-trackpoint-enable-synaptics-trackpoints.patch new file mode 100644 index 00000000000..52b85f0025e --- /dev/null +++ b/queue-4.19/input-trackpoint-enable-synaptics-trackpoints.patch @@ -0,0 +1,38 @@ +From 31a1a08ff3930bfa8e16ff69ab335fe9f678ab20 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 28 Sep 2020 16:19:05 -0700 +Subject: Input: trackpoint - enable Synaptics trackpoints + +From: Vincent Huang + +[ Upstream commit 996d585b079ad494a30cac10e08585bcd5345125 ] + +Add Synaptics IDs in trackpoint_start_protocol() to mark them as valid. + +Signed-off-by: Vincent Huang +Fixes: 6c77545af100 ("Input: trackpoint - add new trackpoint variant IDs") +Reviewed-by: Harry Cutts +Tested-by: Harry Cutts +Link: https://lore.kernel.org/r/20200924053013.1056953-1-vincent.huang@tw.synaptics.com +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/mouse/trackpoint.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c +index 31c16b68aa311..e468657854094 100644 +--- a/drivers/input/mouse/trackpoint.c ++++ b/drivers/input/mouse/trackpoint.c +@@ -285,6 +285,8 @@ static int trackpoint_start_protocol(struct psmouse *psmouse, + case TP_VARIANT_ALPS: + case TP_VARIANT_ELAN: + case TP_VARIANT_NXP: ++ case TP_VARIANT_JYT_SYNAPTICS: ++ case TP_VARIANT_SYNAPTICS: + if (variant_id) + *variant_id = param[0]; + if (firmware_id) +-- +2.25.1 + diff --git a/queue-4.19/iommu-exynos-add-missing-put_device-call-in-exynos_i.patch b/queue-4.19/iommu-exynos-add-missing-put_device-call-in-exynos_i.patch new file mode 100644 index 00000000000..73bbb13c181 --- /dev/null +++ b/queue-4.19/iommu-exynos-add-missing-put_device-call-in-exynos_i.patch @@ -0,0 +1,51 @@ +From 065af14931d3166d98438fd063f4ad951e05bb5c 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 1bd0cd7168dfc..4bf6049dd2c79 100644 +--- a/drivers/iommu/exynos-iommu.c ++++ b/drivers/iommu/exynos-iommu.c +@@ -1302,13 +1302,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); + mutex_init(&owner->rpm_lock); +-- +2.25.1 + diff --git a/queue-4.19/nfs-fix-security-label-length-not-being-reset.patch b/queue-4.19/nfs-fix-security-label-length-not-being-reset.patch new file mode 100644 index 00000000000..b7116f551df --- /dev/null +++ b/queue-4.19/nfs-fix-security-label-length-not-being-reset.patch @@ -0,0 +1,50 @@ +From b22fe5de1f2f600087ff8c2c1d1f51466bb2d869 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 4ae726e70d873..733fd9e4f0a15 100644 +--- a/fs/nfs/dir.c ++++ b/fs/nfs/dir.c +@@ -553,6 +553,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.19/pinctrl-mvebu-fix-i2c-sda-definition-for-98dx3236.patch b/queue-4.19/pinctrl-mvebu-fix-i2c-sda-definition-for-98dx3236.patch new file mode 100644 index 00000000000..13efffea682 --- /dev/null +++ b/queue-4.19/pinctrl-mvebu-fix-i2c-sda-definition-for-98dx3236.patch @@ -0,0 +1,40 @@ +From 242930986f4b03275513ed10ea17beef19b7a365 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 8 Sep 2020 09:17:10 +1200 +Subject: pinctrl: mvebu: Fix i2c sda definition for 98DX3236 + +From: Chris Packham + +[ Upstream commit 63c3212e7a37d68c89a13bdaebce869f4e064e67 ] + +Per the datasheet the i2c functions use MPP_Sel=0x1. They are documented +as using MPP_Sel=0x4 as well but mixing 0x1 and 0x4 is clearly wrong. On +the board tested 0x4 resulted in a non-functioning i2c bus so stick with +0x1 which works. + +Fixes: d7ae8f8dee7f ("pinctrl: mvebu: pinctrl driver for 98DX3236 SoC") +Signed-off-by: Chris Packham +Reviewed-by: Andrew Lunn +Link: https://lore.kernel.org/r/20200907211712.9697-2-chris.packham@alliedtelesis.co.nz +Signed-off-by: Linus Walleij +Signed-off-by: Sasha Levin +--- + drivers/pinctrl/mvebu/pinctrl-armada-xp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c +index 43231fd065a18..1a9450ef932b5 100644 +--- a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c ++++ b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c +@@ -418,7 +418,7 @@ static struct mvebu_mpp_mode mv98dx3236_mpp_modes[] = { + MPP_VAR_FUNCTION(0x1, "i2c0", "sck", V_98DX3236_PLUS)), + MPP_MODE(15, + MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS), +- MPP_VAR_FUNCTION(0x4, "i2c0", "sda", V_98DX3236_PLUS)), ++ MPP_VAR_FUNCTION(0x1, "i2c0", "sda", V_98DX3236_PLUS)), + MPP_MODE(16, + MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS), + MPP_VAR_FUNCTION(0x4, "dev", "oe", V_98DX3236_PLUS)), +-- +2.25.1 + diff --git a/queue-4.19/random32-restore-__latent_entropy-attribute-on-net_r.patch b/queue-4.19/random32-restore-__latent_entropy-attribute-on-net_r.patch new file mode 100644 index 00000000000..52005d14c7c --- /dev/null +++ b/queue-4.19/random32-restore-__latent_entropy-attribute-on-net_r.patch @@ -0,0 +1,46 @@ +From 1679e1c4e88cad18a1795fcdb7ab77bbb6fdd231 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 2 Oct 2020 17:16:11 +0200 +Subject: random32: Restore __latent_entropy attribute on net_rand_state + +From: Thibaut Sautereau + +[ Upstream commit 09a6b0bc3be793ca8cba580b7992d73e9f68f15d ] + +Commit f227e3ec3b5c ("random32: update the net random state on interrupt +and activity") broke compilation and was temporarily fixed by Linus in +83bdc7275e62 ("random32: remove net_rand_state from the latent entropy +gcc plugin") by entirely moving net_rand_state out of the things handled +by the latent_entropy GCC plugin. + +From what I understand when reading the plugin code, using the +__latent_entropy attribute on a declaration was the wrong part and +simply keeping the __latent_entropy attribute on the variable definition +was the correct fix. + +Fixes: 83bdc7275e62 ("random32: remove net_rand_state from the latent entropy gcc plugin") +Acked-by: Willy Tarreau +Cc: Emese Revfy +Signed-off-by: Thibaut Sautereau +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + lib/random32.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/random32.c b/lib/random32.c +index 036de0c93e224..b6f3325e38e43 100644 +--- a/lib/random32.c ++++ b/lib/random32.c +@@ -48,7 +48,7 @@ static inline void prandom_state_selftest(void) + } + #endif + +-DEFINE_PER_CPU(struct rnd_state, net_rand_state); ++DEFINE_PER_CPU(struct rnd_state, net_rand_state) __latent_entropy; + + /** + * prandom_u32_state - seeded pseudo-random number generator. +-- +2.25.1 + diff --git a/queue-4.19/series b/queue-4.19/series index 448d0573370..94abe59e6b6 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -20,3 +20,11 @@ drivers-net-wan-hdlc-set-skb-protocol-before-transmi.patch mac80211-do-not-allow-bigger-vht-mpdus-than-the-hard.patch spi-fsl-espi-only-process-interrupts-for-expected-ev.patch nvme-fc-fail-new-connections-to-a-deleted-host-or-re.patch +gpio-sprd-clear-interrupt-when-setting-the-type-as-e.patch +pinctrl-mvebu-fix-i2c-sda-definition-for-98dx3236.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 +input-trackpoint-enable-synaptics-trackpoints.patch +random32-restore-__latent_entropy-attribute-on-net_r.patch