From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: Jesse Zhang <jesse.zhang@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Alexander.Deucher@amd.com,
Christian Koenig <christian.koenig@amd.com>,
Tim.Huang@amd.com
Subject: Re: [PATCH 19/22 V2] drm/amdgpu: Fix the warning division or modulo by zero for the variable num_xcc_per_xcp
Date: Fri, 10 May 2024 14:03:33 +0530 [thread overview]
Message-ID: <85ed088d-e090-40d4-a7da-49cc74e24ffd@amd.com> (raw)
In-Reply-To: <20240510082623.3500063-1-jesse.zhang@amd.com>
On 5/10/2024 1:56 PM, Jesse Zhang wrote:
> Checks the partition mode and returns an error for an invalid mode.
>
> Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
> Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c b/drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c
> index 414ea3f560a7..b1c18b7a38ad 100644
> --- a/drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c
> +++ b/drivers/gpu/drm/amd/amdgpu/aqua_vanjaram.c
> @@ -501,6 +501,12 @@ static int aqua_vanjaram_switch_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr,
>
> if (mode == AMDGPU_AUTO_COMPUTE_PARTITION_MODE) {
> mode = __aqua_vanjaram_get_auto_mode(xcp_mgr);
> + if (mode == AMDGPU_UNKNOWN_COMPUTE_PARTITION_MODE) {
> + dev_err(adev->dev,
> + "Invalid compute partition mode requested, requested: %s, available memory partitions: %d",
Please change the error message to something like
"Invalid config, no compatible compute partition mode found, available
memory partitions: %d"
With that change,
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Thanks,
Lijo
> + amdgpu_gfx_compute_mode_desc(mode), adev->gmc.num_mem_partitions);
> + return -EINVAL;
> + }
> } else if (!__aqua_vanjaram_is_valid_mode(xcp_mgr, mode)) {
> dev_err(adev->dev,
> "Invalid compute partition mode requested, requested: %s, available memory partitions: %d",
> @@ -522,6 +528,7 @@ static int aqua_vanjaram_switch_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr,
> goto unlock;
>
> num_xcc_per_xcp = __aqua_vanjaram_get_xcc_per_xcp(xcp_mgr, mode);
> if (adev->gfx.funcs->switch_partition_mode)
> adev->gfx.funcs->switch_partition_mode(xcp_mgr->adev,
> num_xcc_per_xcp);
prev parent reply other threads:[~2024-05-10 8:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-10 8:26 [PATCH 19/22 V2] drm/amdgpu: Fix the warning division or modulo by zero for the variable num_xcc_per_xcp Jesse Zhang
2024-05-10 8:33 ` Lazar, Lijo [this message]
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=85ed088d-e090-40d4-a7da-49cc74e24ffd@amd.com \
--to=lijo.lazar@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Tim.Huang@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=jesse.zhang@amd.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 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.