Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp392373rdb; Mon, 22 Jan 2024 07:26:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGEkLXgBeg0pVZcDfshqJjllcxcSIGpPfXap5nW8dOZwBF6kdZYghL48/WrHpw7au03vnT8 X-Received: by 2002:a05:620a:2408:b0:783:8d53:852f with SMTP id d8-20020a05620a240800b007838d53852fmr6895075qkn.3.1705937181588; Mon, 22 Jan 2024 07:26:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705937181; cv=pass; d=google.com; s=arc-20160816; b=1Jj9DMiuxurNtBqeN4/zXykwgrLmcdB5QD0scSUaGQZNiOnDAgvfcJEdPIL8NaArUB 5fxWtElkJOC3LPtKUS6zidgxsxulKH/RJ5ZrB7tcKld0VAdeOz6D7QXjBAh/w0d4J4ou MeppPDJTdIg3YjwhASxGVeFf8n9s5aPvgQcquU6VODchPEKbW+cRGSQ4a7qxDqkK1YGp Vbdzv5WiuhsxqMTP4AOcnjF6t6xzSu6mdy4ahhOgECPxoB29vCYkJbDHRZM55T7kdfoL sDfrbBTKpg1b4Y+CK0kM/re/jM+TbpJAYw5Aod3neXhM7KYGuwolp99DHiEWhU7mo3aj a+Ew== 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=VazY8XS5IpjZkEdb0X3aKoH7bEoikIDAZowVi3nxs8A=; fh=kyY+FbZYxlF4bKBF2iAmSn4e9KSjcTPNz++r2P6ed2Y=; b=llwfkHritWiLEnVhSjQ23+IAcn3ieyk+zwBg03ZMQKlxAa4U6ss0JO25c8+jDJP+ZE YAQ1oA+Q/9odd10UEOw3OVyKup48B1LYJ4VBw72rs1zeGUjasW0Uuf7+Qq5f9VKhbZ0R vozJBdW1SOjMFBZOrigXmt6GW4x0ohloKJqo2pPkn2E1KhwS/kZCikBTmjaYVSZrd4tF S40tSGmD+oOzuYLVm/KUANfWGWfd3uWkEBl0sWXBFcWK47+oJG9AD5giE+XUJZWcngsM alW4fmWhNompAQMnO8B/GbBfHYcAOfLofc/4twvkIjI9/qTsGpKvqGwF4ppPu3Ssd3ie eDtg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gRklkEbG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33295-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33295-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bk4-20020a05620a1a0400b007832366f885si6291830qkb.224.2024.01.22.07.26.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 07:26:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33295-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gRklkEbG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33295-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33295-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4D3851C2260E for ; Mon, 22 Jan 2024 15:26:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8358A5D8EA; Mon, 22 Jan 2024 15:01:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gRklkEbG" 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 A500E5D8E9; Mon, 22 Jan 2024 15:01:23 +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=1705935683; cv=none; b=ZaFKfVp8PNOGcakCHANaUmfDMwQBP+nkQuVFsvZSdk9DLP8FmnlV9/PcfSMNKFwajzhyvnG8iWQFJWwKwmf6ApU9Qvz+Ij2RjxTbVQUlsy2PpDPm9CopIIbGmY5VDc+aaudNH9R/XPeLQOhYA2i8tT7WR0a6hqaLojhY3cBzT4g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935683; c=relaxed/simple; bh=bB14RhwtHCht10MRw+OWoJQOjFl0frT6lyEbD5z5Phk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FJVm7tV2F9eaHd0chT7dHa5x9QU1b2IsYjS7EaZOGBE2/X5g2acVrZTQm9BGFkaCyzskeVdDej4A4D96GRpU7tBXqTqNzTdSOMKat/3mxLNtLM2oyV5xtRmuDRtuPfjyr8s8IMTZn1QG1oold+aLzsk1NsoYtJ6aOl6ulL724B4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gRklkEbG; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2402EC433C7; Mon, 22 Jan 2024 15:01:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705935683; bh=bB14RhwtHCht10MRw+OWoJQOjFl0frT6lyEbD5z5Phk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gRklkEbGQgRD/oiH5PirFGtoy628UtNe0D0XItifHnKeLShsKmcIpmsRvS3CsG11z I4YwFJRTCBOqeAc6ATk93QWnc/EUEl4Jyop45rbaub5AvSzIgixgUaJ3HXhQyBQ/nk Ng2jZOeEETcYB0wHOylpmRAid1WiH1r7Vkj2s/+u6LMrb6wF+VIbxxs4eWwe1rj/9j 2xt8OG30o2h+At0O09qQZCcYvETlogZGEBiDh2jDLMcqPnT5JZ0w230Gqb/OCGL/dx tQcOWDnsxYj+8X/bfXdoWGb+uEvFmQ0gzq6MzYf/3Q/FlbHWwc2KV+zkHzf17KDPox MLUE2LrS1SS5A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Stanley.Yang" , Tao Zhou , Hawking Zhang , Alex Deucher , Sasha Levin , christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, lijo.lazar@amd.com, asad.kamal@amd.com, Felix.Kuehling@amd.com, le.ma@amd.com, srinivasan.shanmugam@amd.com, mukul.joshi@amd.com, rajneesh.bhardwaj@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.7 73/88] drm/amdgpu: Fix ecc irq enable/disable unpaired Date: Mon, 22 Jan 2024 09:51:46 -0500 Message-ID: <20240122145608.990137-73-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122145608.990137-1-sashal@kernel.org> References: <20240122145608.990137-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.7.1 Content-Transfer-Encoding: 8bit From: "Stanley.Yang" [ Upstream commit a32c6f7f5737cc7e31cd7ad5133f0d96fca12ea6 ] The ecc_irq is disabled while GPU mode2 reset suspending process, but not be enabled during GPU mode2 reset resume process. Changed from V1: only do sdma/gfx ras_late_init in aldebaran_mode2_restore_ip delete amdgpu_ras_late_resume function Changed from V2: check umc ras supported before put ecc_irq Signed-off-by: Stanley.Yang Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/aldebaran.c | 26 +++++++++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 5 +++++ drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 4 ++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c b/drivers/gpu/drm/amd/amdgpu/aldebaran.c index 02f4c6f9d4f6..576067d66bb9 100644 --- a/drivers/gpu/drm/amd/amdgpu/aldebaran.c +++ b/drivers/gpu/drm/amd/amdgpu/aldebaran.c @@ -330,6 +330,7 @@ aldebaran_mode2_restore_hwcontext(struct amdgpu_reset_control *reset_ctl, { struct list_head *reset_device_list = reset_context->reset_device_list; struct amdgpu_device *tmp_adev = NULL; + struct amdgpu_ras *con; int r; if (reset_device_list == NULL) @@ -355,7 +356,30 @@ aldebaran_mode2_restore_hwcontext(struct amdgpu_reset_control *reset_ctl, */ amdgpu_register_gpu_instance(tmp_adev); - /* Resume RAS */ + /* Resume RAS, ecc_irq */ + con = amdgpu_ras_get_context(tmp_adev); + if (!amdgpu_sriov_vf(tmp_adev) && con) { + if (tmp_adev->sdma.ras && + tmp_adev->sdma.ras->ras_block.ras_late_init) { + r = tmp_adev->sdma.ras->ras_block.ras_late_init(tmp_adev, + &tmp_adev->sdma.ras->ras_block.ras_comm); + if (r) { + dev_err(tmp_adev->dev, "SDMA failed to execute ras_late_init! ret:%d\n", r); + goto end; + } + } + + if (tmp_adev->gfx.ras && + tmp_adev->gfx.ras->ras_block.ras_late_init) { + r = tmp_adev->gfx.ras->ras_block.ras_late_init(tmp_adev, + &tmp_adev->gfx.ras->ras_block.ras_comm); + if (r) { + dev_err(tmp_adev->dev, "GFX failed to execute ras_late_init! ret:%d\n", r); + goto end; + } + } + } + amdgpu_ras_resume(tmp_adev); /* Update PSP FW topology after reset */ diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c index a5a05c16c10d..6c5185608854 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c @@ -1041,6 +1041,10 @@ static int gmc_v10_0_hw_fini(void *handle) amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0); + if (adev->gmc.ecc_irq.funcs && + amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__UMC)) + amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0); + return 0; } diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c index 23d7b548d13f..c9c653cfc765 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c @@ -941,6 +941,11 @@ static int gmc_v11_0_hw_fini(void *handle) } amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0); + + if (adev->gmc.ecc_irq.funcs && + amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__UMC)) + amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0); + gmc_v11_0_gart_disable(adev); return 0; diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index 2ac5820e9c92..507d695bcc6b 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c @@ -2380,6 +2380,10 @@ static int gmc_v9_0_hw_fini(void *handle) amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0); + if (adev->gmc.ecc_irq.funcs && + amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__UMC)) + amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0); + return 0; } -- 2.43.0