All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	intel-xe@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Oak Zeng" <oak.zeng@intel.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2 1/3] drm/xe/hmm: Style- and include fixes
Date: Tue, 04 Mar 2025 14:21:50 +0200	[thread overview]
Message-ID: <87jz95yoip.fsf@intel.com> (raw)
In-Reply-To: <20250304113758.67889-2-thomas.hellstrom@linux.intel.com>

On Tue, 04 Mar 2025, Thomas Hellström <thomas.hellstrom@linux.intel.com> wrote:
> Add proper #ifndef around the xe_hmm.h header, proper spacing
> and since the documentation mostly follows kerneldoc format,
> make it kerneldoc. Also prepare for upcoming -stable fixes.
>
> Fixes: 81e058a3e7fd ("drm/xe: Introduce helper to populate userptr")
> Cc: Oak Zeng <oak.zeng@intel.com>
> Cc: <stable@vger.kernel.org> # v6.10+
> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>

Doing this also flags xe_pcode_api.h:

index 856b14fe1c4d..ac635efa224b 100644
--- a/drivers/gpu/drm/xe/Makefile
+++ b/drivers/gpu/drm/xe/Makefile
@@ -328,7 +328,7 @@ always-$(CONFIG_DRM_XE_WERROR) += \
 	$(patsubst %.h,%.hdrtest, $(shell cd $(src) && find * -name '*.h' $(hdrtest_find_args)))
 
 quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
-      cmd_hdrtest = $(CC) -DHDRTEST $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@
+      cmd_hdrtest = $(CC) -DHDRTEST $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $< -include $<; touch $@
 
 $(obj)/%.hdrtest: $(src)/%.h FORCE
 	$(call if_changed_dep,hdrtest)

BR,
Jani.

> ---
>  drivers/gpu/drm/xe/xe_hmm.c | 9 +++------
>  drivers/gpu/drm/xe/xe_hmm.h | 5 +++++
>  2 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_hmm.c b/drivers/gpu/drm/xe/xe_hmm.c
> index 089834467880..c56738fa713b 100644
> --- a/drivers/gpu/drm/xe/xe_hmm.c
> +++ b/drivers/gpu/drm/xe/xe_hmm.c
> @@ -19,11 +19,10 @@ static u64 xe_npages_in_range(unsigned long start, unsigned long end)
>  	return (end - start) >> PAGE_SHIFT;
>  }
>  
> -/*
> +/**
>   * xe_mark_range_accessed() - mark a range is accessed, so core mm
>   * have such information for memory eviction or write back to
>   * hard disk
> - *
>   * @range: the range to mark
>   * @write: if write to this range, we mark pages in this range
>   * as dirty
> @@ -43,11 +42,10 @@ static void xe_mark_range_accessed(struct hmm_range *range, bool write)
>  	}
>  }
>  
> -/*
> +/**
>   * xe_build_sg() - build a scatter gather table for all the physical pages/pfn
>   * in a hmm_range. dma-map pages if necessary. dma-address is save in sg table
>   * and will be used to program GPU page table later.
> - *
>   * @xe: the xe device who will access the dma-address in sg table
>   * @range: the hmm range that we build the sg table from. range->hmm_pfns[]
>   * has the pfn numbers of pages that back up this hmm address range.
> @@ -112,9 +110,8 @@ static int xe_build_sg(struct xe_device *xe, struct hmm_range *range,
>  	return ret;
>  }
>  
> -/*
> +/**
>   * xe_hmm_userptr_free_sg() - Free the scatter gather table of userptr
> - *
>   * @uvma: the userptr vma which hold the scatter gather table
>   *
>   * With function xe_userptr_populate_range, we allocate storage of
> diff --git a/drivers/gpu/drm/xe/xe_hmm.h b/drivers/gpu/drm/xe/xe_hmm.h
> index 909dc2bdcd97..9602cb7d976d 100644
> --- a/drivers/gpu/drm/xe/xe_hmm.h
> +++ b/drivers/gpu/drm/xe/xe_hmm.h
> @@ -3,9 +3,14 @@
>   * Copyright © 2024 Intel Corporation
>   */
>  
> +#ifndef _XE_HMM_H_
> +#define _XE_HMM_H_
> +
>  #include <linux/types.h>
>  
>  struct xe_userptr_vma;
>  
>  int xe_hmm_userptr_populate_range(struct xe_userptr_vma *uvma, bool is_mm_mmap_locked);
> +
>  void xe_hmm_userptr_free_sg(struct xe_userptr_vma *uvma);
> +#endif

-- 
Jani Nikula, Intel

  reply	other threads:[~2025-03-04 12:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 11:37 [PATCH v2 0/3] drm/xe: Userptr invalid page access fixes Thomas Hellström
2025-03-04 11:37 ` [PATCH v2 1/3] drm/xe/hmm: Style- and include fixes Thomas Hellström
2025-03-04 12:21   ` Jani Nikula [this message]
2025-03-04 15:16   ` Matthew Auld
2025-03-04 11:37 ` [PATCH v2 2/3] drm/xe/hmm: Don't dereference struct page pointers without notifier lock Thomas Hellström
2025-03-04 15:16   ` Matthew Auld
2025-03-04 15:37     ` Thomas Hellström
2025-03-04 11:37 ` [PATCH v2 3/3] drm/xe/userptr: Unmap userptrs in the mmu notifier Thomas Hellström
2025-03-04 16:53   ` Matthew Auld
2025-03-04 13:48 ` ✗ CI.Patch_applied: failure for drm/xe: Userptr invalid page access fixes (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jz95yoip.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=oak.zeng@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=thomas.hellstrom@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.