Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp872361rwi; Wed, 19 Oct 2022 04:09:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6dfRbwKyr3OHdy/5Sh/jYvtCyiwWdcJhCgUwyeAl6dtJLDfH4AkJZ0zhsGEPvcwoqDn8iv X-Received: by 2002:a17:902:edcd:b0:17a:6fa:228d with SMTP id q13-20020a170902edcd00b0017a06fa228dmr7979311plk.29.1666177745116; Wed, 19 Oct 2022 04:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666177745; cv=none; d=google.com; s=arc-20160816; b=gFAMPYrLz+6f4Oo6SRNPrPe5qs6Ln/ehfsJ97yoMPlwfFB0x5OHCYS7Jutbzhli1Ms mZSbhenhN94htD9xAPQ0ytASV34LZcHnGeABVnSB0QUNLHoXhqGmWqCRkDFlFXdJVj4g fTjYnm1oz+3KeK1XMUkm5Nd3SVWFfWWmMgzXJq0c/Ug5fYmDngZhO85TCqSWSfxScrjE dByww6rddxe/nC20dw2sn3DNOhXKrVbm/l7+1zY5Z+3SnLS3iSWA+fFpShGYCxovncJh MJhCkW2kTAbhXw4BoshxhmzMJDn/MO2lHCePDx5aFmqcPhE01CdvTSiVov10nHI2y4zl GNcg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fdEvwau9N/YbcB7d/XgephwtoRhttEd0AgCQlxrX2Q0=; b=F6K+lLvl+BQhojA12QyvH4cEv7d3bdtZ7RXmGO3akyQy7BJyqbDMC6R96zBGK2t6AC 1XiTXSGm5uq8YYxtVd9CJln6eTGKWVT2LdSFbTMN0Fgd1UxRNdQuyGaRcK4MRm9XYWty SSeQNoBHZRQ5LDF4MR36wbNr48G+rIBOfowMRMeqOJ676SbB7IsYu3w5DmtTYFzYPIjE BHPMmICs1QD9ohOWwE3sE5kHzYb/TqG2ChWuJC+nmEXxXNXk6ivHeoo47GDH0RROAfdr A5VJUFxRRFXL80C7XVBq3+hKwwo8fPEQawVatWEgMqPflT3GKsGvSxNfdabm2g9lIkB7 fD9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="wCDG/DCz"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t18-20020a63dd12000000b004637c92ef98si19473256pgg.195.2022.10.19.04.08.51; Wed, 19 Oct 2022 04:09:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="wCDG/DCz"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234753AbiJSK6k (ORCPT + 99 others); Wed, 19 Oct 2022 06:58:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234126AbiJSK4q (ORCPT ); Wed, 19 Oct 2022 06:56:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF791165510; Wed, 19 Oct 2022 03:27:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 06E74B824C3; Wed, 19 Oct 2022 09:11:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6416CC433D7; Wed, 19 Oct 2022 09:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170668; bh=D57F51nhXs+6rwTKvULIB5lh9K58TqPulJrZALO2lFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wCDG/DCzII0YUg9RFOd5frXpgCFE0ioVMHXLm6eMS3uqSYaAojbZ8rcsxJkodMjWr 5WdRlVoCFC942JAOQDA8sABjeoFLyHvejrjLyWY2BW0gmDvo7txNn/moZvzvONnxmy ZeTuKJn3GG6e+/mXyeEfnXTrtjNvYgWJOYUfX1DI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Christian=20K=C3=B6nig?= , Yifan Zha , Horace Chen , Hawking Zhang , Alex Deucher , Sasha Levin Subject: [PATCH 6.0 741/862] drm/amdgpu: Skip the program of MMMC_VM_AGP_* in SRIOV on MMHUB v3_0_0 Date: Wed, 19 Oct 2022 10:33:48 +0200 Message-Id: <20221019083322.695644152@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 From: Yifan Zha [ Upstream commit c1026c6f319724dc88fc08d9d9d35bcbdf492b42 ] [Why] VF should not program these registers, the value were defined in the host. [How] Skip writing them in SRIOV environment and program them on host side. Acked-by: Christian König Signed-off-by: Yifan Zha Signed-off-by: Horace Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c index bc11b2de37ae..a1d26c4d80b8 100644 --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c @@ -169,17 +169,17 @@ static void mmhub_v3_0_init_system_aperture_regs(struct amdgpu_device *adev) uint64_t value; uint32_t tmp; - /* Disable AGP. */ - WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BASE, 0); - WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_TOP, 0); - WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BOT, 0x00FFFFFF); - if (!amdgpu_sriov_vf(adev)) { /* * the new L1 policy will block SRIOV guest from writing * these regs, and they will be programed at host. * so skip programing these regs. */ + /* Disable AGP. */ + WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BASE, 0); + WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_TOP, 0); + WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BOT, 0x00FFFFFF); + /* Program the system aperture low logical page number. */ WREG32_SOC15(MMHUB, 0, regMMMC_VM_SYSTEM_APERTURE_LOW_ADDR, adev->gmc.vram_start >> 18); -- 2.35.1