From: Bjorn Helgaas <helgaas@kernel.org>
To: Prike Liang <Prike.Liang@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
Evan.quan@amd.com, ray.huang@amd.com, linux-kernel@vger.org,
amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/amd/powerplay: fix pre-check condition for setting clock range
Date: Mon, 9 Mar 2020 08:10:34 -0500 [thread overview]
Message-ID: <20200309131034.GA64875@google.com> (raw)
In-Reply-To: <1583290538-30426-1-git-send-email-Prike.Liang@amd.com>
On Wed, Mar 04, 2020 at 10:55:37AM +0800, Prike Liang wrote:
> This fix will handle some MP1 FW issue like as mclk dpm table in
> renoir has a reverse dpm clock layout and a zero frequency dpm level
> as following case.
>
> cat pp_dpm_mclk
> 0: 1200Mhz
> 1: 1200Mhz
> 2: 800Mhz
> 3: 0Mhz
>
> Signed-off-by: Prike Liang <Prike.Liang@amd.com>
> ---
> drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +-
> drivers/gpu/drm/amd/powerplay/smu_v12_0.c | 3 ---
> 2 files changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> index e3398f9..d454493 100644
> --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> @@ -214,7 +214,7 @@ int smu_set_soft_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
> {
> int ret = 0;
>
> - if (min <= 0 && max <= 0)
> + if (min < 0 && max < 0)
This change causes the following Coverity warning because min and max
are both unsigned:
int smu_set_soft_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
uint32_t min, uint32_t max)
>>> CID 1460516: Integer handling issues (NO_EFFECT)
>>> This less-than-zero comparison of an unsigned value is never true. "min < 0U".
225 if (min < 0 && max < 0)
226 return -EINVAL;
> return -EINVAL;
>
> if (!smu_clk_dpm_is_enabled(smu, clk_type))
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2020-03-09 13:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-04 2:55 [PATCH 1/2] drm/amd/powerplay: fix pre-check condition for setting clock range Prike Liang
2020-03-04 2:55 ` [PATCH 2/2] drm/amd/powerplay: map mclk to fclk for COMBINATIONAL_BYPASS case Prike Liang
2020-03-04 3:20 ` Quan, Evan
2020-03-09 13:10 ` Bjorn Helgaas [this message]
2020-03-10 0:05 ` [PATCH 1/2] drm/amd/powerplay: fix pre-check condition for setting clock range Liang, Prike
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=20200309131034.GA64875@google.com \
--to=helgaas@kernel.org \
--cc=Evan.quan@amd.com \
--cc=Prike.Liang@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=linux-kernel@vger.org \
--cc=ray.huang@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.