The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix udmabuf vmap error
@ 2025-04-15  3:15 Huan Yang
  2025-04-15  3:15 ` [PATCH 1/2] Revert "udmabuf: fix vmap_udmabuf error page set" Huan Yang
  2025-04-15  3:15 ` [PATCH 2/2] udmabuf: fix vmap missed offset page Huan Yang
  0 siblings, 2 replies; 11+ messages in thread
From: Huan Yang @ 2025-04-15  3:15 UTC (permalink / raw)
  To: Sumit Semwal, Christian König, Gerd Hoffmann,
	Vivek Kasireddy, Andrew Morton, Dave Airlie, linux-media,
	dri-devel, linaro-mm-sig, linux-kernel
  Cc: opensource.kernel, Huan Yang

In [1] Bingbu report an error that vmap_udmabuf invoke failed due to use
vmap_pfn and blocked by !pfn_valid.

Due to misunderstand it, I change vmap_pfn check of !pfn_valid to
pfn_valid, then send [2], then Christoph point that:
  vmap_pfn is entirely for memory not backed by pages or folios,
  i.e. PCIe BARs and similar memory.  This must not be mixed with proper
  folio backed memory.

So, I given a misuse of vmap_pfn. But to fix vmap_udmabuf, and consider
HVO effect, I offer a RFC patchset [3], which simple copy vmap_pfn to
vmap_udmabuf, other implement folio range based vmap.

But in [3], Muchun point that I misunderstand HVO, which do not
released any page struct pointer in vmemmap, only change this VA's PTE
point to hugetlb's **HEAD** page frame, and release remainned **tail** page
frame. So any page struct pointer do exist, and folio_page, folio_pfn or
other api still can work.

By this, we can fix this error simpliy:
 Patch 1 revert this vmap_pfn misuse patch.
 Patch 2 fix missed offset page set.

[1] https://lore.kernel.org/all/9172a601-c360-0d5b-ba1b-33deba430455@linux.intel.com/
[2] https://lore.kernel.org/all/20250312061513.1126496-1-link@vivo.com/
[3] https://lore.kernel.org/all/20250327092922.536-1-link@vivo.com/

Huan Yang (2):
  Revert "udmabuf: fix vmap_udmabuf error page set"
  udmabuf: fix vmap missed offset page

 drivers/dma-buf/Kconfig   |  1 -
 drivers/dma-buf/udmabuf.c | 23 ++++++++---------------
 2 files changed, 8 insertions(+), 16 deletions(-)


base-commit: b425262c07a6a643ebeed91046e161e20b944164
--
2.48.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-04-28  7:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-15  3:15 [PATCH 0/2] Fix udmabuf vmap error Huan Yang
2025-04-15  3:15 ` [PATCH 1/2] Revert "udmabuf: fix vmap_udmabuf error page set" Huan Yang
2025-04-22  5:14   ` Kasireddy, Vivek
2025-04-23  7:22     ` Huan Yang
2025-04-23  7:26       ` Huan Yang
2025-04-28  4:16         ` Kasireddy, Vivek
2025-04-28  7:03           ` Huan Yang
2025-04-15  3:15 ` [PATCH 2/2] udmabuf: fix vmap missed offset page Huan Yang
2025-04-22  5:22   ` Kasireddy, Vivek
2025-04-23  7:25     ` Huan Yang
2025-04-25  2:59     ` Bingbu Cao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox