From: Dan Carpenter <dan.carpenter@oracle.com> To: Alex Deucher <alexander.deucher@amd.com> Cc: "Christian König" <christian.koenig@amd.com>, "David Airlie" <airlied@linux.ie>, "Daniel Vetter" <daniel@ffwll.ch>, "Evan Quan" <evan.quan@amd.com>, "Kevin Wang" <kevin1.wang@amd.com>, "Hawking Zhang" <Hawking.Zhang@amd.com>, "Lijo Lazar" <lijo.lazar@amd.com>, amd-gfx@lists.freedesktop.org, kernel-janitors@vger.kernel.org Subject: [PATCH] drm/amd/pm: fix error code in smu_set_power_limit() Date: Wed, 14 Apr 2021 08:59:22 +0300 [thread overview] Message-ID: <YHaEutSVsa63kcFZ@mwanda> (raw) We should return -EINVAL instead of success if the "limit" is too high. Fixes: e098bc9612c2 ("drm/amd/pm: optimize the power related source code layout") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index e0eb7ca112e2..c29d8b3131b7 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -2221,6 +2221,7 @@ static int smu_set_power_limit(void *handle, uint32_t limit) dev_err(smu->adev->dev, "New power limit (%d) is over the max allowed %d\n", limit, smu->max_power_limit); + ret = -EINVAL; goto out; } -- 2.30.2
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com> To: Alex Deucher <alexander.deucher@amd.com> Cc: "Lijo Lazar" <lijo.lazar@amd.com>, "David Airlie" <airlied@linux.ie>, "Kevin Wang" <kevin1.wang@amd.com>, kernel-janitors@vger.kernel.org, amd-gfx@lists.freedesktop.org, "Daniel Vetter" <daniel@ffwll.ch>, "Evan Quan" <evan.quan@amd.com>, "Christian König" <christian.koenig@amd.com>, "Hawking Zhang" <Hawking.Zhang@amd.com> Subject: [PATCH] drm/amd/pm: fix error code in smu_set_power_limit() Date: Wed, 14 Apr 2021 08:59:22 +0300 [thread overview] Message-ID: <YHaEutSVsa63kcFZ@mwanda> (raw) We should return -EINVAL instead of success if the "limit" is too high. Fixes: e098bc9612c2 ("drm/amd/pm: optimize the power related source code layout") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index e0eb7ca112e2..c29d8b3131b7 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -2221,6 +2221,7 @@ static int smu_set_power_limit(void *handle, uint32_t limit) dev_err(smu->adev->dev, "New power limit (%d) is over the max allowed %d\n", limit, smu->max_power_limit); + ret = -EINVAL; goto out; } -- 2.30.2 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next reply other threads:[~2021-04-14 5:59 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-14 5:59 Dan Carpenter [this message] 2021-04-14 5:59 ` [PATCH] drm/amd/pm: fix error code in smu_set_power_limit() Dan Carpenter 2021-04-15 16:23 ` Alex Deucher 2021-04-15 16:23 ` Alex Deucher
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=YHaEutSVsa63kcFZ@mwanda \ --to=dan.carpenter@oracle.com \ --cc=Hawking.Zhang@amd.com \ --cc=airlied@linux.ie \ --cc=alexander.deucher@amd.com \ --cc=amd-gfx@lists.freedesktop.org \ --cc=christian.koenig@amd.com \ --cc=daniel@ffwll.ch \ --cc=evan.quan@amd.com \ --cc=kernel-janitors@vger.kernel.org \ --cc=kevin1.wang@amd.com \ --cc=lijo.lazar@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: linkBe 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.