From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Srinivasan Shanmugam" <srinivasan.shanmugam@amd.com>,
"Xiaojian Du" <Xiaojian.Du@amd.com>,
"Lijo Lazar" <lijo.lazar@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Sasha Levin" <sashal@kernel.org>,
Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch,
Hawking.Zhang@amd.com, tao.zhou1@amd.com, Felix.Kuehling@amd.com,
mukul.joshi@amd.com, shiwu.zhang@amd.com,
mario.limonciello@amd.com, amd-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 6.7 36/39] drm/amdgpu: Fix with right return code '-EIO' in 'amdgpu_gmc_vram_checking()'
Date: Sun, 28 Jan 2024 11:10:56 -0500 [thread overview]
Message-ID: <20240128161130.200783-36-sashal@kernel.org> (raw)
In-Reply-To: <20240128161130.200783-1-sashal@kernel.org>
From: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
[ Upstream commit fac4ebd79fed60e79cccafdad45a2bb8d3795044 ]
The amdgpu_gmc_vram_checking() function in emulation checks whether
all of the memory range of shared system memory could be accessed by
GPU, from this aspect, -EIO is returned for error scenarios.
Fixes the below:
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c:919 gmc_v6_0_hw_init() warn: missing error code? 'r'
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c:1103 gmc_v7_0_hw_init() warn: missing error code? 'r'
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c:1223 gmc_v8_0_hw_init() warn: missing error code? 'r'
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c:2344 gmc_v9_0_hw_init() warn: missing error code? 'r'
Cc: Xiaojian Du <Xiaojian.Du@amd.com>
Cc: Lijo Lazar <lijo.lazar@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
index d2f273d77e59..55784a9f26c4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
@@ -1045,21 +1045,28 @@ int amdgpu_gmc_vram_checking(struct amdgpu_device *adev)
* seconds, so here, we just pick up three parts for emulation.
*/
ret = memcmp(vram_ptr, cptr, 10);
- if (ret)
- return ret;
+ if (ret) {
+ ret = -EIO;
+ goto release_buffer;
+ }
ret = memcmp(vram_ptr + (size / 2), cptr, 10);
- if (ret)
- return ret;
+ if (ret) {
+ ret = -EIO;
+ goto release_buffer;
+ }
ret = memcmp(vram_ptr + size - 10, cptr, 10);
- if (ret)
- return ret;
+ if (ret) {
+ ret = -EIO;
+ goto release_buffer;
+ }
+release_buffer:
amdgpu_bo_free_kernel(&vram_bo, &vram_gpu,
&vram_ptr);
- return 0;
+ return ret;
}
static ssize_t current_memory_partition_show(
--
2.43.0
next prev parent reply other threads:[~2024-01-28 16:12 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-28 16:10 [PATCH AUTOSEL 6.7 01/39] PCI: Only override AMD USB controller if required Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 02/39] PCI: switchtec: Fix stdev_release() crash after surprise hot remove Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 03/39] perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 04/39] xhci: fix possible null pointer deref during xhci urb enqueue Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 05/39] extcon: fix possible name leak in extcon_dev_register() Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 06/39] usb: hub: Replace hardcoded quirk value with BIT() macro Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 07/39] usb: hub: Add quirk to decrease IN-ep poll interval for Microchip USB491x hub Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 08/39] selftests/sgx: Fix linker script asserts Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 09/39] tty: allow TIOCSLCKTRMIOS with CAP_CHECKPOINT_RESTORE Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 10/39] tty: serial: 8250: Set RS422 interface by default to fix Moxa RS422/RS485 PCIe boards Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 11/39] fs/kernfs/dir: obey S_ISGID Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 12/39] spmi: mediatek: Fix UAF on device remove Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 13/39] ring-buffer: Do no swap cpu buffers if order is different Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 14/39] staging: vme_user: Fix the issue of return the wrong error code Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 15/39] power: supply: qcom_battmgr: Register the power supplies after PDR is up Sasha Levin
2024-01-29 13:03 ` Sebastian Reichel
2024-01-30 23:01 ` Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 16/39] PCI: Fix 64GT/s effective data rate calculation Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 17/39] PCI/AER: Decode Requester ID when no error info found Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 18/39] 9p: Fix initialisation of netfs_inode for 9p Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 19/39] tracefs/eventfs: Use root and instance inodes as default ownership Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 20/39] usb: xhci-plat: fix usb disconnect issue after s4 Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 21/39] misc: lis3lv02d_i2c: Add missing setting of the reg_ctrl callback Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 22/39] libsubcmd: Fix memory leak in uniq() Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 23/39] ASoC: codecs: rtq9128: Fix PM_RUNTIME usage Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 24/39] ASoC: codecs: rtq9128: Fix TDM enable and DAI format control flow Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 25/39] drm/amdkfd: Fix lock dependency warning Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 26/39] drm/amd/display: To adjust dprefclk by down spread percentage Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 27/39] Revert "drm/amd/display: Fix conversions between bytes and KB" Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 28/39] drm/amdkfd: Fix lock dependency warning with srcu Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 29/39] virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 30/39] blk-mq: fix IO hang from sbitmap wakeup race Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 31/39] ceph: reinitialize mds feature bit even when session in open Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 32/39] ceph: fix deadlock or deadcode of misusing dget() Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 33/39] ceph: fix invalid pointer access if get_quota_realm return ERR_PTR Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 34/39] drm/amdgpu: fix avg vs input power reporting on smu7 Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 35/39] drm/amd/powerplay: Fix kzalloc parameter 'ATOM_Tonga_PPM_Table' in 'get_platform_power_management_table()' Sasha Levin
2024-01-28 16:10 ` Sasha Levin [this message]
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 37/39] drm/amdgpu: Release 'adev->pm.fw' before return in 'amdgpu_device_need_post()' Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 38/39] drm/amdkfd: Fix 'node' NULL check in 'svm_range_get_range_boundaries()' Sasha Levin
2024-01-28 16:10 ` [PATCH AUTOSEL 6.7 39/39] i2c: rk3x: Adjust mask/value offset for i2c2 on rv1126 Sasha Levin
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=20240128161130.200783-36-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Felix.Kuehling@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Xiaojian.Du@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=lijo.lazar@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mukul.joshi@amd.com \
--cc=shiwu.zhang@amd.com \
--cc=srinivasan.shanmugam@amd.com \
--cc=stable@vger.kernel.org \
--cc=tao.zhou1@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox