]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.18
authorSasha Levin <sashal@kernel.org>
Fri, 10 Jun 2022 12:34:52 +0000 (08:34 -0400)
committerSasha Levin <sashal@kernel.org>
Fri, 10 Jun 2022 12:34:52 +0000 (08:34 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
24 files changed:
queue-5.18/bootconfig-make-the-bootconfig.o-as-a-normal-object-.patch [new file with mode: 0644]
queue-5.18/dmaengine-idxd-set-dma_interrupt-cap-bit.patch [new file with mode: 0644]
queue-5.18/dmaengine-zynqmp_dma-in-struct-zynqmp_dma_chan-fix-d.patch [new file with mode: 0644]
queue-5.18/f2fs-avoid-infinite-loop-to-flush-node-pages.patch [new file with mode: 0644]
queue-5.18/f2fs-fix-to-tag-gcing-flag-on-page-during-file-defra.patch [new file with mode: 0644]
queue-5.18/f2fs-remove-warn_on-in-f2fs_is_valid_blkaddr.patch [new file with mode: 0644]
queue-5.18/i2c-cadence-increase-timeout-per-message-if-necessar.patch [new file with mode: 0644]
queue-5.18/i2c-mediatek-optimize-master_xfer-and-avoid-circular.patch [new file with mode: 0644]
queue-5.18/iommu-arm-smmu-fix-possible-null-ptr-deref-in-arm_sm.patch [new file with mode: 0644]
queue-5.18/iommu-arm-smmu-v3-check-return-value-after-calling-p.patch [new file with mode: 0644]
queue-5.18/m68knommu-fix-undefined-reference-to-_init_sp.patch [new file with mode: 0644]
queue-5.18/m68knommu-fix-undefined-reference-to-mach_get_rtc_pl.patch [new file with mode: 0644]
queue-5.18/m68knommu-set-zero_page-to-the-allocated-zeroed-page.patch [new file with mode: 0644]
queue-5.18/mips-cpc-fix-refcount-leak-in-mips_cpc_default_phys_.patch [new file with mode: 0644]
queue-5.18/nfsv4-don-t-hold-the-layoutget-locks-across-multiple.patch [new file with mode: 0644]
queue-5.18/risc-v-use-memcpy-for-kexec_file-mode.patch [new file with mode: 0644]
queue-5.18/rtla-makefile-properly-handle-dependencies.patch [new file with mode: 0644]
queue-5.18/series
queue-5.18/tracing-avoid-adding-tracer-option-before-update_tra.patch [new file with mode: 0644]
queue-5.18/tracing-fix-sleeping-function-called-from-invalid-co.patch [new file with mode: 0644]
queue-5.18/tracing-make-tp_printk-work-on-syscall-tracepoints.patch [new file with mode: 0644]
queue-5.18/video-fbdev-hyperv_fb-allow-resolutions-with-size-64.patch [new file with mode: 0644]
queue-5.18/video-fbdev-pxa3xx-gcu-release-the-resources-correct.patch [new file with mode: 0644]
queue-5.18/xprtrdma-treat-all-calls-not-a-bcall-when-bc_serv-is.patch [new file with mode: 0644]

diff --git a/queue-5.18/bootconfig-make-the-bootconfig.o-as-a-normal-object-.patch b/queue-5.18/bootconfig-make-the-bootconfig.o-as-a-normal-object-.patch
new file mode 100644 (file)
index 0000000..3659c37
--- /dev/null
@@ -0,0 +1,45 @@
+From 913be6e94a2381db06888065f09fd47f96858aa0 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 6 Apr 2022 11:30:59 +0900
+Subject: bootconfig: Make the bootconfig.o as a normal object file
+
+From: Masami Hiramatsu <mhiramat@kernel.org>
+
+[ Upstream commit 6014a23638cdee63a71ef13c51d7c563eb5829ee ]
+
+Since the APIs defined in the bootconfig.o are not individually used,
+it is meaningless to build it as library by lib-y. Use obj-y for that.
+
+Link: https://lkml.kernel.org/r/164921225875.1090670.15565363126983098971.stgit@devnote2
+
+Cc: Padmanabha Srinivasaiah <treasure4paddy@gmail.com>
+Cc: Jonathan Corbet <corbet@lwn.net>
+Cc: Randy Dunlap <rdunlap@infradead.org>
+Cc: Nick Desaulniers <ndesaulniers@google.com>
+Cc: Sami Tolvanen <samitolvanen@google.com>
+Cc: Nathan Chancellor <nathan@kernel.org>
+Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
+Reported-by: Masahiro Yamada <masahiroy@kernel.org>
+Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
+Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ lib/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index 6b9ffc1bd1ee..08053df16c7c 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -279,7 +279,7 @@ $(foreach file, $(libfdt_files), \
+       $(eval CFLAGS_$(file) = -I $(srctree)/scripts/dtc/libfdt))
+ lib-$(CONFIG_LIBFDT) += $(libfdt_files)
+-lib-$(CONFIG_BOOT_CONFIG) += bootconfig.o
++obj-$(CONFIG_BOOT_CONFIG) += bootconfig.o
+ obj-$(CONFIG_RBTREE_TEST) += rbtree_test.o
+ obj-$(CONFIG_INTERVAL_TREE_TEST) += interval_tree_test.o
+-- 
+2.35.1
+
diff --git a/queue-5.18/dmaengine-idxd-set-dma_interrupt-cap-bit.patch b/queue-5.18/dmaengine-idxd-set-dma_interrupt-cap-bit.patch
new file mode 100644 (file)
index 0000000..92be46a
--- /dev/null
@@ -0,0 +1,37 @@
+From b957d786a79ecbe5bffeab4456bd0ee92357a50f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 11 Apr 2022 15:09:38 -0700
+Subject: dmaengine: idxd: set DMA_INTERRUPT cap bit
+
+From: Dave Jiang <dave.jiang@intel.com>
+
+[ Upstream commit 4e5a4eb20393b851590b4465f1197a8041c2076b ]
+
+Even though idxd driver has always supported interrupt, it never actually
+set the DMA_INTERRUPT cap bit. Rectify this mistake so the interrupt
+capability is advertised.
+
+Reported-by: Ben Walker <benjamin.walker@intel.com>
+Signed-off-by: Dave Jiang <dave.jiang@intel.com>
+Link: https://lore.kernel.org/r/164971497859.2201379.17925303210723708961.stgit@djiang5-desk3.ch.intel.com
+Signed-off-by: Vinod Koul <vkoul@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/dma/idxd/dma.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/dma/idxd/dma.c b/drivers/dma/idxd/dma.c
+index bfff59617d04..13e061944db9 100644
+--- a/drivers/dma/idxd/dma.c
++++ b/drivers/dma/idxd/dma.c
+@@ -193,6 +193,7 @@ int idxd_register_dma_device(struct idxd_device *idxd)
+       INIT_LIST_HEAD(&dma->channels);
+       dma->dev = dev;
++      dma_cap_set(DMA_INTERRUPT, dma->cap_mask);
+       dma_cap_set(DMA_PRIVATE, dma->cap_mask);
+       dma_cap_set(DMA_COMPLETION_NO_ORDER, dma->cap_mask);
+       dma->device_release = idxd_dma_release;
+-- 
+2.35.1
+
diff --git a/queue-5.18/dmaengine-zynqmp_dma-in-struct-zynqmp_dma_chan-fix-d.patch b/queue-5.18/dmaengine-zynqmp_dma-in-struct-zynqmp_dma_chan-fix-d.patch
new file mode 100644 (file)
index 0000000..aaf8e0b
--- /dev/null
@@ -0,0 +1,64 @@
+From 5ee9f5528f380acb0391920117232ee461979e39 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 10 May 2022 12:42:40 +0530
+Subject: dmaengine: zynqmp_dma: In struct zynqmp_dma_chan fix desc_size data
+ type
+
+From: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
+
+[ Upstream commit f9a9f43a62a04ec3183fb0da9226c7706eed0115 ]
+
+In zynqmp_dma_alloc/free_chan_resources functions there is a
+potential overflow in the below expressions.
+
+dma_alloc_coherent(chan->dev, (2 * chan->desc_size *
+                  ZYNQMP_DMA_NUM_DESCS),
+                  &chan->desc_pool_p, GFP_KERNEL);
+
+dma_free_coherent(chan->dev,(2 * ZYNQMP_DMA_DESC_SIZE(chan) *
+                 ZYNQMP_DMA_NUM_DESCS),
+                chan->desc_pool_v, chan->desc_pool_p);
+
+The arguments desc_size and ZYNQMP_DMA_NUM_DESCS were 32 bit. Though
+this overflow condition is not observed but it is a potential problem
+in the case of 32-bit multiplication. Hence fix it by changing the
+desc_size data type to size_t.
+
+In addition to coverity fix it also reuse ZYNQMP_DMA_DESC_SIZE macro in
+dma_alloc_coherent API argument.
+
+Addresses-Coverity: Event overflow_before_widen.
+Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
+Link: https://lore.kernel.org/r/1652166762-18317-2-git-send-email-radhey.shyam.pandey@xilinx.com
+Signed-off-by: Vinod Koul <vkoul@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/dma/xilinx/zynqmp_dma.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
+index 7aa63b652027..3ffa7f37c701 100644
+--- a/drivers/dma/xilinx/zynqmp_dma.c
++++ b/drivers/dma/xilinx/zynqmp_dma.c
+@@ -229,7 +229,7 @@ struct zynqmp_dma_chan {
+       bool is_dmacoherent;
+       struct tasklet_struct tasklet;
+       bool idle;
+-      u32 desc_size;
++      size_t desc_size;
+       bool err;
+       u32 bus_width;
+       u32 src_burst_len;
+@@ -486,7 +486,8 @@ static int zynqmp_dma_alloc_chan_resources(struct dma_chan *dchan)
+       }
+       chan->desc_pool_v = dma_alloc_coherent(chan->dev,
+-                                             (2 * chan->desc_size * ZYNQMP_DMA_NUM_DESCS),
++                                             (2 * ZYNQMP_DMA_DESC_SIZE(chan) *
++                                             ZYNQMP_DMA_NUM_DESCS),
+                                              &chan->desc_pool_p, GFP_KERNEL);
+       if (!chan->desc_pool_v)
+               return -ENOMEM;
+-- 
+2.35.1
+
diff --git a/queue-5.18/f2fs-avoid-infinite-loop-to-flush-node-pages.patch b/queue-5.18/f2fs-avoid-infinite-loop-to-flush-node-pages.patch
new file mode 100644 (file)
index 0000000..8a33bca
--- /dev/null
@@ -0,0 +1,179 @@
+From be62271fa94b89ffe14a38d457aeeb691a5d801d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 29 Mar 2022 16:25:54 -0700
+Subject: f2fs: avoid infinite loop to flush node pages
+
+From: Jaegeuk Kim <jaegeuk@kernel.org>
+
+[ Upstream commit a7b8618aa2f0f926ce85f2486ac835a85c753ca7 ]
+
+xfstests/generic/475 can give EIO all the time which give an infinite loop
+to flush node page like below. Let's avoid it.
+
+[16418.518551] Call Trace:
+[16418.518553]  ? dm_submit_bio+0x48/0x400
+[16418.518574]  ? submit_bio_checks+0x1ac/0x5a0
+[16418.525207]  __submit_bio+0x1a9/0x230
+[16418.525210]  ? kmem_cache_alloc+0x29e/0x3c0
+[16418.525223]  submit_bio_noacct+0xa8/0x2b0
+[16418.525226]  submit_bio+0x4d/0x130
+[16418.525238]  __submit_bio+0x49/0x310 [f2fs]
+[16418.525339]  ? bio_add_page+0x6a/0x90
+[16418.525344]  f2fs_submit_page_bio+0x134/0x1f0 [f2fs]
+[16418.525365]  read_node_page+0x125/0x1b0 [f2fs]
+[16418.525388]  __get_node_page.part.0+0x58/0x3f0 [f2fs]
+[16418.525409]  __get_node_page+0x2f/0x60 [f2fs]
+[16418.525431]  f2fs_get_dnode_of_data+0x423/0x860 [f2fs]
+[16418.525452]  ? asm_sysvec_apic_timer_interrupt+0x12/0x20
+[16418.525458]  ? __mod_memcg_state.part.0+0x2a/0x30
+[16418.525465]  ? __mod_memcg_lruvec_state+0x27/0x40
+[16418.525467]  ? __xa_set_mark+0x57/0x70
+[16418.525472]  f2fs_do_write_data_page+0x10e/0x7b0 [f2fs]
+[16418.525493]  f2fs_write_single_data_page+0x555/0x830 [f2fs]
+[16418.525514]  ? sysvec_apic_timer_interrupt+0x4e/0x90
+[16418.525518]  ? asm_sysvec_apic_timer_interrupt+0x12/0x20
+[16418.525523]  f2fs_write_cache_pages+0x303/0x880 [f2fs]
+[16418.525545]  ? blk_flush_plug_list+0x47/0x100
+[16418.525548]  f2fs_write_data_pages+0xfd/0x320 [f2fs]
+[16418.525569]  do_writepages+0xd5/0x210
+[16418.525648]  filemap_fdatawrite_wbc+0x7d/0xc0
+[16418.525655]  filemap_fdatawrite+0x50/0x70
+[16418.525658]  f2fs_sync_dirty_inodes+0xa4/0x230 [f2fs]
+[16418.525679]  f2fs_write_checkpoint+0x16d/0x1720 [f2fs]
+[16418.525699]  ? ttwu_do_wakeup+0x1c/0x160
+[16418.525709]  ? ttwu_do_activate+0x6d/0xd0
+[16418.525711]  ? __wait_for_common+0x11d/0x150
+[16418.525715]  kill_f2fs_super+0xca/0x100 [f2fs]
+[16418.525733]  deactivate_locked_super+0x3b/0xb0
+[16418.525739]  deactivate_super+0x40/0x50
+[16418.525741]  cleanup_mnt+0x139/0x190
+[16418.525747]  __cleanup_mnt+0x12/0x20
+[16418.525749]  task_work_run+0x6d/0xa0
+[16418.525765]  exit_to_user_mode_prepare+0x1ad/0x1b0
+[16418.525771]  syscall_exit_to_user_mode+0x27/0x50
+[16418.525774]  do_syscall_64+0x48/0xc0
+[16418.525776]  entry_SYSCALL_64_after_hwframe+0x44/0xae
+
+Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/f2fs/checkpoint.c |  8 +-------
+ fs/f2fs/f2fs.h       | 23 +++++++++++++++++++----
+ fs/f2fs/node.c       | 23 ++++++++++++-----------
+ 3 files changed, 32 insertions(+), 22 deletions(-)
+
+diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
+index 71b1e93cbe0c..beceac9885c3 100644
+--- a/fs/f2fs/checkpoint.c
++++ b/fs/f2fs/checkpoint.c
+@@ -98,13 +98,7 @@ static struct page *__get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index,
+       }
+       if (unlikely(!PageUptodate(page))) {
+-              if (page->index == sbi->metapage_eio_ofs) {
+-                      if (sbi->metapage_eio_cnt++ == MAX_RETRY_META_PAGE_EIO)
+-                              set_ckpt_flags(sbi, CP_ERROR_FLAG);
+-              } else {
+-                      sbi->metapage_eio_ofs = page->index;
+-                      sbi->metapage_eio_cnt = 0;
+-              }
++              f2fs_handle_page_eio(sbi, page->index, META);
+               f2fs_put_page(page, 1);
+               return ERR_PTR(-EIO);
+       }
+diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
+index 6ec8c6d4711f..9b89f26af1f3 100644
+--- a/fs/f2fs/f2fs.h
++++ b/fs/f2fs/f2fs.h
+@@ -578,8 +578,8 @@ enum {
+ /* maximum retry quota flush count */
+ #define DEFAULT_RETRY_QUOTA_FLUSH_COUNT               8
+-/* maximum retry of EIO'ed meta page */
+-#define MAX_RETRY_META_PAGE_EIO                       100
++/* maximum retry of EIO'ed page */
++#define MAX_RETRY_PAGE_EIO                    100
+ #define F2FS_LINK_MAX 0xffffffff      /* maximum link count per file */
+@@ -1614,8 +1614,8 @@ struct f2fs_sb_info {
+       /* keep migration IO order for LFS mode */
+       struct f2fs_rwsem io_order_lock;
+       mempool_t *write_io_dummy;              /* Dummy pages */
+-      pgoff_t metapage_eio_ofs;               /* EIO page offset */
+-      int metapage_eio_cnt;                   /* EIO count */
++      pgoff_t page_eio_ofs[NR_PAGE_TYPE];     /* EIO page offset */
++      int page_eio_cnt[NR_PAGE_TYPE];         /* EIO count */
+       /* for checkpoint */
+       struct f2fs_checkpoint *ckpt;           /* raw checkpoint pointer */
+@@ -4541,6 +4541,21 @@ static inline void f2fs_io_schedule_timeout(long timeout)
+       io_schedule_timeout(timeout);
+ }
++static inline void f2fs_handle_page_eio(struct f2fs_sb_info *sbi, pgoff_t ofs,
++                                      enum page_type type)
++{
++      if (unlikely(f2fs_cp_error(sbi)))
++              return;
++
++      if (ofs == sbi->page_eio_ofs[type]) {
++              if (sbi->page_eio_cnt[type]++ == MAX_RETRY_PAGE_EIO)
++                      set_ckpt_flags(sbi, CP_ERROR_FLAG);
++      } else {
++              sbi->page_eio_ofs[type] = ofs;
++              sbi->page_eio_cnt[type] = 0;
++      }
++}
++
+ #define EFSBADCRC     EBADMSG         /* Bad CRC detected */
+ #define EFSCORRUPTED  EUCLEAN         /* Filesystem is corrupted */
+diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
+index c45d341dcf6e..a8d0fa2731cb 100644
+--- a/fs/f2fs/node.c
++++ b/fs/f2fs/node.c
+@@ -1416,8 +1416,7 @@ static struct page *__get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid,
+       err = read_node_page(page, 0);
+       if (err < 0) {
+-              f2fs_put_page(page, 1);
+-              return ERR_PTR(err);
++              goto out_put_err;
+       } else if (err == LOCKED_PAGE) {
+               err = 0;
+               goto page_hit;
+@@ -1443,19 +1442,21 @@ static struct page *__get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid,
+               goto out_err;
+       }
+ page_hit:
+-      if (unlikely(nid != nid_of_node(page))) {
+-              f2fs_warn(sbi, "inconsistent node block, nid:%lu, node_footer[nid:%u,ino:%u,ofs:%u,cpver:%llu,blkaddr:%u]",
++      if (likely(nid == nid_of_node(page)))
++              return page;
++
++      f2fs_warn(sbi, "inconsistent node block, nid:%lu, node_footer[nid:%u,ino:%u,ofs:%u,cpver:%llu,blkaddr:%u]",
+                         nid, nid_of_node(page), ino_of_node(page),
+                         ofs_of_node(page), cpver_of_node(page),
+                         next_blkaddr_of_node(page));
+-              set_sbi_flag(sbi, SBI_NEED_FSCK);
+-              err = -EINVAL;
++      set_sbi_flag(sbi, SBI_NEED_FSCK);
++      err = -EINVAL;
+ out_err:
+-              ClearPageUptodate(page);
+-              f2fs_put_page(page, 1);
+-              return ERR_PTR(err);
+-      }
+-      return page;
++      ClearPageUptodate(page);
++out_put_err:
++      f2fs_handle_page_eio(sbi, page->index, NODE);
++      f2fs_put_page(page, 1);
++      return ERR_PTR(err);
+ }
+ struct page *f2fs_get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid)
+-- 
+2.35.1
+
diff --git a/queue-5.18/f2fs-fix-to-tag-gcing-flag-on-page-during-file-defra.patch b/queue-5.18/f2fs-fix-to-tag-gcing-flag-on-page-during-file-defra.patch
new file mode 100644 (file)
index 0000000..2b46feb
--- /dev/null
@@ -0,0 +1,35 @@
+From 4f2028ef1c81581a053eacd787102e5a3e0d6789 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 27 May 2022 12:13:30 +0800
+Subject: f2fs: fix to tag gcing flag on page during file defragment
+
+From: Chao Yu <chao@kernel.org>
+
+[ Upstream commit 2d1fe8a86bf5e0663866fd0da83c2af1e1b0e362 ]
+
+In order to garantee migrated data be persisted during checkpoint,
+otherwise out-of-order persistency between data and node may cause
+data corruption after SPOR.
+
+Signed-off-by: Chao Yu <chao.yu@oppo.com>
+Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/f2fs/file.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
+index 176e97b985e6..5d1b97e852e7 100644
+--- a/fs/f2fs/file.c
++++ b/fs/f2fs/file.c
+@@ -2687,6 +2687,7 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi,
+                       }
+                       set_page_dirty(page);
++                      set_page_private_gcing(page);
+                       f2fs_put_page(page, 1);
+                       idx++;
+-- 
+2.35.1
+
diff --git a/queue-5.18/f2fs-remove-warn_on-in-f2fs_is_valid_blkaddr.patch b/queue-5.18/f2fs-remove-warn_on-in-f2fs_is_valid_blkaddr.patch
new file mode 100644 (file)
index 0000000..bd2b11d
--- /dev/null
@@ -0,0 +1,60 @@
+From 58e282d210c8fda9a4fb9a6da2a52211f8803a9f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 15 Apr 2022 21:19:02 +0800
+Subject: f2fs: remove WARN_ON in f2fs_is_valid_blkaddr
+
+From: Dongliang Mu <mudongliangabcd@gmail.com>
+
+[ Upstream commit dc2f78e2d4cc844a1458653d57ce1b54d4a29f21 ]
+
+Syzbot triggers two WARNs in f2fs_is_valid_blkaddr and
+__is_bitmap_valid. For example, in f2fs_is_valid_blkaddr,
+if type is DATA_GENERIC_ENHANCE or DATA_GENERIC_ENHANCE_READ,
+it invokes WARN_ON if blkaddr is not in the right range.
+The call trace is as follows:
+
+ f2fs_get_node_info+0x45f/0x1070
+ read_node_page+0x577/0x1190
+ __get_node_page.part.0+0x9e/0x10e0
+ __get_node_page
+ f2fs_get_node_page+0x109/0x180
+ do_read_inode
+ f2fs_iget+0x2a5/0x58b0
+ f2fs_fill_super+0x3b39/0x7ca0
+
+Fix these two WARNs by replacing WARN_ON with dump_stack.
+
+Reported-by: syzbot+763ae12a2ede1d99d4dc@syzkaller.appspotmail.com
+Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
+Reviewed-by: Chao Yu <chao@kernel.org>
+Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/f2fs/checkpoint.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
+index 909085a78f9c..71b1e93cbe0c 100644
+--- a/fs/f2fs/checkpoint.c
++++ b/fs/f2fs/checkpoint.c
+@@ -158,7 +158,7 @@ static bool __is_bitmap_valid(struct f2fs_sb_info *sbi, block_t blkaddr,
+               f2fs_err(sbi, "Inconsistent error blkaddr:%u, sit bitmap:%d",
+                        blkaddr, exist);
+               set_sbi_flag(sbi, SBI_NEED_FSCK);
+-              WARN_ON(1);
++              dump_stack();
+       }
+       return exist;
+ }
+@@ -196,7 +196,7 @@ bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
+                       f2fs_warn(sbi, "access invalid blkaddr:%u",
+                                 blkaddr);
+                       set_sbi_flag(sbi, SBI_NEED_FSCK);
+-                      WARN_ON(1);
++                      dump_stack();
+                       return false;
+               } else {
+                       return __is_bitmap_valid(sbi, blkaddr, type);
+-- 
+2.35.1
+
diff --git a/queue-5.18/i2c-cadence-increase-timeout-per-message-if-necessar.patch b/queue-5.18/i2c-cadence-increase-timeout-per-message-if-necessar.patch
new file mode 100644 (file)
index 0000000..0f30168
--- /dev/null
@@ -0,0 +1,64 @@
+From ba456533de590505aadc964d0fdfd1e376fed3d3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 13 Apr 2022 10:14:10 +0100
+Subject: i2c: cadence: Increase timeout per message if necessary
+
+From: Lucas Tanure <tanureal@opensource.cirrus.com>
+
+[ Upstream commit 96789dce043f5bff8b7d62aa28d52a7c59403a84 ]
+
+Timeout as 1 second sets an upper limit on the length
+of the transfer executed, but there is no maximum length
+of a write or read message set in i2c_adapter_quirks for
+this controller.
+
+This upper limit affects devices that require sending
+large firmware blobs over I2C.
+
+To remove that limitation, calculate the minimal time
+necessary, plus some wiggle room, for every message and
+use it instead of the default one second, if more than
+one second.
+
+Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
+Acked-by: Michal Simek <michal.simek@xilinx.com>
+Signed-off-by: Wolfram Sang <wsa@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/i2c/busses/i2c-cadence.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
+index 805c77143a0f..b4c1ad19cdae 100644
+--- a/drivers/i2c/busses/i2c-cadence.c
++++ b/drivers/i2c/busses/i2c-cadence.c
+@@ -760,7 +760,7 @@ static void cdns_i2c_master_reset(struct i2c_adapter *adap)
+ static int cdns_i2c_process_msg(struct cdns_i2c *id, struct i2c_msg *msg,
+               struct i2c_adapter *adap)
+ {
+-      unsigned long time_left;
++      unsigned long time_left, msg_timeout;
+       u32 reg;
+       id->p_msg = msg;
+@@ -785,8 +785,16 @@ static int cdns_i2c_process_msg(struct cdns_i2c *id, struct i2c_msg *msg,
+       else
+               cdns_i2c_msend(id);
++      /* Minimal time to execute this message */
++      msg_timeout = msecs_to_jiffies((1000 * msg->len * BITS_PER_BYTE) / id->i2c_clk);
++      /* Plus some wiggle room */
++      msg_timeout += msecs_to_jiffies(500);
++
++      if (msg_timeout < adap->timeout)
++              msg_timeout = adap->timeout;
++
+       /* Wait for the signal of completion */
+-      time_left = wait_for_completion_timeout(&id->xfer_done, adap->timeout);
++      time_left = wait_for_completion_timeout(&id->xfer_done, msg_timeout);
+       if (time_left == 0) {
+               cdns_i2c_master_reset(adap);
+               dev_err(id->adap.dev.parent,
+-- 
+2.35.1
+
diff --git a/queue-5.18/i2c-mediatek-optimize-master_xfer-and-avoid-circular.patch b/queue-5.18/i2c-mediatek-optimize-master_xfer-and-avoid-circular.patch
new file mode 100644 (file)
index 0000000..2d1987c
--- /dev/null
@@ -0,0 +1,110 @@
+From 314afaaf292d1bc6d16c647b47655a2bd0681077 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 11 Apr 2022 15:21:07 +0200
+Subject: i2c: mediatek: Optimize master_xfer() and avoid circular locking
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
+
+[ Upstream commit 8b4fc246c3fffde96835b2f6d5d0e2a56c70d8f9 ]
+
+Especially (but not only) during probe, it may happen that multiple
+devices are communicating via i2c (or multiple i2c busses) and
+sometimes while others are probing asynchronously.
+For example, a Cr50 TPM may be filling entropy (or userspace may be
+reading random data) while the rt5682 (i2c) codec driver reads/sets
+some registers, like while getting/setting a clock's rate, which
+happens both during probe and during system operation.
+
+In this driver, the mtk_i2c_transfer() function (which is the i2c
+.master_xfer() callback) was granularly managing the clocks by
+performing a clk_bulk_prepare_enable() to start them and its inverse.
+This is not only creating possible circular locking dependencies in
+the some cases (like former explanation), but it's also suboptimal,
+as clk_core prepare/unprepare operations are using mutex locking,
+which creates a bit of unwanted overhead (for example, i2c trackpads
+will call master_xfer() every few milliseconds!).
+
+With this commit, we avoid both the circular locking and additional
+overhead by changing how we handle the clocks in this driver:
+- Prepare the clocks during probe (and PM resume)
+- Enable/disable clocks in mtk_i2c_transfer()
+- Unprepare the clocks only for driver removal (and PM suspend)
+
+For the sake of providing a full explanation: during probe, the
+clocks are not only prepared but also enabled, as this is needed
+for some hardware initialization but, after that, we are disabling
+but not unpreparing them, leaving an expected state for the
+aforementioned clock handling strategy.
+
+Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
+Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
+Reviewed-by: Qii Wang <qii.wang@mediatek.com>
+Signed-off-by: Wolfram Sang <wsa@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/i2c/busses/i2c-mt65xx.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
+index f651d3e124d6..bdecb78bfc26 100644
+--- a/drivers/i2c/busses/i2c-mt65xx.c
++++ b/drivers/i2c/busses/i2c-mt65xx.c
+@@ -1177,7 +1177,7 @@ static int mtk_i2c_transfer(struct i2c_adapter *adap,
+       int left_num = num;
+       struct mtk_i2c *i2c = i2c_get_adapdata(adap);
+-      ret = clk_bulk_prepare_enable(I2C_MT65XX_CLK_MAX, i2c->clocks);
++      ret = clk_bulk_enable(I2C_MT65XX_CLK_MAX, i2c->clocks);
+       if (ret)
+               return ret;
+@@ -1231,7 +1231,7 @@ static int mtk_i2c_transfer(struct i2c_adapter *adap,
+       ret = num;
+ err_exit:
+-      clk_bulk_disable_unprepare(I2C_MT65XX_CLK_MAX, i2c->clocks);
++      clk_bulk_disable(I2C_MT65XX_CLK_MAX, i2c->clocks);
+       return ret;
+ }
+@@ -1412,7 +1412,7 @@ static int mtk_i2c_probe(struct platform_device *pdev)
+               return ret;
+       }
+       mtk_i2c_init_hw(i2c);
+-      clk_bulk_disable_unprepare(I2C_MT65XX_CLK_MAX, i2c->clocks);
++      clk_bulk_disable(I2C_MT65XX_CLK_MAX, i2c->clocks);
+       ret = devm_request_irq(&pdev->dev, irq, mtk_i2c_irq,
+                              IRQF_NO_SUSPEND | IRQF_TRIGGER_NONE,
+@@ -1439,6 +1439,8 @@ static int mtk_i2c_remove(struct platform_device *pdev)
+       i2c_del_adapter(&i2c->adap);
++      clk_bulk_unprepare(I2C_MT65XX_CLK_MAX, i2c->clocks);
++
+       return 0;
+ }
+@@ -1448,6 +1450,7 @@ static int mtk_i2c_suspend_noirq(struct device *dev)
+       struct mtk_i2c *i2c = dev_get_drvdata(dev);
+       i2c_mark_adapter_suspended(&i2c->adap);
++      clk_bulk_unprepare(I2C_MT65XX_CLK_MAX, i2c->clocks);
+       return 0;
+ }
+@@ -1465,7 +1468,7 @@ static int mtk_i2c_resume_noirq(struct device *dev)
+       mtk_i2c_init_hw(i2c);
+-      clk_bulk_disable_unprepare(I2C_MT65XX_CLK_MAX, i2c->clocks);
++      clk_bulk_disable(I2C_MT65XX_CLK_MAX, i2c->clocks);
+       i2c_mark_adapter_resumed(&i2c->adap);
+-- 
+2.35.1
+
diff --git a/queue-5.18/iommu-arm-smmu-fix-possible-null-ptr-deref-in-arm_sm.patch b/queue-5.18/iommu-arm-smmu-fix-possible-null-ptr-deref-in-arm_sm.patch
new file mode 100644 (file)
index 0000000..f8347dc
--- /dev/null
@@ -0,0 +1,44 @@
+From 6d4177a5ef41ee0f4cbd883d8d03d3da59eca947 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 25 Apr 2022 19:41:36 +0800
+Subject: iommu/arm-smmu: fix possible null-ptr-deref in
+ arm_smmu_device_probe()
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+[ Upstream commit d9ed8af1dee37f181096631fb03729ece98ba816 ]
+
+It will cause null-ptr-deref when using 'res', if platform_get_resource()
+returns NULL, so move using 'res' after devm_ioremap_resource() that
+will check it to avoid null-ptr-deref.
+And use devm_platform_get_and_ioremap_resource() to simplify code.
+
+Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
+Link: https://lore.kernel.org/r/20220425114136.2649310-1-yangyingliang@huawei.com
+Signed-off-by: Will Deacon <will@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/iommu/arm/arm-smmu/arm-smmu.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c
+index 568cce590ccc..52b71f6aee3f 100644
+--- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
++++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
+@@ -2092,11 +2092,10 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
+       if (err)
+               return err;
+-      res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+-      ioaddr = res->start;
+-      smmu->base = devm_ioremap_resource(dev, res);
++      smmu->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
+       if (IS_ERR(smmu->base))
+               return PTR_ERR(smmu->base);
++      ioaddr = res->start;
+       /*
+        * The resource size should effectively match the value of SMMU_TOP;
+        * stash that temporarily until we know PAGESIZE to validate it with.
+-- 
+2.35.1
+
diff --git a/queue-5.18/iommu-arm-smmu-v3-check-return-value-after-calling-p.patch b/queue-5.18/iommu-arm-smmu-v3-check-return-value-after-calling-p.patch
new file mode 100644 (file)
index 0000000..6b24001
--- /dev/null
@@ -0,0 +1,37 @@
+From b66158958015275a45f24dab30f2ebb5e8fe888d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 25 Apr 2022 19:45:25 +0800
+Subject: iommu/arm-smmu-v3: check return value after calling
+ platform_get_resource()
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+[ Upstream commit b131fa8c1d2afd05d0b7598621114674289c2fbb ]
+
+It will cause null-ptr-deref if platform_get_resource() returns NULL,
+we need check the return value.
+
+Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
+Link: https://lore.kernel.org/r/20220425114525.2651143-1-yangyingliang@huawei.com
+Signed-off-by: Will Deacon <will@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+index 627a3ed5ee8f..88817a3376ef 100644
+--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
++++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+@@ -3770,6 +3770,8 @@ static int arm_smmu_device_probe(struct platform_device *pdev)
+       /* Base address */
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++      if (!res)
++              return -EINVAL;
+       if (resource_size(res) < arm_smmu_resource_size(smmu)) {
+               dev_err(dev, "MMIO region too small (%pr)\n", res);
+               return -EINVAL;
+-- 
+2.35.1
+
diff --git a/queue-5.18/m68knommu-fix-undefined-reference-to-_init_sp.patch b/queue-5.18/m68knommu-fix-undefined-reference-to-_init_sp.patch
new file mode 100644 (file)
index 0000000..18db7d9
--- /dev/null
@@ -0,0 +1,43 @@
+From 09c4e83cd612bc5e901335f7ca87606007a8f5da Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 13 May 2022 17:27:39 +1000
+Subject: m68knommu: fix undefined reference to `_init_sp'
+
+From: Greg Ungerer <gerg@linux-m68k.org>
+
+[ Upstream commit a71b9e66fee47c59b3ec34e652b5c23bc6550794 ]
+
+When configuring a nommu classic m68k system enabling the uboot parameter
+passing support (CONFIG_UBOOT) will produce the following compile error:
+
+   m68k-linux-ld: arch/m68k/kernel/uboot.o: in function `process_uboot_commandline':
+   uboot.c:(.init.text+0x32): undefined reference to `_init_sp'
+
+The logic to support this option is only used on ColdFire based platforms
+(in its head.S startup code). So make the selection of this option
+depend on building for a ColdFire based platform.
+
+Reported-by: kernel test robot <lkp@intel.com>
+Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/m68k/Kconfig.machine | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/m68k/Kconfig.machine b/arch/m68k/Kconfig.machine
+index eeab4f3e6c19..946853a08502 100644
+--- a/arch/m68k/Kconfig.machine
++++ b/arch/m68k/Kconfig.machine
+@@ -335,6 +335,7 @@ comment "Machine Options"
+ config UBOOT
+       bool "Support for U-Boot command line parameters"
++      depends on COLDFIRE
+       help
+         If you say Y here kernel will try to collect command
+         line parameters from the initial u-boot stack.
+-- 
+2.35.1
+
diff --git a/queue-5.18/m68knommu-fix-undefined-reference-to-mach_get_rtc_pl.patch b/queue-5.18/m68knommu-fix-undefined-reference-to-mach_get_rtc_pl.patch
new file mode 100644 (file)
index 0000000..28871b7
--- /dev/null
@@ -0,0 +1,91 @@
+From adfa85734678b26d2479e36341f1a3467fcad3de Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 16 May 2022 16:36:07 +1000
+Subject: m68knommu: fix undefined reference to `mach_get_rtc_pll'
+
+From: Greg Ungerer <gerg@linux-m68k.org>
+
+[ Upstream commit 1300eec9e51f23c34c4487d2b06f58ca22e1ad3d ]
+
+Configuring for a nommu classic m68k target and enabling the generic rtc
+driver (CONFIG_RTC_DRV_GENERIC) will result in the following compile
+error:
+
+   m68k-linux-ld: arch/m68k/kernel/time.o: in function `rtc_ioctl':
+   time.c:(.text+0x82): undefined reference to `mach_get_rtc_pll'
+   m68k-linux-ld: time.c:(.text+0xbc): undefined reference to `mach_set_rtc_pll'
+   m68k-linux-ld: time.c:(.text+0xf4): undefined reference to `mach_set_rtc_pll'
+
+There are no definitions of "mach_set_rtc_pll" and "mach_get_rtc_pll" in the
+nommu code paths. Move these definitions and the associated "mach_hwclk",
+so that they are around their use case in time.c. This means they will
+always be defined on the builds that require them, and not on those that
+cannot use them - such as ColdFire (both with and without MMU enabled).
+
+Reported-by: kernel test robot <lkp@intel.com>
+Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Reviewed-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/m68k/kernel/setup_mm.c | 7 -------
+ arch/m68k/kernel/setup_no.c | 1 -
+ arch/m68k/kernel/time.c     | 9 +++++++++
+ 3 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
+index 8f94feed969c..07317367ead8 100644
+--- a/arch/m68k/kernel/setup_mm.c
++++ b/arch/m68k/kernel/setup_mm.c
+@@ -87,15 +87,8 @@ void (*mach_sched_init) (void) __initdata = NULL;
+ void (*mach_init_IRQ) (void) __initdata = NULL;
+ void (*mach_get_model) (char *model);
+ void (*mach_get_hardware_list) (struct seq_file *m);
+-/* machine dependent timer functions */
+-int (*mach_hwclk) (int, struct rtc_time*);
+-EXPORT_SYMBOL(mach_hwclk);
+ unsigned int (*mach_get_ss)(void);
+-int (*mach_get_rtc_pll)(struct rtc_pll_info *);
+-int (*mach_set_rtc_pll)(struct rtc_pll_info *);
+ EXPORT_SYMBOL(mach_get_ss);
+-EXPORT_SYMBOL(mach_get_rtc_pll);
+-EXPORT_SYMBOL(mach_set_rtc_pll);
+ void (*mach_reset)( void );
+ void (*mach_halt)( void );
+ void (*mach_power_off)( void );
+diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c
+index 5e4104f07a44..19eea73d3c17 100644
+--- a/arch/m68k/kernel/setup_no.c
++++ b/arch/m68k/kernel/setup_no.c
+@@ -50,7 +50,6 @@ char __initdata command_line[COMMAND_LINE_SIZE];
+ /* machine dependent timer functions */
+ void (*mach_sched_init)(void) __initdata = NULL;
+-int (*mach_hwclk) (int, struct rtc_time*);
+ /* machine dependent reboot functions */
+ void (*mach_reset)(void);
+diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c
+index 340ffeea0a9d..a97600b2af50 100644
+--- a/arch/m68k/kernel/time.c
++++ b/arch/m68k/kernel/time.c
+@@ -63,6 +63,15 @@ void timer_heartbeat(void)
+ #endif /* CONFIG_HEARTBEAT */
+ #ifdef CONFIG_M68KCLASSIC
++/* machine dependent timer functions */
++int (*mach_hwclk) (int, struct rtc_time*);
++EXPORT_SYMBOL(mach_hwclk);
++
++int (*mach_get_rtc_pll)(struct rtc_pll_info *);
++int (*mach_set_rtc_pll)(struct rtc_pll_info *);
++EXPORT_SYMBOL(mach_get_rtc_pll);
++EXPORT_SYMBOL(mach_set_rtc_pll);
++
+ #if !IS_BUILTIN(CONFIG_RTC_DRV_GENERIC)
+ void read_persistent_clock64(struct timespec64 *ts)
+ {
+-- 
+2.35.1
+
diff --git a/queue-5.18/m68knommu-set-zero_page-to-the-allocated-zeroed-page.patch b/queue-5.18/m68knommu-set-zero_page-to-the-allocated-zeroed-page.patch
new file mode 100644 (file)
index 0000000..35cecf5
--- /dev/null
@@ -0,0 +1,47 @@
+From 8c34a940366f39f0c95430114f1ed68b571c014a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 20 Apr 2022 23:27:47 +1000
+Subject: m68knommu: set ZERO_PAGE() to the allocated zeroed page
+
+From: Greg Ungerer <gerg@linux-m68k.org>
+
+[ Upstream commit dc068f46217970d9516f16cd37972a01d50dc055 ]
+
+The non-MMU m68k pagetable ZERO_PAGE() macro is being set to the
+somewhat non-sensical value of "virt_to_page(0)". The zeroth page
+is not in any way guaranteed to be a page full of "0". So the result
+is that ZERO_PAGE() will almost certainly contain random values.
+
+We already allocate a real "empty_zero_page" in the mm setup code shared
+between MMU m68k and non-MMU m68k. It is just not hooked up to the
+ZERO_PAGE() macro for the non-MMU m68k case.
+
+Fix ZERO_PAGE() to use the allocated "empty_zero_page" pointer.
+
+I am not aware of any specific issues caused by the old code.
+
+Link: https://lore.kernel.org/linux-m68k/2a462b23-5b8e-bbf4-ec7d-778434a3b9d7@google.com/T/#t
+Reported-by: Hugh Dickens <hughd@google.com>
+Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/m68k/include/asm/pgtable_no.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/arch/m68k/include/asm/pgtable_no.h b/arch/m68k/include/asm/pgtable_no.h
+index 87151d67d91e..bce5ca56c388 100644
+--- a/arch/m68k/include/asm/pgtable_no.h
++++ b/arch/m68k/include/asm/pgtable_no.h
+@@ -42,7 +42,8 @@ extern void paging_init(void);
+  * ZERO_PAGE is a global shared page that is always zero: used
+  * for zero-mapped memory areas etc..
+  */
+-#define ZERO_PAGE(vaddr)      (virt_to_page(0))
++extern void *empty_zero_page;
++#define ZERO_PAGE(vaddr)      (virt_to_page(empty_zero_page))
+ /*
+  * All 32bit addresses are effectively valid for vmalloc...
+-- 
+2.35.1
+
diff --git a/queue-5.18/mips-cpc-fix-refcount-leak-in-mips_cpc_default_phys_.patch b/queue-5.18/mips-cpc-fix-refcount-leak-in-mips_cpc_default_phys_.patch
new file mode 100644 (file)
index 0000000..48f85e8
--- /dev/null
@@ -0,0 +1,35 @@
+From 8fb4d34d70a7de1d887e841d4896380a8d32a1bd Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 7 Apr 2022 12:26:57 +0800
+Subject: mips: cpc: Fix refcount leak in mips_cpc_default_phys_base
+
+From: Gong Yuanjun <ruc_gongyuanjun@163.com>
+
+[ Upstream commit 4107fa700f314592850e2c64608f6ede4c077476 ]
+
+Add the missing of_node_put() to release the refcount incremented
+by of_find_compatible_node().
+
+Signed-off-by: Gong Yuanjun <ruc_gongyuanjun@163.com>
+Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/mips/kernel/mips-cpc.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/mips/kernel/mips-cpc.c b/arch/mips/kernel/mips-cpc.c
+index 17aff13cd7ce..3e386f7e1545 100644
+--- a/arch/mips/kernel/mips-cpc.c
++++ b/arch/mips/kernel/mips-cpc.c
+@@ -28,6 +28,7 @@ phys_addr_t __weak mips_cpc_default_phys_base(void)
+       cpc_node = of_find_compatible_node(of_root, NULL, "mti,mips-cpc");
+       if (cpc_node) {
+               err = of_address_to_resource(cpc_node, 0, &res);
++              of_node_put(cpc_node);
+               if (!err)
+                       return res.start;
+       }
+-- 
+2.35.1
+
diff --git a/queue-5.18/nfsv4-don-t-hold-the-layoutget-locks-across-multiple.patch b/queue-5.18/nfsv4-don-t-hold-the-layoutget-locks-across-multiple.patch
new file mode 100644 (file)
index 0000000..8d54a1b
--- /dev/null
@@ -0,0 +1,39 @@
+From a24882d29e3b9040e508ba48d6252e0d008dc60e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 14 May 2022 10:08:14 -0400
+Subject: NFSv4: Don't hold the layoutget locks across multiple RPC calls
+
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+
+[ Upstream commit 6949493884fe88500de4af182588e071cf1544ee ]
+
+When doing layoutget as part of the open() compound, we have to be
+careful to release the layout locks before we can call any further RPC
+calls, such as setattr(). The reason is that those calls could trigger
+a recall, which could deadlock.
+
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/nfs/nfs4proc.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
+index 8c5907287c16..d1eaaeb7f713 100644
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -3098,6 +3098,10 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
+       }
+ out:
++      if (opendata->lgp) {
++              nfs4_lgopen_release(opendata->lgp);
++              opendata->lgp = NULL;
++      }
+       if (!opendata->cancelled)
+               nfs4_sequence_free_slot(&opendata->o_res.seq_res);
+       return ret;
+-- 
+2.35.1
+
diff --git a/queue-5.18/risc-v-use-memcpy-for-kexec_file-mode.patch b/queue-5.18/risc-v-use-memcpy-for-kexec_file-mode.patch
new file mode 100644 (file)
index 0000000..04dcf81
--- /dev/null
@@ -0,0 +1,52 @@
+From c31d754c294b8f4bcce21030e9d0169aa67b95d3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 8 Apr 2022 18:09:10 +0800
+Subject: RISC-V: use memcpy for kexec_file mode
+
+From: Liao Chang <liaochang1@huawei.com>
+
+[ Upstream commit b7fb4d78a6ade6026d9e5cf438c2a46ab962e032 ]
+
+The pointer to buffer loading kernel binaries is in kernel space for
+kexec_fil mode, When copy_from_user copies data from pointer to a block
+of memory, it checkes that the pointer is in the user space range, on
+RISCV-V that is:
+
+static inline bool __access_ok(unsigned long addr, unsigned long size)
+{
+       return size <= TASK_SIZE && addr <= TASK_SIZE - size;
+}
+
+and TASK_SIZE is 0x4000000000 for 64-bits, which now causes
+copy_from_user to reject the access of the field 'buf' of struct
+kexec_segment that is in range [CONFIG_PAGE_OFFSET - VMALLOC_SIZE,
+CONFIG_PAGE_OFFSET), is invalid user space pointer.
+
+This patch fixes this issue by skipping access_ok(), use mempcy() instead.
+
+Signed-off-by: Liao Chang <liaochang1@huawei.com>
+Link: https://lore.kernel.org/r/20220408100914.150110-3-lizhengyu3@huawei.com
+Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/riscv/kernel/machine_kexec.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/arch/riscv/kernel/machine_kexec.c b/arch/riscv/kernel/machine_kexec.c
+index cbef0fc73afa..df8e24559035 100644
+--- a/arch/riscv/kernel/machine_kexec.c
++++ b/arch/riscv/kernel/machine_kexec.c
+@@ -65,7 +65,9 @@ machine_kexec_prepare(struct kimage *image)
+               if (image->segment[i].memsz <= sizeof(fdt))
+                       continue;
+-              if (copy_from_user(&fdt, image->segment[i].buf, sizeof(fdt)))
++              if (image->file_mode)
++                      memcpy(&fdt, image->segment[i].buf, sizeof(fdt));
++              else if (copy_from_user(&fdt, image->segment[i].buf, sizeof(fdt)))
+                       continue;
+               if (fdt_check_header(&fdt))
+-- 
+2.35.1
+
diff --git a/queue-5.18/rtla-makefile-properly-handle-dependencies.patch b/queue-5.18/rtla-makefile-properly-handle-dependencies.patch
new file mode 100644 (file)
index 0000000..abd75b5
--- /dev/null
@@ -0,0 +1,136 @@
+From 9d21a89b779bad1ca8d1d1afac3fa3b0a90a94fb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 29 Apr 2022 16:54:58 +0200
+Subject: rtla/Makefile: Properly handle dependencies
+
+From: Daniel Bristot de Oliveira <bristot@kernel.org>
+
+[ Upstream commit fe4d0d5dde457bb5832b866418b5036f4f0c8d13 ]
+
+Linus had a problem compiling RTLA, saying:
+
+"[...] I wish the tracing tools would do a bit more package
+checking and helpful error messages too, rather than just
+fail with:
+
+    fatal error: tracefs.h: No such file or directory"
+
+Which is indeed not a helpful message. Update the Makefile, adding
+proper checks for the dependencies, with useful information about
+how to resolve possible problems.
+
+For example, the previous error is now reported as:
+
+    $ make
+    ********************************************
+    ** NOTICE: libtracefs version 1.3 or higher not found
+    **
+    ** Consider installing the latest libtracefs from your
+    ** distribution, e.g., 'dnf install libtracefs' on Fedora,
+    ** or from source:
+    **
+    **  https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/
+    **
+    ********************************************
+
+These messages are inspired by the ones used on trace-cmd, as suggested
+by Stevel Rostedt.
+
+Link: https://lore.kernel.org/r/CAHk-=whxmA86E=csNv76DuxX_wYsg8mW15oUs3XTabu2Yc80yw@mail.gmail.com/
+
+Changes from V1:
+ - Moved the rst2man check to the install phase (when it is used).
+ - Removed the procps-ng lib check [1] as it is being removed.
+
+[1] a0f9f8c1030c66305c9b921057c3d483064d5529.1651220820.git.bristot@kernel.org
+
+Link: https://lkml.kernel.org/r/3f1fac776c37e4b67c876a94e5a0e45ed022ff3d.1651238057.git.bristot@kernel.org
+
+Cc: Ingo Molnar <mingo@kernel.org>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
+Suggested-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
+Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ Documentation/tools/rtla/Makefile | 14 ++++++++++++-
+ tools/tracing/rtla/Makefile       | 35 +++++++++++++++++++++++++++++++
+ 2 files changed, 48 insertions(+), 1 deletion(-)
+
+diff --git a/Documentation/tools/rtla/Makefile b/Documentation/tools/rtla/Makefile
+index 9f2b84af1a6c..093af6d7a0e9 100644
+--- a/Documentation/tools/rtla/Makefile
++++ b/Documentation/tools/rtla/Makefile
+@@ -17,9 +17,21 @@ DOC_MAN1    = $(addprefix $(OUTPUT),$(_DOC_MAN1))
+ RST2MAN_DEP   := $(shell command -v rst2man 2>/dev/null)
+ RST2MAN_OPTS  += --verbose
++TEST_RST2MAN = $(shell sh -c "rst2man --version > /dev/null 2>&1 || echo n")
++
+ $(OUTPUT)%.1: %.rst
+ ifndef RST2MAN_DEP
+-      $(error "rst2man not found, but required to generate man pages")
++      $(info ********************************************)
++      $(info ** NOTICE: rst2man not found)
++      $(info **)
++      $(info ** Consider installing the latest rst2man from your)
++      $(info ** distribution, e.g., 'dnf install python3-docutils' on Fedora,)
++      $(info ** or from source:)
++      $(info **)
++      $(info **  https://docutils.sourceforge.io/docs/dev/repository.html )
++      $(info **)
++      $(info ********************************************)
++      $(error NOTICE: rst2man required to generate man pages)
+ endif
+       rst2man $(RST2MAN_OPTS) $< > $@
+diff --git a/tools/tracing/rtla/Makefile b/tools/tracing/rtla/Makefile
+index 523f0a8c38c2..3822f4ea5f49 100644
+--- a/tools/tracing/rtla/Makefile
++++ b/tools/tracing/rtla/Makefile
+@@ -58,6 +58,41 @@ else
+ DOCSRC        =       $(SRCTREE)/../../../Documentation/tools/rtla/
+ endif
++LIBTRACEEVENT_MIN_VERSION = 1.5
++LIBTRACEFS_MIN_VERSION = 1.3
++
++TEST_LIBTRACEEVENT = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEEVENT_MIN_VERSION) libtraceevent > /dev/null 2>&1 || echo n")
++ifeq ("$(TEST_LIBTRACEEVENT)", "n")
++.PHONY: warning_traceevent
++warning_traceevent:
++      @echo "********************************************"
++      @echo "** NOTICE: libtraceevent version $(LIBTRACEEVENT_MIN_VERSION) or higher not found"
++      @echo "**"
++      @echo "** Consider installing the latest libtraceevent from your"
++      @echo "** distribution, e.g., 'dnf install libtraceevent' on Fedora,"
++      @echo "** or from source:"
++      @echo "**"
++      @echo "**  https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/ "
++      @echo "**"
++      @echo "********************************************"
++endif
++
++TEST_LIBTRACEFS = $(shell sh -c "$(PKG_CONFIG) --atleast-version $(LIBTRACEFS_MIN_VERSION) libtracefs > /dev/null 2>&1 || echo n")
++ifeq ("$(TEST_LIBTRACEFS)", "n")
++.PHONY: warning_tracefs
++warning_tracefs:
++      @echo "********************************************"
++      @echo "** NOTICE: libtracefs version $(LIBTRACEFS_MIN_VERSION) or higher not found"
++      @echo "**"
++      @echo "** Consider installing the latest libtracefs from your"
++      @echo "** distribution, e.g., 'dnf install libtracefs' on Fedora,"
++      @echo "** or from source:"
++      @echo "**"
++      @echo "**  https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/ "
++      @echo "**"
++      @echo "********************************************"
++endif
++
+ .PHONY:       all
+ all:  rtla
+-- 
+2.35.1
+
index e88b4700cd43dc050a9c9a5a87b1ba36dab20f18..cd252c457032349de744b739bdcbecb4718c329a 100644 (file)
@@ -152,3 +152,26 @@ perf-c2c-fix-sorting-in-percent_rmt_hitm_cmp.patch
 bluetooth-mgmt-add-conditions-for-setting-hci_conn_f.patch
 bluetooth-hci_sync-fix-attempting-to-suspend-with-un.patch
 bluetooth-don-t-use-bitmaps-for-random-flag-accesses.patch
+dmaengine-idxd-set-dma_interrupt-cap-bit.patch
+mips-cpc-fix-refcount-leak-in-mips_cpc_default_phys_.patch
+bootconfig-make-the-bootconfig.o-as-a-normal-object-.patch
+tracing-make-tp_printk-work-on-syscall-tracepoints.patch
+tracing-fix-sleeping-function-called-from-invalid-co.patch
+tracing-avoid-adding-tracer-option-before-update_tra.patch
+i2c-mediatek-optimize-master_xfer-and-avoid-circular.patch
+iommu-arm-smmu-fix-possible-null-ptr-deref-in-arm_sm.patch
+iommu-arm-smmu-v3-check-return-value-after-calling-p.patch
+f2fs-remove-warn_on-in-f2fs_is_valid_blkaddr.patch
+f2fs-avoid-infinite-loop-to-flush-node-pages.patch
+i2c-cadence-increase-timeout-per-message-if-necessar.patch
+m68knommu-set-zero_page-to-the-allocated-zeroed-page.patch
+m68knommu-fix-undefined-reference-to-_init_sp.patch
+dmaengine-zynqmp_dma-in-struct-zynqmp_dma_chan-fix-d.patch
+nfsv4-don-t-hold-the-layoutget-locks-across-multiple.patch
+video-fbdev-hyperv_fb-allow-resolutions-with-size-64.patch
+video-fbdev-pxa3xx-gcu-release-the-resources-correct.patch
+risc-v-use-memcpy-for-kexec_file-mode.patch
+m68knommu-fix-undefined-reference-to-mach_get_rtc_pl.patch
+rtla-makefile-properly-handle-dependencies.patch
+f2fs-fix-to-tag-gcing-flag-on-page-during-file-defra.patch
+xprtrdma-treat-all-calls-not-a-bcall-when-bc_serv-is.patch
diff --git a/queue-5.18/tracing-avoid-adding-tracer-option-before-update_tra.patch b/queue-5.18/tracing-avoid-adding-tracer-option-before-update_tra.patch
new file mode 100644 (file)
index 0000000..2e8d0a5
--- /dev/null
@@ -0,0 +1,66 @@
+From 86e84273a36b17872d1d3adee0d4ec3fa619f08d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 26 Apr 2022 20:24:06 +0800
+Subject: tracing: Avoid adding tracer option before update_tracer_options
+
+From: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
+
+[ Upstream commit ef9188bcc6ca1d8a2ad83e826b548e6820721061 ]
+
+To prepare for support asynchronous tracer_init_tracefs initcall,
+avoid calling create_trace_option_files before __update_tracer_options.
+Otherwise, create_trace_option_files will show warning because
+some tracers in trace_types list are already in tr->topts.
+
+For example, hwlat_tracer call register_tracer in late_initcall,
+and global_trace.dir is already created in tracing_init_dentry,
+hwlat_tracer will be put into tr->topts.
+Then if the __update_tracer_options is executed after hwlat_tracer
+registered, create_trace_option_files find that hwlat_tracer is
+already in tr->topts.
+
+Link: https://lkml.kernel.org/r/20220426122407.17042-2-mark-pk.tsai@mediatek.com
+
+Link: https://lore.kernel.org/lkml/20220322133339.GA32582@xsang-OptiPlex-9020/
+Reported-by: kernel test robot <oliver.sang@intel.com>
+Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
+Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ kernel/trace/trace.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
+index 8d2b5c5ce5b3..114c31bdf8f9 100644
+--- a/kernel/trace/trace.c
++++ b/kernel/trace/trace.c
+@@ -6334,12 +6334,18 @@ static void tracing_set_nop(struct trace_array *tr)
+       tr->current_trace = &nop_trace;
+ }
++static bool tracer_options_updated;
++
+ static void add_tracer_options(struct trace_array *tr, struct tracer *t)
+ {
+       /* Only enable if the directory has been created already. */
+       if (!tr->dir)
+               return;
++      /* Only create trace option files after update_tracer_options finish */
++      if (!tracer_options_updated)
++              return;
++
+       create_trace_option_files(tr, t);
+ }
+@@ -9178,6 +9184,7 @@ static void __update_tracer_options(struct trace_array *tr)
+ static void update_tracer_options(struct trace_array *tr)
+ {
+       mutex_lock(&trace_types_lock);
++      tracer_options_updated = true;
+       __update_tracer_options(tr);
+       mutex_unlock(&trace_types_lock);
+ }
+-- 
+2.35.1
+
diff --git a/queue-5.18/tracing-fix-sleeping-function-called-from-invalid-co.patch b/queue-5.18/tracing-fix-sleeping-function-called-from-invalid-co.patch
new file mode 100644 (file)
index 0000000..73c25b8
--- /dev/null
@@ -0,0 +1,93 @@
+From 5c553903c7aa80da7607d5a9e30b3e3e83979eb3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 19 Apr 2022 09:39:10 +0800
+Subject: tracing: Fix sleeping function called from invalid context on RT
+ kernel
+
+From: Jun Miao <jun.miao@intel.com>
+
+[ Upstream commit 12025abdc8539ed9d5014e2d647a3fd1bd3de5cd ]
+
+When setting bootparams="trace_event=initcall:initcall_start tp_printk=1" in the
+cmdline, the output_printk() was called, and the spin_lock_irqsave() was called in the
+atomic and irq disable interrupt context suitation. On the PREEMPT_RT kernel,
+these locks are replaced with sleepable rt-spinlock, so the stack calltrace will
+be triggered.
+Fix it by raw_spin_lock_irqsave when PREEMPT_RT and "trace_event=initcall:initcall_start
+tp_printk=1" enabled.
+
+ BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46
+ in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1, name: swapper/0
+ preempt_count: 2, expected: 0
+ RCU nest depth: 0, expected: 0
+ Preemption disabled at:
+ [<ffffffff8992303e>] try_to_wake_up+0x7e/0xba0
+ CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.17.1-rt17+ #19 34c5812404187a875f32bee7977f7367f9679ea7
+ Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014
+ Call Trace:
+  <TASK>
+  dump_stack_lvl+0x60/0x8c
+  dump_stack+0x10/0x12
+  __might_resched.cold+0x11d/0x155
+  rt_spin_lock+0x40/0x70
+  trace_event_buffer_commit+0x2fa/0x4c0
+  ? map_vsyscall+0x93/0x93
+  trace_event_raw_event_initcall_start+0xbe/0x110
+  ? perf_trace_initcall_finish+0x210/0x210
+  ? probe_sched_wakeup+0x34/0x40
+  ? ttwu_do_wakeup+0xda/0x310
+  ? trace_hardirqs_on+0x35/0x170
+  ? map_vsyscall+0x93/0x93
+  do_one_initcall+0x217/0x3c0
+  ? trace_event_raw_event_initcall_level+0x170/0x170
+  ? push_cpu_stop+0x400/0x400
+  ? cblist_init_generic+0x241/0x290
+  kernel_init_freeable+0x1ac/0x347
+  ? _raw_spin_unlock_irq+0x65/0x80
+  ? rest_init+0xf0/0xf0
+  kernel_init+0x1e/0x150
+  ret_from_fork+0x22/0x30
+  </TASK>
+
+Link: https://lkml.kernel.org/r/20220419013910.894370-1-jun.miao@intel.com
+
+Signed-off-by: Jun Miao <jun.miao@intel.com>
+Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ kernel/trace/trace.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
+index f6fb04d79eba..8d2b5c5ce5b3 100644
+--- a/kernel/trace/trace.c
++++ b/kernel/trace/trace.c
+@@ -2837,7 +2837,7 @@ trace_event_buffer_lock_reserve(struct trace_buffer **current_rb,
+ }
+ EXPORT_SYMBOL_GPL(trace_event_buffer_lock_reserve);
+-static DEFINE_SPINLOCK(tracepoint_iter_lock);
++static DEFINE_RAW_SPINLOCK(tracepoint_iter_lock);
+ static DEFINE_MUTEX(tracepoint_printk_mutex);
+ static void output_printk(struct trace_event_buffer *fbuffer)
+@@ -2865,14 +2865,14 @@ static void output_printk(struct trace_event_buffer *fbuffer)
+       event = &fbuffer->trace_file->event_call->event;
+-      spin_lock_irqsave(&tracepoint_iter_lock, flags);
++      raw_spin_lock_irqsave(&tracepoint_iter_lock, flags);
+       trace_seq_init(&iter->seq);
+       iter->ent = fbuffer->entry;
+       event_call->event.funcs->trace(iter, 0, event);
+       trace_seq_putc(&iter->seq, 0);
+       printk("%s", iter->seq.buffer);
+-      spin_unlock_irqrestore(&tracepoint_iter_lock, flags);
++      raw_spin_unlock_irqrestore(&tracepoint_iter_lock, flags);
+ }
+ int tracepoint_printk_sysctl(struct ctl_table *table, int write,
+-- 
+2.35.1
+
diff --git a/queue-5.18/tracing-make-tp_printk-work-on-syscall-tracepoints.patch b/queue-5.18/tracing-make-tp_printk-work-on-syscall-tracepoints.patch
new file mode 100644 (file)
index 0000000..5839d31
--- /dev/null
@@ -0,0 +1,116 @@
+From 37f6385914c8377e4aeacd004e7d1a4d9bf010f7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 10 Apr 2022 22:50:25 +0800
+Subject: tracing: Make tp_printk work on syscall tracepoints
+
+From: Jeff Xie <xiehuan09@gmail.com>
+
+[ Upstream commit cb1c45fb68b8a4285ccf750842b1136f26cfe267 ]
+
+Currently the tp_printk option has no effect on syscall tracepoint.
+When adding the kernel option parameter tp_printk, then:
+
+echo 1 > /sys/kernel/debug/tracing/events/syscalls/enable
+
+When running any application, no trace information is printed on the
+terminal.
+
+Now added printk for syscall tracepoints.
+
+Link: https://lkml.kernel.org/r/20220410145025.681144-1-xiehuan09@gmail.com
+
+Signed-off-by: Jeff Xie <xiehuan09@gmail.com>
+Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ kernel/trace/trace_syscalls.c | 35 +++++++++++------------------------
+ 1 file changed, 11 insertions(+), 24 deletions(-)
+
+diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
+index f755bde42fd0..b69e207012c9 100644
+--- a/kernel/trace/trace_syscalls.c
++++ b/kernel/trace/trace_syscalls.c
+@@ -154,7 +154,7 @@ print_syscall_enter(struct trace_iterator *iter, int flags,
+                       goto end;
+               /* parameter types */
+-              if (tr->trace_flags & TRACE_ITER_VERBOSE)
++              if (tr && tr->trace_flags & TRACE_ITER_VERBOSE)
+                       trace_seq_printf(s, "%s ", entry->types[i]);
+               /* parameter values */
+@@ -296,9 +296,7 @@ static void ftrace_syscall_enter(void *data, struct pt_regs *regs, long id)
+       struct trace_event_file *trace_file;
+       struct syscall_trace_enter *entry;
+       struct syscall_metadata *sys_data;
+-      struct ring_buffer_event *event;
+-      struct trace_buffer *buffer;
+-      unsigned int trace_ctx;
++      struct trace_event_buffer fbuffer;
+       unsigned long args[6];
+       int syscall_nr;
+       int size;
+@@ -321,20 +319,16 @@ static void ftrace_syscall_enter(void *data, struct pt_regs *regs, long id)
+       size = sizeof(*entry) + sizeof(unsigned long) * sys_data->nb_args;
+-      trace_ctx = tracing_gen_ctx();
+-
+-      event = trace_event_buffer_lock_reserve(&buffer, trace_file,
+-                      sys_data->enter_event->event.type, size, trace_ctx);
+-      if (!event)
++      entry = trace_event_buffer_reserve(&fbuffer, trace_file, size);
++      if (!entry)
+               return;
+-      entry = ring_buffer_event_data(event);
++      entry = ring_buffer_event_data(fbuffer.event);
+       entry->nr = syscall_nr;
+       syscall_get_arguments(current, regs, args);
+       memcpy(entry->args, args, sizeof(unsigned long) * sys_data->nb_args);
+-      event_trigger_unlock_commit(trace_file, buffer, event, entry,
+-                                  trace_ctx);
++      trace_event_buffer_commit(&fbuffer);
+ }
+ static void ftrace_syscall_exit(void *data, struct pt_regs *regs, long ret)
+@@ -343,9 +337,7 @@ static void ftrace_syscall_exit(void *data, struct pt_regs *regs, long ret)
+       struct trace_event_file *trace_file;
+       struct syscall_trace_exit *entry;
+       struct syscall_metadata *sys_data;
+-      struct ring_buffer_event *event;
+-      struct trace_buffer *buffer;
+-      unsigned int trace_ctx;
++      struct trace_event_buffer fbuffer;
+       int syscall_nr;
+       syscall_nr = trace_get_syscall_nr(current, regs);
+@@ -364,20 +356,15 @@ static void ftrace_syscall_exit(void *data, struct pt_regs *regs, long ret)
+       if (!sys_data)
+               return;
+-      trace_ctx = tracing_gen_ctx();
+-
+-      event = trace_event_buffer_lock_reserve(&buffer, trace_file,
+-                      sys_data->exit_event->event.type, sizeof(*entry),
+-                      trace_ctx);
+-      if (!event)
++      entry = trace_event_buffer_reserve(&fbuffer, trace_file, sizeof(*entry));
++      if (!entry)
+               return;
+-      entry = ring_buffer_event_data(event);
++      entry = ring_buffer_event_data(fbuffer.event);
+       entry->nr = syscall_nr;
+       entry->ret = syscall_get_return_value(current, regs);
+-      event_trigger_unlock_commit(trace_file, buffer, event, entry,
+-                                  trace_ctx);
++      trace_event_buffer_commit(&fbuffer);
+ }
+ static int reg_event_syscall_enter(struct trace_event_file *file,
+-- 
+2.35.1
+
diff --git a/queue-5.18/video-fbdev-hyperv_fb-allow-resolutions-with-size-64.patch b/queue-5.18/video-fbdev-hyperv_fb-allow-resolutions-with-size-64.patch
new file mode 100644 (file)
index 0000000..57ee89b
--- /dev/null
@@ -0,0 +1,63 @@
+From 9fdc096cd778ffbbf9216cbce291896770c97644 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 27 Apr 2022 06:47:53 -0700
+Subject: video: fbdev: hyperv_fb: Allow resolutions with size > 64 MB for Gen1
+
+From: Saurabh Sengar <ssengar@linux.microsoft.com>
+
+[ Upstream commit c4b4d7047f16a8d138ce76da65faefb7165736f2 ]
+
+This patch fixes a bug where GEN1 VMs doesn't allow resolutions greater
+than 64 MB size (eg 7680x4320). Unnecessary PCI check limits Gen1 VRAM
+to legacy PCI BAR size only (ie 64MB). Thus any, resolution requesting
+greater then 64MB (eg 7680x4320) would fail. MMIO region assigning this
+memory shouldn't be limited by PCI bar size.
+
+Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
+Reviewed-by: Dexuan Cui <decui@microsoft.com>
+Signed-off-by: Helge Deller <deller@gmx.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/video/fbdev/hyperv_fb.c | 19 +------------------
+ 1 file changed, 1 insertion(+), 18 deletions(-)
+
+diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
+index c8e0ea27caf1..58c304a3b7c4 100644
+--- a/drivers/video/fbdev/hyperv_fb.c
++++ b/drivers/video/fbdev/hyperv_fb.c
+@@ -1009,7 +1009,6 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
+       struct pci_dev *pdev  = NULL;
+       void __iomem *fb_virt;
+       int gen2vm = efi_enabled(EFI_BOOT);
+-      resource_size_t pot_start, pot_end;
+       phys_addr_t paddr;
+       int ret;
+@@ -1060,23 +1059,7 @@ static int hvfb_getmem(struct hv_device *hdev, struct fb_info *info)
+       dio_fb_size =
+               screen_width * screen_height * screen_depth / 8;
+-      if (gen2vm) {
+-              pot_start = 0;
+-              pot_end = -1;
+-      } else {
+-              if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) ||
+-                  pci_resource_len(pdev, 0) < screen_fb_size) {
+-                      pr_err("Resource not available or (0x%lx < 0x%lx)\n",
+-                             (unsigned long) pci_resource_len(pdev, 0),
+-                             (unsigned long) screen_fb_size);
+-                      goto err1;
+-              }
+-
+-              pot_end = pci_resource_end(pdev, 0);
+-              pot_start = pot_end - screen_fb_size + 1;
+-      }
+-
+-      ret = vmbus_allocate_mmio(&par->mem, hdev, pot_start, pot_end,
++      ret = vmbus_allocate_mmio(&par->mem, hdev, 0, -1,
+                                 screen_fb_size, 0x100000, true);
+       if (ret != 0) {
+               pr_err("Unable to allocate framebuffer memory\n");
+-- 
+2.35.1
+
diff --git a/queue-5.18/video-fbdev-pxa3xx-gcu-release-the-resources-correct.patch b/queue-5.18/video-fbdev-pxa3xx-gcu-release-the-resources-correct.patch
new file mode 100644 (file)
index 0000000..c1b05bf
--- /dev/null
@@ -0,0 +1,67 @@
+From 9c834eb16b0d61430f2bfc43a3a2806a5ec7c3a9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 13 May 2022 18:05:41 +0800
+Subject: video: fbdev: pxa3xx-gcu: release the resources correctly in
+ pxa3xx_gcu_probe/remove()
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+[ Upstream commit d87ad457f7e1b8d2492ca5b1531eb35030a1cc8f ]
+
+In pxa3xx_gcu_probe(), the sequence of error lable is wrong, it will
+leads some resource leaked, so adjust the sequence to handle the error
+correctly, and if pxa3xx_gcu_add_buffer() fails, pxa3xx_gcu_free_buffers()
+need be called.
+In pxa3xx_gcu_remove(), add missing clk_disable_unpreprare().
+
+Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
+Signed-off-by: Helge Deller <deller@gmx.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/video/fbdev/pxa3xx-gcu.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c
+index 350b3139c863..043cc8f9ef1c 100644
+--- a/drivers/video/fbdev/pxa3xx-gcu.c
++++ b/drivers/video/fbdev/pxa3xx-gcu.c
+@@ -646,6 +646,7 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
+       for (i = 0; i < 8; i++) {
+               ret = pxa3xx_gcu_add_buffer(dev, priv);
+               if (ret) {
++                      pxa3xx_gcu_free_buffers(dev, priv);
+                       dev_err(dev, "failed to allocate DMA memory\n");
+                       goto err_disable_clk;
+               }
+@@ -662,15 +663,15 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
+                       SHARED_SIZE, irq);
+       return 0;
+-err_free_dma:
+-      dma_free_coherent(dev, SHARED_SIZE,
+-                      priv->shared, priv->shared_phys);
++err_disable_clk:
++      clk_disable_unprepare(priv->clk);
+ err_misc_deregister:
+       misc_deregister(&priv->misc_dev);
+-err_disable_clk:
+-      clk_disable_unprepare(priv->clk);
++err_free_dma:
++      dma_free_coherent(dev, SHARED_SIZE,
++                        priv->shared, priv->shared_phys);
+       return ret;
+ }
+@@ -683,6 +684,7 @@ static int pxa3xx_gcu_remove(struct platform_device *pdev)
+       pxa3xx_gcu_wait_idle(priv);
+       misc_deregister(&priv->misc_dev);
+       dma_free_coherent(dev, SHARED_SIZE, priv->shared, priv->shared_phys);
++      clk_disable_unprepare(priv->clk);
+       pxa3xx_gcu_free_buffers(dev, priv);
+       return 0;
+-- 
+2.35.1
+
diff --git a/queue-5.18/xprtrdma-treat-all-calls-not-a-bcall-when-bc_serv-is.patch b/queue-5.18/xprtrdma-treat-all-calls-not-a-bcall-when-bc_serv-is.patch
new file mode 100644 (file)
index 0000000..ef97cef
--- /dev/null
@@ -0,0 +1,73 @@
+From d02e60c9bc883f1d6e5f76a4475fecdf428f8ae9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 22 May 2022 20:36:48 +0800
+Subject: xprtrdma: treat all calls not a bcall when bc_serv is NULL
+
+From: Kinglong Mee <kinglongmee@gmail.com>
+
+[ Upstream commit 11270e7ca268e8d61b5d9e5c3a54bd1550642c9c ]
+
+When a rdma server returns a fault format reply, nfs v3 client may
+treats it as a bcall when bc service is not exist.
+
+The debug message at rpcrdma_bc_receive_call are,
+
+[56579.837169] RPC:       rpcrdma_bc_receive_call: callback XID
+00000001, length=20
+[56579.837174] RPC:       rpcrdma_bc_receive_call: 00 00 00 01 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 04
+
+After that, rpcrdma_bc_receive_call will meets NULL pointer as,
+
+[  226.057890] BUG: unable to handle kernel NULL pointer dereference at
+00000000000000c8
+...
+[  226.058704] RIP: 0010:_raw_spin_lock+0xc/0x20
+...
+[  226.059732] Call Trace:
+[  226.059878]  rpcrdma_bc_receive_call+0x138/0x327 [rpcrdma]
+[  226.060011]  __ib_process_cq+0x89/0x170 [ib_core]
+[  226.060092]  ib_cq_poll_work+0x26/0x80 [ib_core]
+[  226.060257]  process_one_work+0x1a7/0x360
+[  226.060367]  ? create_worker+0x1a0/0x1a0
+[  226.060440]  worker_thread+0x30/0x390
+[  226.060500]  ? create_worker+0x1a0/0x1a0
+[  226.060574]  kthread+0x116/0x130
+[  226.060661]  ? kthread_flush_work_fn+0x10/0x10
+[  226.060724]  ret_from_fork+0x35/0x40
+...
+
+Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
+Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/sunrpc/xprtrdma/rpc_rdma.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c
+index 281ddb87ac8d..190a4de239c8 100644
+--- a/net/sunrpc/xprtrdma/rpc_rdma.c
++++ b/net/sunrpc/xprtrdma/rpc_rdma.c
+@@ -1121,6 +1121,7 @@ static bool
+ rpcrdma_is_bcall(struct rpcrdma_xprt *r_xprt, struct rpcrdma_rep *rep)
+ #if defined(CONFIG_SUNRPC_BACKCHANNEL)
+ {
++      struct rpc_xprt *xprt = &r_xprt->rx_xprt;
+       struct xdr_stream *xdr = &rep->rr_stream;
+       __be32 *p;
+@@ -1144,6 +1145,10 @@ rpcrdma_is_bcall(struct rpcrdma_xprt *r_xprt, struct rpcrdma_rep *rep)
+       if (*p != cpu_to_be32(RPC_CALL))
+               return false;
++      /* No bc service. */
++      if (xprt->bc_serv == NULL)
++              return false;
++
+       /* Now that we are sure this is a backchannel call,
+        * advance to the RPC header.
+        */
+-- 
+2.35.1
+