Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp780763rdb; Sun, 28 Jan 2024 08:38:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBmfKg5xRf2axThT1DwRFWIf6mvco444SXsqwHqmcGZ2eGSYVTmikZsn3bkbTMPDjin8XT X-Received: by 2002:a17:90a:780f:b0:293:d89e:349b with SMTP id w15-20020a17090a780f00b00293d89e349bmr2106536pjk.57.1706459887943; Sun, 28 Jan 2024 08:38:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706459887; cv=pass; d=google.com; s=arc-20160816; b=tfzce8ORGGRHUdmoQwGOhWndcBcQM3kk6g7hkZn8tzMlVzdHRn5lG2SvGqBTT8vf9I pCEkdFBo4SnhoaDOEo8adv31pCXv4uBiNdZZIstaxSU77rvrwMv67l6Holbw9v0d0MAw IkSJitySfh4KgF3+4etaQHoaYaVFDHN5h3uE3ozkpW1ym7xvHteLk1ndHyIQn0YUUZPH LBxvJy6PBL/ECiS0Dj0frsYz70042XQcQAQciqk1JKfuX+ges3jy4hN6dyIuUea9Y9U3 YiOdOh6kwDoLwg/d8+/GjVSvwZXAhGghCD6bOeboCUtctNbapFY2yCLXE8ttMCweMDXj +sjg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xXaZd1hagROLDyZWaypG9UHr57XfoDG/6OFleq0lVDU=; fh=2Gnf0c1rDbTn7UwGhtfk2jKyH6rMZM2z9a1E4NtgmiE=; b=zH2ZKQrvz6lc0D7lhTW6/VXwoWP2+Lm+obyGUH0BctCP1vjdBsUe/g8RVMP1BZMOWF JJt+RTt/aDajMjRTX4wbF8RjDJvIpjKsuMUL1Uarh6LYUJ5Oz+a/QsOkmcegViFs/jAd UWm+qEwrGkeFOUoWLZuOqdcSQYZAfqAo5wqVdPBXs4gUZZDz6zU5ZJmxSm3B4ClW83qU e2HJZrYCiEDQ96chXtWSmPPmeU6dxPE7VOSdybqqvID5sOmj8dNbZFidzdNNbHw/n8EU rNU0eAlx5b6te212QwZYfOO6RekO7ZWQ329c/dUKCvvZNj5R+ksVi1rYIA9EIPlu2y/k kdsw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SmRY0cx3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-41779-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41779-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a12-20020a17090a8c0c00b00294af473372si3406909pjo.68.2024.01.28.08.38.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 08:38:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41779-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SmRY0cx3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-41779-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41779-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9677228141C for ; Sun, 28 Jan 2024 16:38:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5EE831292D1; Sun, 28 Jan 2024 16:15:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SmRY0cx3" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 863661292CD; Sun, 28 Jan 2024 16:15:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706458508; cv=none; b=BbJZaSHAt/PHuEWyXWlw2TN+DU/gVXrTOFyLhZC11gdyvCP4y2fa1oXC5rp/mgGqA/9kjYGP3HuzjVstp7eiqWpcwShx6w/4y10Wwh8dPbHno1MLMgHt9Izhg/BKmX9WzK4iux8VXKk6jXnPFlx0kQ3by2LWwW1LcMgQ8718+TM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706458508; c=relaxed/simple; bh=h9y2lAYglnEeDHVIfLbYIRCSzH858WPaNlhqC2pj/Qs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VIgKhSqNQawMdXImd8ENZMa3v36C1zTy3LchekOh0181aVRDPWRnqnSWTwJHJsfE9y1ybQV8kU0/hBThxTHSIBMuBkHbOCGG2J8cqyjIdQ2YEhS5saSZRAeqfTf9lNYBkFDOA+cHLuUyfLnhuPYtnEej7QMW3kk+2CISLhKN03I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SmRY0cx3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60AEFC433F1; Sun, 28 Jan 2024 16:15:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706458508; bh=h9y2lAYglnEeDHVIfLbYIRCSzH858WPaNlhqC2pj/Qs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SmRY0cx3STI3JZGtzyp3Vvwz/KxwYXVjnQ6c+d+SzPLKLovwsTQzB/+yX6kWuLj+H NT2vg6TVDbQuT8ba7JhGC29VGgbp+VZiy/YsKrfPnn54bXVhPmkB+un+5J4a335avp P+C+3CmmpHXpC5ZszXFk58TrxLGOROCTjdUasNEQjTVb38LhCrnbMlFXpFdNdz4/tZ sK5qStLf1pJvuSBXZm0xpaFG6+aL2gt+Pj0NGnBG6uvvVEd7n+amssq0ZcN7uP5Ogi hM8ndiTivRAMUDwnwZjFmOVwOMfrLeE6t/lX/OqB4X22yu6F9K7c2kNoSW+wDbVso/ qfGsLwVeq57Gg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Srinivasan Shanmugam , Xiaojian Du , Lijo Lazar , =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher , Sasha Levin , Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, Hawking.Zhang@amd.com, Felix.Kuehling@amd.com, tao.zhou1@amd.com, ikshwaku.chauhan@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.1 24/27] drm/amdgpu: Fix with right return code '-EIO' in 'amdgpu_gmc_vram_checking()' Date: Sun, 28 Jan 2024 11:14:09 -0500 Message-ID: <20240128161424.203600-24-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240128161424.203600-1-sashal@kernel.org> References: <20240128161424.203600-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.75 Content-Transfer-Encoding: 8bit From: Srinivasan Shanmugam [ 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 Cc: Lijo Lazar Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Suggested-by: Christian König Reviewed-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- 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 2bc791ed8830..ea0fb079f942 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c @@ -808,19 +808,26 @@ 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; } -- 2.43.0