From: Sasha Levin Date: Sun, 24 Oct 2021 01:28:45 +0000 (-0400) Subject: Fixes for 4.19 X-Git-Tag: v4.4.290~66 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0972d50c734ed69998cb9a14402b29cdf1ff59ff;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/asoc-wm8960-fix-clock-configuration-on-slave-mode.patch b/queue-4.19/asoc-wm8960-fix-clock-configuration-on-slave-mode.patch new file mode 100644 index 00000000000..3ed1ba7ec11 --- /dev/null +++ b/queue-4.19/asoc-wm8960-fix-clock-configuration-on-slave-mode.patch @@ -0,0 +1,60 @@ +From 5ac72cae50025b6bb40d6594b4f66d37d4b43516 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 13 Oct 2021 13:17:04 +0800 +Subject: ASoC: wm8960: Fix clock configuration on slave mode + +From: Shengjiu Wang + +[ Upstream commit 6b9b546dc00797c74bef491668ce5431ff54e1e2 ] + +There is a noise issue for 8kHz sample rate on slave mode. +Compared with master mode, the difference is the DACDIV +setting, after correcting the DACDIV, the noise is gone. + +There is no noise issue for 48kHz sample rate, because +the default value of DACDIV is correct for 48kHz. + +So wm8960_configure_clocking() should be functional for +ADC and DAC function even if it is slave mode. + +In order to be compatible for old use case, just add +condition for checking that sysclk is zero with +slave mode. + +Fixes: 0e50b51aa22f ("ASoC: wm8960: Let wm8960 driver configure its bit clock and frame clock") +Signed-off-by: Shengjiu Wang +Acked-by: Charles Keepax +Link: https://lore.kernel.org/r/1634102224-3922-1-git-send-email-shengjiu.wang@nxp.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/wm8960.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c +index 88e869d16714..abd5c12764f0 100644 +--- a/sound/soc/codecs/wm8960.c ++++ b/sound/soc/codecs/wm8960.c +@@ -755,9 +755,16 @@ static int wm8960_configure_clocking(struct snd_soc_component *component) + int i, j, k; + int ret; + +- if (!(iface1 & (1<<6))) { +- dev_dbg(component->dev, +- "Codec is slave mode, no need to configure clock\n"); ++ /* ++ * For Slave mode clocking should still be configured, ++ * so this if statement should be removed, but some platform ++ * may not work if the sysclk is not configured, to avoid such ++ * compatible issue, just add '!wm8960->sysclk' condition in ++ * this if statement. ++ */ ++ if (!(iface1 & (1 << 6)) && !wm8960->sysclk) { ++ dev_warn(component->dev, ++ "slave mode, but proceeding with no clock configuration\n"); + return 0; + } + +-- +2.33.0 + diff --git a/queue-4.19/dma-debug-fix-sg-checks-in-debug_dma_map_sg.patch b/queue-4.19/dma-debug-fix-sg-checks-in-debug_dma_map_sg.patch new file mode 100644 index 00000000000..28e7b9aeb76 --- /dev/null +++ b/queue-4.19/dma-debug-fix-sg-checks-in-debug_dma_map_sg.patch @@ -0,0 +1,79 @@ +From 5540e034500bd5e9b506b53ec3f111d2f8354299 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 6 Oct 2021 22:19:43 +0200 +Subject: dma-debug: fix sg checks in debug_dma_map_sg() + +From: Gerald Schaefer + +[ Upstream commit 293d92cbbd2418ca2ba43fed07f1b92e884d1c77 ] + +The following warning occurred sporadically on s390: +DMA-API: nvme 0006:00:00.0: device driver maps memory from kernel text or rodata [addr=0000000048cc5e2f] [len=131072] +WARNING: CPU: 4 PID: 825 at kernel/dma/debug.c:1083 check_for_illegal_area+0xa8/0x138 + +It is a false-positive warning, due to broken logic in debug_dma_map_sg(). +check_for_illegal_area() checks for overlay of sg elements with kernel text +or rodata. It is called with sg_dma_len(s) instead of s->length as +parameter. After the call to ->map_sg(), sg_dma_len() will contain the +length of possibly combined sg elements in the DMA address space, and not +the individual sg element length, which would be s->length. + +The check will then use the physical start address of an sg element, and +add the DMA length for the overlap check, which could result in the false +warning, because the DMA length can be larger than the actual single sg +element length. + +In addition, the call to check_for_illegal_area() happens in the iteration +over mapped_ents, which will not include all individual sg elements if +any of them were combined in ->map_sg(). + +Fix this by using s->length instead of sg_dma_len(s). Also put the call to +check_for_illegal_area() in a separate loop, iterating over all the +individual sg elements ("nents" instead of "mapped_ents"). + +While at it, as suggested by Robin Murphy, also move check_for_stack() +inside the new loop, as it is similarly concerned with validating the +individual sg elements. + +Link: https://lore.kernel.org/lkml/20210705185252.4074653-1-gerald.schaefer@linux.ibm.com +Fixes: 884d05970bfb ("dma-debug: use sg_dma_len accessor") +Signed-off-by: Gerald Schaefer +Signed-off-by: Christoph Hellwig +Signed-off-by: Sasha Levin +--- + kernel/dma/debug.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c +index 3a2397444076..1c82b0d25498 100644 +--- a/kernel/dma/debug.c ++++ b/kernel/dma/debug.c +@@ -1422,6 +1422,12 @@ void debug_dma_map_sg(struct device *dev, struct scatterlist *sg, + if (unlikely(dma_debug_disabled())) + return; + ++ for_each_sg(sg, s, nents, i) { ++ check_for_stack(dev, sg_page(s), s->offset); ++ if (!PageHighMem(sg_page(s))) ++ check_for_illegal_area(dev, sg_virt(s), s->length); ++ } ++ + for_each_sg(sg, s, mapped_ents, i) { + entry = dma_entry_alloc(); + if (!entry) +@@ -1437,12 +1443,6 @@ void debug_dma_map_sg(struct device *dev, struct scatterlist *sg, + entry->sg_call_ents = nents; + entry->sg_mapped_ents = mapped_ents; + +- check_for_stack(dev, sg_page(s), s->offset); +- +- if (!PageHighMem(sg_page(s))) { +- check_for_illegal_area(dev, sg_virt(s), sg_dma_len(s)); +- } +- + check_sg_segment(dev, s); + + add_dma_entry(entry); +-- +2.33.0 + diff --git a/queue-4.19/lan78xx-select-crc32.patch b/queue-4.19/lan78xx-select-crc32.patch new file mode 100644 index 00000000000..c3968fac925 --- /dev/null +++ b/queue-4.19/lan78xx-select-crc32.patch @@ -0,0 +1,40 @@ +From e329182a34e2aed32ac2913ce09240be5a0f2e80 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 15 Oct 2021 15:07:54 +0200 +Subject: lan78xx: select CRC32 + +From: Vegard Nossum + +[ Upstream commit 46393d61a328d7c4e3264252dae891921126c674 ] + +Fix the following build/link error by adding a dependency on the CRC32 +routines: + + ld: drivers/net/usb/lan78xx.o: in function `lan78xx_set_multicast': + lan78xx.c:(.text+0x48cf): undefined reference to `crc32_le' + +The actual use of crc32_le() comes indirectly through ether_crc(). + +Fixes: 55d7de9de6c30 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver") +Signed-off-by: Vegard Nossum +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/usb/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig +index cc2fd1957765..23fa0e2a75ff 100644 +--- a/drivers/net/usb/Kconfig ++++ b/drivers/net/usb/Kconfig +@@ -116,6 +116,7 @@ config USB_LAN78XX + select PHYLIB + select MICROCHIP_PHY + select FIXED_PHY ++ select CRC32 + help + This option adds support for Microchip LAN78XX based USB 2 + & USB 3 10/100/1000 Ethernet adapters. +-- +2.33.0 + diff --git a/queue-4.19/net-hns3-add-limit-ets-dwrr-bandwidth-cannot-be-0.patch b/queue-4.19/net-hns3-add-limit-ets-dwrr-bandwidth-cannot-be-0.patch new file mode 100644 index 00000000000..a2012263661 --- /dev/null +++ b/queue-4.19/net-hns3-add-limit-ets-dwrr-bandwidth-cannot-be-0.patch @@ -0,0 +1,46 @@ +From 98d807fbe2b72ca5b580c75c7582ce57f5be3269 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 Oct 2021 22:16:30 +0800 +Subject: net: hns3: add limit ets dwrr bandwidth cannot be 0 + +From: Guangbin Huang + +[ Upstream commit 731797fdffa3d083db536e2fdd07ceb050bb40b1 ] + +If ets dwrr bandwidth of tc is set to 0, the hardware will switch to SP +mode. In this case, this tc may occupy all the tx bandwidth if it has +huge traffic, so it violates the purpose of the user setting. + +To fix this problem, limit the ets dwrr bandwidth must greater than 0. + +Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature") +Signed-off-by: Guangbin Huang +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c +index dd935cd1fb44..865d27aea7d7 100644 +--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c ++++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c +@@ -96,6 +96,15 @@ static int hclge_ets_validate(struct hclge_dev *hdev, struct ieee_ets *ets, + *changed = true; + break; + case IEEE_8021QAZ_TSA_ETS: ++ /* The hardware will switch to sp mode if bandwidth is ++ * 0, so limit ets bandwidth must be greater than 0. ++ */ ++ if (!ets->tc_tx_bw[i]) { ++ dev_err(&hdev->pdev->dev, ++ "tc%u ets bw cannot be 0\n", i); ++ return -EINVAL; ++ } ++ + if (hdev->tm_info.tc_info[i].tc_sch_mode != + HCLGE_SCH_MODE_DWRR) + *changed = true; +-- +2.33.0 + diff --git a/queue-4.19/net-hns3-disable-sriov-before-unload-hclge-layer.patch b/queue-4.19/net-hns3-disable-sriov-before-unload-hclge-layer.patch new file mode 100644 index 00000000000..140de355503 --- /dev/null +++ b/queue-4.19/net-hns3-disable-sriov-before-unload-hclge-layer.patch @@ -0,0 +1,90 @@ +From e33231b07868abe5c1bbcb22da5d1b6c28005efb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 Oct 2021 22:16:35 +0800 +Subject: net: hns3: disable sriov before unload hclge layer + +From: Peng Li + +[ Upstream commit 0dd8a25f355b4df2d41c08df1716340854c7d4c5 ] + +HNS3 driver includes hns3.ko, hnae3.ko and hclge.ko. +hns3.ko includes network stack and pci_driver, hclge.ko includes +HW device action, algo_ops and timer task, hnae3.ko includes some +register function. + +When SRIOV is enable and hclge.ko is removed, HW device is unloaded +but VF still exists, PF will not reply VF mbx messages, and cause +errors. + +This patch fix it by disable SRIOV before remove hclge.ko. + +Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") +Signed-off-by: Peng Li +Signed-off-by: Guangbin Huang +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/hisilicon/hns3/hnae3.c | 21 +++++++++++++++++++ + drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + + .../hisilicon/hns3/hns3pf/hclge_main.c | 1 + + 3 files changed, 23 insertions(+) + +diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.c b/drivers/net/ethernet/hisilicon/hns3/hnae3.c +index f9259e568fa0..b250d0fe9ac5 100644 +--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.c ++++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.c +@@ -10,6 +10,27 @@ static LIST_HEAD(hnae3_ae_algo_list); + static LIST_HEAD(hnae3_client_list); + static LIST_HEAD(hnae3_ae_dev_list); + ++void hnae3_unregister_ae_algo_prepare(struct hnae3_ae_algo *ae_algo) ++{ ++ const struct pci_device_id *pci_id; ++ struct hnae3_ae_dev *ae_dev; ++ ++ if (!ae_algo) ++ return; ++ ++ list_for_each_entry(ae_dev, &hnae3_ae_dev_list, node) { ++ if (!hnae3_get_bit(ae_dev->flag, HNAE3_DEV_INITED_B)) ++ continue; ++ ++ pci_id = pci_match_id(ae_algo->pdev_id_table, ae_dev->pdev); ++ if (!pci_id) ++ continue; ++ if (IS_ENABLED(CONFIG_PCI_IOV)) ++ pci_disable_sriov(ae_dev->pdev); ++ } ++} ++EXPORT_SYMBOL(hnae3_unregister_ae_algo_prepare); ++ + /* we are keeping things simple and using single lock for all the + * list. This is a non-critical code so other updations, if happen + * in parallel, can wait. +diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h +index 5e1a7ab06c63..866e9f293b4c 100644 +--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h ++++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h +@@ -516,6 +516,7 @@ struct hnae3_handle { + int hnae3_register_ae_dev(struct hnae3_ae_dev *ae_dev); + void hnae3_unregister_ae_dev(struct hnae3_ae_dev *ae_dev); + ++void hnae3_unregister_ae_algo_prepare(struct hnae3_ae_algo *ae_algo); + void hnae3_unregister_ae_algo(struct hnae3_ae_algo *ae_algo); + void hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo); + +diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +index 16ab000454f9..2c334b56fd42 100644 +--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ++++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +@@ -6387,6 +6387,7 @@ static int hclge_init(void) + + static void hclge_exit(void) + { ++ hnae3_unregister_ae_algo_prepare(&ae_algo); + hnae3_unregister_ae_algo(&ae_algo); + } + module_init(hclge_init); +-- +2.33.0 + diff --git a/queue-4.19/netfilter-ipvs-make-global-sysctl-readonly-in-non-in.patch b/queue-4.19/netfilter-ipvs-make-global-sysctl-readonly-in-non-in.patch new file mode 100644 index 00000000000..49ff153c0d3 --- /dev/null +++ b/queue-4.19/netfilter-ipvs-make-global-sysctl-readonly-in-non-in.patch @@ -0,0 +1,40 @@ +From 16328b9d8af430edf8e7cec18c92d4cb28628f25 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 12 Oct 2021 16:54:37 +0200 +Subject: netfilter: ipvs: make global sysctl readonly in non-init netns + +From: Antoine Tenart + +[ Upstream commit 174c376278949c44aad89c514a6b5db6cee8db59 ] + +Because the data pointer of net/ipv4/vs/debug_level is not updated per +netns, it must be marked as read-only in non-init netns. + +Fixes: c6d2d445d8de ("IPVS: netns, final patch enabling network name space.") +Signed-off-by: Antoine Tenart +Acked-by: Julian Anastasov +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Sasha Levin +--- + net/netfilter/ipvs/ip_vs_ctl.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c +index 6208fa09fe71..3bf8d7f3cdc3 100644 +--- a/net/netfilter/ipvs/ip_vs_ctl.c ++++ b/net/netfilter/ipvs/ip_vs_ctl.c +@@ -3955,6 +3955,11 @@ static int __net_init ip_vs_control_net_init_sysctl(struct netns_ipvs *ipvs) + tbl[idx++].data = &ipvs->sysctl_conn_reuse_mode; + tbl[idx++].data = &ipvs->sysctl_schedule_icmp; + tbl[idx++].data = &ipvs->sysctl_ignore_tunneled; ++#ifdef CONFIG_IP_VS_DEBUG ++ /* Global sysctls must be ro in non-init netns */ ++ if (!net_eq(net, &init_net)) ++ tbl[idx++].mode = 0444; ++#endif + + ipvs->sysctl_hdr = register_net_sysctl(net, "net/ipv4/vs", tbl); + if (ipvs->sysctl_hdr == NULL) { +-- +2.33.0 + diff --git a/queue-4.19/nios2-irqflags-rename-a-redefined-register-name.patch b/queue-4.19/nios2-irqflags-rename-a-redefined-register-name.patch new file mode 100644 index 00000000000..2dc0dd4c94e --- /dev/null +++ b/queue-4.19/nios2-irqflags-rename-a-redefined-register-name.patch @@ -0,0 +1,67 @@ +From e9d1738bb68380acfc25d9181b8de650d54a3381 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 4 Oct 2021 00:56:06 -0700 +Subject: NIOS2: irqflags: rename a redefined register name + +From: Randy Dunlap + +[ Upstream commit 4cce60f15c04d69eff6ffc539ab09137dbe15070 ] + +Both arch/nios2/ and drivers/mmc/host/tmio_mmc.c define a macro +with the name "CTL_STATUS". Change the one in arch/nios2/ to be +"CTL_FSTATUS" (flags status) to eliminate the build warning. + +In file included from ../drivers/mmc/host/tmio_mmc.c:22: +drivers/mmc/host/tmio_mmc.h:31: warning: "CTL_STATUS" redefined + 31 | #define CTL_STATUS 0x1c +arch/nios2/include/asm/registers.h:14: note: this is the location of the previous definition + 14 | #define CTL_STATUS 0 + +Fixes: b31ebd8055ea ("nios2: Nios2 registers") +Signed-off-by: Randy Dunlap +Cc: Dinh Nguyen +Signed-off-by: Dinh Nguyen +Signed-off-by: Sasha Levin +--- + arch/nios2/include/asm/irqflags.h | 4 ++-- + arch/nios2/include/asm/registers.h | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/arch/nios2/include/asm/irqflags.h b/arch/nios2/include/asm/irqflags.h +index 75ab92e639f8..0338fcb88203 100644 +--- a/arch/nios2/include/asm/irqflags.h ++++ b/arch/nios2/include/asm/irqflags.h +@@ -22,7 +22,7 @@ + + static inline unsigned long arch_local_save_flags(void) + { +- return RDCTL(CTL_STATUS); ++ return RDCTL(CTL_FSTATUS); + } + + /* +@@ -31,7 +31,7 @@ static inline unsigned long arch_local_save_flags(void) + */ + static inline void arch_local_irq_restore(unsigned long flags) + { +- WRCTL(CTL_STATUS, flags); ++ WRCTL(CTL_FSTATUS, flags); + } + + static inline void arch_local_irq_disable(void) +diff --git a/arch/nios2/include/asm/registers.h b/arch/nios2/include/asm/registers.h +index 615bce19b546..33824f2ad1ab 100644 +--- a/arch/nios2/include/asm/registers.h ++++ b/arch/nios2/include/asm/registers.h +@@ -24,7 +24,7 @@ + #endif + + /* control register numbers */ +-#define CTL_STATUS 0 ++#define CTL_FSTATUS 0 + #define CTL_ESTATUS 1 + #define CTL_BSTATUS 2 + #define CTL_IENABLE 3 +-- +2.33.0 + diff --git a/queue-4.19/series b/queue-4.19/series index 417424ea252..1f5858c520e 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -2,3 +2,10 @@ arm-dts-at91-sama5d2_som1_ek-disable-isc-node-by-def.patch xtensa-xtfpga-use-config_use_of-instead-of-config_of.patch xtensa-xtfpga-try-software-restart-before-simulating.patch nfsd-keep-existing-listeners-on-portlist-error.patch +dma-debug-fix-sg-checks-in-debug_dma_map_sg.patch +asoc-wm8960-fix-clock-configuration-on-slave-mode.patch +netfilter-ipvs-make-global-sysctl-readonly-in-non-in.patch +lan78xx-select-crc32.patch +nios2-irqflags-rename-a-redefined-register-name.patch +net-hns3-add-limit-ets-dwrr-bandwidth-cannot-be-0.patch +net-hns3-disable-sriov-before-unload-hclge-layer.patch