From: Greg Kroah-Hartman Date: Mon, 24 Jan 2022 13:58:57 +0000 (+0100) Subject: 5.15-stable patches X-Git-Tag: v4.4.300~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=947212d48861bac4bead66d655e6c1a3d54076e9;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: arm64-dts-qcom-msm8996-drop-not-documented-adreno-properties.patch bcmgenet-add-wol-irq-check.patch bitops-protect-find_first_-zero-_bit-properly.patch devlink-remove-misleading-internal_flags-from-health-reporter-dump.patch dmaengine-at_xdmac-don-t-start-transactions-at-tx_submit-level.patch dmaengine-at_xdmac-fix-at_xdmac_lld-struct-definition.patch dmaengine-at_xdmac-fix-concurrency-over-xfers_list.patch dmaengine-at_xdmac-fix-lld-view-setting.patch dmaengine-at_xdmac-print-debug-message-after-realeasing-the-lock.patch dmaengine-at_xdmac-start-transfer-for-cyclic-channels-in-issue_pending.patch gre-don-t-accidentally-set-rto_onlink-in-gre_fill_metadata_dst.patch hid-vivaldi-fix-handling-devices-not-using-numbered-reports.patch inet-frags-annotate-races-around-fqdir-dead-and-fqdir-high_thresh.patch iwlwifi-fix-bz-nmi-behaviour.patch libcxgb-don-t-accidentally-set-rto_onlink-in-cxgb_find_route.patch net-axienet-add-missing-memory-barriers.patch net-axienet-fix-for-tx-busy-handling.patch net-axienet-fix-number-of-tx-ring-slots-for-available-check.patch net-axienet-fix-tx-ring-slot-available-check.patch net-axienet-increase-default-tx-ring-size-to-128.patch net-axienet-limit-minimum-tx-ring-size.patch net-axienet-reset-core-on-initialization-prior-to-mdio-access.patch net-bonding-fix-bond_xmit_broadcast-return-value-error-bug.patch net-cpsw-avoid-alignment-faults-by-taking-net_ip_align-into-account.patch net-ethernet-mtk_eth_soc-fix-error-checking-in-mtk_mac_config.patch net-fix-sock_timestamping_bind_phc-to-release-device.patch net-ipa-fix-atomic-update-in-ipa_endpoint_replenish.patch net-mscc-ocelot-don-t-let-phylink-re-enable-tx-pause-on-the-npi-port.patch net-mscc-ocelot-fix-using-match-before-it-is-set.patch net-ocelot-fix-the-call-to-switchdev_bridge_port_offload.patch net-phy-micrel-use-kszphy_suspend-kszphy_resume-for-irq-aware-devices.patch net-sfp-fix-high-power-modules-without-diagnostic-monitoring.patch net-wwan-fix-mru-mismatch-issue-which-may-lead-to-data-connection-lost.patch net_sched-restore-mpu-xxx-handling.patch netns-add-schedule-point-in-ops_exit_list.patch perf-probe-fix-ppc64-perf-probe-add-events-failed-case.patch perf-script-fix-hex-dump-character-output.patch perf-tools-drop-requirement-for-libstdc-.so-for-libopencsd-check.patch rtc-pxa-fix-null-pointer-dereference.patch taskstats-cleanup-the-use-of-task-exit_code.patch um-gitignore-add-kernel-capflags.c.patch vdpa-mlx5-fix-wrong-configuration-of-virtio_version_1_0.patch vdpa-mlx5-restore-cur_num_vqs-in-case-of-failure-in-change_num_qps.patch virtio_ring-mark-ring-unused-on-error.patch xfrm-don-t-accidentally-set-rto_onlink-in-decode_session4.patch --- diff --git a/queue-5.15/arm64-dts-qcom-msm8996-drop-not-documented-adreno-properties.patch b/queue-5.15/arm64-dts-qcom-msm8996-drop-not-documented-adreno-properties.patch new file mode 100644 index 00000000000..4c83938fbbd --- /dev/null +++ b/queue-5.15/arm64-dts-qcom-msm8996-drop-not-documented-adreno-properties.patch @@ -0,0 +1,40 @@ +From c41910f257a22dc406c60d8826b4a3b5398003a3 Mon Sep 17 00:00:00 2001 +From: David Heidelberg +Date: Sat, 30 Oct 2021 12:04:12 +0200 +Subject: arm64: dts: qcom: msm8996: drop not documented adreno properties + +From: David Heidelberg + +commit c41910f257a22dc406c60d8826b4a3b5398003a3 upstream. + +These properties aren't documented nor implemented in the driver. +Drop them. + +Fixes warnings as: +$ make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/msm/gpu.yaml +... +arch/arm64/boot/dts/qcom/msm8996-mtp.dt.yaml: gpu@b00000: 'qcom,gpu-quirk-fault-detect-mask', 'qcom,gpu-quirk-two-pass-use-wfi' do not match any of the regexes: 'pinctrl-[0-9]+' + From schema: Documentation/devicetree/bindings/display/msm/gpu.yaml +... + +Fixes: 69cc3114ab0f ("arm64: dts: Add Adreno GPU definitions") +Signed-off-by: David Heidelberg +Signed-off-by: Bjorn Andersson +Link: https://lore.kernel.org/r/20211030100413.28370-1-david@ixit.cz +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/boot/dts/qcom/msm8996.dtsi | 3 --- + 1 file changed, 3 deletions(-) + +--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi ++++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi +@@ -965,9 +965,6 @@ + nvmem-cells = <&speedbin_efuse>; + nvmem-cell-names = "speed_bin"; + +- qcom,gpu-quirk-two-pass-use-wfi; +- qcom,gpu-quirk-fault-detect-mask; +- + operating-points-v2 = <&gpu_opp_table>; + + status = "disabled"; diff --git a/queue-5.15/bcmgenet-add-wol-irq-check.patch b/queue-5.15/bcmgenet-add-wol-irq-check.patch new file mode 100644 index 00000000000..015e3764ef6 --- /dev/null +++ b/queue-5.15/bcmgenet-add-wol-irq-check.patch @@ -0,0 +1,42 @@ +From 9deb48b53e7f4056c2eaa2dc2ee3338df619e4f6 Mon Sep 17 00:00:00 2001 +From: Sergey Shtylyov +Date: Thu, 13 Jan 2022 22:46:07 +0300 +Subject: bcmgenet: add WOL IRQ check + +From: Sergey Shtylyov + +commit 9deb48b53e7f4056c2eaa2dc2ee3338df619e4f6 upstream. + +The driver neglects to check the result of platform_get_irq_optional()'s +call and blithely passes the negative error codes to devm_request_irq() +(which takes *unsigned* IRQ #), causing it to fail with -EINVAL. +Stop calling devm_request_irq() with the invalid IRQ #s. + +Fixes: 8562056f267d ("net: bcmgenet: request Wake-on-LAN interrupt") +Signed-off-by: Sergey Shtylyov +Acked-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/broadcom/genet/bcmgenet.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c +@@ -3966,10 +3966,12 @@ static int bcmgenet_probe(struct platfor + + /* Request the WOL interrupt and advertise suspend if available */ + priv->wol_irq_disabled = true; +- err = devm_request_irq(&pdev->dev, priv->wol_irq, bcmgenet_wol_isr, 0, +- dev->name, priv); +- if (!err) +- device_set_wakeup_capable(&pdev->dev, 1); ++ if (priv->wol_irq > 0) { ++ err = devm_request_irq(&pdev->dev, priv->wol_irq, ++ bcmgenet_wol_isr, 0, dev->name, priv); ++ if (!err) ++ device_set_wakeup_capable(&pdev->dev, 1); ++ } + + /* Set the needed headroom to account for any possible + * features enabling/disabling at runtime diff --git a/queue-5.15/bitops-protect-find_first_-zero-_bit-properly.patch b/queue-5.15/bitops-protect-find_first_-zero-_bit-properly.patch new file mode 100644 index 00000000000..1a0fc03564d --- /dev/null +++ b/queue-5.15/bitops-protect-find_first_-zero-_bit-properly.patch @@ -0,0 +1,56 @@ +From b7ec62d7ee0f0b8af6ba190501dff7f9ee6545ca Mon Sep 17 00:00:00 2001 +From: Yury Norov +Date: Sat, 14 Aug 2021 14:16:57 -0700 +Subject: bitops: protect find_first_{,zero}_bit properly + +From: Yury Norov + +commit b7ec62d7ee0f0b8af6ba190501dff7f9ee6545ca upstream. + +find_first_bit() and find_first_zero_bit() are not protected with +ifdefs as other functions in find.h. It causes build errors on some +platforms if CONFIG_GENERIC_FIND_FIRST_BIT is enabled. + +Signed-off-by: Yury Norov +Fixes: 2cc7b6a44ac2 ("lib: add fast path for find_first_*_bit() and find_last_bit()") +Reported-by: kernel test robot +Tested-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman +--- + include/asm-generic/bitops/find.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/include/asm-generic/bitops/find.h b/include/asm-generic/bitops/find.h +index 0d132ee2a291..835f959a25f2 100644 +--- a/include/asm-generic/bitops/find.h ++++ b/include/asm-generic/bitops/find.h +@@ -97,6 +97,7 @@ unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, + + #ifdef CONFIG_GENERIC_FIND_FIRST_BIT + ++#ifndef find_first_bit + /** + * find_first_bit - find the first set bit in a memory region + * @addr: The address to start the search at +@@ -116,7 +117,9 @@ unsigned long find_first_bit(const unsigned long *addr, unsigned long size) + + return _find_first_bit(addr, size); + } ++#endif + ++#ifndef find_first_zero_bit + /** + * find_first_zero_bit - find the first cleared bit in a memory region + * @addr: The address to start the search at +@@ -136,6 +139,8 @@ unsigned long find_first_zero_bit(const unsigned long *addr, unsigned long size) + + return _find_first_zero_bit(addr, size); + } ++#endif ++ + #else /* CONFIG_GENERIC_FIND_FIRST_BIT */ + + #ifndef find_first_bit +-- +2.34.1 + diff --git a/queue-5.15/devlink-remove-misleading-internal_flags-from-health-reporter-dump.patch b/queue-5.15/devlink-remove-misleading-internal_flags-from-health-reporter-dump.patch new file mode 100644 index 00000000000..063bf76b32f --- /dev/null +++ b/queue-5.15/devlink-remove-misleading-internal_flags-from-health-reporter-dump.patch @@ -0,0 +1,31 @@ +From e9538f8270db24d272659e15841854c7ea11119e Mon Sep 17 00:00:00 2001 +From: Leon Romanovsky +Date: Sun, 28 Nov 2021 14:14:46 +0200 +Subject: devlink: Remove misleading internal_flags from health reporter dump + +From: Leon Romanovsky + +commit e9538f8270db24d272659e15841854c7ea11119e upstream. + +DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET command doesn't have .doit callback +and has no use in internal_flags at all. Remove this misleading assignment. + +Fixes: e44ef4e4516c ("devlink: Hang reporter's dump method on a dumpit cb") +Signed-off-by: Leon Romanovsky +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/core/devlink.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/net/core/devlink.c ++++ b/net/core/devlink.c +@@ -8795,8 +8795,6 @@ static const struct genl_small_ops devli + GENL_DONT_VALIDATE_DUMP_STRICT, + .dumpit = devlink_nl_cmd_health_reporter_dump_get_dumpit, + .flags = GENL_ADMIN_PERM, +- .internal_flags = DEVLINK_NL_FLAG_NEED_DEVLINK_OR_PORT | +- DEVLINK_NL_FLAG_NO_LOCK, + }, + { + .cmd = DEVLINK_CMD_HEALTH_REPORTER_DUMP_CLEAR, diff --git a/queue-5.15/dmaengine-at_xdmac-don-t-start-transactions-at-tx_submit-level.patch b/queue-5.15/dmaengine-at_xdmac-don-t-start-transactions-at-tx_submit-level.patch new file mode 100644 index 00000000000..009a975c5c0 --- /dev/null +++ b/queue-5.15/dmaengine-at_xdmac-don-t-start-transactions-at-tx_submit-level.patch @@ -0,0 +1,53 @@ +From bccfb96b59179d4f96cbbd1ddff8fac6d335eae4 Mon Sep 17 00:00:00 2001 +From: Tudor Ambarus +Date: Wed, 15 Dec 2021 13:01:04 +0200 +Subject: dmaengine: at_xdmac: Don't start transactions at tx_submit level + +From: Tudor Ambarus + +commit bccfb96b59179d4f96cbbd1ddff8fac6d335eae4 upstream. + +tx_submit is supposed to push the current transaction descriptor to a +pending queue, waiting for issue_pending() to be called. issue_pending() +must start the transfer, not tx_submit(), thus remove +at_xdmac_start_xfer() from at_xdmac_tx_submit(). Clients of at_xdmac that +assume that tx_submit() starts the transfer must be updated and call +dma_async_issue_pending() if they miss to call it (one example is +atmel_serial). + +As the at_xdmac_start_xfer() is now called only from +at_xdmac_advance_work() when !at_xdmac_chan_is_enabled(), the +at_xdmac_chan_is_enabled() check is no longer needed in +at_xdmac_start_xfer(), thus remove it. + +Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") +Signed-off-by: Tudor Ambarus +Link: https://lore.kernel.org/r/20211215110115.191749-2-tudor.ambarus@microchip.com +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman +--- + drivers/dma/at_xdmac.c | 6 ------ + 1 file changed, 6 deletions(-) + +--- a/drivers/dma/at_xdmac.c ++++ b/drivers/dma/at_xdmac.c +@@ -385,9 +385,6 @@ static void at_xdmac_start_xfer(struct a + + dev_vdbg(chan2dev(&atchan->chan), "%s: desc 0x%p\n", __func__, first); + +- if (at_xdmac_chan_is_enabled(atchan)) +- return; +- + /* Set transfer as active to not try to start it again. */ + first->active_xfer = true; + +@@ -479,9 +476,6 @@ static dma_cookie_t at_xdmac_tx_submit(s + dev_vdbg(chan2dev(tx->chan), "%s: atchan 0x%p, add desc 0x%p to xfers_list\n", + __func__, atchan, desc); + list_add_tail(&desc->xfer_node, &atchan->xfers_list); +- if (list_is_singular(&atchan->xfers_list)) +- at_xdmac_start_xfer(atchan, desc); +- + spin_unlock_irqrestore(&atchan->lock, irqflags); + return cookie; + } diff --git a/queue-5.15/dmaengine-at_xdmac-fix-at_xdmac_lld-struct-definition.patch b/queue-5.15/dmaengine-at_xdmac-fix-at_xdmac_lld-struct-definition.patch new file mode 100644 index 00000000000..b631bb822dc --- /dev/null +++ b/queue-5.15/dmaengine-at_xdmac-fix-at_xdmac_lld-struct-definition.patch @@ -0,0 +1,50 @@ +From 912f7c6f7fac273f40e621447cf17d14b50d6e5b Mon Sep 17 00:00:00 2001 +From: Tudor Ambarus +Date: Wed, 15 Dec 2021 13:01:13 +0200 +Subject: dmaengine: at_xdmac: Fix at_xdmac_lld struct definition + +From: Tudor Ambarus + +commit 912f7c6f7fac273f40e621447cf17d14b50d6e5b upstream. + +The hardware channel next descriptor view structure contains just +fields of 32 bits, while dma_addr_t can be of type u64 or u32 +depending on CONFIG_ARCH_DMA_ADDR_T_64BIT. Force u32 to comply with +what the hardware expects. + +Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") +Signed-off-by: Tudor Ambarus +Link: https://lore.kernel.org/r/20211215110115.191749-11-tudor.ambarus@microchip.com +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman +--- + drivers/dma/at_xdmac.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +--- a/drivers/dma/at_xdmac.c ++++ b/drivers/dma/at_xdmac.c +@@ -253,15 +253,15 @@ struct at_xdmac { + + /* Linked List Descriptor */ + struct at_xdmac_lld { +- dma_addr_t mbr_nda; /* Next Descriptor Member */ +- u32 mbr_ubc; /* Microblock Control Member */ +- dma_addr_t mbr_sa; /* Source Address Member */ +- dma_addr_t mbr_da; /* Destination Address Member */ +- u32 mbr_cfg; /* Configuration Register */ +- u32 mbr_bc; /* Block Control Register */ +- u32 mbr_ds; /* Data Stride Register */ +- u32 mbr_sus; /* Source Microblock Stride Register */ +- u32 mbr_dus; /* Destination Microblock Stride Register */ ++ u32 mbr_nda; /* Next Descriptor Member */ ++ u32 mbr_ubc; /* Microblock Control Member */ ++ u32 mbr_sa; /* Source Address Member */ ++ u32 mbr_da; /* Destination Address Member */ ++ u32 mbr_cfg; /* Configuration Register */ ++ u32 mbr_bc; /* Block Control Register */ ++ u32 mbr_ds; /* Data Stride Register */ ++ u32 mbr_sus; /* Source Microblock Stride Register */ ++ u32 mbr_dus; /* Destination Microblock Stride Register */ + }; + + /* 64-bit alignment needed to update CNDA and CUBC registers in an atomic way. */ diff --git a/queue-5.15/dmaengine-at_xdmac-fix-concurrency-over-xfers_list.patch b/queue-5.15/dmaengine-at_xdmac-fix-concurrency-over-xfers_list.patch new file mode 100644 index 00000000000..e44a80b4920 --- /dev/null +++ b/queue-5.15/dmaengine-at_xdmac-fix-concurrency-over-xfers_list.patch @@ -0,0 +1,50 @@ +From 18deddea9184b62941395889ff7659529c877326 Mon Sep 17 00:00:00 2001 +From: Tudor Ambarus +Date: Wed, 15 Dec 2021 13:01:10 +0200 +Subject: dmaengine: at_xdmac: Fix concurrency over xfers_list + +From: Tudor Ambarus + +commit 18deddea9184b62941395889ff7659529c877326 upstream. + +Since tx_submit can be called from a hard IRQ, xfers_list must be +protected with a lock to avoid concurency on the list's elements. +Since at_xdmac_handle_cyclic() is called from a tasklet, spin_lock_irq +is enough to protect from a hard IRQ. + +Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") +Signed-off-by: Tudor Ambarus +Link: https://lore.kernel.org/r/20211215110115.191749-8-tudor.ambarus@microchip.com +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman +--- + drivers/dma/at_xdmac.c | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +--- a/drivers/dma/at_xdmac.c ++++ b/drivers/dma/at_xdmac.c +@@ -1619,14 +1619,17 @@ static void at_xdmac_handle_cyclic(struc + struct at_xdmac_desc *desc; + struct dma_async_tx_descriptor *txd; + +- if (!list_empty(&atchan->xfers_list)) { +- desc = list_first_entry(&atchan->xfers_list, +- struct at_xdmac_desc, xfer_node); +- txd = &desc->tx_dma_desc; +- +- if (txd->flags & DMA_PREP_INTERRUPT) +- dmaengine_desc_get_callback_invoke(txd, NULL); ++ spin_lock_irq(&atchan->lock); ++ if (list_empty(&atchan->xfers_list)) { ++ spin_unlock_irq(&atchan->lock); ++ return; + } ++ desc = list_first_entry(&atchan->xfers_list, struct at_xdmac_desc, ++ xfer_node); ++ spin_unlock_irq(&atchan->lock); ++ txd = &desc->tx_dma_desc; ++ if (txd->flags & DMA_PREP_INTERRUPT) ++ dmaengine_desc_get_callback_invoke(txd, NULL); + } + + static void at_xdmac_handle_error(struct at_xdmac_chan *atchan) diff --git a/queue-5.15/dmaengine-at_xdmac-fix-lld-view-setting.patch b/queue-5.15/dmaengine-at_xdmac-fix-lld-view-setting.patch new file mode 100644 index 00000000000..935dec9b117 --- /dev/null +++ b/queue-5.15/dmaengine-at_xdmac-fix-lld-view-setting.patch @@ -0,0 +1,41 @@ +From 1385eb4d14d447cc5d744bc2ac34f43be66c9963 Mon Sep 17 00:00:00 2001 +From: Tudor Ambarus +Date: Wed, 15 Dec 2021 13:01:12 +0200 +Subject: dmaengine: at_xdmac: Fix lld view setting + +From: Tudor Ambarus + +commit 1385eb4d14d447cc5d744bc2ac34f43be66c9963 upstream. + +AT_XDMAC_CNDC_NDVIEW_NDV3 was set even for AT_XDMAC_MBR_UBC_NDV2, +because of the wrong bit handling. Fix it. + +Fixes: ee0fe35c8dcd ("dmaengine: xdmac: Handle descriptor's view 3 registers") +Signed-off-by: Tudor Ambarus +Link: https://lore.kernel.org/r/20211215110115.191749-10-tudor.ambarus@microchip.com +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman +--- + drivers/dma/at_xdmac.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/dma/at_xdmac.c ++++ b/drivers/dma/at_xdmac.c +@@ -99,6 +99,7 @@ + #define AT_XDMAC_CNDC_NDE (0x1 << 0) /* Channel x Next Descriptor Enable */ + #define AT_XDMAC_CNDC_NDSUP (0x1 << 1) /* Channel x Next Descriptor Source Update */ + #define AT_XDMAC_CNDC_NDDUP (0x1 << 2) /* Channel x Next Descriptor Destination Update */ ++#define AT_XDMAC_CNDC_NDVIEW_MASK GENMASK(28, 27) + #define AT_XDMAC_CNDC_NDVIEW_NDV0 (0x0 << 3) /* Channel x Next Descriptor View 0 */ + #define AT_XDMAC_CNDC_NDVIEW_NDV1 (0x1 << 3) /* Channel x Next Descriptor View 1 */ + #define AT_XDMAC_CNDC_NDVIEW_NDV2 (0x2 << 3) /* Channel x Next Descriptor View 2 */ +@@ -402,7 +403,8 @@ static void at_xdmac_start_xfer(struct a + */ + if (at_xdmac_chan_is_cyclic(atchan)) + reg = AT_XDMAC_CNDC_NDVIEW_NDV1; +- else if (first->lld.mbr_ubc & AT_XDMAC_MBR_UBC_NDV3) ++ else if ((first->lld.mbr_ubc & ++ AT_XDMAC_CNDC_NDVIEW_MASK) == AT_XDMAC_MBR_UBC_NDV3) + reg = AT_XDMAC_CNDC_NDVIEW_NDV3; + else + reg = AT_XDMAC_CNDC_NDVIEW_NDV2; diff --git a/queue-5.15/dmaengine-at_xdmac-print-debug-message-after-realeasing-the-lock.patch b/queue-5.15/dmaengine-at_xdmac-print-debug-message-after-realeasing-the-lock.patch new file mode 100644 index 00000000000..38ddb8b9afd --- /dev/null +++ b/queue-5.15/dmaengine-at_xdmac-print-debug-message-after-realeasing-the-lock.patch @@ -0,0 +1,38 @@ +From 5edc24ac876a928f36f407a0fcdb33b94a3a210f Mon Sep 17 00:00:00 2001 +From: Tudor Ambarus +Date: Wed, 15 Dec 2021 13:01:06 +0200 +Subject: dmaengine: at_xdmac: Print debug message after realeasing the lock + +From: Tudor Ambarus + +commit 5edc24ac876a928f36f407a0fcdb33b94a3a210f upstream. + +It is desirable to do the prints without the lock held if possible, so +move the print after the lock is released. + +Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") +Signed-off-by: Tudor Ambarus +Link: https://lore.kernel.org/r/20211215110115.191749-4-tudor.ambarus@microchip.com +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman +--- + drivers/dma/at_xdmac.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/dma/at_xdmac.c ++++ b/drivers/dma/at_xdmac.c +@@ -473,10 +473,12 @@ static dma_cookie_t at_xdmac_tx_submit(s + spin_lock_irqsave(&atchan->lock, irqflags); + cookie = dma_cookie_assign(tx); + +- dev_vdbg(chan2dev(tx->chan), "%s: atchan 0x%p, add desc 0x%p to xfers_list\n", +- __func__, atchan, desc); + list_add_tail(&desc->xfer_node, &atchan->xfers_list); + spin_unlock_irqrestore(&atchan->lock, irqflags); ++ ++ dev_vdbg(chan2dev(tx->chan), "%s: atchan 0x%p, add desc 0x%p to xfers_list\n", ++ __func__, atchan, desc); ++ + return cookie; + } + diff --git a/queue-5.15/dmaengine-at_xdmac-start-transfer-for-cyclic-channels-in-issue_pending.patch b/queue-5.15/dmaengine-at_xdmac-start-transfer-for-cyclic-channels-in-issue_pending.patch new file mode 100644 index 00000000000..0d5903a07d7 --- /dev/null +++ b/queue-5.15/dmaengine-at_xdmac-start-transfer-for-cyclic-channels-in-issue_pending.patch @@ -0,0 +1,40 @@ +From e6af9b05bec63cd4d1de2a33968cd0be2a91282a Mon Sep 17 00:00:00 2001 +From: Tudor Ambarus +Date: Wed, 15 Dec 2021 13:01:05 +0200 +Subject: dmaengine: at_xdmac: Start transfer for cyclic channels in issue_pending + +From: Tudor Ambarus + +commit e6af9b05bec63cd4d1de2a33968cd0be2a91282a upstream. + +Cyclic channels must too call issue_pending in order to start a transfer. +Start the transfer in issue_pending regardless of the type of channel. +This wrongly worked before, because in the past the transfer was started +at tx_submit level when only a desc in the transfer list. + +Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") +Signed-off-by: Tudor Ambarus +Link: https://lore.kernel.org/r/20211215110115.191749-3-tudor.ambarus@microchip.com +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman +--- + drivers/dma/at_xdmac.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +--- a/drivers/dma/at_xdmac.c ++++ b/drivers/dma/at_xdmac.c +@@ -1778,11 +1778,9 @@ static void at_xdmac_issue_pending(struc + + dev_dbg(chan2dev(&atchan->chan), "%s\n", __func__); + +- if (!at_xdmac_chan_is_cyclic(atchan)) { +- spin_lock_irqsave(&atchan->lock, flags); +- at_xdmac_advance_work(atchan); +- spin_unlock_irqrestore(&atchan->lock, flags); +- } ++ spin_lock_irqsave(&atchan->lock, flags); ++ at_xdmac_advance_work(atchan); ++ spin_unlock_irqrestore(&atchan->lock, flags); + + return; + } diff --git a/queue-5.15/gre-don-t-accidentally-set-rto_onlink-in-gre_fill_metadata_dst.patch b/queue-5.15/gre-don-t-accidentally-set-rto_onlink-in-gre_fill_metadata_dst.patch new file mode 100644 index 00000000000..980f8efde89 --- /dev/null +++ b/queue-5.15/gre-don-t-accidentally-set-rto_onlink-in-gre_fill_metadata_dst.patch @@ -0,0 +1,38 @@ +From f7716b318568b22fbf0e3be99279a979e217cf71 Mon Sep 17 00:00:00 2001 +From: Guillaume Nault +Date: Mon, 10 Jan 2022 14:43:09 +0100 +Subject: gre: Don't accidentally set RTO_ONLINK in gre_fill_metadata_dst() + +From: Guillaume Nault + +commit f7716b318568b22fbf0e3be99279a979e217cf71 upstream. + +Mask the ECN bits before initialising ->flowi4_tos. The tunnel key may +have the last ECN bit set, which will interfere with the route lookup +process as ip_route_output_key_hash() interpretes this bit specially +(to restrict the route scope). + +Found by code inspection, compile tested only. + +Fixes: 962924fa2b7a ("ip_gre: Refactor collect metatdata mode tunnel xmit to ip_md_tunnel_xmit") +Signed-off-by: Guillaume Nault +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/ip_gre.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/net/ipv4/ip_gre.c ++++ b/net/ipv4/ip_gre.c +@@ -604,8 +604,9 @@ static int gre_fill_metadata_dst(struct + + key = &info->key; + ip_tunnel_init_flow(&fl4, IPPROTO_GRE, key->u.ipv4.dst, key->u.ipv4.src, +- tunnel_id_to_key32(key->tun_id), key->tos, 0, +- skb->mark, skb_get_hash(skb)); ++ tunnel_id_to_key32(key->tun_id), ++ key->tos & ~INET_ECN_MASK, 0, skb->mark, ++ skb_get_hash(skb)); + rt = ip_route_output_key(dev_net(dev), &fl4); + if (IS_ERR(rt)) + return PTR_ERR(rt); diff --git a/queue-5.15/hid-vivaldi-fix-handling-devices-not-using-numbered-reports.patch b/queue-5.15/hid-vivaldi-fix-handling-devices-not-using-numbered-reports.patch new file mode 100644 index 00000000000..1e42a3d7cfb --- /dev/null +++ b/queue-5.15/hid-vivaldi-fix-handling-devices-not-using-numbered-reports.patch @@ -0,0 +1,90 @@ +From 3fe6acd4dc922237b30e55473c9349c6ce0690f3 Mon Sep 17 00:00:00 2001 +From: Dmitry Torokhov +Date: Fri, 7 Jan 2022 12:09:36 -0800 +Subject: HID: vivaldi: fix handling devices not using numbered reports + +From: Dmitry Torokhov + +commit 3fe6acd4dc922237b30e55473c9349c6ce0690f3 upstream. + +Unfortunately details of USB HID transport bled into HID core and +handling of numbered/unnumbered reports is quite a mess, with +hid_report_len() calculating the length according to USB rules, +and hid_hw_raw_request() adding report ID to the buffer for both +numbered and unnumbered reports. + +Untangling it all requres a lot of changes in HID, so for now let's +handle this in the driver. + +[jkosina@suse.cz: microoptimize field->report->id to report->id] +Fixes: 14c9c014babe ("HID: add vivaldi HID driver") +Signed-off-by: Dmitry Torokhov +Tested-by: Stephen Boyd # CoachZ +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hid/hid-vivaldi.c | 34 ++++++++++++++++++++++++++++------ + 1 file changed, 28 insertions(+), 6 deletions(-) + +--- a/drivers/hid/hid-vivaldi.c ++++ b/drivers/hid/hid-vivaldi.c +@@ -74,10 +74,11 @@ static void vivaldi_feature_mapping(stru + struct hid_usage *usage) + { + struct vivaldi_data *drvdata = hid_get_drvdata(hdev); ++ struct hid_report *report = field->report; + int fn_key; + int ret; + u32 report_len; +- u8 *buf; ++ u8 *report_data, *buf; + + if (field->logical != HID_USAGE_FN_ROW_PHYSMAP || + (usage->hid & HID_USAGE_PAGE) != HID_UP_ORDINAL) +@@ -89,12 +90,24 @@ static void vivaldi_feature_mapping(stru + if (fn_key > drvdata->max_function_row_key) + drvdata->max_function_row_key = fn_key; + +- buf = hid_alloc_report_buf(field->report, GFP_KERNEL); +- if (!buf) ++ report_data = buf = hid_alloc_report_buf(report, GFP_KERNEL); ++ if (!report_data) + return; + +- report_len = hid_report_len(field->report); +- ret = hid_hw_raw_request(hdev, field->report->id, buf, ++ report_len = hid_report_len(report); ++ if (!report->id) { ++ /* ++ * hid_hw_raw_request() will stuff report ID (which will be 0) ++ * into the first byte of the buffer even for unnumbered ++ * reports, so we need to account for this to avoid getting ++ * -EOVERFLOW in return. ++ * Note that hid_alloc_report_buf() adds 7 bytes to the size ++ * so we can safely say that we have space for an extra byte. ++ */ ++ report_len++; ++ } ++ ++ ret = hid_hw_raw_request(hdev, report->id, report_data, + report_len, HID_FEATURE_REPORT, + HID_REQ_GET_REPORT); + if (ret < 0) { +@@ -103,7 +116,16 @@ static void vivaldi_feature_mapping(stru + goto out; + } + +- ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT, buf, ++ if (!report->id) { ++ /* ++ * Undo the damage from hid_hw_raw_request() for unnumbered ++ * reports. ++ */ ++ report_data++; ++ report_len--; ++ } ++ ++ ret = hid_report_raw_event(hdev, HID_FEATURE_REPORT, report_data, + report_len, 0); + if (ret) { + dev_warn(&hdev->dev, "failed to report feature %d\n", diff --git a/queue-5.15/inet-frags-annotate-races-around-fqdir-dead-and-fqdir-high_thresh.patch b/queue-5.15/inet-frags-annotate-races-around-fqdir-dead-and-fqdir-high_thresh.patch new file mode 100644 index 00000000000..e0357e67d2f --- /dev/null +++ b/queue-5.15/inet-frags-annotate-races-around-fqdir-dead-and-fqdir-high_thresh.patch @@ -0,0 +1,94 @@ +From 91341fa0003befd097e190ec2a4bf63ad957c49a Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Thu, 13 Jan 2022 01:22:29 -0800 +Subject: inet: frags: annotate races around fqdir->dead and fqdir->high_thresh + +From: Eric Dumazet + +commit 91341fa0003befd097e190ec2a4bf63ad957c49a upstream. + +Both fields can be read/written without synchronization, +add proper accessors and documentation. + +Fixes: d5dd88794a13 ("inet: fix various use-after-free in defrags units") +Signed-off-by: Eric Dumazet +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + include/net/inet_frag.h | 11 +++++++++-- + include/net/ipv6_frag.h | 3 ++- + net/ipv4/inet_fragment.c | 8 +++++--- + net/ipv4/ip_fragment.c | 3 ++- + 4 files changed, 18 insertions(+), 7 deletions(-) + +--- a/include/net/inet_frag.h ++++ b/include/net/inet_frag.h +@@ -117,8 +117,15 @@ int fqdir_init(struct fqdir **fqdirp, st + + static inline void fqdir_pre_exit(struct fqdir *fqdir) + { +- fqdir->high_thresh = 0; /* prevent creation of new frags */ +- fqdir->dead = true; ++ /* Prevent creation of new frags. ++ * Pairs with READ_ONCE() in inet_frag_find(). ++ */ ++ WRITE_ONCE(fqdir->high_thresh, 0); ++ ++ /* Pairs with READ_ONCE() in inet_frag_kill(), ip_expire() ++ * and ip6frag_expire_frag_queue(). ++ */ ++ WRITE_ONCE(fqdir->dead, true); + } + void fqdir_exit(struct fqdir *fqdir); + +--- a/include/net/ipv6_frag.h ++++ b/include/net/ipv6_frag.h +@@ -67,7 +67,8 @@ ip6frag_expire_frag_queue(struct net *ne + struct sk_buff *head; + + rcu_read_lock(); +- if (fq->q.fqdir->dead) ++ /* Paired with the WRITE_ONCE() in fqdir_pre_exit(). */ ++ if (READ_ONCE(fq->q.fqdir->dead)) + goto out_rcu_unlock; + spin_lock(&fq->q.lock); + +--- a/net/ipv4/inet_fragment.c ++++ b/net/ipv4/inet_fragment.c +@@ -235,9 +235,9 @@ void inet_frag_kill(struct inet_frag_que + /* The RCU read lock provides a memory barrier + * guaranteeing that if fqdir->dead is false then + * the hash table destruction will not start until +- * after we unlock. Paired with inet_frags_exit_net(). ++ * after we unlock. Paired with fqdir_pre_exit(). + */ +- if (!fqdir->dead) { ++ if (!READ_ONCE(fqdir->dead)) { + rhashtable_remove_fast(&fqdir->rhashtable, &fq->node, + fqdir->f->rhash_params); + refcount_dec(&fq->refcnt); +@@ -352,9 +352,11 @@ static struct inet_frag_queue *inet_frag + /* TODO : call from rcu_read_lock() and no longer use refcount_inc_not_zero() */ + struct inet_frag_queue *inet_frag_find(struct fqdir *fqdir, void *key) + { ++ /* This pairs with WRITE_ONCE() in fqdir_pre_exit(). */ ++ long high_thresh = READ_ONCE(fqdir->high_thresh); + struct inet_frag_queue *fq = NULL, *prev; + +- if (!fqdir->high_thresh || frag_mem_limit(fqdir) > fqdir->high_thresh) ++ if (!high_thresh || frag_mem_limit(fqdir) > high_thresh) + return NULL; + + rcu_read_lock(); +--- a/net/ipv4/ip_fragment.c ++++ b/net/ipv4/ip_fragment.c +@@ -144,7 +144,8 @@ static void ip_expire(struct timer_list + + rcu_read_lock(); + +- if (qp->q.fqdir->dead) ++ /* Paired with WRITE_ONCE() in fqdir_pre_exit(). */ ++ if (READ_ONCE(qp->q.fqdir->dead)) + goto out_rcu_unlock; + + spin_lock(&qp->q.lock); diff --git a/queue-5.15/iwlwifi-fix-bz-nmi-behaviour.patch b/queue-5.15/iwlwifi-fix-bz-nmi-behaviour.patch new file mode 100644 index 00000000000..bd8d0d3be0e --- /dev/null +++ b/queue-5.15/iwlwifi-fix-bz-nmi-behaviour.patch @@ -0,0 +1,52 @@ +From fdfde0cb79264f88992e72b5a056a3a3284fcaad Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Fri, 10 Dec 2021 09:06:11 +0200 +Subject: iwlwifi: fix Bz NMI behaviour + +From: Johannes Berg + +commit fdfde0cb79264f88992e72b5a056a3a3284fcaad upstream. + +Contrary to what was stated before, the hardware hasn't changed +the bits here yet. In any case, the new CSR is also directly +(lower 16 bits) connected to UREG_DOORBELL_TO_ISR6, so if it +still changes the changes would be there. Adjust the code and +comments accordingly. + +Signed-off-by: Johannes Berg +Fixes: 6c0795f1a524 ("iwlwifi: implement Bz NMI behaviour") +Signed-off-by: Luca Coelho +Link: https://lore.kernel.org/r/iwlwifi.20211210090244.75b6207536e3.I7d170a48a9096e6b7269c3a9f447c326f929b171@changeid +Signed-off-by: Luca Coelho +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/intel/iwlwifi/iwl-csr.h | 5 +++-- + drivers/net/wireless/intel/iwlwifi/iwl-io.c | 2 +- + 2 files changed, 4 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h +@@ -104,9 +104,10 @@ + /* GIO Chicken Bits (PCI Express bus link power management) */ + #define CSR_GIO_CHICKEN_BITS (CSR_BASE+0x100) + +-/* Doorbell NMI (since Bz) */ ++/* Doorbell - since Bz ++ * connected to UREG_DOORBELL_TO_ISR6 (lower 16 bits only) ++ */ + #define CSR_DOORBELL_VECTOR (CSR_BASE + 0x130) +-#define CSR_DOORBELL_VECTOR_NMI BIT(1) + + /* host chicken bits */ + #define CSR_HOST_CHICKEN (CSR_BASE + 0x204) +--- a/drivers/net/wireless/intel/iwlwifi/iwl-io.c ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-io.c +@@ -218,7 +218,7 @@ void iwl_force_nmi(struct iwl_trans *tra + UREG_DOORBELL_TO_ISR6_NMI_BIT); + else + iwl_write32(trans, CSR_DOORBELL_VECTOR, +- CSR_DOORBELL_VECTOR_NMI); ++ UREG_DOORBELL_TO_ISR6_NMI_BIT); + } + IWL_EXPORT_SYMBOL(iwl_force_nmi); + diff --git a/queue-5.15/libcxgb-don-t-accidentally-set-rto_onlink-in-cxgb_find_route.patch b/queue-5.15/libcxgb-don-t-accidentally-set-rto_onlink-in-cxgb_find_route.patch new file mode 100644 index 00000000000..8da60fd020d --- /dev/null +++ b/queue-5.15/libcxgb-don-t-accidentally-set-rto_onlink-in-cxgb_find_route.patch @@ -0,0 +1,44 @@ +From a915deaa9abe4fb3a440312c954253a6a733608e Mon Sep 17 00:00:00 2001 +From: Guillaume Nault +Date: Mon, 10 Jan 2022 14:43:11 +0100 +Subject: libcxgb: Don't accidentally set RTO_ONLINK in cxgb_find_route() + +From: Guillaume Nault + +commit a915deaa9abe4fb3a440312c954253a6a733608e upstream. + +Mask the ECN bits before calling ip_route_output_ports(). The tos +variable might be passed directly from an IPv4 header, so it may have +the last ECN bit set. This interferes with the route lookup process as +ip_route_output_key_hash() interpretes this bit specially (to restrict +the route scope). + +Found by code inspection, compile tested only. + +Fixes: 804c2f3e36ef ("libcxgb,iw_cxgb4,cxgbit: add cxgb_find_route()") +Signed-off-by: Guillaume Nault +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c ++++ b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c +@@ -32,6 +32,7 @@ + + #include + #include ++#include + #include + #include + +@@ -99,7 +100,7 @@ cxgb_find_route(struct cxgb4_lld_info *l + + rt = ip_route_output_ports(&init_net, &fl4, NULL, peer_ip, local_ip, + peer_port, local_port, IPPROTO_TCP, +- tos, 0); ++ tos & ~INET_ECN_MASK, 0); + if (IS_ERR(rt)) + return NULL; + n = dst_neigh_lookup(&rt->dst, &peer_ip); diff --git a/queue-5.15/net-axienet-add-missing-memory-barriers.patch b/queue-5.15/net-axienet-add-missing-memory-barriers.patch new file mode 100644 index 00000000000..cd6c9e14425 --- /dev/null +++ b/queue-5.15/net-axienet-add-missing-memory-barriers.patch @@ -0,0 +1,67 @@ +From 95978df6fa328df619c15312e65ece469c2be2d2 Mon Sep 17 00:00:00 2001 +From: Robert Hancock +Date: Tue, 18 Jan 2022 15:41:27 -0600 +Subject: net: axienet: add missing memory barriers + +From: Robert Hancock + +commit 95978df6fa328df619c15312e65ece469c2be2d2 upstream. + +This driver was missing some required memory barriers: + +Use dma_rmb to ensure we see all updates to the descriptor after we see +that an entry has been completed. + +Use wmb and rmb to avoid stale descriptor status between the TX path and +TX complete IRQ path. + +Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") +Signed-off-by: Robert Hancock +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c ++++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +@@ -632,6 +632,8 @@ static int axienet_free_tx_chain(struct + if (nr_bds == -1 && !(status & XAXIDMA_BD_STS_COMPLETE_MASK)) + break; + ++ /* Ensure we see complete descriptor update */ ++ dma_rmb(); + phys = desc_get_phys_addr(lp, cur_p); + dma_unmap_single(ndev->dev.parent, phys, + (cur_p->cntrl & XAXIDMA_BD_CTRL_LENGTH_MASK), +@@ -645,8 +647,10 @@ static int axienet_free_tx_chain(struct + cur_p->app1 = 0; + cur_p->app2 = 0; + cur_p->app4 = 0; +- cur_p->status = 0; + cur_p->skb = NULL; ++ /* ensure our transmit path and device don't prematurely see status cleared */ ++ wmb(); ++ cur_p->status = 0; + + if (sizep) + *sizep += status & XAXIDMA_BD_STS_ACTUAL_LEN_MASK; +@@ -704,6 +708,9 @@ static inline int axienet_check_tx_bd_sp + int num_frag) + { + struct axidma_bd *cur_p; ++ ++ /* Ensure we see all descriptor updates from device or TX IRQ path */ ++ rmb(); + cur_p = &lp->tx_bd_v[(lp->tx_bd_tail + num_frag) % lp->tx_bd_num]; + if (cur_p->status & XAXIDMA_BD_STS_ALL_MASK) + return NETDEV_TX_BUSY; +@@ -843,6 +850,8 @@ static void axienet_recv(struct net_devi + + tail_p = lp->rx_bd_p + sizeof(*lp->rx_bd_v) * lp->rx_bd_ci; + ++ /* Ensure we see complete descriptor update */ ++ dma_rmb(); + phys = desc_get_phys_addr(lp, cur_p); + dma_unmap_single(ndev->dev.parent, phys, lp->max_frm_size, + DMA_FROM_DEVICE); diff --git a/queue-5.15/net-axienet-fix-for-tx-busy-handling.patch b/queue-5.15/net-axienet-fix-for-tx-busy-handling.patch new file mode 100644 index 00000000000..bd42b788df4 --- /dev/null +++ b/queue-5.15/net-axienet-fix-for-tx-busy-handling.patch @@ -0,0 +1,149 @@ +From bb193e3db8b86a63f26889c99e14fd30c9ebd72a Mon Sep 17 00:00:00 2001 +From: Robert Hancock +Date: Tue, 18 Jan 2022 15:41:31 -0600 +Subject: net: axienet: fix for TX busy handling + +From: Robert Hancock + +commit bb193e3db8b86a63f26889c99e14fd30c9ebd72a upstream. + +Network driver documentation indicates we should be avoiding returning +NETDEV_TX_BUSY from ndo_start_xmit in normal cases, since it requires +the packets to be requeued. Instead the queue should be stopped after +a packet is added to the TX ring when there may not be enough room for an +additional one. Also, when TX ring entries are completed, we should only +wake the queue if we know there is room for another full maximally +fragmented packet. + +Print a warning if there is insufficient space at the start of start_xmit, +since this should no longer happen. + +Combined with increasing the default TX ring size (in a subsequent +patch), this appears to recover the TX performance lost by previous changes +to actually manage the TX ring state properly. + +Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") +Signed-off-by: Robert Hancock +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 86 ++++++++++++---------- + 1 file changed, 47 insertions(+), 39 deletions(-) + +--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c ++++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +@@ -661,6 +661,32 @@ static int axienet_free_tx_chain(struct + } + + /** ++ * axienet_check_tx_bd_space - Checks if a BD/group of BDs are currently busy ++ * @lp: Pointer to the axienet_local structure ++ * @num_frag: The number of BDs to check for ++ * ++ * Return: 0, on success ++ * NETDEV_TX_BUSY, if any of the descriptors are not free ++ * ++ * This function is invoked before BDs are allocated and transmission starts. ++ * This function returns 0 if a BD or group of BDs can be allocated for ++ * transmission. If the BD or any of the BDs are not free the function ++ * returns a busy status. This is invoked from axienet_start_xmit. ++ */ ++static inline int axienet_check_tx_bd_space(struct axienet_local *lp, ++ int num_frag) ++{ ++ struct axidma_bd *cur_p; ++ ++ /* Ensure we see all descriptor updates from device or TX IRQ path */ ++ rmb(); ++ cur_p = &lp->tx_bd_v[(lp->tx_bd_tail + num_frag) % lp->tx_bd_num]; ++ if (cur_p->cntrl) ++ return NETDEV_TX_BUSY; ++ return 0; ++} ++ ++/** + * axienet_start_xmit_done - Invoked once a transmit is completed by the + * Axi DMA Tx channel. + * @ndev: Pointer to the net_device structure +@@ -689,33 +715,8 @@ static void axienet_start_xmit_done(stru + /* Matches barrier in axienet_start_xmit */ + smp_mb(); + +- netif_wake_queue(ndev); +-} +- +-/** +- * axienet_check_tx_bd_space - Checks if a BD/group of BDs are currently busy +- * @lp: Pointer to the axienet_local structure +- * @num_frag: The number of BDs to check for +- * +- * Return: 0, on success +- * NETDEV_TX_BUSY, if any of the descriptors are not free +- * +- * This function is invoked before BDs are allocated and transmission starts. +- * This function returns 0 if a BD or group of BDs can be allocated for +- * transmission. If the BD or any of the BDs are not free the function +- * returns a busy status. This is invoked from axienet_start_xmit. +- */ +-static inline int axienet_check_tx_bd_space(struct axienet_local *lp, +- int num_frag) +-{ +- struct axidma_bd *cur_p; +- +- /* Ensure we see all descriptor updates from device or TX IRQ path */ +- rmb(); +- cur_p = &lp->tx_bd_v[(lp->tx_bd_tail + num_frag) % lp->tx_bd_num]; +- if (cur_p->cntrl) +- return NETDEV_TX_BUSY; +- return 0; ++ if (!axienet_check_tx_bd_space(lp, MAX_SKB_FRAGS + 1)) ++ netif_wake_queue(ndev); + } + + /** +@@ -748,19 +749,14 @@ axienet_start_xmit(struct sk_buff *skb, + cur_p = &lp->tx_bd_v[lp->tx_bd_tail]; + + if (axienet_check_tx_bd_space(lp, num_frag + 1)) { +- if (netif_queue_stopped(ndev)) +- return NETDEV_TX_BUSY; +- ++ /* Should not happen as last start_xmit call should have ++ * checked for sufficient space and queue should only be ++ * woken when sufficient space is available. ++ */ + netif_stop_queue(ndev); +- +- /* Matches barrier in axienet_start_xmit_done */ +- smp_mb(); +- +- /* Space might have just been freed - check again */ +- if (axienet_check_tx_bd_space(lp, num_frag + 1)) +- return NETDEV_TX_BUSY; +- +- netif_wake_queue(ndev); ++ if (net_ratelimit()) ++ netdev_warn(ndev, "TX ring unexpectedly full\n"); ++ return NETDEV_TX_BUSY; + } + + if (skb->ip_summed == CHECKSUM_PARTIAL) { +@@ -821,6 +817,18 @@ axienet_start_xmit(struct sk_buff *skb, + if (++lp->tx_bd_tail >= lp->tx_bd_num) + lp->tx_bd_tail = 0; + ++ /* Stop queue if next transmit may not have space */ ++ if (axienet_check_tx_bd_space(lp, MAX_SKB_FRAGS + 1)) { ++ netif_stop_queue(ndev); ++ ++ /* Matches barrier in axienet_start_xmit_done */ ++ smp_mb(); ++ ++ /* Space might have just been freed - check again */ ++ if (!axienet_check_tx_bd_space(lp, MAX_SKB_FRAGS + 1)) ++ netif_wake_queue(ndev); ++ } ++ + return NETDEV_TX_OK; + } + diff --git a/queue-5.15/net-axienet-fix-number-of-tx-ring-slots-for-available-check.patch b/queue-5.15/net-axienet-fix-number-of-tx-ring-slots-for-available-check.patch new file mode 100644 index 00000000000..e0fe36afb26 --- /dev/null +++ b/queue-5.15/net-axienet-fix-number-of-tx-ring-slots-for-available-check.patch @@ -0,0 +1,41 @@ +From aba57a823d2985a2cc8c74a2535f3a88e68d9424 Mon Sep 17 00:00:00 2001 +From: Robert Hancock +Date: Tue, 18 Jan 2022 15:41:30 -0600 +Subject: net: axienet: fix number of TX ring slots for available check + +From: Robert Hancock + +commit aba57a823d2985a2cc8c74a2535f3a88e68d9424 upstream. + +The check for the number of available TX ring slots was off by 1 since a +slot is required for the skb header as well as each fragment. This could +result in overwriting a TX ring slot that was still in use. + +Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") +Signed-off-by: Robert Hancock +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c ++++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +@@ -747,7 +747,7 @@ axienet_start_xmit(struct sk_buff *skb, + num_frag = skb_shinfo(skb)->nr_frags; + cur_p = &lp->tx_bd_v[lp->tx_bd_tail]; + +- if (axienet_check_tx_bd_space(lp, num_frag)) { ++ if (axienet_check_tx_bd_space(lp, num_frag + 1)) { + if (netif_queue_stopped(ndev)) + return NETDEV_TX_BUSY; + +@@ -757,7 +757,7 @@ axienet_start_xmit(struct sk_buff *skb, + smp_mb(); + + /* Space might have just been freed - check again */ +- if (axienet_check_tx_bd_space(lp, num_frag)) ++ if (axienet_check_tx_bd_space(lp, num_frag + 1)) + return NETDEV_TX_BUSY; + + netif_wake_queue(ndev); diff --git a/queue-5.15/net-axienet-fix-tx-ring-slot-available-check.patch b/queue-5.15/net-axienet-fix-tx-ring-slot-available-check.patch new file mode 100644 index 00000000000..ef99e50056f --- /dev/null +++ b/queue-5.15/net-axienet-fix-tx-ring-slot-available-check.patch @@ -0,0 +1,51 @@ +From 996defd7f8b5dafc1d480b7585c7c62437f80c3c Mon Sep 17 00:00:00 2001 +From: Robert Hancock +Date: Tue, 18 Jan 2022 15:41:29 -0600 +Subject: net: axienet: Fix TX ring slot available check + +From: Robert Hancock + +commit 996defd7f8b5dafc1d480b7585c7c62437f80c3c upstream. + +The check for whether a TX ring slot was available was incorrect, +since a slot which had been loaded with transmit data but the device had +not started transmitting would be treated as available, potentially +causing non-transmitted slots to be overwritten. The control field in +the descriptor should be checked, rather than the status field (which may +only be updated when the device completes the entry). + +Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") +Signed-off-by: Robert Hancock +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c ++++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +@@ -643,7 +643,6 @@ static int axienet_free_tx_chain(struct + if (cur_p->skb && (status & XAXIDMA_BD_STS_COMPLETE_MASK)) + dev_consume_skb_irq(cur_p->skb); + +- cur_p->cntrl = 0; + cur_p->app0 = 0; + cur_p->app1 = 0; + cur_p->app2 = 0; +@@ -651,6 +650,7 @@ static int axienet_free_tx_chain(struct + cur_p->skb = NULL; + /* ensure our transmit path and device don't prematurely see status cleared */ + wmb(); ++ cur_p->cntrl = 0; + cur_p->status = 0; + + if (sizep) +@@ -713,7 +713,7 @@ static inline int axienet_check_tx_bd_sp + /* Ensure we see all descriptor updates from device or TX IRQ path */ + rmb(); + cur_p = &lp->tx_bd_v[(lp->tx_bd_tail + num_frag) % lp->tx_bd_num]; +- if (cur_p->status & XAXIDMA_BD_STS_ALL_MASK) ++ if (cur_p->cntrl) + return NETDEV_TX_BUSY; + return 0; + } diff --git a/queue-5.15/net-axienet-increase-default-tx-ring-size-to-128.patch b/queue-5.15/net-axienet-increase-default-tx-ring-size-to-128.patch new file mode 100644 index 00000000000..bc1f0930a73 --- /dev/null +++ b/queue-5.15/net-axienet-increase-default-tx-ring-size-to-128.patch @@ -0,0 +1,35 @@ +From 2d19c3fd80178160dd505ccd7fed1643831227a5 Mon Sep 17 00:00:00 2001 +From: Robert Hancock +Date: Tue, 18 Jan 2022 15:41:32 -0600 +Subject: net: axienet: increase default TX ring size to 128 + +From: Robert Hancock + +commit 2d19c3fd80178160dd505ccd7fed1643831227a5 upstream. + +With previous changes to make the driver handle the TX ring size more +correctly, the default TX ring size of 64 appears to significantly +bottleneck TX performance to around 600 Mbps on a 1 Gbps link on ZynqMP. +Increasing this to 128 seems to bring performance up to near line rate and +shouldn't cause excess bufferbloat (this driver doesn't yet support modern +byte-based queue management). + +Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") +Signed-off-by: Robert Hancock +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c ++++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +@@ -41,7 +41,7 @@ + #include "xilinx_axienet.h" + + /* Descriptors defines for Tx and Rx DMA */ +-#define TX_BD_NUM_DEFAULT 64 ++#define TX_BD_NUM_DEFAULT 128 + #define RX_BD_NUM_DEFAULT 1024 + #define TX_BD_NUM_MIN (MAX_SKB_FRAGS + 1) + #define TX_BD_NUM_MAX 4096 diff --git a/queue-5.15/net-axienet-limit-minimum-tx-ring-size.patch b/queue-5.15/net-axienet-limit-minimum-tx-ring-size.patch new file mode 100644 index 00000000000..fea36569255 --- /dev/null +++ b/queue-5.15/net-axienet-limit-minimum-tx-ring-size.patch @@ -0,0 +1,42 @@ +From 70f5817deddbc6ef3faa35841cab83c280cc653a Mon Sep 17 00:00:00 2001 +From: Robert Hancock +Date: Tue, 18 Jan 2022 15:41:28 -0600 +Subject: net: axienet: limit minimum TX ring size + +From: Robert Hancock + +commit 70f5817deddbc6ef3faa35841cab83c280cc653a upstream. + +The driver will not work properly if the TX ring size is set to below +MAX_SKB_FRAGS + 1 since it needs to hold at least one full maximally +fragmented packet in the TX ring. Limit setting the ring size to below +this value. + +Fixes: 8b09ca823ffb4 ("net: axienet: Make RX/TX ring sizes configurable") +Signed-off-by: Robert Hancock +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c ++++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +@@ -43,6 +43,7 @@ + /* Descriptors defines for Tx and Rx DMA */ + #define TX_BD_NUM_DEFAULT 64 + #define RX_BD_NUM_DEFAULT 1024 ++#define TX_BD_NUM_MIN (MAX_SKB_FRAGS + 1) + #define TX_BD_NUM_MAX 4096 + #define RX_BD_NUM_MAX 4096 + +@@ -1364,7 +1365,8 @@ static int axienet_ethtools_set_ringpara + if (ering->rx_pending > RX_BD_NUM_MAX || + ering->rx_mini_pending || + ering->rx_jumbo_pending || +- ering->rx_pending > TX_BD_NUM_MAX) ++ ering->tx_pending < TX_BD_NUM_MIN || ++ ering->tx_pending > TX_BD_NUM_MAX) + return -EINVAL; + + if (netif_running(ndev)) diff --git a/queue-5.15/net-axienet-reset-core-on-initialization-prior-to-mdio-access.patch b/queue-5.15/net-axienet-reset-core-on-initialization-prior-to-mdio-access.patch new file mode 100644 index 00000000000..4c6888b26a7 --- /dev/null +++ b/queue-5.15/net-axienet-reset-core-on-initialization-prior-to-mdio-access.patch @@ -0,0 +1,40 @@ +From 04cc2da39698efd7eb2e30c112538922d26f848e Mon Sep 17 00:00:00 2001 +From: Robert Hancock +Date: Tue, 18 Jan 2022 15:41:26 -0600 +Subject: net: axienet: reset core on initialization prior to MDIO access + +From: Robert Hancock + +commit 04cc2da39698efd7eb2e30c112538922d26f848e upstream. + +In some cases where the Xilinx Ethernet core was used in 1000Base-X or +SGMII modes, which use the internal PCS/PMA PHY, and the MGT +transceiver clock source for the PCS was not running at the time the +FPGA logic was loaded, the core would come up in a state where the +PCS could not be found on the MDIO bus. To fix this, the Ethernet core +(including the PCS) should be reset after enabling the clocks, prior to +attempting to access the PCS using of_mdio_find_device. + +Fixes: 1a02556086fc (net: axienet: Properly handle PCS/PMA PHY for 1000BaseX mode) +Signed-off-by: Robert Hancock +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c ++++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +@@ -2091,6 +2091,11 @@ static int axienet_probe(struct platform + lp->coalesce_count_rx = XAXIDMA_DFT_RX_THRESHOLD; + lp->coalesce_count_tx = XAXIDMA_DFT_TX_THRESHOLD; + ++ /* Reset core now that clocks are enabled, prior to accessing MDIO */ ++ ret = __axienet_device_reset(lp); ++ if (ret) ++ goto cleanup_clk; ++ + lp->phy_node = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); + if (lp->phy_node) { + ret = axienet_mdio_setup(lp); diff --git a/queue-5.15/net-bonding-fix-bond_xmit_broadcast-return-value-error-bug.patch b/queue-5.15/net-bonding-fix-bond_xmit_broadcast-return-value-error-bug.patch new file mode 100644 index 00000000000..bc53bf3442b --- /dev/null +++ b/queue-5.15/net-bonding-fix-bond_xmit_broadcast-return-value-error-bug.patch @@ -0,0 +1,110 @@ +From 4e5bd03ae34652cd932ab4c91c71c511793df75c Mon Sep 17 00:00:00 2001 +From: Jie Wang +Date: Wed, 12 Jan 2022 20:54:18 +0800 +Subject: net: bonding: fix bond_xmit_broadcast return value error bug + +From: Jie Wang + +commit 4e5bd03ae34652cd932ab4c91c71c511793df75c upstream. + +In Linux bonding scenario, one packet is copied to several copies and sent +by all slave device of bond0 in mode 3(broadcast mode). The mode 3 xmit +function bond_xmit_broadcast() only ueses the last slave device's tx result +as the final result. In this case, if the last slave device is down, then +it always return NET_XMIT_DROP, even though the other slave devices xmit +success. It may cause the tx statistics error, and cause the application +(e.g. scp) consider the network is unreachable. + +For example, use the following command to configure server A. + +echo 3 > /sys/class/net/bond0/bonding/mode +ifconfig bond0 up +ifenslave bond0 eth0 eth1 +ifconfig bond0 192.168.1.125 +ifconfig eth0 up +ifconfig eth1 down +The slave device eth0 and eth1 are connected to server B(192.168.1.107). +Run the ping 192.168.1.107 -c 3 -i 0.2 command, the following information +is displayed. + +PING 192.168.1.107 (192.168.1.107) 56(84) bytes of data. +64 bytes from 192.168.1.107: icmp_seq=1 ttl=64 time=0.077 ms +64 bytes from 192.168.1.107: icmp_seq=2 ttl=64 time=0.056 ms +64 bytes from 192.168.1.107: icmp_seq=3 ttl=64 time=0.051 ms + + 192.168.1.107 ping statistics +0 packets transmitted, 3 received + +Actually, the slave device eth0 of the bond successfully sends three +ICMP packets, but the result shows that 0 packets are transmitted. + +Also if we use scp command to get remote files, the command end with the +following printings. + +ssh_exchange_identification: read: Connection timed out + +So this patch modifies the bond_xmit_broadcast to return NET_XMIT_SUCCESS +if one slave device in the bond sends packets successfully. If all slave +devices send packets fail, the discarded packets stats is increased. The +skb is released when there is no slave device in the bond or the last slave +device is down. + +Fixes: ae46f184bc1f ("bonding: propagate transmit status") +Signed-off-by: Jie Wang +Signed-off-by: Guangbin Huang +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/bonding/bond_main.c | 30 ++++++++++++++++++++++-------- + 1 file changed, 22 insertions(+), 8 deletions(-) + +--- a/drivers/net/bonding/bond_main.c ++++ b/drivers/net/bonding/bond_main.c +@@ -4843,25 +4843,39 @@ static netdev_tx_t bond_xmit_broadcast(s + struct bonding *bond = netdev_priv(bond_dev); + struct slave *slave = NULL; + struct list_head *iter; ++ bool xmit_suc = false; ++ bool skb_used = false; + + bond_for_each_slave_rcu(bond, slave, iter) { +- if (bond_is_last_slave(bond, slave)) +- break; +- if (bond_slave_is_up(slave) && slave->link == BOND_LINK_UP) { +- struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC); ++ struct sk_buff *skb2; + ++ if (!(bond_slave_is_up(slave) && slave->link == BOND_LINK_UP)) ++ continue; ++ ++ if (bond_is_last_slave(bond, slave)) { ++ skb2 = skb; ++ skb_used = true; ++ } else { ++ skb2 = skb_clone(skb, GFP_ATOMIC); + if (!skb2) { + net_err_ratelimited("%s: Error: %s: skb_clone() failed\n", + bond_dev->name, __func__); + continue; + } +- bond_dev_queue_xmit(bond, skb2, slave->dev); + } ++ ++ if (bond_dev_queue_xmit(bond, skb2, slave->dev) == NETDEV_TX_OK) ++ xmit_suc = true; + } +- if (slave && bond_slave_is_up(slave) && slave->link == BOND_LINK_UP) +- return bond_dev_queue_xmit(bond, skb, slave->dev); + +- return bond_tx_drop(bond_dev, skb); ++ if (!skb_used) ++ dev_kfree_skb_any(skb); ++ ++ if (xmit_suc) ++ return NETDEV_TX_OK; ++ ++ atomic_long_inc(&bond_dev->tx_dropped); ++ return NET_XMIT_DROP; + } + + /*------------------------- Device initialization ---------------------------*/ diff --git a/queue-5.15/net-cpsw-avoid-alignment-faults-by-taking-net_ip_align-into-account.patch b/queue-5.15/net-cpsw-avoid-alignment-faults-by-taking-net_ip_align-into-account.patch new file mode 100644 index 00000000000..9eb70865432 --- /dev/null +++ b/queue-5.15/net-cpsw-avoid-alignment-faults-by-taking-net_ip_align-into-account.patch @@ -0,0 +1,100 @@ +From 1771afd47430f5e95c9c3a2e3a8a63e67402d3fe Mon Sep 17 00:00:00 2001 +From: Ard Biesheuvel +Date: Tue, 18 Jan 2022 11:22:04 +0100 +Subject: net: cpsw: avoid alignment faults by taking NET_IP_ALIGN into account + +From: Ard Biesheuvel + +commit 1771afd47430f5e95c9c3a2e3a8a63e67402d3fe upstream. + +Both versions of the CPSW driver declare a CPSW_HEADROOM_NA macro that +takes NET_IP_ALIGN into account, but fail to use it appropriately when +storing incoming packets in memory. This results in the IPv4 source and +destination addresses to appear misaligned in memory, which causes +aligment faults that need to be fixed up in software. + +So let's switch from CPSW_HEADROOM to CPSW_HEADROOM_NA where needed. +This gets rid of any alignment faults on the RX path on a Beaglebone +White. + +Fixes: 9ed4050c0d75 ("net: ethernet: ti: cpsw: add XDP support") +Cc: Grygorii Strashko +Cc: Ilias Apalodimas +Signed-off-by: Ard Biesheuvel +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/ti/cpsw.c | 6 +++--- + drivers/net/ethernet/ti/cpsw_new.c | 6 +++--- + drivers/net/ethernet/ti/cpsw_priv.c | 2 +- + 3 files changed, 7 insertions(+), 7 deletions(-) + +--- a/drivers/net/ethernet/ti/cpsw.c ++++ b/drivers/net/ethernet/ti/cpsw.c +@@ -349,7 +349,7 @@ static void cpsw_rx_handler(void *token, + struct cpsw_common *cpsw = ndev_to_cpsw(xmeta->ndev); + int pkt_size = cpsw->rx_packet_max; + int ret = 0, port, ch = xmeta->ch; +- int headroom = CPSW_HEADROOM; ++ int headroom = CPSW_HEADROOM_NA; + struct net_device *ndev = xmeta->ndev; + struct cpsw_priv *priv; + struct page_pool *pool; +@@ -392,7 +392,7 @@ static void cpsw_rx_handler(void *token, + } + + if (priv->xdp_prog) { +- int headroom = CPSW_HEADROOM, size = len; ++ int size = len; + + xdp_init_buff(&xdp, PAGE_SIZE, &priv->xdp_rxq[ch]); + if (status & CPDMA_RX_VLAN_ENCAP) { +@@ -442,7 +442,7 @@ requeue: + xmeta->ndev = ndev; + xmeta->ch = ch; + +- dma = page_pool_get_dma_addr(new_page) + CPSW_HEADROOM; ++ dma = page_pool_get_dma_addr(new_page) + CPSW_HEADROOM_NA; + ret = cpdma_chan_submit_mapped(cpsw->rxv[ch].ch, new_page, dma, + pkt_size, 0); + if (ret < 0) { +--- a/drivers/net/ethernet/ti/cpsw_new.c ++++ b/drivers/net/ethernet/ti/cpsw_new.c +@@ -283,7 +283,7 @@ static void cpsw_rx_handler(void *token, + { + struct page *new_page, *page = token; + void *pa = page_address(page); +- int headroom = CPSW_HEADROOM; ++ int headroom = CPSW_HEADROOM_NA; + struct cpsw_meta_xdp *xmeta; + struct cpsw_common *cpsw; + struct net_device *ndev; +@@ -336,7 +336,7 @@ static void cpsw_rx_handler(void *token, + } + + if (priv->xdp_prog) { +- int headroom = CPSW_HEADROOM, size = len; ++ int size = len; + + xdp_init_buff(&xdp, PAGE_SIZE, &priv->xdp_rxq[ch]); + if (status & CPDMA_RX_VLAN_ENCAP) { +@@ -386,7 +386,7 @@ requeue: + xmeta->ndev = ndev; + xmeta->ch = ch; + +- dma = page_pool_get_dma_addr(new_page) + CPSW_HEADROOM; ++ dma = page_pool_get_dma_addr(new_page) + CPSW_HEADROOM_NA; + ret = cpdma_chan_submit_mapped(cpsw->rxv[ch].ch, new_page, dma, + pkt_size, 0); + if (ret < 0) { +--- a/drivers/net/ethernet/ti/cpsw_priv.c ++++ b/drivers/net/ethernet/ti/cpsw_priv.c +@@ -1120,7 +1120,7 @@ int cpsw_fill_rx_channels(struct cpsw_pr + xmeta->ndev = priv->ndev; + xmeta->ch = ch; + +- dma = page_pool_get_dma_addr(page) + CPSW_HEADROOM; ++ dma = page_pool_get_dma_addr(page) + CPSW_HEADROOM_NA; + ret = cpdma_chan_idle_submit_mapped(cpsw->rxv[ch].ch, + page, dma, + cpsw->rx_packet_max, diff --git a/queue-5.15/net-ethernet-mtk_eth_soc-fix-error-checking-in-mtk_mac_config.patch b/queue-5.15/net-ethernet-mtk_eth_soc-fix-error-checking-in-mtk_mac_config.patch new file mode 100644 index 00000000000..a2433a76878 --- /dev/null +++ b/queue-5.15/net-ethernet-mtk_eth_soc-fix-error-checking-in-mtk_mac_config.patch @@ -0,0 +1,37 @@ +From 214b3369ab9b0a6f28d6c970220c209417edbc65 Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Sat, 15 Jan 2022 09:49:18 -0800 +Subject: net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config() + +From: Tom Rix + +commit 214b3369ab9b0a6f28d6c970220c209417edbc65 upstream. + +Clang static analysis reports this problem +mtk_eth_soc.c:394:7: warning: Branch condition evaluates + to a garbage value + if (err) + ^~~ + +err is not initialized and only conditionally set. +So intitialize err. + +Fixes: 7e538372694b ("net: ethernet: mediatek: Re-add support SGMII") +Signed-off-by: Tom Rix +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -224,7 +224,7 @@ static void mtk_mac_config(struct phylin + phylink_config); + struct mtk_eth *eth = mac->hw; + u32 mcr_cur, mcr_new, sid, i; +- int val, ge_mode, err; ++ int val, ge_mode, err = 0; + + /* MT76x8 has no hardware settings between for the MAC */ + if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) && diff --git a/queue-5.15/net-fix-sock_timestamping_bind_phc-to-release-device.patch b/queue-5.15/net-fix-sock_timestamping_bind_phc-to-release-device.patch new file mode 100644 index 00000000000..42537b94703 --- /dev/null +++ b/queue-5.15/net-fix-sock_timestamping_bind_phc-to-release-device.patch @@ -0,0 +1,32 @@ +From 2a4d75bfe41232608f5596a6d1369f92ccb20817 Mon Sep 17 00:00:00 2001 +From: Miroslav Lichvar +Date: Tue, 11 Jan 2022 16:10:53 +0100 +Subject: net: fix sock_timestamping_bind_phc() to release device + +From: Miroslav Lichvar + +commit 2a4d75bfe41232608f5596a6d1369f92ccb20817 upstream. + +Don't forget to release the device in sock_timestamping_bind_phc() after +it was used to get the vclock indices. + +Fixes: d463126e23f1 ("net: sock: extend SO_TIMESTAMPING for PHC binding") +Signed-off-by: Miroslav Lichvar +Cc: Yangbo Lu +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/core/sock.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/net/core/sock.c ++++ b/net/core/sock.c +@@ -830,6 +830,8 @@ static int sock_timestamping_bind_phc(st + } + + num = ethtool_get_phc_vclocks(dev, &vclock_index); ++ dev_put(dev); ++ + for (i = 0; i < num; i++) { + if (*(vclock_index + i) == phc_index) { + match = true; diff --git a/queue-5.15/net-ipa-fix-atomic-update-in-ipa_endpoint_replenish.patch b/queue-5.15/net-ipa-fix-atomic-update-in-ipa_endpoint_replenish.patch new file mode 100644 index 00000000000..10a7950c083 --- /dev/null +++ b/queue-5.15/net-ipa-fix-atomic-update-in-ipa_endpoint_replenish.patch @@ -0,0 +1,54 @@ +From 6c0e3b5ce94947b311348c367db9e11dcb2ccc93 Mon Sep 17 00:00:00 2001 +From: Alex Elder +Date: Wed, 12 Jan 2022 07:30:10 -0600 +Subject: net: ipa: fix atomic update in ipa_endpoint_replenish() + +From: Alex Elder + +commit 6c0e3b5ce94947b311348c367db9e11dcb2ccc93 upstream. + +In ipa_endpoint_replenish(), if an error occurs when attempting to +replenish a receive buffer, we just quit and try again later. In +that case we increment the backlog count to reflect that the attempt +was unsuccessful. Then, if the add_one flag was true we increment +the backlog again. + +This second increment is not included in the backlog local variable +though, and its value determines whether delayed work should be +scheduled. This is a bug. + +Fix this by determining whether 1 or 2 should be added to the +backlog before adding it in a atomic_add_return() call. + +Reviewed-by: Matthias Kaehlcke +Fixes: 84f9bd12d46db ("soc: qcom: ipa: IPA endpoints") +Signed-off-by: Alex Elder +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ipa/ipa_endpoint.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/drivers/net/ipa/ipa_endpoint.c ++++ b/drivers/net/ipa/ipa_endpoint.c +@@ -1067,6 +1067,7 @@ static void ipa_endpoint_replenish(struc + { + struct gsi *gsi; + u32 backlog; ++ int delta; + + if (!endpoint->replenish_enabled) { + if (add_one) +@@ -1084,10 +1085,8 @@ static void ipa_endpoint_replenish(struc + + try_again_later: + /* The last one didn't succeed, so fix the backlog */ +- backlog = atomic_inc_return(&endpoint->replenish_backlog); +- +- if (add_one) +- atomic_inc(&endpoint->replenish_backlog); ++ delta = add_one ? 2 : 1; ++ backlog = atomic_add_return(delta, &endpoint->replenish_backlog); + + /* Whenever a receive buffer transaction completes we'll try to + * replenish again. It's unlikely, but if we fail to supply even diff --git a/queue-5.15/net-mscc-ocelot-don-t-let-phylink-re-enable-tx-pause-on-the-npi-port.patch b/queue-5.15/net-mscc-ocelot-don-t-let-phylink-re-enable-tx-pause-on-the-npi-port.patch new file mode 100644 index 00000000000..0764786621d --- /dev/null +++ b/queue-5.15/net-mscc-ocelot-don-t-let-phylink-re-enable-tx-pause-on-the-npi-port.patch @@ -0,0 +1,92 @@ +From 33cb0ff30cff104e753f7882c99e54cf67ea7903 Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Wed, 12 Jan 2022 22:21:27 +0200 +Subject: net: mscc: ocelot: don't let phylink re-enable TX PAUSE on the NPI port + +From: Vladimir Oltean + +commit 33cb0ff30cff104e753f7882c99e54cf67ea7903 upstream. + +Since commit b39648079db4 ("net: mscc: ocelot: disable flow control on +NPI interface"), flow control should be disabled on the DSA CPU port +when used in NPI mode. + +However, the commit blamed in the Fixes: tag below broke this, because +it allowed felix_phylink_mac_link_up() to overwrite SYS_PAUSE_CFG_PAUSE_ENA +for the DSA CPU port. + +This issue became noticeable since the device tree update from commit +8fcea7be5736 ("arm64: dts: ls1028a: mark internal links between Felix +and ENETC as capable of flow control"). + +The solution is to check whether this is the currently configured NPI +port from ocelot_phylink_mac_link_up(), and to not modify the statically +disabled PAUSE frame transmission if it is. + +When the port is configured for lossless mode as opposed to tail drop +mode, but the link partner (DSA master) doesn't observe the transmitted +PAUSE frames, the switch termination throughput is much worse, as can be +seen below. + +Before: + +root@debian:~# iperf3 -c 192.168.100.2 +Connecting to host 192.168.100.2, port 5201 +[ 5] local 192.168.100.1 port 37504 connected to 192.168.100.2 port 5201 +[ ID] Interval Transfer Bitrate Retr Cwnd +[ 5] 0.00-1.00 sec 28.4 MBytes 238 Mbits/sec 357 22.6 KBytes +[ 5] 1.00-2.00 sec 33.6 MBytes 282 Mbits/sec 426 19.8 KBytes +[ 5] 2.00-3.00 sec 34.0 MBytes 285 Mbits/sec 343 21.2 KBytes +[ 5] 3.00-4.00 sec 32.9 MBytes 276 Mbits/sec 354 22.6 KBytes +[ 5] 4.00-5.00 sec 32.3 MBytes 271 Mbits/sec 297 18.4 KBytes +^C[ 5] 5.00-5.06 sec 2.05 MBytes 270 Mbits/sec 45 19.8 KBytes +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Retr +[ 5] 0.00-5.06 sec 163 MBytes 271 Mbits/sec 1822 sender +[ 5] 0.00-5.06 sec 0.00 Bytes 0.00 bits/sec receiver + +After: + +root@debian:~# iperf3 -c 192.168.100.2 +Connecting to host 192.168.100.2, port 5201 +[ 5] local 192.168.100.1 port 49470 connected to 192.168.100.2 port 5201 +[ ID] Interval Transfer Bitrate Retr Cwnd +[ 5] 0.00-1.00 sec 112 MBytes 941 Mbits/sec 259 143 KBytes +[ 5] 1.00-2.00 sec 110 MBytes 920 Mbits/sec 329 144 KBytes +[ 5] 2.00-3.00 sec 112 MBytes 936 Mbits/sec 255 144 KBytes +[ 5] 3.00-4.00 sec 110 MBytes 927 Mbits/sec 355 105 KBytes +[ 5] 4.00-5.00 sec 110 MBytes 926 Mbits/sec 350 156 KBytes +[ 5] 5.00-6.00 sec 110 MBytes 925 Mbits/sec 305 148 KBytes +[ 5] 6.00-7.00 sec 110 MBytes 924 Mbits/sec 320 143 KBytes +[ 5] 7.00-8.00 sec 110 MBytes 925 Mbits/sec 273 97.6 KBytes +[ 5] 8.00-9.00 sec 109 MBytes 913 Mbits/sec 299 141 KBytes +[ 5] 9.00-10.00 sec 110 MBytes 922 Mbits/sec 287 146 KBytes +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Retr +[ 5] 0.00-10.00 sec 1.08 GBytes 926 Mbits/sec 3032 sender +[ 5] 0.00-10.00 sec 1.08 GBytes 925 Mbits/sec receiver + +Fixes: de274be32cb2 ("net: dsa: felix: set TX flow control according to the phylink_mac_link_up resolution") +Reported-by: Xiaoliang Yang +Signed-off-by: Vladimir Oltean +Reviewed-by: Florian Fainelli +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mscc/ocelot.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mscc/ocelot.c ++++ b/drivers/net/ethernet/mscc/ocelot.c +@@ -555,7 +555,10 @@ void ocelot_phylink_mac_link_up(struct o + + ocelot_write_rix(ocelot, 0, ANA_POL_FLOWC, port); + +- ocelot_fields_write(ocelot, port, SYS_PAUSE_CFG_PAUSE_ENA, tx_pause); ++ /* Don't attempt to send PAUSE frames on the NPI port, it's broken */ ++ if (port != ocelot->npi) ++ ocelot_fields_write(ocelot, port, SYS_PAUSE_CFG_PAUSE_ENA, ++ tx_pause); + + /* Undo the effects of ocelot_phylink_mac_link_down: + * enable MAC module diff --git a/queue-5.15/net-mscc-ocelot-fix-using-match-before-it-is-set.patch b/queue-5.15/net-mscc-ocelot-fix-using-match-before-it-is-set.patch new file mode 100644 index 00000000000..f76f83a167b --- /dev/null +++ b/queue-5.15/net-mscc-ocelot-fix-using-match-before-it-is-set.patch @@ -0,0 +1,57 @@ +From baa59504c1cd0cca7d41954a45ee0b3dc78e41a0 Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Tue, 18 Jan 2022 05:41:10 -0800 +Subject: net: mscc: ocelot: fix using match before it is set + +From: Tom Rix + +commit baa59504c1cd0cca7d41954a45ee0b3dc78e41a0 upstream. + +Clang static analysis reports this issue +ocelot_flower.c:563:8: warning: 1st function call argument + is an uninitialized value + !is_zero_ether_addr(match.mask->dst)) { + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The variable match is used before it is set. So move the +block. + +Fixes: 75944fda1dfe ("net: mscc: ocelot: offload ingress skbedit and vlan actions to VCAP IS1") +Signed-off-by: Tom Rix +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mscc/ocelot_flower.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +--- a/drivers/net/ethernet/mscc/ocelot_flower.c ++++ b/drivers/net/ethernet/mscc/ocelot_flower.c +@@ -467,13 +467,6 @@ ocelot_flower_parse_key(struct ocelot *o + return -EOPNOTSUPP; + } + +- if (filter->block_id == VCAP_IS1 && +- !is_zero_ether_addr(match.mask->dst)) { +- NL_SET_ERR_MSG_MOD(extack, +- "Key type S1_NORMAL cannot match on destination MAC"); +- return -EOPNOTSUPP; +- } +- + /* The hw support mac matches only for MAC_ETYPE key, + * therefore if other matches(port, tcp flags, etc) are added + * then just bail out +@@ -488,6 +481,14 @@ ocelot_flower_parse_key(struct ocelot *o + return -EOPNOTSUPP; + + flow_rule_match_eth_addrs(rule, &match); ++ ++ if (filter->block_id == VCAP_IS1 && ++ !is_zero_ether_addr(match.mask->dst)) { ++ NL_SET_ERR_MSG_MOD(extack, ++ "Key type S1_NORMAL cannot match on destination MAC"); ++ return -EOPNOTSUPP; ++ } ++ + filter->key_type = OCELOT_VCAP_KEY_ETYPE; + ether_addr_copy(filter->key.etype.dmac.value, + match.key->dst); diff --git a/queue-5.15/net-ocelot-fix-the-call-to-switchdev_bridge_port_offload.patch b/queue-5.15/net-ocelot-fix-the-call-to-switchdev_bridge_port_offload.patch new file mode 100644 index 00000000000..7f9cd014064 --- /dev/null +++ b/queue-5.15/net-ocelot-fix-the-call-to-switchdev_bridge_port_offload.patch @@ -0,0 +1,52 @@ +From c0b7f7d7e0ad44f35745c01964b3fa2833e298cb Mon Sep 17 00:00:00 2001 +From: Horatiu Vultur +Date: Mon, 17 Jan 2022 13:53:00 +0100 +Subject: net: ocelot: Fix the call to switchdev_bridge_port_offload + +From: Horatiu Vultur + +commit c0b7f7d7e0ad44f35745c01964b3fa2833e298cb upstream. + +In the blamed commit, the call to the function +switchdev_bridge_port_offload was passing the wrong argument for +atomic_nb. It was ocelot_netdevice_nb instead of ocelot_swtchdev_nb. +This patch fixes this issue. + +Fixes: 4e51bf44a03af6 ("net: bridge: move the switchdev object replay helpers to "push" mode") +Signed-off-by: Horatiu Vultur +Reviewed-by: Vladimir Oltean +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mscc/ocelot_net.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/mscc/ocelot_net.c ++++ b/drivers/net/ethernet/mscc/ocelot_net.c +@@ -1168,7 +1168,7 @@ static int ocelot_netdevice_bridge_join( + ocelot_port_bridge_join(ocelot, port, bridge); + + err = switchdev_bridge_port_offload(brport_dev, dev, priv, +- &ocelot_netdevice_nb, ++ &ocelot_switchdev_nb, + &ocelot_switchdev_blocking_nb, + false, extack); + if (err) +@@ -1182,7 +1182,7 @@ static int ocelot_netdevice_bridge_join( + + err_switchdev_sync: + switchdev_bridge_port_unoffload(brport_dev, priv, +- &ocelot_netdevice_nb, ++ &ocelot_switchdev_nb, + &ocelot_switchdev_blocking_nb); + err_switchdev_offload: + ocelot_port_bridge_leave(ocelot, port, bridge); +@@ -1195,7 +1195,7 @@ static void ocelot_netdevice_pre_bridge_ + struct ocelot_port_private *priv = netdev_priv(dev); + + switchdev_bridge_port_unoffload(brport_dev, priv, +- &ocelot_netdevice_nb, ++ &ocelot_switchdev_nb, + &ocelot_switchdev_blocking_nb); + } + diff --git a/queue-5.15/net-phy-micrel-use-kszphy_suspend-kszphy_resume-for-irq-aware-devices.patch b/queue-5.15/net-phy-micrel-use-kszphy_suspend-kszphy_resume-for-irq-aware-devices.patch new file mode 100644 index 00000000000..1e5169f5321 --- /dev/null +++ b/queue-5.15/net-phy-micrel-use-kszphy_suspend-kszphy_resume-for-irq-aware-devices.patch @@ -0,0 +1,140 @@ +From f1131b9c23fb4a3540a774828ff49f421619f902 Mon Sep 17 00:00:00 2001 +From: Claudiu Beznea +Date: Tue, 18 Jan 2022 13:08:12 +0200 +Subject: net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices + +From: Claudiu Beznea + +commit f1131b9c23fb4a3540a774828ff49f421619f902 upstream. + +On a setup with KSZ9131 and MACB drivers it happens on suspend path, from +time to time, that the PHY interrupt arrives after PHY and MACB were +suspended (PHY via genphy_suspend(), MACB via macb_suspend()). In this +case the phy_read() at the beginning of kszphy_handle_interrupt() will +fail (as MACB driver is suspended at this time) leading to phy_error() +being called and a stack trace being displayed on console. To solve this +.suspend/.resume functions for all KSZ devices implementing +.handle_interrupt were replaced with kszphy_suspend()/kszphy_resume() +which disable/enable interrupt before/after calling +genphy_suspend()/genphy_resume(). + +The fix has been adapted for all KSZ devices which implements +.handle_interrupt but it has been tested only on KSZ9131. + +Fixes: 59ca4e58b917 ("net: phy: micrel: implement generic .handle_interrupt() callback") +Signed-off-by: Claudiu Beznea +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/phy/micrel.c | 36 ++++++++++++++++++------------------ + 1 file changed, 18 insertions(+), 18 deletions(-) + +--- a/drivers/net/phy/micrel.c ++++ b/drivers/net/phy/micrel.c +@@ -1547,8 +1547,8 @@ static struct phy_driver ksphy_driver[] + .config_init = kszphy_config_init, + .config_intr = kszphy_config_intr, + .handle_interrupt = kszphy_handle_interrupt, +- .suspend = genphy_suspend, +- .resume = genphy_resume, ++ .suspend = kszphy_suspend, ++ .resume = kszphy_resume, + }, { + .phy_id = PHY_ID_KSZ8021, + .phy_id_mask = 0x00ffffff, +@@ -1562,8 +1562,8 @@ static struct phy_driver ksphy_driver[] + .get_sset_count = kszphy_get_sset_count, + .get_strings = kszphy_get_strings, + .get_stats = kszphy_get_stats, +- .suspend = genphy_suspend, +- .resume = genphy_resume, ++ .suspend = kszphy_suspend, ++ .resume = kszphy_resume, + }, { + .phy_id = PHY_ID_KSZ8031, + .phy_id_mask = 0x00ffffff, +@@ -1577,8 +1577,8 @@ static struct phy_driver ksphy_driver[] + .get_sset_count = kszphy_get_sset_count, + .get_strings = kszphy_get_strings, + .get_stats = kszphy_get_stats, +- .suspend = genphy_suspend, +- .resume = genphy_resume, ++ .suspend = kszphy_suspend, ++ .resume = kszphy_resume, + }, { + .phy_id = PHY_ID_KSZ8041, + .phy_id_mask = MICREL_PHY_ID_MASK, +@@ -1609,8 +1609,8 @@ static struct phy_driver ksphy_driver[] + .get_sset_count = kszphy_get_sset_count, + .get_strings = kszphy_get_strings, + .get_stats = kszphy_get_stats, +- .suspend = genphy_suspend, +- .resume = genphy_resume, ++ .suspend = kszphy_suspend, ++ .resume = kszphy_resume, + }, { + .name = "Micrel KSZ8051", + /* PHY_BASIC_FEATURES */ +@@ -1623,8 +1623,8 @@ static struct phy_driver ksphy_driver[] + .get_strings = kszphy_get_strings, + .get_stats = kszphy_get_stats, + .match_phy_device = ksz8051_match_phy_device, +- .suspend = genphy_suspend, +- .resume = genphy_resume, ++ .suspend = kszphy_suspend, ++ .resume = kszphy_resume, + }, { + .phy_id = PHY_ID_KSZ8001, + .name = "Micrel KSZ8001 or KS8721", +@@ -1638,8 +1638,8 @@ static struct phy_driver ksphy_driver[] + .get_sset_count = kszphy_get_sset_count, + .get_strings = kszphy_get_strings, + .get_stats = kszphy_get_stats, +- .suspend = genphy_suspend, +- .resume = genphy_resume, ++ .suspend = kszphy_suspend, ++ .resume = kszphy_resume, + }, { + .phy_id = PHY_ID_KSZ8081, + .name = "Micrel KSZ8081 or KSZ8091", +@@ -1669,8 +1669,8 @@ static struct phy_driver ksphy_driver[] + .config_init = ksz8061_config_init, + .config_intr = kszphy_config_intr, + .handle_interrupt = kszphy_handle_interrupt, +- .suspend = genphy_suspend, +- .resume = genphy_resume, ++ .suspend = kszphy_suspend, ++ .resume = kszphy_resume, + }, { + .phy_id = PHY_ID_KSZ9021, + .phy_id_mask = 0x000ffffe, +@@ -1685,8 +1685,8 @@ static struct phy_driver ksphy_driver[] + .get_sset_count = kszphy_get_sset_count, + .get_strings = kszphy_get_strings, + .get_stats = kszphy_get_stats, +- .suspend = genphy_suspend, +- .resume = genphy_resume, ++ .suspend = kszphy_suspend, ++ .resume = kszphy_resume, + .read_mmd = genphy_read_mmd_unsupported, + .write_mmd = genphy_write_mmd_unsupported, + }, { +@@ -1704,7 +1704,7 @@ static struct phy_driver ksphy_driver[] + .get_sset_count = kszphy_get_sset_count, + .get_strings = kszphy_get_strings, + .get_stats = kszphy_get_stats, +- .suspend = genphy_suspend, ++ .suspend = kszphy_suspend, + .resume = kszphy_resume, + }, { + .phy_id = PHY_ID_LAN8814, +@@ -1732,7 +1732,7 @@ static struct phy_driver ksphy_driver[] + .get_sset_count = kszphy_get_sset_count, + .get_strings = kszphy_get_strings, + .get_stats = kszphy_get_stats, +- .suspend = genphy_suspend, ++ .suspend = kszphy_suspend, + .resume = kszphy_resume, + }, { + .phy_id = PHY_ID_KSZ8873MLL, diff --git a/queue-5.15/net-sfp-fix-high-power-modules-without-diagnostic-monitoring.patch b/queue-5.15/net-sfp-fix-high-power-modules-without-diagnostic-monitoring.patch new file mode 100644 index 00000000000..35140146780 --- /dev/null +++ b/queue-5.15/net-sfp-fix-high-power-modules-without-diagnostic-monitoring.patch @@ -0,0 +1,95 @@ +From 5765cee119bf5a36c94d20eceb37c445508934be Mon Sep 17 00:00:00 2001 +From: "Russell King (Oracle)" +Date: Mon, 17 Jan 2022 14:52:33 +0000 +Subject: net: sfp: fix high power modules without diagnostic monitoring +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Russell King (Oracle) + +commit 5765cee119bf5a36c94d20eceb37c445508934be upstream. + +Commit 7cfa9c92d0a3 ("net: sfp: avoid power switch on address-change +modules") unintetionally changed the semantics for high power modules +without the digital diagnostics monitoring. We repeatedly attempt to +read the power status from the non-existing 0xa2 address in a futile +hope this failure is temporary: + +[ 8.856051] sfp sfp-eth3: module NTT 0000000000000000 rev 0000 sn 0000000000000000 dc 160408 +[ 8.865843] mvpp2 f4000000.ethernet eth3: switched to inband/1000base-x link mode +[ 8.873469] sfp sfp-eth3: Failed to read EEPROM: -5 +[ 8.983251] sfp sfp-eth3: Failed to read EEPROM: -5 +[ 9.103250] sfp sfp-eth3: Failed to read EEPROM: -5 + +We previosuly assumed such modules were powered up in the correct mode, +continuing without further configuration as long as the required power +class was supported by the host. + +Restore this behaviour, while preserving the intent of subsequent +patches to avoid the "Address Change Sequence not supported" warning +if we are not going to be accessing the DDM address. + +Fixes: 7cfa9c92d0a3 ("net: sfp: avoid power switch on address-change modules") +Reported-by: 照山周一郎 +Tested-by: 照山周一郎 +Signed-off-by: Russell King (Oracle) +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/phy/sfp.c | 25 +++++++++++++++++++++---- + 1 file changed, 21 insertions(+), 4 deletions(-) + +--- a/drivers/net/phy/sfp.c ++++ b/drivers/net/phy/sfp.c +@@ -1641,17 +1641,20 @@ static int sfp_sm_probe_for_phy(struct s + static int sfp_module_parse_power(struct sfp *sfp) + { + u32 power_mW = 1000; ++ bool supports_a2; + + if (sfp->id.ext.options & cpu_to_be16(SFP_OPTIONS_POWER_DECL)) + power_mW = 1500; + if (sfp->id.ext.options & cpu_to_be16(SFP_OPTIONS_HIGH_POWER_LEVEL)) + power_mW = 2000; + ++ supports_a2 = sfp->id.ext.sff8472_compliance != ++ SFP_SFF8472_COMPLIANCE_NONE || ++ sfp->id.ext.diagmon & SFP_DIAGMON_DDM; ++ + if (power_mW > sfp->max_power_mW) { + /* Module power specification exceeds the allowed maximum. */ +- if (sfp->id.ext.sff8472_compliance == +- SFP_SFF8472_COMPLIANCE_NONE && +- !(sfp->id.ext.diagmon & SFP_DIAGMON_DDM)) { ++ if (!supports_a2) { + /* The module appears not to implement bus address + * 0xa2, so assume that the module powers up in the + * indicated mode. +@@ -1668,11 +1671,25 @@ static int sfp_module_parse_power(struct + } + } + ++ if (power_mW <= 1000) { ++ /* Modules below 1W do not require a power change sequence */ ++ sfp->module_power_mW = power_mW; ++ return 0; ++ } ++ ++ if (!supports_a2) { ++ /* The module power level is below the host maximum and the ++ * module appears not to implement bus address 0xa2, so assume ++ * that the module powers up in the indicated mode. ++ */ ++ return 0; ++ } ++ + /* If the module requires a higher power mode, but also requires + * an address change sequence, warn the user that the module may + * not be functional. + */ +- if (sfp->id.ext.diagmon & SFP_DIAGMON_ADDRMODE && power_mW > 1000) { ++ if (sfp->id.ext.diagmon & SFP_DIAGMON_ADDRMODE) { + dev_warn(sfp->dev, + "Address Change Sequence not supported but module requires %u.%uW, module may not be functional\n", + power_mW / 1000, (power_mW / 100) % 10); diff --git a/queue-5.15/net-wwan-fix-mru-mismatch-issue-which-may-lead-to-data-connection-lost.patch b/queue-5.15/net-wwan-fix-mru-mismatch-issue-which-may-lead-to-data-connection-lost.patch new file mode 100644 index 00000000000..36ba4967c81 --- /dev/null +++ b/queue-5.15/net-wwan-fix-mru-mismatch-issue-which-may-lead-to-data-connection-lost.patch @@ -0,0 +1,48 @@ +From f542cdfa3083a309e3caafbbdf41490c4935492a Mon Sep 17 00:00:00 2001 +From: Slark Xiao +Date: Sat, 15 Jan 2022 10:34:30 +0800 +Subject: net: wwan: Fix MRU mismatch issue which may lead to data connection lost + +From: Slark Xiao + +commit f542cdfa3083a309e3caafbbdf41490c4935492a upstream. + +In pci_generic.c there is a 'mru_default' in struct mhi_pci_dev_info. +This value shall be used for whole mhi if it's given a value for a specific product. +But in function mhi_net_rx_refill_work(), it's still using hard code value MHI_DEFAULT_MRU. +'mru_default' shall have higher priority than MHI_DEFAULT_MRU. +And after checking, this change could help fix a data connection lost issue. + +Fixes: 5c2c85315948 ("bus: mhi: pci-generic: configurable network interface MRU") +Signed-off-by: Shujun Wang +Signed-off-by: Slark Xiao +Reviewed-by: Loic Poulain +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wwan/mhi_wwan_mbim.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/wwan/mhi_wwan_mbim.c b/drivers/net/wwan/mhi_wwan_mbim.c +index 71bf9b4f769f..6872782e8dd8 100644 +--- a/drivers/net/wwan/mhi_wwan_mbim.c ++++ b/drivers/net/wwan/mhi_wwan_mbim.c +@@ -385,13 +385,13 @@ static void mhi_net_rx_refill_work(struct work_struct *work) + int err; + + while (!mhi_queue_is_full(mdev, DMA_FROM_DEVICE)) { +- struct sk_buff *skb = alloc_skb(MHI_DEFAULT_MRU, GFP_KERNEL); ++ struct sk_buff *skb = alloc_skb(mbim->mru, GFP_KERNEL); + + if (unlikely(!skb)) + break; + + err = mhi_queue_skb(mdev, DMA_FROM_DEVICE, skb, +- MHI_DEFAULT_MRU, MHI_EOT); ++ mbim->mru, MHI_EOT); + if (unlikely(err)) { + kfree_skb(skb); + break; +-- +2.34.1 + diff --git a/queue-5.15/net_sched-restore-mpu-xxx-handling.patch b/queue-5.15/net_sched-restore-mpu-xxx-handling.patch new file mode 100644 index 00000000000..2e76e90e095 --- /dev/null +++ b/queue-5.15/net_sched-restore-mpu-xxx-handling.patch @@ -0,0 +1,99 @@ +From fb80445c438c78b40b547d12b8d56596ce4ccfeb Mon Sep 17 00:00:00 2001 +From: Kevin Bracey +Date: Wed, 12 Jan 2022 19:02:10 +0200 +Subject: net_sched: restore "mpu xxx" handling + +From: Kevin Bracey + +commit fb80445c438c78b40b547d12b8d56596ce4ccfeb upstream. + +commit 56b765b79e9a ("htb: improved accuracy at high rates") broke +"overhead X", "linklayer atm" and "mpu X" attributes. + +"overhead X" and "linklayer atm" have already been fixed. This restores +the "mpu X" handling, as might be used by DOCSIS or Ethernet shaping: + + tc class add ... htb rate X overhead 4 mpu 64 + +The code being fixed is used by htb, tbf and act_police. Cake has its +own mpu handling. qdisc_calculate_pkt_len still uses the size table +containing values adjusted for mpu by user space. + +iproute2 tc has always passed mpu into the kernel via a tc_ratespec +structure, but the kernel never directly acted on it, merely stored it +so that it could be read back by `tc class show`. + +Rather, tc would generate length-to-time tables that included the mpu +(and linklayer) in their construction, and the kernel used those tables. + +Since v3.7, the tables were no longer used. Along with "mpu", this also +broke "overhead" and "linklayer" which were fixed in 01cb71d2d47b +("net_sched: restore "overhead xxx" handling", v3.10) and 8a8e3d84b171 +("net_sched: restore "linklayer atm" handling", v3.11). + +"overhead" was fixed by simply restoring use of tc_ratespec::overhead - +this had originally been used by the kernel but was initially omitted +from the new non-table-based calculations. + +"linklayer" had been handled in the table like "mpu", but the mode was +not originally passed in tc_ratespec. The new implementation was made to +handle it by getting new versions of tc to pass the mode in an extended +tc_ratespec, and for older versions of tc the table contents were analysed +at load time to deduce linklayer. + +As "mpu" has always been given to the kernel in tc_ratespec, +accompanying the mpu-based table, we can restore system functionality +with no userspace change by making the kernel act on the tc_ratespec +value. + +Fixes: 56b765b79e9a ("htb: improved accuracy at high rates") +Signed-off-by: Kevin Bracey +Cc: Eric Dumazet +Cc: Jiri Pirko +Cc: Vimalkumar +Link: https://lore.kernel.org/r/20220112170210.1014351-1-kevin@bracey.fi +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + include/net/sch_generic.h | 5 +++++ + net/sched/sch_generic.c | 1 + + 2 files changed, 6 insertions(+) + +--- a/include/net/sch_generic.h ++++ b/include/net/sch_generic.h +@@ -1260,6 +1260,7 @@ struct psched_ratecfg { + u64 rate_bytes_ps; /* bytes per second */ + u32 mult; + u16 overhead; ++ u16 mpu; + u8 linklayer; + u8 shift; + }; +@@ -1269,6 +1270,9 @@ static inline u64 psched_l2t_ns(const st + { + len += r->overhead; + ++ if (len < r->mpu) ++ len = r->mpu; ++ + if (unlikely(r->linklayer == TC_LINKLAYER_ATM)) + return ((u64)(DIV_ROUND_UP(len,48)*53) * r->mult) >> r->shift; + +@@ -1291,6 +1295,7 @@ static inline void psched_ratecfg_getrat + res->rate = min_t(u64, r->rate_bytes_ps, ~0U); + + res->overhead = r->overhead; ++ res->mpu = r->mpu; + res->linklayer = (r->linklayer & TC_LINKLAYER_MASK); + } + +--- a/net/sched/sch_generic.c ++++ b/net/sched/sch_generic.c +@@ -1455,6 +1455,7 @@ void psched_ratecfg_precompute(struct ps + { + memset(r, 0, sizeof(*r)); + r->overhead = conf->overhead; ++ r->mpu = conf->mpu; + r->rate_bytes_ps = max_t(u64, conf->rate, rate64); + r->linklayer = (conf->linklayer & TC_LINKLAYER_MASK); + psched_ratecfg_precompute__(r->rate_bytes_ps, &r->mult, &r->shift); diff --git a/queue-5.15/netns-add-schedule-point-in-ops_exit_list.patch b/queue-5.15/netns-add-schedule-point-in-ops_exit_list.patch new file mode 100644 index 00000000000..7af76ac7c94 --- /dev/null +++ b/queue-5.15/netns-add-schedule-point-in-ops_exit_list.patch @@ -0,0 +1,47 @@ +From 2836615aa22de55b8fca5e32fe1b27a67cda625e Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Tue, 18 Jan 2022 03:43:40 -0800 +Subject: netns: add schedule point in ops_exit_list() + +From: Eric Dumazet + +commit 2836615aa22de55b8fca5e32fe1b27a67cda625e upstream. + +When under stress, cleanup_net() can have to dismantle +netns in big numbers. ops_exit_list() currently calls +many helpers [1] that have no schedule point, and we can +end up with soft lockups, particularly on hosts +with many cpus. + +Even for moderate amount of netns processed by cleanup_net() +this patch avoids latency spikes. + +[1] Some of these helpers like fib_sync_up() and fib_sync_down_dev() +are very slow because net/ipv4/fib_semantics.c uses host-wide hash tables, +and ifindex is used as the only input of two hash functions. + ifindexes tend to be the same for all netns (lo.ifindex==1 per instance) + This will be fixed in a separate patch. + +Fixes: 72ad937abd0a ("net: Add support for batching network namespace cleanups") +Signed-off-by: Eric Dumazet +Cc: Eric W. Biederman +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/core/net_namespace.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/net/core/net_namespace.c ++++ b/net/core/net_namespace.c +@@ -164,8 +164,10 @@ static void ops_exit_list(const struct p + { + struct net *net; + if (ops->exit) { +- list_for_each_entry(net, net_exit_list, exit_list) ++ list_for_each_entry(net, net_exit_list, exit_list) { + ops->exit(net); ++ cond_resched(); ++ } + } + if (ops->exit_batch) + ops->exit_batch(net_exit_list); diff --git a/queue-5.15/perf-probe-fix-ppc64-perf-probe-add-events-failed-case.patch b/queue-5.15/perf-probe-fix-ppc64-perf-probe-add-events-failed-case.patch new file mode 100644 index 00000000000..34ad2030dfa --- /dev/null +++ b/queue-5.15/perf-probe-fix-ppc64-perf-probe-add-events-failed-case.patch @@ -0,0 +1,62 @@ +From 4624f199327a704dd1069aca1c3cadb8f2a28c6f Mon Sep 17 00:00:00 2001 +From: Zechuan Chen +Date: Tue, 28 Dec 2021 19:13:38 +0800 +Subject: perf probe: Fix ppc64 'perf probe add events failed' case + +From: Zechuan Chen + +commit 4624f199327a704dd1069aca1c3cadb8f2a28c6f upstream. + +Because of commit bf794bf52a80c627 ("powerpc/kprobes: Fix kallsyms +lookup across powerpc ABIv1 and ABIv2"), in ppc64 ABIv1, our perf +command eliminates the need to use the prefix "." at the symbol name. + +But when the command "perf probe -a schedule" is executed on ppc64 +ABIv1, it obtains two symbol address information through /proc/kallsyms, +for example: + + cat /proc/kallsyms | grep -w schedule + c000000000657020 T .schedule + c000000000d4fdb8 D schedule + +The symbol "D schedule" is not a function symbol, and perf will print: +"p:probe/schedule _text+13958584"Failed to write event: Invalid argument + +Therefore, when searching symbols from map and adding probe point for +them, a symbol type check is added. If the type of symbol is not a +function, skip it. + +Fixes: bf794bf52a80c627 ("powerpc/kprobes: Fix kallsyms lookup across powerpc ABIv1 and ABIv2") +Signed-off-by: Zechuan Chen +Acked-by: Masami Hiramatsu +Cc: Alexander Shishkin +Cc: Ingo Molnar +Cc: Jianlin Lv +Cc: Jin Yao +Cc: Jiri Olsa +Cc: Mark Rutland +Cc: Michael Ellerman +Cc: Namhyung Kim +Cc: Naveen N. Rao +Cc: Peter Zijlstra +Cc: Ravi Bangoria +Cc: Yang Jihong +Link: https://lore.kernel.org/r/20211228111338.218602-1-chenzechuan1@huawei.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/util/probe-event.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/tools/perf/util/probe-event.c ++++ b/tools/perf/util/probe-event.c +@@ -3083,6 +3083,9 @@ static int find_probe_trace_events_from_ + for (j = 0; j < num_matched_functions; j++) { + sym = syms[j]; + ++ if (sym->type != STT_FUNC) ++ continue; ++ + /* There can be duplicated symbols in the map */ + for (i = 0; i < j; i++) + if (sym->start == syms[i]->start) { diff --git a/queue-5.15/perf-script-fix-hex-dump-character-output.patch b/queue-5.15/perf-script-fix-hex-dump-character-output.patch new file mode 100644 index 00000000000..d6b2f74ad0f --- /dev/null +++ b/queue-5.15/perf-script-fix-hex-dump-character-output.patch @@ -0,0 +1,63 @@ +From 62942e9fda9fd1def10ffcbd5e1c025b3c9eec17 Mon Sep 17 00:00:00 2001 +From: Adrian Hunter +Date: Wed, 12 Jan 2022 10:50:57 +0200 +Subject: perf script: Fix hex dump character output + +From: Adrian Hunter + +commit 62942e9fda9fd1def10ffcbd5e1c025b3c9eec17 upstream. + +Using grep -C with perf script -D can give erroneous results as grep loses +lines due to non-printable characters, for example, below the 0020, 0060 +and 0070 lines are missing: + + $ perf script -D | grep -C10 AUX | head + . 0010: 08 00 00 00 00 00 00 00 1f 00 00 00 00 00 00 00 ................ + . 0030: 01 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 ................ + . 0040: 00 08 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ................ + . 0050: 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................ + . 0080: 02 00 00 00 00 00 00 00 1b 00 00 00 00 00 00 00 ................ + . 0090: 00 00 00 00 00 00 00 00 ........ + + 0 0 0x450 [0x98]: PERF_RECORD_AUXTRACE_INFO type: 1 + PMU Type 8 + Time Shift 31 + +perf's isprint() is a custom implementation from the kernel, but the +kernel's _ctype appears to include characters from Latin-1 Supplement which +is not compatible with, for example, UTF-8. Fix by checking also isascii(). + +After: + + $ tools/perf/perf script -D | grep -C10 AUX | head + . 0010: 08 00 00 00 00 00 00 00 1f 00 00 00 00 00 00 00 ................ + . 0020: 03 84 32 2f 00 00 00 00 63 7c 4f d2 fa ff ff ff ..2/....c|O..... + . 0030: 01 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 ................ + . 0040: 00 08 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ................ + . 0050: 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................ + . 0060: 00 02 00 00 00 00 00 00 00 c0 03 00 00 00 00 00 ................ + . 0070: e2 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ................ + . 0080: 02 00 00 00 00 00 00 00 1b 00 00 00 00 00 00 00 ................ + . 0090: 00 00 00 00 00 00 00 00 ........ + +Fixes: 3052ba56bcb58904 ("tools perf: Move from sane_ctype.h obtained from git to the Linux's original") +Signed-off-by: Adrian Hunter +Cc: Jiri Olsa +Link: http://lore.kernel.org/lkml/20220112085057.277205-1-adrian.hunter@intel.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/util/debug.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/perf/util/debug.c ++++ b/tools/perf/util/debug.c +@@ -179,7 +179,7 @@ static int trace_event_printer(enum bina + break; + case BINARY_PRINT_CHAR_DATA: + printed += color_fprintf(fp, color, "%c", +- isprint(ch) ? ch : '.'); ++ isprint(ch) && isascii(ch) ? ch : '.'); + break; + case BINARY_PRINT_CHAR_PAD: + printed += color_fprintf(fp, color, " "); diff --git a/queue-5.15/perf-tools-drop-requirement-for-libstdc-.so-for-libopencsd-check.patch b/queue-5.15/perf-tools-drop-requirement-for-libstdc-.so-for-libopencsd-check.patch new file mode 100644 index 00000000000..b5db1986db1 --- /dev/null +++ b/queue-5.15/perf-tools-drop-requirement-for-libstdc-.so-for-libopencsd-check.patch @@ -0,0 +1,55 @@ +From ed17b1914978eddb2b01f2d34577f1c82518c650 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= +Date: Fri, 3 Dec 2021 22:05:44 +0100 +Subject: perf tools: Drop requirement for libstdc++.so for libopencsd check +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Uwe Kleine-König + +commit ed17b1914978eddb2b01f2d34577f1c82518c650 upstream. + +It's possible to link against libopencsd_c_api without having +libstdc++.so available, only libstdc++.so.6.0.28 (or whatever version is +in use) needs to be available. The same holds true for libopencsd.so. +When -lstdc++ (or -lopencsd) is explicitly passed to the linker however +the .so file must be available. + +So wrap adding the dependencies into a check for static linking that +actually requires adding them all. The same construct is already used +for some other tests in the same file to reduce dependencies in the +dynamic linking case. + +Fixes: 573cf5c9a152 ("perf build: Add missing -lstdc++ when linking with libopencsd") +Reviewed-by: James Clark +Signed-off-by: Uwe Kleine-König +Cc: Adrian Bunk +Cc: Alexander Shishkin +Cc: Branislav Rankov +Cc: Diederik de Haas +Cc: Jiri Olsa +Cc: Mark Rutland +Cc: Namhyung Kim +Cc: Peter Zijlstra +Link: https://lore.kernel.org/all/20211203210544.1137935-1-uwe@kleine-koenig.org +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/Makefile.config | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/tools/perf/Makefile.config ++++ b/tools/perf/Makefile.config +@@ -143,7 +143,10 @@ FEATURE_CHECK_LDFLAGS-libcrypto = -lcryp + ifdef CSINCLUDES + LIBOPENCSD_CFLAGS := -I$(CSINCLUDES) + endif +-OPENCSDLIBS := -lopencsd_c_api -lopencsd -lstdc++ ++OPENCSDLIBS := -lopencsd_c_api ++ifeq ($(findstring -static,${LDFLAGS}),-static) ++ OPENCSDLIBS += -lopencsd -lstdc++ ++endif + ifdef CSLIBS + LIBOPENCSD_LDFLAGS := -L$(CSLIBS) + endif diff --git a/queue-5.15/rtc-pxa-fix-null-pointer-dereference.patch b/queue-5.15/rtc-pxa-fix-null-pointer-dereference.patch new file mode 100644 index 00000000000..546a46e8863 --- /dev/null +++ b/queue-5.15/rtc-pxa-fix-null-pointer-dereference.patch @@ -0,0 +1,51 @@ +From 34127b3632b21e5c391756e724b1198eb9917981 Mon Sep 17 00:00:00 2001 +From: Laurence de Bruxelles +Date: Sat, 1 Jan 2022 15:41:49 +0000 +Subject: rtc: pxa: fix null pointer dereference + +From: Laurence de Bruxelles + +commit 34127b3632b21e5c391756e724b1198eb9917981 upstream. + +With the latest stable kernel versions the rtc on the PXA based +Zaurus does not work, when booting I see the following kernel messages: + +pxa-rtc pxa-rtc: failed to find rtc clock source +pxa-rtc pxa-rtc: Unable to init SA1100 RTC sub-device +pxa-rtc: probe of pxa-rtc failed with error -2 +hctosys: unable to open rtc device (rtc0) + +I think this is because commit f2997775b111 ("rtc: sa1100: fix possible +race condition") moved the allocation of the rtc_device struct out of +sa1100_rtc_init and into sa1100_rtc_probe. This means that pxa_rtc_probe +also needs to do allocation for the rtc_device struct, otherwise +sa1100_rtc_init will try to dereference a null pointer. This patch adds +that allocation by copying how sa1100_rtc_probe in +drivers/rtc/rtc-sa1100.c does it; after the IRQs are set up a managed +rtc_device is allocated. + +I've tested this patch with `qemu-system-arm -machine akita` and with a +real Zaurus SL-C1000 applied to 4.19, 5.4, and 5.10. + +Signed-off-by: Laurence de Bruxelles +Fixes: f2997775b111 ("rtc: sa1100: fix possible race condition") +Signed-off-by: Alexandre Belloni +Link: https://lore.kernel.org/r/20220101154149.12026-1-lfdebrux@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/rtc/rtc-pxa.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/rtc/rtc-pxa.c ++++ b/drivers/rtc/rtc-pxa.c +@@ -330,6 +330,10 @@ static int __init pxa_rtc_probe(struct p + if (sa1100_rtc->irq_alarm < 0) + return -ENXIO; + ++ sa1100_rtc->rtc = devm_rtc_allocate_device(&pdev->dev); ++ if (IS_ERR(sa1100_rtc->rtc)) ++ return PTR_ERR(sa1100_rtc->rtc); ++ + pxa_rtc->base = devm_ioremap(dev, pxa_rtc->ress->start, + resource_size(pxa_rtc->ress)); + if (!pxa_rtc->base) { diff --git a/queue-5.15/series b/queue-5.15/series index bda2da2b840..68d8d2b32f8 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -792,3 +792,48 @@ gpio-idt3243x-fix-irq-check-in-idt_gpio_probe.patch net-smc-fix-hung_task-when-removing-smc-r-devices.patch net-axienet-increase-reset-timeout.patch net-axienet-wait-for-phyrstcmplt-after-core-reset.patch +net-axienet-reset-core-on-initialization-prior-to-mdio-access.patch +net-axienet-add-missing-memory-barriers.patch +net-axienet-limit-minimum-tx-ring-size.patch +net-axienet-fix-tx-ring-slot-available-check.patch +net-axienet-fix-number-of-tx-ring-slots-for-available-check.patch +net-axienet-fix-for-tx-busy-handling.patch +net-axienet-increase-default-tx-ring-size-to-128.patch +bitops-protect-find_first_-zero-_bit-properly.patch +um-gitignore-add-kernel-capflags.c.patch +hid-vivaldi-fix-handling-devices-not-using-numbered-reports.patch +rtc-pxa-fix-null-pointer-dereference.patch +vdpa-mlx5-fix-wrong-configuration-of-virtio_version_1_0.patch +virtio_ring-mark-ring-unused-on-error.patch +taskstats-cleanup-the-use-of-task-exit_code.patch +inet-frags-annotate-races-around-fqdir-dead-and-fqdir-high_thresh.patch +netns-add-schedule-point-in-ops_exit_list.patch +iwlwifi-fix-bz-nmi-behaviour.patch +xfrm-don-t-accidentally-set-rto_onlink-in-decode_session4.patch +vdpa-mlx5-restore-cur_num_vqs-in-case-of-failure-in-change_num_qps.patch +gre-don-t-accidentally-set-rto_onlink-in-gre_fill_metadata_dst.patch +libcxgb-don-t-accidentally-set-rto_onlink-in-cxgb_find_route.patch +perf-script-fix-hex-dump-character-output.patch +dmaengine-at_xdmac-don-t-start-transactions-at-tx_submit-level.patch +dmaengine-at_xdmac-start-transfer-for-cyclic-channels-in-issue_pending.patch +dmaengine-at_xdmac-print-debug-message-after-realeasing-the-lock.patch +dmaengine-at_xdmac-fix-concurrency-over-xfers_list.patch +dmaengine-at_xdmac-fix-lld-view-setting.patch +dmaengine-at_xdmac-fix-at_xdmac_lld-struct-definition.patch +perf-tools-drop-requirement-for-libstdc-.so-for-libopencsd-check.patch +perf-probe-fix-ppc64-perf-probe-add-events-failed-case.patch +devlink-remove-misleading-internal_flags-from-health-reporter-dump.patch +arm64-dts-qcom-msm8996-drop-not-documented-adreno-properties.patch +net-fix-sock_timestamping_bind_phc-to-release-device.patch +net-bonding-fix-bond_xmit_broadcast-return-value-error-bug.patch +net-ipa-fix-atomic-update-in-ipa_endpoint_replenish.patch +net_sched-restore-mpu-xxx-handling.patch +net-mscc-ocelot-don-t-let-phylink-re-enable-tx-pause-on-the-npi-port.patch +bcmgenet-add-wol-irq-check.patch +net-wwan-fix-mru-mismatch-issue-which-may-lead-to-data-connection-lost.patch +net-ethernet-mtk_eth_soc-fix-error-checking-in-mtk_mac_config.patch +net-ocelot-fix-the-call-to-switchdev_bridge_port_offload.patch +net-sfp-fix-high-power-modules-without-diagnostic-monitoring.patch +net-cpsw-avoid-alignment-faults-by-taking-net_ip_align-into-account.patch +net-phy-micrel-use-kszphy_suspend-kszphy_resume-for-irq-aware-devices.patch +net-mscc-ocelot-fix-using-match-before-it-is-set.patch diff --git a/queue-5.15/taskstats-cleanup-the-use-of-task-exit_code.patch b/queue-5.15/taskstats-cleanup-the-use-of-task-exit_code.patch new file mode 100644 index 00000000000..31124a68c85 --- /dev/null +++ b/queue-5.15/taskstats-cleanup-the-use-of-task-exit_code.patch @@ -0,0 +1,59 @@ +From 1b5a42d9c85f0e731f01c8d1129001fd8531a8a0 Mon Sep 17 00:00:00 2001 +From: "Eric W. Biederman" +Date: Mon, 3 Jan 2022 11:32:36 -0600 +Subject: taskstats: Cleanup the use of task->exit_code + +From: Eric W. Biederman + +commit 1b5a42d9c85f0e731f01c8d1129001fd8531a8a0 upstream. + +In the function bacct_add_task the code reading task->exit_code was +introduced in commit f3cef7a99469 ("[PATCH] csa: basic accounting over +taskstats"), and it is not entirely clear what the taskstats interface +is trying to return as only returning the exit_code of the first task +in a process doesn't make a lot of sense. + +As best as I can figure the intent is to return task->exit_code after +a task exits. The field is returned with per task fields, so the +exit_code of the entire process is not wanted. Only the value of the +first task is returned so this is not a useful way to get the per task +ptrace stop code. The ordinary case of returning this value is +returning after a task exits, which also precludes use for getting +a ptrace value. + +It is common to for the first task of a process to also be the last +task of a process so this field may have done something reasonable by +accident in testing. + +Make ac_exitcode a reliable per task value by always returning it for +every exited task. + +Setting ac_exitcode in a sensible mannter makes it possible to continue +to provide this value going forward. + +Cc: Balbir Singh +Fixes: f3cef7a99469 ("[PATCH] csa: basic accounting over taskstats") +Link: https://lkml.kernel.org/r/20220103213312.9144-5-ebiederm@xmission.com +Signed-off-by: "Eric W. Biederman" +Signed-off-by: Greg Kroah-Hartman +--- + kernel/tsacct.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/kernel/tsacct.c ++++ b/kernel/tsacct.c +@@ -38,11 +38,10 @@ void bacct_add_tsk(struct user_namespace + stats->ac_btime = clamp_t(time64_t, btime, 0, U32_MAX); + stats->ac_btime64 = btime; + +- if (thread_group_leader(tsk)) { ++ if (tsk->flags & PF_EXITING) + stats->ac_exitcode = tsk->exit_code; +- if (tsk->flags & PF_FORKNOEXEC) +- stats->ac_flag |= AFORK; +- } ++ if (thread_group_leader(tsk) && (tsk->flags & PF_FORKNOEXEC)) ++ stats->ac_flag |= AFORK; + if (tsk->flags & PF_SUPERPRIV) + stats->ac_flag |= ASU; + if (tsk->flags & PF_DUMPCORE) diff --git a/queue-5.15/um-gitignore-add-kernel-capflags.c.patch b/queue-5.15/um-gitignore-add-kernel-capflags.c.patch new file mode 100644 index 00000000000..925547b417c --- /dev/null +++ b/queue-5.15/um-gitignore-add-kernel-capflags.c.patch @@ -0,0 +1,27 @@ +From 4b86366fdfbedec42f8f7ee037775f2839921d34 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Mon, 13 Sep 2021 10:17:29 +0200 +Subject: um: gitignore: Add kernel/capflags.c + +From: Johannes Berg + +commit 4b86366fdfbedec42f8f7ee037775f2839921d34 upstream. + +This file is generated, we should ignore it. + +Fixes: d8fb32f4790f ("um: Add support for host CPU flags and alignment") +Signed-off-by: Johannes Berg +Acked-By: anton.ivanov@cambridgegreys.com +Signed-off-by: Richard Weinberger +Signed-off-by: Greg Kroah-Hartman +--- + arch/um/.gitignore | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/um/.gitignore ++++ b/arch/um/.gitignore +@@ -2,3 +2,4 @@ + kernel/config.c + kernel/config.tmp + kernel/vmlinux.lds ++kernel/capflags.c diff --git a/queue-5.15/vdpa-mlx5-fix-wrong-configuration-of-virtio_version_1_0.patch b/queue-5.15/vdpa-mlx5-fix-wrong-configuration-of-virtio_version_1_0.patch new file mode 100644 index 00000000000..28b809b8317 --- /dev/null +++ b/queue-5.15/vdpa-mlx5-fix-wrong-configuration-of-virtio_version_1_0.patch @@ -0,0 +1,35 @@ +From 97143b70aa847f2b0a1f959dde126b76ff7b5376 Mon Sep 17 00:00:00 2001 +From: Eli Cohen +Date: Thu, 30 Dec 2021 16:20:24 +0200 +Subject: vdpa/mlx5: Fix wrong configuration of virtio_version_1_0 + +From: Eli Cohen + +commit 97143b70aa847f2b0a1f959dde126b76ff7b5376 upstream. + +Remove overriding of virtio_version_1_0 which forced the virtqueue +object to version 1. + +Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") +Signed-off-by: Eli Cohen +Link: https://lore.kernel.org/r/20211230142024.142979-1-elic@nvidia.com +Signed-off-by: Michael S. Tsirkin +Reviewed-by: Parav Pandit +Acked-by: Jason Wang +Reviewed-by: Si-Wei Liu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c ++++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c +@@ -873,8 +873,6 @@ static int create_virtqueue(struct mlx5_ + MLX5_SET(virtio_q, vq_ctx, umem_3_id, mvq->umem3.id); + MLX5_SET(virtio_q, vq_ctx, umem_3_size, mvq->umem3.size); + MLX5_SET(virtio_q, vq_ctx, pd, ndev->mvdev.res.pdn); +- if (MLX5_CAP_DEV_VDPA_EMULATION(ndev->mvdev.mdev, eth_frame_offload_type)) +- MLX5_SET(virtio_q, vq_ctx, virtio_version_1_0, 1); + + err = mlx5_cmd_exec(ndev->mvdev.mdev, in, inlen, out, sizeof(out)); + if (err) diff --git a/queue-5.15/vdpa-mlx5-restore-cur_num_vqs-in-case-of-failure-in-change_num_qps.patch b/queue-5.15/vdpa-mlx5-restore-cur_num_vqs-in-case-of-failure-in-change_num_qps.patch new file mode 100644 index 00000000000..5ba3db20c3c --- /dev/null +++ b/queue-5.15/vdpa-mlx5-restore-cur_num_vqs-in-case-of-failure-in-change_num_qps.patch @@ -0,0 +1,38 @@ +From 37e07e705888e4c3502f204e9c6785c9c2d6d86a Mon Sep 17 00:00:00 2001 +From: Eli Cohen +Date: Wed, 5 Jan 2022 13:46:41 +0200 +Subject: vdpa/mlx5: Restore cur_num_vqs in case of failure in change_num_qps() + +From: Eli Cohen + +commit 37e07e705888e4c3502f204e9c6785c9c2d6d86a upstream. + +Restore ndev->cur_num_vqs to the original value in case change_num_qps() +fails. + +Fixes: 52893733f2c5 ("vdpa/mlx5: Add multiqueue support") +Reviewed-by: Si-Wei Liu +Acked-by: Jason Wang +Signed-off-by: Eli Cohen +Link: https://lore.kernel.org/r/20220105114646.577224-10-elic@nvidia.com +Signed-off-by: Michael S. Tsirkin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/vdpa/mlx5/net/mlx5_vnet.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c ++++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c +@@ -1510,9 +1510,11 @@ static int change_num_qps(struct mlx5_vd + return 0; + + clean_added: +- for (--i; i >= cur_qps; --i) ++ for (--i; i >= 2 * cur_qps; --i) + teardown_vq(ndev, &ndev->vqs[i]); + ++ ndev->cur_num_vqs = 2 * cur_qps; ++ + return err; + } + diff --git a/queue-5.15/virtio_ring-mark-ring-unused-on-error.patch b/queue-5.15/virtio_ring-mark-ring-unused-on-error.patch new file mode 100644 index 00000000000..ee1d0851e2e --- /dev/null +++ b/queue-5.15/virtio_ring-mark-ring-unused-on-error.patch @@ -0,0 +1,38 @@ +From 1861ba626ae9b98136f3e504208cdef6b29cd3ec Mon Sep 17 00:00:00 2001 +From: "Michael S. Tsirkin" +Date: Thu, 6 Jan 2022 07:57:46 -0500 +Subject: virtio_ring: mark ring unused on error + +From: Michael S. Tsirkin + +commit 1861ba626ae9b98136f3e504208cdef6b29cd3ec upstream. + +A recently added error path does not mark ring unused when exiting on +OOM, which will lead to BUG on the next entry in debug builds. + +TODO: refactor code so we have START_USE and END_USE in the same function. + +Fixes: fc6d70f40b3d ("virtio_ring: check desc == NULL when using indirect with packed") +Cc: "Xuan Zhuo" +Cc: Jiasheng Jiang +Reviewed-by: Xuan Zhuo +Signed-off-by: Michael S. Tsirkin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/virtio/virtio_ring.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/virtio/virtio_ring.c ++++ b/drivers/virtio/virtio_ring.c +@@ -1197,8 +1197,10 @@ static inline int virtqueue_add_packed(s + if (virtqueue_use_indirect(_vq, total_sg)) { + err = virtqueue_add_indirect_packed(vq, sgs, total_sg, out_sgs, + in_sgs, data, gfp); +- if (err != -ENOMEM) ++ if (err != -ENOMEM) { ++ END_USE(vq); + return err; ++ } + + /* fall back on direct */ + } diff --git a/queue-5.15/xfrm-don-t-accidentally-set-rto_onlink-in-decode_session4.patch b/queue-5.15/xfrm-don-t-accidentally-set-rto_onlink-in-decode_session4.patch new file mode 100644 index 00000000000..cec498a7b08 --- /dev/null +++ b/queue-5.15/xfrm-don-t-accidentally-set-rto_onlink-in-decode_session4.patch @@ -0,0 +1,47 @@ +From 23e7b1bfed61e301853b5e35472820d919498278 Mon Sep 17 00:00:00 2001 +From: Guillaume Nault +Date: Mon, 10 Jan 2022 14:43:06 +0100 +Subject: xfrm: Don't accidentally set RTO_ONLINK in decode_session4() + +From: Guillaume Nault + +commit 23e7b1bfed61e301853b5e35472820d919498278 upstream. + +Similar to commit 94e2238969e8 ("xfrm4: strip ECN bits from tos field"), +clear the ECN bits from iph->tos when setting ->flowi4_tos. +This ensures that the last bit of ->flowi4_tos is cleared, so +ip_route_output_key_hash() isn't going to restrict the scope of the +route lookup. + +Use ~INET_ECN_MASK instead of IPTOS_RT_MASK, because we have no reason +to clear the high order bits. + +Found by code inspection, compile tested only. + +Fixes: 4da3089f2b58 ("[IPSEC]: Use TOS when doing tunnel lookups") +Signed-off-by: Guillaume Nault +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/xfrm/xfrm_policy.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/net/xfrm/xfrm_policy.c ++++ b/net/xfrm/xfrm_policy.c +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -3297,7 +3298,7 @@ decode_session4(struct sk_buff *skb, str + fl4->flowi4_proto = iph->protocol; + fl4->daddr = reverse ? iph->saddr : iph->daddr; + fl4->saddr = reverse ? iph->daddr : iph->saddr; +- fl4->flowi4_tos = iph->tos; ++ fl4->flowi4_tos = iph->tos & ~INET_ECN_MASK; + + if (!ip_is_fragment(iph)) { + switch (iph->protocol) {