Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	Matt Atwood <matthew.s.atwood@intel.com>,
	Matthew Brost <matthew.brost@intel.com>
Subject: Re: [PATCH] drm/xe: Fix wa_oob codegen recipe for external module builds
Date: Mon, 8 Jun 2026 20:50:18 -0400	[thread overview]
Message-ID: <aidjSmuniJLmR4Uz@intel.com> (raw)
In-Reply-To: <20260604074501.172129-1-thomas.hellstrom@linux.intel.com>

On Thu, Jun 04, 2026 at 09:45:00AM +0200, Thomas Hellström wrote:
> When building with 'make M=drivers/gpu/drm/xe modules', kbuild invokes
> scripts/Makefile.build with obj=., causing $(obj) to expand to '.'.
> Make normalizes './xe_gen_wa_oob' to 'xe_gen_wa_oob' when constructing
> the $^ automatic variable (target name normalization), so the recipe
> command becomes just 'xe_gen_wa_oob ...' without any path prefix, and
> the shell cannot find the tool.
> 
> Fix by replacing $^ with explicit $(obj)/xe_gen_wa_oob and
> $(src)/<rules-file> references in both wa_oob recipe commands.
> In recipe strings, make does not apply target name normalization, so
> $(obj)/xe_gen_wa_oob correctly expands to './xe_gen_wa_oob' and the
> shell can execute it. This matches the pattern already used by other
> DRM drivers (e.g. radeon's mkregtable).
> 
> Fixes: f037e0b78e6d ("drm/xe: add xe_device_wa infrastructure")
> Cc: Matt Atwood <matthew.s.atwood@intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: intel-xe@lists.freedesktop.org
> Assisted-by: GitHub_Copilot:claude-sonnet-4.6
> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>


\o/ - I suffered with this bug in my setup many times... I even had a
workaround here at some point, but I was always postponing spending time
on this...

Thanks for fixing it for good!

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/xe/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
> index 09661f079d03..8e7b146880f4 100644
> --- a/drivers/gpu/drm/xe/Makefile
> +++ b/drivers/gpu/drm/xe/Makefile
> @@ -16,14 +16,14 @@ subdir-ccflags-y += -I$(obj) -I$(src)
>  hostprogs := xe_gen_wa_oob
>  generated_oob := $(obj)/generated/xe_wa_oob.c $(obj)/generated/xe_wa_oob.h
>  quiet_cmd_wa_oob = GEN     $(notdir $(generated_oob))
> -      cmd_wa_oob = mkdir -p $(@D); $^ $(generated_oob)
> +      cmd_wa_oob = mkdir -p $(@D); $(obj)/xe_gen_wa_oob $(src)/xe_wa_oob.rules $(generated_oob)
>  $(obj)/generated/%_wa_oob.c $(obj)/generated/%_wa_oob.h: $(obj)/xe_gen_wa_oob \
>  		 $(src)/xe_wa_oob.rules
>  	$(call cmd,wa_oob)
>  
>  generated_device_oob := $(obj)/generated/xe_device_wa_oob.c $(obj)/generated/xe_device_wa_oob.h
>  quiet_cmd_device_wa_oob = GEN	$(notdir $(generated_device_oob))
> -      cmd_device_wa_oob = mkdir -p $(@D); $^ $(generated_device_oob)
> +      cmd_device_wa_oob = mkdir -p $(@D); $(obj)/xe_gen_wa_oob $(src)/xe_device_wa_oob.rules $(generated_device_oob)
>  $(obj)/generated/%_device_wa_oob.c $(obj)/generated/%_device_wa_oob.h: $(obj)/xe_gen_wa_oob \
>  		 $(src)/xe_device_wa_oob.rules
>  	$(call cmd,device_wa_oob)
> -- 
> 2.54.0
> 

      parent reply	other threads:[~2026-06-09  0:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04  7:45 [PATCH] drm/xe: Fix wa_oob codegen recipe for external module builds Thomas Hellström
2026-06-04  7:52 ` ✓ CI.KUnit: success for " Patchwork
2026-06-04  8:32 ` ✓ Xe.CI.BAT: " Patchwork
2026-06-04 19:31 ` ✓ Xe.CI.FULL: " Patchwork
2026-06-09  0:50 ` Rodrigo Vivi [this message]

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=aidjSmuniJLmR4Uz@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=matthew.s.atwood@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox