From: Raag Jadav <raag.jadav@intel.com>
To: dave@stgolabs.net, jic23@kernel.org, dave.jiang@intel.com,
alison.schofield@intel.com, vishal.l.verma@intel.com,
djbw@kernel.org, iweiny@kernel.org, ming.li@zohomail.com,
bhelgaas@google.com, rodrigo.vivi@intel.com
Cc: linux-cxl@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, intel-xe@lists.freedesktop.org,
lukas@wunner.de, riana.tauro@intel.com,
michal.wajdeczko@intel.com, matthew.d.roper@intel.com,
Raag Jadav <raag.jadav@intel.com>
Subject: [PATCH v2 2/2] drm/xe/ras: Enable SGUnit PCIe error reporting
Date: Tue, 25 Aug 2026 11:12:51 +0530 [thread overview]
Message-ID: <20260825054312.1319951-3-raag.jadav@intel.com> (raw)
In-Reply-To: <20260825054312.1319951-1-raag.jadav@intel.com>
SGUnit as a PCI endpoint is not AER capable and requires explicit
programming of error reporting bits in DevCtl register of it's config
space for upstream error propagation. Hack it.
While at it, add native AER sanity check for upstream port before
programming SGUnit register.
This is as per pci_enable_pcie_error_reporting() logic implemented
in PCIe AER driver.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
---
drivers/gpu/drm/xe/xe_ras.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
index de4cb9ef7355..c4b5c0b5eb0d 100644
--- a/drivers/gpu/drm/xe/xe_ras.c
+++ b/drivers/gpu/drm/xe/xe_ras.c
@@ -3,6 +3,8 @@
* Copyright © 2026 Intel Corporation
*/
+#include <linux/aer.h>
+
#include "xe_debugfs.h"
#include "xe_device.h"
#include "xe_drm_ras.h"
@@ -234,6 +236,9 @@ static struct pci_dev *find_usp_dev(struct pci_dev *pdev)
return pci_upstream_bridge(vsp);
}
+#define PCI_EXP_AER_FLAGS (PCI_EXP_DEVCTL_CERE | PCI_EXP_DEVCTL_NFERE | \
+ PCI_EXP_DEVCTL_FERE | PCI_EXP_DEVCTL_URRE)
+
static void ras_usp_aer_init(struct xe_device *xe)
{
struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
@@ -251,6 +256,14 @@ static void ras_usp_aer_init(struct xe_device *xe)
return;
}
+ if (!pcie_aer_is_native(usp)) {
+ dev_warn(&usp->dev, "No native AER support\n");
+ return;
+ }
+
+ pcie_capability_set_word(pdev, PCI_EXP_DEVCTL, PCI_EXP_AER_FLAGS);
+ pci_save_state(pdev);
+
/*
* Clear any stale Uncorrectable Internal Error Status event in Uncorrectable Error
* Status Register.
@@ -279,6 +292,7 @@ static void ras_usp_aer_init(struct xe_device *xe)
pci_save_state(usp);
dev_dbg(&usp->dev, "Uncorrectable Internal Errors downgraded and unmasked\n");
}
+MODULE_IMPORT_NS("AER");
static void ras_send_error_event(struct xe_device *xe, u8 severity, u8 component)
{
--
2.43.0
next prev parent reply other threads:[~2026-08-25 5:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 5:42 [PATCH v2 0/2] Export pcie_aer_is_native() to AER namespace Raag Jadav
2026-08-25 5:42 ` [PATCH v2 1/2] PCI/AER: " Raag Jadav
2026-08-25 5:49 ` sashiko-bot
2026-08-25 14:18 ` Rodrigo Vivi
2026-08-25 15:05 ` Dave Jiang
2026-08-25 15:25 ` Rodrigo Vivi
2026-08-25 15:41 ` Dave Jiang
2026-08-25 15:00 ` Dave Jiang
2026-08-25 5:42 ` Raag Jadav [this message]
2026-08-25 5:58 ` [PATCH v2 2/2] drm/xe/ras: Enable SGUnit PCIe error reporting sashiko-bot
2026-08-26 21:26 ` Bjorn Helgaas
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=20260825054312.1319951-3-raag.jadav@intel.com \
--to=raag.jadav@intel.com \
--cc=alison.schofield@intel.com \
--cc=bhelgaas@google.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=djbw@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=iweiny@kernel.org \
--cc=jic23@kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=matthew.d.roper@intel.com \
--cc=michal.wajdeczko@intel.com \
--cc=ming.li@zohomail.com \
--cc=riana.tauro@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=vishal.l.verma@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