From: Sasha Levin Date: Wed, 18 Jan 2023 20:22:19 +0000 (-0500) Subject: Fixes for 5.15 X-Git-Tag: v4.14.304~61 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=19e5334947538d94fea5521ef4cfd215ffa9c2f0;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.15 Signed-off-by: Sasha Levin --- diff --git a/queue-5.15/btrfs-always-report-error-in-run_one_delayed_ref.patch b/queue-5.15/btrfs-always-report-error-in-run_one_delayed_ref.patch new file mode 100644 index 00000000000..7861e04a542 --- /dev/null +++ b/queue-5.15/btrfs-always-report-error-in-run_one_delayed_ref.patch @@ -0,0 +1,80 @@ +From 6550b0c331861056d465df7c9b0d36049148db86 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Dec 2022 09:00:40 +0800 +Subject: btrfs: always report error in run_one_delayed_ref() + +From: Qu Wenruo + +[ Upstream commit 39f501d68ec1ed5cd5c66ac6ec2a7131c517bb92 ] + +Currently we have a btrfs_debug() for run_one_delayed_ref() failure, but +if end users hit such problem, there will be no chance that +btrfs_debug() is enabled. This can lead to very little useful info for +debugging. + +This patch will: + +- Add extra info for error reporting + Including: + * logical bytenr + * num_bytes + * type + * action + * ref_mod + +- Replace the btrfs_debug() with btrfs_err() + +- Move the error reporting into run_one_delayed_ref() + This is to avoid use-after-free, the @node can be freed in the caller. + +This error should only be triggered at most once. + +As if run_one_delayed_ref() failed, we trigger the error message, then +causing the call chain to error out: + +btrfs_run_delayed_refs() +`- btrfs_run_delayed_refs() + `- btrfs_run_delayed_refs_for_head() + `- run_one_delayed_ref() + +And we will abort the current transaction in btrfs_run_delayed_refs(). +If we have to run delayed refs for the abort transaction, +run_one_delayed_ref() will just cleanup the refs and do nothing, thus no +new error messages would be output. + +Reviewed-by: Anand Jain +Signed-off-by: Qu Wenruo +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + fs/btrfs/extent-tree.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c +index e72973f7c2cd..750c1ff9947d 100644 +--- a/fs/btrfs/extent-tree.c ++++ b/fs/btrfs/extent-tree.c +@@ -1717,6 +1717,11 @@ static int run_one_delayed_ref(struct btrfs_trans_handle *trans, + BUG(); + if (ret && insert_reserved) + btrfs_pin_extent(trans, node->bytenr, node->num_bytes, 1); ++ if (ret < 0) ++ btrfs_err(trans->fs_info, ++"failed to run delayed ref for logical %llu num_bytes %llu type %u action %u ref_mod %d: %d", ++ node->bytenr, node->num_bytes, node->type, ++ node->action, node->ref_mod, ret); + return ret; + } + +@@ -1955,8 +1960,6 @@ static int btrfs_run_delayed_refs_for_head(struct btrfs_trans_handle *trans, + if (ret) { + unselect_delayed_ref_head(delayed_refs, locked_ref); + btrfs_put_delayed_ref(ref); +- btrfs_debug(fs_info, "run_one_delayed_ref returned %d", +- ret); + return ret; + } + +-- +2.35.1 + diff --git a/queue-5.15/btrfs-fix-trace-event-name-typo-for-flush_delayed_re.patch b/queue-5.15/btrfs-fix-trace-event-name-typo-for-flush_delayed_re.patch new file mode 100644 index 00000000000..d631702bfb3 --- /dev/null +++ b/queue-5.15/btrfs-fix-trace-event-name-typo-for-flush_delayed_re.patch @@ -0,0 +1,37 @@ +From 561b504aeb02a609a42ad1d3838b3fa029e217f8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Dec 2022 11:06:07 +0900 +Subject: btrfs: fix trace event name typo for FLUSH_DELAYED_REFS + +From: Naohiro Aota + +[ Upstream commit 0a3212de8ab3e2ce5808c6265855e528d4a6767b ] + +Fix a typo of printing FLUSH_DELAYED_REFS event in flush_space() as +FLUSH_ELAYED_REFS. + +Reviewed-by: Johannes Thumshirn +Signed-off-by: Naohiro Aota +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + include/trace/events/btrfs.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h +index 8f58fd95efc7..9271b5dfae4c 100644 +--- a/include/trace/events/btrfs.h ++++ b/include/trace/events/btrfs.h +@@ -96,7 +96,7 @@ struct btrfs_space_info; + EM( FLUSH_DELALLOC_WAIT, "FLUSH_DELALLOC_WAIT") \ + EM( FLUSH_DELALLOC_FULL, "FLUSH_DELALLOC_FULL") \ + EM( FLUSH_DELAYED_REFS_NR, "FLUSH_DELAYED_REFS_NR") \ +- EM( FLUSH_DELAYED_REFS, "FLUSH_ELAYED_REFS") \ ++ EM( FLUSH_DELAYED_REFS, "FLUSH_DELAYED_REFS") \ + EM( ALLOC_CHUNK, "ALLOC_CHUNK") \ + EM( ALLOC_CHUNK_FORCE, "ALLOC_CHUNK_FORCE") \ + EM( RUN_DELAYED_IPUTS, "RUN_DELAYED_IPUTS") \ +-- +2.35.1 + diff --git a/queue-5.15/f2fs-let-s-avoid-panic-if-extent_tree-is-not-created.patch b/queue-5.15/f2fs-let-s-avoid-panic-if-extent_tree-is-not-created.patch new file mode 100644 index 00000000000..2abba299502 --- /dev/null +++ b/queue-5.15/f2fs-let-s-avoid-panic-if-extent_tree-is-not-created.patch @@ -0,0 +1,70 @@ +From 58d722fdd8a3fdb1f5921e2ce720f1b0cb726d69 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Dec 2022 16:14:10 -0800 +Subject: f2fs: let's avoid panic if extent_tree is not created + +From: Jaegeuk Kim + +[ Upstream commit df9d44b645b83fffccfb4e28c1f93376585fdec8 ] + +This patch avoids the below panic. + +pc : __lookup_extent_tree+0xd8/0x760 +lr : f2fs_do_write_data_page+0x104/0x87c +sp : ffffffc010cbb3c0 +x29: ffffffc010cbb3e0 x28: 0000000000000000 +x27: ffffff8803e7f020 x26: ffffff8803e7ed40 +x25: ffffff8803e7f020 x24: ffffffc010cbb460 +x23: ffffffc010cbb480 x22: 0000000000000000 +x21: 0000000000000000 x20: ffffffff22e90900 +x19: 0000000000000000 x18: ffffffc010c5d080 +x17: 0000000000000000 x16: 0000000000000020 +x15: ffffffdb1acdbb88 x14: ffffff888759e2b0 +x13: 0000000000000000 x12: ffffff802da49000 +x11: 000000000a001200 x10: ffffff8803e7ed40 +x9 : ffffff8023195800 x8 : ffffff802da49078 +x7 : 0000000000000001 x6 : 0000000000000000 +x5 : 0000000000000006 x4 : ffffffc010cbba28 +x3 : 0000000000000000 x2 : ffffffc010cbb480 +x1 : 0000000000000000 x0 : ffffff8803e7ed40 +Call trace: + __lookup_extent_tree+0xd8/0x760 + f2fs_do_write_data_page+0x104/0x87c + f2fs_write_single_data_page+0x420/0xb60 + f2fs_write_cache_pages+0x418/0xb1c + __f2fs_write_data_pages+0x428/0x58c + f2fs_write_data_pages+0x30/0x40 + do_writepages+0x88/0x190 + __writeback_single_inode+0x48/0x448 + writeback_sb_inodes+0x468/0x9e8 + __writeback_inodes_wb+0xb8/0x2a4 + wb_writeback+0x33c/0x740 + wb_do_writeback+0x2b4/0x400 + wb_workfn+0xe4/0x34c + process_one_work+0x24c/0x5bc + worker_thread+0x3e8/0xa50 + kthread+0x150/0x1b4 + +Signed-off-by: Jaegeuk Kim +Signed-off-by: Sasha Levin +--- + fs/f2fs/extent_cache.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c +index 761fd42c93f2..6a9ab5c11939 100644 +--- a/fs/f2fs/extent_cache.c ++++ b/fs/f2fs/extent_cache.c +@@ -415,7 +415,8 @@ static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs, + struct extent_node *en; + bool ret = false; + +- f2fs_bug_on(sbi, !et); ++ if (!et) ++ return false; + + trace_f2fs_lookup_extent_tree_start(inode, pgofs); + +-- +2.35.1 + diff --git a/queue-5.15/fbdev-omapfb-avoid-stack-overflow-warning.patch b/queue-5.15/fbdev-omapfb-avoid-stack-overflow-warning.patch new file mode 100644 index 00000000000..30bf66c0825 --- /dev/null +++ b/queue-5.15/fbdev-omapfb-avoid-stack-overflow-warning.patch @@ -0,0 +1,100 @@ +From 1fc7d5ee8df88bffbd6df05da044f63328819c5c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 15 Dec 2022 18:02:28 +0100 +Subject: fbdev: omapfb: avoid stack overflow warning + +From: Arnd Bergmann + +[ Upstream commit 634cf6ead93988b0da9ac054521ab63a3ba189db ] + +The dsi_irq_stats structure is a little too big to fit on the +stack of a 32-bit task, depending on the specific gcc options: + +fbdev/omap2/omapfb/dss/dsi.c: In function 'dsi_dump_dsidev_irqs': +fbdev/omap2/omapfb/dss/dsi.c:1621:1: error: the frame size of 1064 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] + +Since this is only a debugfs file, performance is not critical, +so just dynamically allocate it, and print an error message +in there in place of a failure code when the allocation fails. + +Signed-off-by: Arnd Bergmann +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 28 ++++++++++++++-------- + 1 file changed, 18 insertions(+), 10 deletions(-) + +diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c +index d43b081d592f..db84a662e8de 100644 +--- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c ++++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c +@@ -1538,22 +1538,28 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, + { + struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); + unsigned long flags; +- struct dsi_irq_stats stats; ++ struct dsi_irq_stats *stats; ++ ++ stats = kzalloc(sizeof(*stats), GFP_KERNEL); ++ if (!stats) { ++ seq_printf(s, "out of memory\n"); ++ return; ++ } + + spin_lock_irqsave(&dsi->irq_stats_lock, flags); + +- stats = dsi->irq_stats; ++ *stats = dsi->irq_stats; + memset(&dsi->irq_stats, 0, sizeof(dsi->irq_stats)); + dsi->irq_stats.last_reset = jiffies; + + spin_unlock_irqrestore(&dsi->irq_stats_lock, flags); + + seq_printf(s, "period %u ms\n", +- jiffies_to_msecs(jiffies - stats.last_reset)); ++ jiffies_to_msecs(jiffies - stats->last_reset)); + +- seq_printf(s, "irqs %d\n", stats.irq_count); ++ seq_printf(s, "irqs %d\n", stats->irq_count); + #define PIS(x) \ +- seq_printf(s, "%-20s %10d\n", #x, stats.dsi_irqs[ffs(DSI_IRQ_##x)-1]) ++ seq_printf(s, "%-20s %10d\n", #x, stats->dsi_irqs[ffs(DSI_IRQ_##x)-1]) + + seq_printf(s, "-- DSI%d interrupts --\n", dsi->module_id + 1); + PIS(VC0); +@@ -1577,10 +1583,10 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, + + #define PIS(x) \ + seq_printf(s, "%-20s %10d %10d %10d %10d\n", #x, \ +- stats.vc_irqs[0][ffs(DSI_VC_IRQ_##x)-1], \ +- stats.vc_irqs[1][ffs(DSI_VC_IRQ_##x)-1], \ +- stats.vc_irqs[2][ffs(DSI_VC_IRQ_##x)-1], \ +- stats.vc_irqs[3][ffs(DSI_VC_IRQ_##x)-1]); ++ stats->vc_irqs[0][ffs(DSI_VC_IRQ_##x)-1], \ ++ stats->vc_irqs[1][ffs(DSI_VC_IRQ_##x)-1], \ ++ stats->vc_irqs[2][ffs(DSI_VC_IRQ_##x)-1], \ ++ stats->vc_irqs[3][ffs(DSI_VC_IRQ_##x)-1]); + + seq_printf(s, "-- VC interrupts --\n"); + PIS(CS); +@@ -1596,7 +1602,7 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, + + #define PIS(x) \ + seq_printf(s, "%-20s %10d\n", #x, \ +- stats.cio_irqs[ffs(DSI_CIO_IRQ_##x)-1]); ++ stats->cio_irqs[ffs(DSI_CIO_IRQ_##x)-1]); + + seq_printf(s, "-- CIO interrupts --\n"); + PIS(ERRSYNCESC1); +@@ -1620,6 +1626,8 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, + PIS(ULPSACTIVENOT_ALL0); + PIS(ULPSACTIVENOT_ALL1); + #undef PIS ++ ++ kfree(stats); + } + + static void dsi1_dump_irqs(struct seq_file *s) +-- +2.35.1 + diff --git a/queue-5.15/net-ethtool-ioctl-return-eopnotsupp-if-we-have-no-ph.patch b/queue-5.15/net-ethtool-ioctl-return-eopnotsupp-if-we-have-no-ph.patch new file mode 100644 index 00000000000..82e37cd05c0 --- /dev/null +++ b/queue-5.15/net-ethtool-ioctl-return-eopnotsupp-if-we-have-no-ph.patch @@ -0,0 +1,38 @@ +From 6bbd2d3a59bd831f08c51dfa4bbf26431a6639cc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Dec 2022 14:48:23 +0300 +Subject: net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats + +From: Daniil Tatianin + +[ Upstream commit 9deb1e9fb88b1120a908676fa33bdf9e2eeaefce ] + +It's not very useful to copy back an empty ethtool_stats struct and +return 0 if we didn't actually have any stats. This also allows for +further simplification of this function in the future commits. + +Signed-off-by: Daniil Tatianin +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/ethtool/ioctl.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c +index 6991d77dcb2e..939c63d6e74b 100644 +--- a/net/ethtool/ioctl.c ++++ b/net/ethtool/ioctl.c +@@ -2074,7 +2074,8 @@ static int ethtool_get_phy_stats(struct net_device *dev, void __user *useraddr) + return n_stats; + if (n_stats > S32_MAX / sizeof(u64)) + return -ENOMEM; +- WARN_ON_ONCE(!n_stats); ++ if (WARN_ON_ONCE(!n_stats)) ++ return -EOPNOTSUPP; + + if (copy_from_user(&stats, useraddr, sizeof(stats))) + return -EFAULT; +-- +2.35.1 + diff --git a/queue-5.15/perf-x86-rapl-treat-tigerlake-like-icelake.patch b/queue-5.15/perf-x86-rapl-treat-tigerlake-like-icelake.patch new file mode 100644 index 00000000000..f8ff07909ef --- /dev/null +++ b/queue-5.15/perf-x86-rapl-treat-tigerlake-like-icelake.patch @@ -0,0 +1,40 @@ +From aa342ef449700168160b8da4e35e69a063f209b8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 28 Dec 2022 06:34:54 -0500 +Subject: perf/x86/rapl: Treat Tigerlake like Icelake + +From: Chris Wilson + +[ Upstream commit c07311b5509f6035f1dd828db3e90ff4859cf3b9 ] + +Since Tigerlake seems to have inherited its cstates and other RAPL power +caps from Icelake, assume it also follows Icelake for its RAPL events. + +Signed-off-by: Chris Wilson +Signed-off-by: Rodrigo Vivi +Signed-off-by: Ingo Molnar +Cc: Peter Zijlstra +Cc: Stephane Eranian +Cc: Zhang Rui +Link: https://lore.kernel.org/r/20221228113454.1199118-1-rodrigo.vivi@intel.com +Signed-off-by: Sasha Levin +--- + arch/x86/events/rapl.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c +index 77e3a47af5ad..840ee43e3e46 100644 +--- a/arch/x86/events/rapl.c ++++ b/arch/x86/events/rapl.c +@@ -804,6 +804,8 @@ static const struct x86_cpu_id rapl_model_match[] __initconst = { + X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X, &model_hsx), + X86_MATCH_INTEL_FAM6_MODEL(COMETLAKE_L, &model_skl), + X86_MATCH_INTEL_FAM6_MODEL(COMETLAKE, &model_skl), ++ X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE_L, &model_skl), ++ X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE, &model_skl), + X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE, &model_skl), + X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_L, &model_skl), + X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, &model_spr), +-- +2.35.1 + diff --git a/queue-5.15/pnfs-filelayout-fix-coalescing-test-for-single-ds.patch b/queue-5.15/pnfs-filelayout-fix-coalescing-test-for-single-ds.patch new file mode 100644 index 00000000000..8e503cbb4b2 --- /dev/null +++ b/queue-5.15/pnfs-filelayout-fix-coalescing-test-for-single-ds.patch @@ -0,0 +1,49 @@ +From e2f17f7d57113a2261eb37bd770d25e449077e9a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Dec 2022 12:31:29 -0500 +Subject: pNFS/filelayout: Fix coalescing test for single DS + +From: Olga Kornievskaia + +[ Upstream commit a6b9d2fa0024e7e399c26facd0fb466b7396e2b9 ] + +When there is a single DS no striping constraints need to be placed on +the IO. When such constraint is applied then buffered reads don't +coalesce to the DS's rsize. + +Signed-off-by: Olga Kornievskaia +Signed-off-by: Trond Myklebust +Signed-off-by: Sasha Levin +--- + fs/nfs/filelayout/filelayout.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c +index d2103852475f..45eec08ec904 100644 +--- a/fs/nfs/filelayout/filelayout.c ++++ b/fs/nfs/filelayout/filelayout.c +@@ -783,6 +783,12 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid, + return &fl->generic_hdr; + } + ++static bool ++filelayout_lseg_is_striped(const struct nfs4_filelayout_segment *flseg) ++{ ++ return flseg->num_fh > 1; ++} ++ + /* + * filelayout_pg_test(). Called by nfs_can_coalesce_requests() + * +@@ -803,6 +809,8 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, + size = pnfs_generic_pg_test(pgio, prev, req); + if (!size) + return 0; ++ else if (!filelayout_lseg_is_striped(FILELAYOUT_LSEG(pgio->pg_lseg))) ++ return size; + + /* see if req and prev are in the same stripe */ + if (prev) { +-- +2.35.1 + diff --git a/queue-5.15/r8169-move-rtl_wol_enable_rx-and-rtl_prepare_power_d.patch b/queue-5.15/r8169-move-rtl_wol_enable_rx-and-rtl_prepare_power_d.patch new file mode 100644 index 00000000000..4e212707585 --- /dev/null +++ b/queue-5.15/r8169-move-rtl_wol_enable_rx-and-rtl_prepare_power_d.patch @@ -0,0 +1,85 @@ +From 8fbe047fdb35ae333f8a7c0c4187cb52761aa8eb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Dec 2022 20:31:52 +0800 +Subject: r8169: move rtl_wol_enable_rx() and rtl_prepare_power_down() + +From: Chunhao Lin + +[ Upstream commit ad425666a1f05d9b215a84cf010c3789b2ea8206 ] + +There is no functional change. Moving these two functions for following +patch "r8169: fix dmar pte write access is not set error". + +Signed-off-by: Chunhao Lin +Reviewed-by: Heiner Kallweit +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/realtek/r8169_main.c | 44 +++++++++++------------ + 1 file changed, 22 insertions(+), 22 deletions(-) + +diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c +index 2af4c76bcf02..264bb3ec44a5 100644 +--- a/drivers/net/ethernet/realtek/r8169_main.c ++++ b/drivers/net/ethernet/realtek/r8169_main.c +@@ -2251,28 +2251,6 @@ static int rtl_set_mac_address(struct net_device *dev, void *p) + return 0; + } + +-static void rtl_wol_enable_rx(struct rtl8169_private *tp) +-{ +- if (tp->mac_version >= RTL_GIGA_MAC_VER_25) +- RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) | +- AcceptBroadcast | AcceptMulticast | AcceptMyPhys); +-} +- +-static void rtl_prepare_power_down(struct rtl8169_private *tp) +-{ +- if (tp->dash_type != RTL_DASH_NONE) +- return; +- +- if (tp->mac_version == RTL_GIGA_MAC_VER_32 || +- tp->mac_version == RTL_GIGA_MAC_VER_33) +- rtl_ephy_write(tp, 0x19, 0xff64); +- +- if (device_may_wakeup(tp_to_dev(tp))) { +- phy_speed_down(tp->phydev, false); +- rtl_wol_enable_rx(tp); +- } +-} +- + static void rtl_init_rxcfg(struct rtl8169_private *tp) + { + switch (tp->mac_version) { +@@ -2492,6 +2470,28 @@ static void rtl_enable_rxdvgate(struct rtl8169_private *tp) + rtl_wait_txrx_fifo_empty(tp); + } + ++static void rtl_wol_enable_rx(struct rtl8169_private *tp) ++{ ++ if (tp->mac_version >= RTL_GIGA_MAC_VER_25) ++ RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) | ++ AcceptBroadcast | AcceptMulticast | AcceptMyPhys); ++} ++ ++static void rtl_prepare_power_down(struct rtl8169_private *tp) ++{ ++ if (tp->dash_type != RTL_DASH_NONE) ++ return; ++ ++ if (tp->mac_version == RTL_GIGA_MAC_VER_32 || ++ tp->mac_version == RTL_GIGA_MAC_VER_33) ++ rtl_ephy_write(tp, 0x19, 0xff64); ++ ++ if (device_may_wakeup(tp_to_dev(tp))) { ++ phy_speed_down(tp->phydev, false); ++ rtl_wol_enable_rx(tp); ++ } ++} ++ + static void rtl_set_tx_config_registers(struct rtl8169_private *tp) + { + u32 val = TX_DMA_BURST << TxDMAShift | +-- +2.35.1 + diff --git a/queue-5.15/rdma-srp-move-large-values-to-a-new-enum-for-gcc13.patch b/queue-5.15/rdma-srp-move-large-values-to-a-new-enum-for-gcc13.patch new file mode 100644 index 00000000000..e23e38b976f --- /dev/null +++ b/queue-5.15/rdma-srp-move-large-values-to-a-new-enum-for-gcc13.patch @@ -0,0 +1,66 @@ +From be0d5304482d17f9d1db83a1f9a53dae62a7628f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 12 Dec 2022 13:04:11 +0100 +Subject: RDMA/srp: Move large values to a new enum for gcc13 + +From: Jiri Slaby (SUSE) + +[ Upstream commit 56c5dab20a6391604df9521f812c01d1e3fe1bd0 ] + +Since gcc13, each member of an enum has the same type as the enum [1]. And +that is inherited from its members. Provided these two: + SRP_TAG_NO_REQ = ~0U, + SRP_TAG_TSK_MGMT = 1U << 31 +all other members are unsigned ints. + +Esp. with SRP_MAX_SGE and SRP_TSK_MGMT_SQ_SIZE and their use in min(), +this results in the following warnings: + include/linux/minmax.h:20:35: error: comparison of distinct pointer types lacks a cast + drivers/infiniband/ulp/srp/ib_srp.c:563:42: note: in expansion of macro 'min' + + include/linux/minmax.h:20:35: error: comparison of distinct pointer types lacks a cast + drivers/infiniband/ulp/srp/ib_srp.c:2369:27: note: in expansion of macro 'min' + +So move the large values away to a separate enum, so that they don't +affect other members. + +[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113 + +Link: https://lore.kernel.org/r/20221212120411.13750-1-jirislaby@kernel.org +Signed-off-by: Jiri Slaby (SUSE) +Reviewed-by: Bart Van Assche +Signed-off-by: Leon Romanovsky +Signed-off-by: Sasha Levin +--- + drivers/infiniband/ulp/srp/ib_srp.h | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h +index abccddeea1e3..152242e8f733 100644 +--- a/drivers/infiniband/ulp/srp/ib_srp.h ++++ b/drivers/infiniband/ulp/srp/ib_srp.h +@@ -62,9 +62,6 @@ enum { + SRP_DEFAULT_CMD_SQ_SIZE = SRP_DEFAULT_QUEUE_SIZE - SRP_RSP_SQ_SIZE - + SRP_TSK_MGMT_SQ_SIZE, + +- SRP_TAG_NO_REQ = ~0U, +- SRP_TAG_TSK_MGMT = 1U << 31, +- + SRP_MAX_PAGES_PER_MR = 512, + + SRP_MAX_ADD_CDB_LEN = 16, +@@ -79,6 +76,11 @@ enum { + sizeof(struct srp_imm_buf), + }; + ++enum { ++ SRP_TAG_NO_REQ = ~0U, ++ SRP_TAG_TSK_MGMT = BIT(31), ++}; ++ + enum srp_target_state { + SRP_TARGET_SCANNING, + SRP_TARGET_LIVE, +-- +2.35.1 + diff --git a/queue-5.15/selftests-bpf-check-null-propagation-only-neither-re.patch b/queue-5.15/selftests-bpf-check-null-propagation-only-neither-re.patch new file mode 100644 index 00000000000..bd01d5666af --- /dev/null +++ b/queue-5.15/selftests-bpf-check-null-propagation-only-neither-re.patch @@ -0,0 +1,92 @@ +From 37a58a4c5b1ef0263639fb3c62445eb376e9ed21 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Dec 2022 10:44:14 +0800 +Subject: selftests/bpf: check null propagation only neither reg is + PTR_TO_BTF_ID + +From: Hao Sun + +[ Upstream commit cedebd74cf3883f0384af9ec26b4e6f8f1964dd4 ] + +Verify that nullness information is not porpagated in the branches +of register to register JEQ and JNE operations if one of them is +PTR_TO_BTF_ID. Implement this in C level so we can use CO-RE. + +Signed-off-by: Hao Sun +Suggested-by: Martin KaFai Lau +Link: https://lore.kernel.org/r/20221222024414.29539-2-sunhao.th@gmail.com +Signed-off-by: Martin KaFai Lau +Signed-off-by: Sasha Levin +--- + .../bpf/prog_tests/jeq_infer_not_null.c | 9 ++++ + .../bpf/progs/jeq_infer_not_null_fail.c | 42 +++++++++++++++++++ + 2 files changed, 51 insertions(+) + create mode 100644 tools/testing/selftests/bpf/prog_tests/jeq_infer_not_null.c + create mode 100644 tools/testing/selftests/bpf/progs/jeq_infer_not_null_fail.c + +diff --git a/tools/testing/selftests/bpf/prog_tests/jeq_infer_not_null.c b/tools/testing/selftests/bpf/prog_tests/jeq_infer_not_null.c +new file mode 100644 +index 000000000000..3add34df5767 +--- /dev/null ++++ b/tools/testing/selftests/bpf/prog_tests/jeq_infer_not_null.c +@@ -0,0 +1,9 @@ ++// SPDX-License-Identifier: GPL-2.0 ++ ++#include ++#include "jeq_infer_not_null_fail.skel.h" ++ ++void test_jeq_infer_not_null(void) ++{ ++ RUN_TESTS(jeq_infer_not_null_fail); ++} +diff --git a/tools/testing/selftests/bpf/progs/jeq_infer_not_null_fail.c b/tools/testing/selftests/bpf/progs/jeq_infer_not_null_fail.c +new file mode 100644 +index 000000000000..f46965053acb +--- /dev/null ++++ b/tools/testing/selftests/bpf/progs/jeq_infer_not_null_fail.c +@@ -0,0 +1,42 @@ ++// SPDX-License-Identifier: GPL-2.0 ++ ++#include "vmlinux.h" ++#include ++#include "bpf_misc.h" ++ ++char _license[] SEC("license") = "GPL"; ++ ++struct { ++ __uint(type, BPF_MAP_TYPE_HASH); ++ __uint(max_entries, 1); ++ __type(key, u64); ++ __type(value, u64); ++} m_hash SEC(".maps"); ++ ++SEC("?raw_tp") ++__failure __msg("R8 invalid mem access 'map_value_or_null") ++int jeq_infer_not_null_ptr_to_btfid(void *ctx) ++{ ++ struct bpf_map *map = (struct bpf_map *)&m_hash; ++ struct bpf_map *inner_map = map->inner_map_meta; ++ u64 key = 0, ret = 0, *val; ++ ++ val = bpf_map_lookup_elem(map, &key); ++ /* Do not mark ptr as non-null if one of them is ++ * PTR_TO_BTF_ID (R9), reject because of invalid ++ * access to map value (R8). ++ * ++ * Here, we need to inline those insns to access ++ * R8 directly, since compiler may use other reg ++ * once it figures out val==inner_map. ++ */ ++ asm volatile("r8 = %[val];\n" ++ "r9 = %[inner_map];\n" ++ "if r8 != r9 goto +1;\n" ++ "%[ret] = *(u64 *)(r8 +0);\n" ++ : [ret] "+r"(ret) ++ : [inner_map] "r"(inner_map), [val] "r"(val) ++ : "r8", "r9"); ++ ++ return ret; ++} +-- +2.35.1 + diff --git a/queue-5.15/series b/queue-5.15/series new file mode 100644 index 00000000000..6f05ebde471 --- /dev/null +++ b/queue-5.15/series @@ -0,0 +1,14 @@ +btrfs-fix-trace-event-name-typo-for-flush_delayed_re.patch +pnfs-filelayout-fix-coalescing-test-for-single-ds.patch +selftests-bpf-check-null-propagation-only-neither-re.patch +tools-virtio-initialize-spinlocks-in-vring_test.c.patch +virtio_pci-modify-enoent-to-einval.patch +vduse-validate-vq_num-in-vduse_validate_config.patch +net-ethtool-ioctl-return-eopnotsupp-if-we-have-no-ph.patch +r8169-move-rtl_wol_enable_rx-and-rtl_prepare_power_d.patch +rdma-srp-move-large-values-to-a-new-enum-for-gcc13.patch +btrfs-always-report-error-in-run_one_delayed_ref.patch +x86-asm-fix-an-assembler-warning-with-current-binuti.patch +f2fs-let-s-avoid-panic-if-extent_tree-is-not-created.patch +perf-x86-rapl-treat-tigerlake-like-icelake.patch +fbdev-omapfb-avoid-stack-overflow-warning.patch diff --git a/queue-5.15/tools-virtio-initialize-spinlocks-in-vring_test.c.patch b/queue-5.15/tools-virtio-initialize-spinlocks-in-vring_test.c.patch new file mode 100644 index 00000000000..4b10e04228e --- /dev/null +++ b/queue-5.15/tools-virtio-initialize-spinlocks-in-vring_test.c.patch @@ -0,0 +1,48 @@ +From 0d034da6985701b8c18bab6423107889772a3910 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 12 Oct 2022 08:29:49 +0200 +Subject: tools/virtio: initialize spinlocks in vring_test.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ricardo Cañuelo + +[ Upstream commit c262f75cb6bb5a63828e72ce3b8fe808e5029479 ] + +The virtio_device vqs_list spinlocks must be initialized before use to +prevent functions that manipulate the device virtualqueues, such as +vring_new_virtqueue(), from blocking indefinitely. + +Signed-off-by: Ricardo Cañuelo +Message-Id: <20221012062949.1526176-1-ricardo.canuelo@collabora.com> +Signed-off-by: Michael S. Tsirkin +Reviewed-by: Xuan Zhuo +Signed-off-by: Sasha Levin +--- + tools/virtio/vringh_test.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tools/virtio/vringh_test.c b/tools/virtio/vringh_test.c +index fa87b58bd5fa..98ff808d6f0c 100644 +--- a/tools/virtio/vringh_test.c ++++ b/tools/virtio/vringh_test.c +@@ -308,6 +308,7 @@ static int parallel_test(u64 features, + + gvdev.vdev.features = features; + INIT_LIST_HEAD(&gvdev.vdev.vqs); ++ spin_lock_init(&gvdev.vdev.vqs_list_lock); + gvdev.to_host_fd = to_host[1]; + gvdev.notifies = 0; + +@@ -455,6 +456,7 @@ int main(int argc, char *argv[]) + getrange = getrange_iov; + vdev.features = 0; + INIT_LIST_HEAD(&vdev.vqs); ++ spin_lock_init(&vdev.vqs_list_lock); + + while (argv[1]) { + if (strcmp(argv[1], "--indirect") == 0) +-- +2.35.1 + diff --git a/queue-5.15/vduse-validate-vq_num-in-vduse_validate_config.patch b/queue-5.15/vduse-validate-vq_num-in-vduse_validate_config.patch new file mode 100644 index 00000000000..55786297001 --- /dev/null +++ b/queue-5.15/vduse-validate-vq_num-in-vduse_validate_config.patch @@ -0,0 +1,48 @@ +From 139b1ac76679309d5ac1fbb05c175b1b9e11ec20 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 28 Nov 2022 07:57:15 -0800 +Subject: vduse: Validate vq_num in vduse_validate_config() + +From: Harshit Mogalapalli + +[ Upstream commit 937c783aa3d8d77963ec91918d3298edb45b9161 ] + +Add a limit to 'config->vq_num' which is user controlled data which +comes from an vduse_ioctl to prevent large memory allocations. + +Micheal says - This limit is somewhat arbitrary. +However, currently virtio pci and ccw are limited to a 16 bit vq number. +While MMIO isn't it is also isn't used with lots of VQs due to +current lack of support for per-vq interrupts. +Thus, the 0xffff limit on number of VQs corresponding +to a 16-bit VQ number seems sufficient for now. + +This is found using static analysis with smatch. + +Suggested-by: Michael S. Tsirkin +Signed-off-by: Harshit Mogalapalli +Message-Id: <20221128155717.2579992-1-harshit.m.mogalapalli@oracle.com> +Signed-off-by: Michael S. Tsirkin +Acked-by: Jason Wang +Signed-off-by: Sasha Levin +--- + drivers/vdpa/vdpa_user/vduse_dev.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c +index e7d2d5b7e125..3467c75f310a 100644 +--- a/drivers/vdpa/vdpa_user/vduse_dev.c ++++ b/drivers/vdpa/vdpa_user/vduse_dev.c +@@ -1251,6 +1251,9 @@ static bool vduse_validate_config(struct vduse_dev_config *config) + if (config->config_size > PAGE_SIZE) + return false; + ++ if (config->vq_num > 0xffff) ++ return false; ++ + if (!device_is_allowed(config->device_id)) + return false; + +-- +2.35.1 + diff --git a/queue-5.15/virtio_pci-modify-enoent-to-einval.patch b/queue-5.15/virtio_pci-modify-enoent-to-einval.patch new file mode 100644 index 00000000000..2475ff144fe --- /dev/null +++ b/queue-5.15/virtio_pci-modify-enoent-to-einval.patch @@ -0,0 +1,39 @@ +From 3b1016e07bd9eb8015d3e0e5099af606b0d59942 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 1 Nov 2022 19:16:54 +0800 +Subject: virtio_pci: modify ENOENT to EINVAL + +From: Angus Chen + +[ Upstream commit b66ead2d0ecac00c3a06a6218af5411cb5fcb5d5 ] + +Virtio_crypto use max_data_queues+1 to setup vqs, +we use vp_modern_get_num_queues to protect the vq range in setup_vq. +We could enter index >= vp_modern_get_num_queues(mdev) in setup_vq +if common->num_queues is not set well,and it return -ENOENT. +It is better to use -EINVAL instead. + +Signed-off-by: Angus Chen +Message-Id: <20221101111655.1947-1-angus.chen@jaguarmicro.com> +Signed-off-by: Michael S. Tsirkin +Signed-off-by: Sasha Levin +--- + drivers/virtio/virtio_pci_modern.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c +index 30654d3a0b41..a274261f36d6 100644 +--- a/drivers/virtio/virtio_pci_modern.c ++++ b/drivers/virtio/virtio_pci_modern.c +@@ -196,7 +196,7 @@ static struct virtqueue *setup_vq(struct virtio_pci_device *vp_dev, + int err; + + if (index >= vp_modern_get_num_queues(mdev)) +- return ERR_PTR(-ENOENT); ++ return ERR_PTR(-EINVAL); + + /* Check if queue is either not available or already active. */ + num = vp_modern_get_queue_size(mdev, index); +-- +2.35.1 + diff --git a/queue-5.15/x86-asm-fix-an-assembler-warning-with-current-binuti.patch b/queue-5.15/x86-asm-fix-an-assembler-warning-with-current-binuti.patch new file mode 100644 index 00000000000..dcd7d66e90f --- /dev/null +++ b/queue-5.15/x86-asm-fix-an-assembler-warning-with-current-binuti.patch @@ -0,0 +1,34 @@ +From dfa78506149b4076c36385572a31d5924a9fe3a0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Jan 2023 10:24:11 -0500 +Subject: x86/asm: Fix an assembler warning with current binutils + +From: Mikulas Patocka + +[ Upstream commit 55d235361fccef573990dfa5724ab453866e7816 ] + +Fix a warning: "found `movsd'; assuming `movsl' was meant" + +Signed-off-by: Mikulas Patocka +Signed-off-by: Ingo Molnar +Cc: linux-kernel@vger.kernel.org +Signed-off-by: Sasha Levin +--- + arch/x86/lib/iomap_copy_64.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/x86/lib/iomap_copy_64.S b/arch/x86/lib/iomap_copy_64.S +index a1f9416bf67a..6ff2f56cb0f7 100644 +--- a/arch/x86/lib/iomap_copy_64.S ++++ b/arch/x86/lib/iomap_copy_64.S +@@ -10,6 +10,6 @@ + */ + SYM_FUNC_START(__iowrite32_copy) + movl %edx,%ecx +- rep movsd ++ rep movsl + RET + SYM_FUNC_END(__iowrite32_copy) +-- +2.35.1 +