From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 3/4] drm/xe/oa: Add val arg to xe_oa_is_valid_config_reg
Date: Mon, 11 May 2026 13:41:33 -0700 [thread overview]
Message-ID: <agI+/b71gVUNYd2G@soc-5CG1426VCC.clients.intel.com> (raw)
In-Reply-To: <87se7xydof.wl-ashutosh.dixit@intel.com>
On Mon, May 11, 2026 at 12:00:16PM -0700, Dixit, Ashutosh wrote:
>On Mon, 11 May 2026 11:31:44 -0700, Umesh Nerlige Ramappa wrote:
>>
>> On Thu, Apr 30, 2026 at 09:14:58AM -0700, Ashutosh Dixit wrote:
>> > Add val arg to xe_oa_is_valid_config_reg so that register values can also
>> > be verified, in addition to register address. Value verification is needed
>> > to implement MERTOA Wa_14026779378.
>> >
>> > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
>> > ---
>> > drivers/gpu/drm/xe/xe_oa.c | 18 +++++++++---------
>> > 1 file changed, 9 insertions(+), 9 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
>> > index 13458050907ad..7e1e8a86d19c0 100644
>> > --- a/drivers/gpu/drm/xe/xe_oa.c
>> > +++ b/drivers/gpu/drm/xe/xe_oa.c
>> > @@ -2249,7 +2249,7 @@ static bool xe_oa_is_valid_mux_addr(struct xe_oa *oa, u32 addr)
>> > return xe_oa_reg_in_range_table(addr, gen12_oa_mux_regs);
>> > }
>> >
>> > -static bool xe_oa_is_valid_config_reg_addr(struct xe_oa *oa, u32 addr)
>> > +static bool xe_oa_is_valid_config_reg(struct xe_oa *oa, u32 addr, u32 val)
>> > {
>> > return xe_oa_is_valid_flex_addr(oa, addr) ||
>> > xe_oa_is_valid_b_counter_addr(oa, addr) ||
>>
>> But val is not being used here. Maybe we can drop it and revive it when we
>> actually know what to compare the val against?
>
>Hi Umesh, It is used in the next patch, as mentioned in the commit
>message. This patch is just to separate out the refactor from the actual wa
>(which is implemented in the next patch). Thanks.
My bad. I missed that.
Umesh
>
>> > @@ -2257,7 +2257,7 @@ static bool xe_oa_is_valid_config_reg_addr(struct xe_oa *oa, u32 addr)
>> > }
>> >
>> > static struct xe_oa_reg *
>> > -xe_oa_alloc_regs(struct xe_oa *oa, bool (*is_valid)(struct xe_oa *oa, u32 addr),
>> > +xe_oa_alloc_regs(struct xe_oa *oa, bool (*is_valid)(struct xe_oa *oa, u32 addr, u32 val),
>> > u32 __user *regs, u32 n_regs)
>> > {
>> > struct xe_oa_reg *oa_regs;
>> > @@ -2275,16 +2275,16 @@ xe_oa_alloc_regs(struct xe_oa *oa, bool (*is_valid)(struct xe_oa *oa, u32 addr),
>> > if (err)
>> > goto addr_err;
>> >
>> > - if (!is_valid(oa, addr)) {
>> > - drm_dbg(&oa->xe->drm, "Invalid oa_reg address: %X\n", addr);
>> > - err = -EINVAL;
>> > - goto addr_err;
>> > - }
>> > -
>> > err = get_user(value, regs + 1);
>> > if (err)
>> > goto addr_err;
>> >
>> > + if (!is_valid(oa, addr, value)) {
>> > + drm_dbg(&oa->xe->drm, "Invalid oa_reg addr/value: %#x %#x\n", addr, value);
>> > + err = -EINVAL;
>> > + goto addr_err;
>> > + }
>> > +
>> > oa_regs[i].addr = XE_REG(addr);
>> > oa_regs[i].value = value;
>> >
>> > @@ -2383,7 +2383,7 @@ int xe_oa_add_config_ioctl(struct drm_device *dev, u64 data, struct drm_file *fi
>> > memcpy(oa_config->uuid, arg->uuid, sizeof(arg->uuid));
>> >
>> > oa_config->regs_len = arg->n_regs;
>> > - regs = xe_oa_alloc_regs(oa, xe_oa_is_valid_config_reg_addr,
>> > + regs = xe_oa_alloc_regs(oa, xe_oa_is_valid_config_reg,
>> > u64_to_user_ptr(arg->regs_ptr),
>> > arg->n_regs);
>> > if (IS_ERR(regs)) {
>> > --
>> > 2.54.0
>> >
next prev parent reply other threads:[~2026-05-11 20:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 16:14 [PATCH 0/4] More MERTOA WA's Ashutosh Dixit
2026-04-30 16:14 ` [PATCH 1/4] drm/xe/oa: Refactor oa_unit_supports_oa_format Ashutosh Dixit
2026-04-30 16:14 ` [PATCH 2/4] drm/xe/oa: MERTOA Wa_14026746987 Ashutosh Dixit
2026-04-30 16:14 ` [PATCH 3/4] drm/xe/oa: Add val arg to xe_oa_is_valid_config_reg Ashutosh Dixit
2026-05-11 18:31 ` Umesh Nerlige Ramappa
2026-05-11 19:00 ` Dixit, Ashutosh
2026-05-11 20:41 ` Umesh Nerlige Ramappa [this message]
2026-04-30 16:14 ` [PATCH 4/4] drm/xe/oa: MERTOA Wa_14026779378 Ashutosh Dixit
2026-04-30 17:21 ` ✓ CI.KUnit: success for More MERTOA WA's Patchwork
2026-04-30 18:16 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-01 5:06 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-05-11 20:42 ` [PATCH 0/4] " Umesh Nerlige Ramappa
2026-05-12 21:23 ` Dixit, Ashutosh
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=agI+/b71gVUNYd2G@soc-5CG1426VCC.clients.intel.com \
--to=umesh.nerlige.ramappa@intel.com \
--cc=ashutosh.dixit@intel.com \
--cc=intel-xe@lists.freedesktop.org \
/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