Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp1178317rdf; Wed, 22 Nov 2023 07:34:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmixc4Q/2wE769o9E53YFN4emHquAHNcJZ0PqBz5/9f4de+9tKzzjcYYLkB+dlZyYXnJ4C X-Received: by 2002:a05:6a00:2d84:b0:6cb:ccea:e2ed with SMTP id fb4-20020a056a002d8400b006cbcceae2edmr2106495pfb.13.1700667243981; Wed, 22 Nov 2023 07:34:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700667243; cv=none; d=google.com; s=arc-20160816; b=q4pGkHFxyflhjFRJLFjxuUaQgaVdWBuTAX1jjNG4mk0/Y6wWDAm0rqGw2avbL8+Wnr jODNlT/TPIUFLPjM3Ag1ue3oZZyb+/t66lAusxiU4CMiXQg4jO40NpbihsYONiQ439Bo +6XxMkaMGHKNxTiqmH19cNhiSluWxB/TfL1bY9FFsQHgLurAPLbUUTxMN0/jNuhUqjeV Gk8rg6gDk2Nr3qc/+n9v/4Nn24gGlh7uziTEKPwgKt37nePgRmKnAdGYooVoFzKFlQ3A oSfveNHvOpSj5LuKHCaiDUAhD334Qk2LnhgF7nYf9vpZvkbOU1K9WyQbsomET0l9kfeD uJTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=S2gQ9i4Lw8WflC2YAIr3p908cfln8ll31F8BuNtyqIM=; fh=Qa8O/1beuB+HFBfvSrZlerJKjswYjucO70FqqjfOfvk=; b=H0agWCwWe4yceJFXEMWKOuKgPno/CukpmfIVtzj1aYGVo0gRwbLcD1mdDO5PDcT+8H dNc95VC/Bqlb0jHdOXqdzk7j+uUGVe/zo5rTuKGHuirstizUPtFB/T1kgMAsQBPaX204 dzgY+dGowsMG+vvQYO/KyLOjYqKZ8+2Na+7yl17RGJnxpT20AoWf3A5+gIqveNtsviR6 4r6p1YncdTAF6uyxiRS72a5LlsN1+HQdKyU5oX6ijnMyhIKw3JSPJ66v6j9yPKuBLlXb CyiXx/r1s3rxp0zx5z1oWcPJlSy5Nkxg+rEjcgaFLbIRqoLqNHvyC9gz4xGQa0Tq5ZGo JKpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sjtgvLB2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a70-20020a639049000000b005aa7d3730dfsi12376271pge.114.2023.11.22.07.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 07:34:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sjtgvLB2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9E5E98212A96; Wed, 22 Nov 2023 07:33:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344410AbjKVPds (ORCPT + 99 others); Wed, 22 Nov 2023 10:33:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344436AbjKVPda (ORCPT ); Wed, 22 Nov 2023 10:33:30 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9045619A4; Wed, 22 Nov 2023 07:33:04 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69D7AC433C9; Wed, 22 Nov 2023 15:33:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700667184; bh=NI3biGsjUjf9hvOjQhTGPV8BLZqLm8iTMxw2iDQUTqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sjtgvLB2LDHwURcr+Jtx0/44cNpR6HmKvPsYuVyPAW5Q0qiLwV6RYwT610DewUqrB Tx8Bt88iDphNjwGL653Wsfo0/BR+y6Qeq3TAQjot3wqWI7aZLaY/n54NPbEd9jFLiX DuzYcXx3hfSZwjjeQhXP7zyahIuH55ffbihEQTULSX94dtBJqAmYFs+TTGrWi0kX6K zLVJKRhpWRtTBnwnhpZKHPg254uUOHzhmphqntIcqg2/8sAMZc1pE8haLnM23bwILN qQtHp7XKTb9SqwP/OWgHy6xS4I/X4gRyZFDV24imzLSCrk0RtbuqaSz/XJO6HN39s6 iVIH00l6m5cow== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Victor Lu , Samir Dhume , Alex Deucher , Sasha Levin , christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, Hawking.Zhang@amd.com, tao.zhou1@amd.com, le.ma@amd.com, Felix.Kuehling@amd.com, srinivasan.shanmugam@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.6 14/17] drm/amdgpu: Do not program VF copy regs in mmhub v1.8 under SRIOV (v2) Date: Wed, 22 Nov 2023 10:31:43 -0500 Message-ID: <20231122153212.852040-14-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231122153212.852040-1-sashal@kernel.org> References: <20231122153212.852040-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.6.2 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 22 Nov 2023 07:33:51 -0800 (PST) From: Victor Lu [ Upstream commit 0288603040c38ccfeb5342f34a52673366d90038 ] MC_VM_AGP_* registers should not be programmed by guest driver. v2: move early return outside of loop Signed-off-by: Victor Lu Reviewed-by: Samir Dhume Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c index 784c4e0774707..3d8e579d5c4e8 100644 --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c @@ -130,6 +130,9 @@ static void mmhub_v1_8_init_system_aperture_regs(struct amdgpu_device *adev) uint64_t value; int i; + if (amdgpu_sriov_vf(adev)) + return; + inst_mask = adev->aid_mask; for_each_inst(i, inst_mask) { /* Program the AGP BAR */ @@ -139,9 +142,6 @@ static void mmhub_v1_8_init_system_aperture_regs(struct amdgpu_device *adev) WREG32_SOC15(MMHUB, i, regMC_VM_AGP_TOP, adev->gmc.agp_end >> 24); - if (amdgpu_sriov_vf(adev)) - return; - /* Program the system aperture low logical page number. */ WREG32_SOC15(MMHUB, i, regMC_VM_SYSTEM_APERTURE_LOW_ADDR, min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18); -- 2.42.0