All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mallesh Koujalagi" <mallesh.koujalagi@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [RFC PATCH v1 3/6] drm/xe/cper: Add gfp argument to xe_cper_emit()
Date: Thu, 26 Nov 2026 14:13:09 +0000	[thread overview]
Message-ID: <sashiko-outbox-235678@kernel.org> (raw)
In-Reply-To: <20261126135732.2169939-11-mallesh.koujalagi@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/xe/cper: GFP_KERNEL allocation in log_emit_cper() breaks
  atomic callers
--

commit 826dbbb831de269b02c7f7d8232c745e70217854
Author: Mallesh Koujalagi <mallesh.koujalagi@intel.com>

drm/xe/cper: Add gfp argument to xe_cper_emit()

This commit adds a gfp_t parameter to xe_cper_emit() and
xe_cper_emit_counter(), passing GFP_KERNEL from log_emit_cper() and
GFP_ATOMIC | __GFP_NOWARN from log_emit_cper_atomic().

> diff --git a/drivers/gpu/drm/xe/xe_log.c b/drivers/gpu/drm/xe/xe_log.c
> index 78c114754daa2..c5cc1de4c5076 100644
> --- a/drivers/gpu/drm/xe/xe_log.c
> +++ b/drivers/gpu/drm/xe/xe_log.c
> @@ -22,7 +22,7 @@ static void log_emit_cper(struct pci_dev *pdev, int cper_sev, enum xe_sigid sigi
>  				   component, location, data, len, vaf);
>  
>  	xe_cper_emit(xe_any_to_xe(pdev), cper_sev, sigid,
> -		     component, location, data, len, vaf);
> +		     component, location, data, len, vaf, GFP_KERNEL);
>  }

[Severity: High]
Can passing GFP_KERNEL to xe_cper_emit() from log_emit_cper() cause
sleeping allocations in atomic context or invert the fs_reclaim ->
ct->lock lock ordering on platforms with has_driver_cper?

cper_emit_sw_err() previously allocated with GFP_NOWAIT | __GFP_NOWARN,
and several callers of xe_log_err() and xe_log_err_fatal() still run in
atomic or reclaim-restricted contexts.  For example, xe_wedge_declare() is
called from hardirq context via dg1_irq_handler() -> xe_mert_irq_handler()
-> mert_handle_cat_error() -> xe_wedge_declare(), and calls
xe_log_err_fatal().  Similarly, xe_pcode_request() calls
pcode_try_request() -> ... -> pcode_mailbox_status() -> xe_log_err() under
preempt_disable(), and guc_ct_send_locked() and dequeue_one_g2h() call
xe_log_err() while holding ct->lock (which primelockdep() primes under
fs_reclaim_acquire(GFP_KERNEL)).

Later commits in this series ("drm/xe/pagefault: Use xe_log_err_atomic()
for queue full errors" and "drm/xe/guc_ct: Use atomic logging under
ct->fast_lock") convert the pf_queue->lock and ct->fast_lock sites, which
are also broken at this commit, while the xe_wedge_declare(),
pcode_mailbox_status() and ct->lock paths remain unconverted.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126135732.2169939-8-mallesh.koujalagi@intel.com?part=3

  reply	other threads:[~2026-11-26 14:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 13:57 [RFC PATCH v1 0/6] drm/xe: Support xe_log_* helpers in atomic context Mallesh Koujalagi
2026-11-26 13:57 ` [RFC PATCH v1 1/6] drm/xe/cper: Software CPER-Do not review Mallesh Koujalagi
2026-11-26 14:18   ` sashiko-bot
2026-11-26 13:57 ` [RFC PATCH v1 2/6] drm/xe/log: Add xe_log_* logging helpers for atomic context Mallesh Koujalagi
2026-11-26 13:57 ` [RFC PATCH v1 3/6] drm/xe/cper: Add gfp argument to xe_cper_emit() Mallesh Koujalagi
2026-11-26 14:13   ` sashiko-bot [this message]
2026-11-26 13:57 ` [RFC PATCH v1 4/6] drm/xe/tests: Update log tests for atomic logging support Mallesh Koujalagi
2026-11-26 13:57 ` [RFC PATCH v1 5/6] drm/xe/pagefault: Use xe_log_err_atomic() for queue full errors Mallesh Koujalagi
2026-11-26 13:57 ` [RFC PATCH v1 6/6] drm/xe/guc_ct: Use atomic logging under ct->fast_lock Mallesh Koujalagi
2026-11-26 14:10   ` sashiko-bot
2026-11-26 18:41 ` ✗ CI.checkpatch: warning for drm/xe: Support xe_log_* helpers in atomic context Patchwork
2026-11-26 18:43 ` ✓ CI.KUnit: success " Patchwork
2026-11-26 19:21 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-27  5:25 ` ✓ Xe.CI.FULL: " 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=sashiko-outbox-235678@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=mallesh.koujalagi@intel.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.