From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Karthik Poosa <karthik.poosa@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, <anshuman.gupta@intel.com>,
<badal.nilawar@intel.com>, <raag.jadav@intel.com>,
<riana.tauro@intel.com>, <sk.anirban@intel.com>,
<mallesh.koujalagi@intel.com>, <soham.purkait@intel.com>
Subject: Re: [PATCH 2/2] drm/xe/hwmon: Increase timeout for mailbox power limits
Date: Mon, 31 Aug 2026 09:59:42 -0400 [thread overview]
Message-ID: <apWIzqpwcDeDxbwq@intel.com> (raw)
In-Reply-To: <20260729171546.3368457-3-karthik.poosa@intel.com>
On Wed, Jul 29, 2026 at 10:45:46PM +0530, Karthik Poosa wrote:
> Mailbox power limit operations can occasionally take longer than the
> current 1 ms timeout, causing sporadic failures.
> Increase the timeout to 10 ms and rename PL_WRITE_MBX_TIMEOUT_MS to
> PL_MBX_TIMEOUT_MS to better reflect its usage.
>
> Signed-off-by: Karthik Poosa <karthik.poosa@intel.com>
> ---
> drivers/gpu/drm/xe/xe_hwmon.c | 28 +++++++++++++++-------------
> 1 file changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
> index de3f2aeffc3f..459ad953dfc8 100644
> --- a/drivers/gpu/drm/xe/xe_hwmon.c
> +++ b/drivers/gpu/drm/xe/xe_hwmon.c
> @@ -102,9 +102,9 @@ enum sensor_attr_power {
> #define PWR_ATTR_TO_STR(attr) (((attr) == hwmon_power_max) ? "PL1" : "PL2")
>
> /*
> - * Timeout for power limit write mailbox command.
> + * Timeout for power limit mailbox commands.
while at it, please remove this useless comments all over.
I know it pre-dates AI, but it looks like AI code, commenting the obvious,
which is already clear in the define name...
> */
> -#define PL_WRITE_MBX_TIMEOUT_MS (1)
> +#define PL_MBX_TIMEOUT_MS (10)
>
> /* Index of memory controller in READ_THERMAL_DATA output */
> #define TEMP_INDEX_MCTRL 2
> @@ -199,11 +199,12 @@ static int xe_hwmon_pcode_read_power_limit(const struct xe_hwmon *hwmon, u32 att
> u32 val0 = 0, val1 = 0;
> int ret = 0;
>
> - ret = xe_pcode_read(root_tile, PCODE_MBOX(PCODE_POWER_SETUP,
> - (channel == CHANNEL_CARD) ?
> - READ_PSYSGPU_POWER_LIMIT :
> - READ_PACKAGE_POWER_LIMIT,
> - prepare_power_limit_param2(hwmon)), &val0, &val1);
> + ret = xe_pcode_read_timeout(root_tile, PCODE_MBOX(PCODE_POWER_SETUP,
> + (channel == CHANNEL_CARD) ?
> + READ_PSYSGPU_POWER_LIMIT :
> + READ_PACKAGE_POWER_LIMIT,
> + prepare_power_limit_param2(hwmon)),
> + &val0, &val1, PL_MBX_TIMEOUT_MS);
>
> if (ret) {
> drm_dbg(&hwmon->xe->drm, "read failed ch %d val0 0x%08x, val1 0x%08x, ret %d\n",
> @@ -232,11 +233,12 @@ static int xe_hwmon_pcode_rmw_power_limit(const struct xe_hwmon *hwmon, u32 attr
> u32 val0 = 0, val1 = 0;
> int ret = 0;
>
> - ret = xe_pcode_read(root_tile, PCODE_MBOX(PCODE_POWER_SETUP,
> - (channel == CHANNEL_CARD) ?
> - READ_PSYSGPU_POWER_LIMIT :
> - READ_PACKAGE_POWER_LIMIT,
> - prepare_power_limit_param2(hwmon)), &val0, &val1);
> + ret = xe_pcode_read_timeout(root_tile, PCODE_MBOX(PCODE_POWER_SETUP,
> + (channel == CHANNEL_CARD) ?
> + READ_PSYSGPU_POWER_LIMIT :
> + READ_PACKAGE_POWER_LIMIT,
> + prepare_power_limit_param2(hwmon)),
> + &val0, &val1, PL_MBX_TIMEOUT_MS);
> if (ret)
> drm_dbg(&hwmon->xe->drm, "read failed ch %d val0 0x%08x, val1 0x%08x, ret %d\n",
> channel, val0, val1, ret);
> @@ -252,7 +254,7 @@ static int xe_hwmon_pcode_rmw_power_limit(const struct xe_hwmon *hwmon, u32 attr
> (channel == CHANNEL_CARD) ?
> WRITE_PSYSGPU_POWER_LIMIT :
> WRITE_PACKAGE_POWER_LIMIT, 0),
> - val0, val1, PL_WRITE_MBX_TIMEOUT_MS);
> + val0, val1, PL_MBX_TIMEOUT_MS);
> if (ret)
> drm_dbg(&hwmon->xe->drm, "write failed ch %d val0 0x%08x, val1 0x%08x, ret %d\n",
> channel, val0, val1, ret);
> --
> 2.25.1
>
next prev parent reply other threads:[~2026-08-31 13:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 17:15 [PATCH 0/2] drm/xe: Increase timeout for hwmon power limit mailbox operations Karthik Poosa
2026-07-29 17:14 ` ✓ CI.KUnit: success for " Patchwork
2026-07-29 17:15 ` [PATCH 1/2] drm/xe/pcode: Introduce xe_pcode_read_timeout() API Karthik Poosa
2026-08-31 5:32 ` Tauro, Riana
2026-08-31 6:50 ` Poosa, Karthik
2026-07-29 17:15 ` [PATCH 2/2] drm/xe/hwmon: Increase timeout for mailbox power limits Karthik Poosa
2026-08-31 5:29 ` Tauro, Riana
2026-08-31 6:54 ` Poosa, Karthik
2026-08-31 7:09 ` Tauro, Riana
2026-08-31 7:41 ` Raag Jadav
2026-08-31 13:58 ` Rodrigo Vivi
2026-08-31 16:27 ` Poosa, Karthik
2026-08-31 16:48 ` Rodrigo Vivi
2026-08-31 13:59 ` Rodrigo Vivi [this message]
2026-07-29 18:07 ` ✓ Xe.CI.BAT: success for drm/xe: Increase timeout for hwmon power limit mailbox operations Patchwork
2026-07-29 22:58 ` ✗ Xe.CI.FULL: failure " 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=apWIzqpwcDeDxbwq@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=badal.nilawar@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=karthik.poosa@intel.com \
--cc=mallesh.koujalagi@intel.com \
--cc=raag.jadav@intel.com \
--cc=riana.tauro@intel.com \
--cc=sk.anirban@intel.com \
--cc=soham.purkait@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