From: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
Alex Deucher <alexander.deucher@amd.com>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Hawking Zhang <Hawking.Zhang@amd.com>,
Lijo Lazar <lijo.lazar@amd.com>,
Michael J <michael.j.ruhl@intel.com>,
Riana Tauro <riana.tauro@intel.com>,
Anshuman Gupta <anshuman.gupta@intel.com>
Subject: Re: [RFC v5 5/5] drm/xe/RAS: send multicast event on occurrence of an error
Date: Tue, 26 Aug 2025 15:04:27 +0530 [thread overview]
Message-ID: <ec613c23-1c0a-417c-92c1-df47fd09d3d7@linux.intel.com> (raw)
In-Reply-To: <aJ-uRzbCxXmiQhlH@intel.com>
[-- Attachment #1: Type: text/plain, Size: 2831 bytes --]
On 16-08-2025 03:31, Rodrigo Vivi wrote:
> On Wed, Jul 30, 2025 at 12:19:56PM +0530, Aravind Iddamsetty wrote:
>> Whenever a correctable or an uncorrectable error happens an event is sent
>> to the corresponding listeners of these groups.
>>
>> v2: Rebase
>> v3: protect with CONFIG_NET define.
>>
>> Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com> #v2
>> Signed-off-by: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_hw_error.c | 41 ++++++++++++++++++++++++++++++++
>> 1 file changed, 41 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_hw_error.c b/drivers/gpu/drm/xe/xe_hw_error.c
>> index bdd9c88674b2..e6e2e6250b70 100644
>> --- a/drivers/gpu/drm/xe/xe_hw_error.c
>> +++ b/drivers/gpu/drm/xe/xe_hw_error.c
>> @@ -2,6 +2,8 @@
>> /*
>> * Copyright © 2023 Intel Corporation
>> */
>> +#include <net/genetlink.h>
>> +#include <uapi/drm/drm_netlink.h>
>>
>> #include "xe_gt_printk.h"
>> #include "xe_hw_error.h"
>> @@ -776,6 +778,43 @@ xe_soc_hw_error_handler(struct xe_tile *tile, const enum hardware_error hw_err)
>> (HARDWARE_ERROR_MAX << 1) + 1);
>> }
>>
>> +#ifdef CONFIG_NET
>> +static void
>> +generate_netlink_event(struct xe_device *xe, const enum hardware_error hw_err)
>> +{
>> + struct sk_buff *msg;
>> + void *hdr;
>> +
>> + if (!xe->drm.drm_genl_family)
>> + return;
>> +
>> + msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
>> + if (!msg) {
>> + drm_dbg_driver(&xe->drm, "couldn't allocate memory for error multicast event\n");
>> + return;
>> + }
>> +
>> + hdr = genlmsg_put(msg, 0, 0, xe->drm.drm_genl_family, 0, DRM_RAS_CMD_ERROR_EVENT);
> this is something that could be wrapped up in the drm_ras
are you referring to entire generate_netlink_event function? because I
thought driver might want to pass in custom info as part of event
may be like the error ID that was reported by HW.
Thanks,
Aravind.
>
>> + if (!hdr) {
>> + drm_dbg_driver(&xe->drm, "mutlicast msg buffer is small\n");
>> + nlmsg_free(msg);
>> + return;
>> + }
>> +
>> + genlmsg_end(msg, hdr);
>> +
>> + genlmsg_multicast(xe->drm.drm_genl_family, msg, 0,
>> + hw_err ?
>> + DRM_GENL_MCAST_UNCORR_ERR
>> + : DRM_GENL_MCAST_CORR_ERR,
>> + GFP_ATOMIC);
>> +}
>> +#else
>> +static void
>> +generate_netlink_event(struct xe_device *xe, const enum hardware_error hw_err)
>> +{}
>> +#endif
>> +
>> static void
>> xe_hw_error_source_handler(struct xe_tile *tile, const enum hardware_error hw_err)
>> {
>> @@ -837,6 +876,8 @@ xe_hw_error_source_handler(struct xe_tile *tile, const enum hardware_error hw_er
>> }
>>
>> xe_mmio_write32(&tile->mmio, DEV_ERR_STAT_REG(hw_err), errsrc);
>> +
>> + generate_netlink_event(tile_to_xe(tile), hw_err);
>> unlock:
>> spin_unlock_irqrestore(&tile_to_xe(tile)->irq.lock, flags);
>> }
>> --
>> 2.25.1
>>
[-- Attachment #2: Type: text/html, Size: 3793 bytes --]
next prev parent reply other threads:[~2025-08-26 9:34 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-30 6:49 [RFC v5 0/5] Proposal to use netlink for RAS and Telemetry across drm subsystem Aravind Iddamsetty
2025-07-30 6:49 ` [RFC v5 1/5] drm/netlink: Add netlink infrastructure Aravind Iddamsetty
2025-08-15 17:07 ` Zack McKevitt
2025-08-21 9:45 ` Aravind Iddamsetty
2025-08-25 17:31 ` Zack McKevitt
2025-08-15 21:48 ` Rodrigo Vivi
2025-08-26 5:58 ` Aravind Iddamsetty
2025-07-30 6:49 ` [RFC v5 2/5] drm/xe/RAS: Register netlink capability Aravind Iddamsetty
2025-08-15 21:52 ` Rodrigo Vivi
2025-08-26 9:01 ` Aravind Iddamsetty
2025-07-30 6:49 ` [RFC v5 3/5] drm/xe/RAS: Expose the error counters Aravind Iddamsetty
2025-08-15 21:58 ` Rodrigo Vivi
2025-08-26 9:26 ` Aravind Iddamsetty
2025-07-30 6:49 ` [RFC v5 4/5] drm/netlink: Define multicast groups Aravind Iddamsetty
2025-08-15 22:00 ` Rodrigo Vivi
2025-07-30 6:49 ` [RFC v5 5/5] drm/xe/RAS: send multicast event on occurrence of an error Aravind Iddamsetty
2025-08-15 22:01 ` Rodrigo Vivi
2025-08-26 9:34 ` Aravind Iddamsetty [this message]
2025-07-30 21:00 ` [RFC v5 0/5] Proposal to use netlink for RAS and Telemetry across drm subsystem Lukas Wunner
2025-07-31 15:30 ` Aravind Iddamsetty
2025-08-13 20:21 ` Rodrigo Vivi
2025-08-15 21:24 ` Rodrigo Vivi
2025-08-26 4:42 ` Aravind Iddamsetty
2025-08-25 9:38 ` Aravind Iddamsetty
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=ec613c23-1c0a-417c-92c1-df47fd09d3d7@linux.intel.com \
--to=aravind.iddamsetty@linux.intel.com \
--cc=Hawking.Zhang@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=anshuman.gupta@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=joonas.lahtinen@linux.intel.com \
--cc=lijo.lazar@amd.com \
--cc=michael.j.ruhl@intel.com \
--cc=riana.tauro@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
/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;
as well as URLs for NNTP newsgroup(s).