Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp781741rwb; Mon, 26 Sep 2022 05:56:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6B0jbkavuTMkLPOpR6IZgy0h0NDLucqN3LdppT1gnfg22ZQHPGZV2YxA7/FA6x4MYym7cX X-Received: by 2002:a17:902:e805:b0:178:230b:57e3 with SMTP id u5-20020a170902e80500b00178230b57e3mr22421769plg.102.1664196969823; Mon, 26 Sep 2022 05:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664196969; cv=none; d=google.com; s=arc-20160816; b=BOEyd659QbNBDPydkNCIvivwP/NxaN4w24DJzT5aS2zud7S1qo8pnlwCXBuCKVCbBe +s2Xsmo085LFdqhD0YM64Sz6lShIXdY2zF/2aezAaCIBVIJcT4yKZlf98gO8YlisnG+Y qWYZoJJgND59+fN9dGF3s5BoOoV89n61kXf+ln/guQ799v3NW3jDHS9J1Qidoor4aIzk xtbI1Qhz163jMs5Qt4bXMU653INY7Cp30dDrI6I9t5x2Hmd9GHmgMW32ap0wCzhF5J4Z KTK8pJtXSmW3irvrAbIVap+A46U9njXBiYOlDFvc3FD4SsqE/izePGGZjHdTttGxIcuJ 3/Pg== 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=Y12j7sJjC+6razh3CELRfUiWIAbvGCmwue/yQd1L3Fw=; b=ppYCH9HatK959zKK1kvrhoaX78a0K6lCvtmgQ83YvaFI7NonljHweZLFYMwtr1UZ5e J1dbBWc2Z9D/wC5QcWKvMS7JjQAB7BO1FM0Y/SA0mSlFl5GA9j+mkL3wBOXNeKSYEyOY ldbCPnY0p2E0qxWyDFN9WuQdPuPd9xclS7E2FtsdU/S8NN4xeeZ/YRMMYYFH+7s1o/q/ SlScS10Qeke1K7FOQ15sbB8QJyqZVEl4f6CiS1iZNNG1pj2sRsDjfQov/ydy8pcnLSVW H+RQJBayBSvHJuOO5jezDTEloa2QLfqfPOsi5nOWGsffjvuldV2gu8NZsW7lh0nA9vMw KJvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I8Vgk8B6; 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 ga22-20020a17090b039600b001f561cba131si11145153pjb.179.2022.09.26.05.55.58; Mon, 26 Sep 2022 05:56:09 -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=I8Vgk8B6; 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 S236617AbiIZKvw (ORCPT + 99 others); Mon, 26 Sep 2022 06:51:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236790AbiIZKtX (ORCPT ); Mon, 26 Sep 2022 06:49:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F01D557E3D; Mon, 26 Sep 2022 03:26:43 -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 6C5EDB80835; Mon, 26 Sep 2022 10:26:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3EA4C433D6; Mon, 26 Sep 2022 10:26:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664188001; bh=nOF7kRm8jGivPH6YjcExgoVyFxqCAoJsNJIcRv3yxjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I8Vgk8B6GnwXsmxq3xpLFrZkVmzqWhPYzT1fHu7M5RQ1fdoyeMFN/13ohBZp+0J5r tw8XTS+4AYtv9riyVBl9+qF2GMKvqqQ+65kTDvtKUKecDLBmWPYhZSQ9j64qZwCXwD oDN8rPiryBlzRwTIbAEsX/dVEaTnY5LEB3hUMcU4= 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?= , Lijo Lazar , Alex Deucher , Sasha Levin Subject: [PATCH 5.10 001/141] drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega Date: Mon, 26 Sep 2022 12:10:27 +0200 Message-Id: <20220926100754.689443370@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100754.639112000@linuxfoundation.org> References: <20220926100754.639112000@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 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: Alex Deucher [ Upstream commit e3163bc8ffdfdb405e10530b140135b2ee487f89 ] This mirrors what we do for other asics and this way we are sure the sdma doorbell range is properly initialized. There is a comment about the way doorbells on gfx9 work that requires that they are initialized for other IPs before GFX is initialized. However, the statement says that it applies to multimedia as well, but the VCN code currently initializes doorbells after GFX and there are no known issues there. In my testing at least I don't see any problems on SDMA. This is a prerequisite for fixing the Unsupported Request error reported through AER during driver load. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216373 The error was unnoticed before and got visible because of the commit referenced below. This doesn't fix anything in the commit below, rather fixes the issue in amdgpu exposed by the commit. The reference is only to associate this commit with below one so that both go together. Fixes: 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") Acked-by: Christian König Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 5 +++++ drivers/gpu/drm/amd/amdgpu/soc15.c | 25 ------------------------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c index 1f2e2460e121..a1a8e026b9fa 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c @@ -1475,6 +1475,11 @@ static int sdma_v4_0_start(struct amdgpu_device *adev) WREG32_SDMA(i, mmSDMA0_CNTL, temp); if (!amdgpu_sriov_vf(adev)) { + ring = &adev->sdma.instance[i].ring; + adev->nbio.funcs->sdma_doorbell_range(adev, i, + ring->use_doorbell, ring->doorbell_index, + adev->doorbell_index.sdma_doorbell_range); + /* unhalt engine */ temp = RREG32_SDMA(i, mmSDMA0_F32_CNTL); temp = REG_SET_FIELD(temp, SDMA0_F32_CNTL, HALT, 0); diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c index 7212b9900e0a..abd649285a22 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc15.c +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c @@ -1332,25 +1332,6 @@ static int soc15_common_sw_fini(void *handle) return 0; } -static void soc15_doorbell_range_init(struct amdgpu_device *adev) -{ - int i; - struct amdgpu_ring *ring; - - /* sdma/ih doorbell range are programed by hypervisor */ - if (!amdgpu_sriov_vf(adev)) { - for (i = 0; i < adev->sdma.num_instances; i++) { - ring = &adev->sdma.instance[i].ring; - adev->nbio.funcs->sdma_doorbell_range(adev, i, - ring->use_doorbell, ring->doorbell_index, - adev->doorbell_index.sdma_doorbell_range); - } - - adev->nbio.funcs->ih_doorbell_range(adev, adev->irq.ih.use_doorbell, - adev->irq.ih.doorbell_index); - } -} - static int soc15_common_hw_init(void *handle) { struct amdgpu_device *adev = (struct amdgpu_device *)handle; @@ -1370,12 +1351,6 @@ static int soc15_common_hw_init(void *handle) /* enable the doorbell aperture */ soc15_enable_doorbell_aperture(adev, true); - /* HW doorbell routing policy: doorbell writing not - * in SDMA/IH/MM/ACV range will be routed to CP. So - * we need to init SDMA/IH/MM/ACV doorbell range prior - * to CP ip block init and ring test. - */ - soc15_doorbell_range_init(adev); return 0; } -- 2.35.1