From nobody Fri Dec 19 17:36:12 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76321C32771 for ; Mon, 26 Sep 2022 11:09:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237286AbiIZLI3 (ORCPT ); Mon, 26 Sep 2022 07:08:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237305AbiIZLHZ (ORCPT ); Mon, 26 Sep 2022 07:07:25 -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 13DE751402; Mon, 26 Sep 2022 03:34:26 -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 E6CFCB80942; Mon, 26 Sep 2022 10:34:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60649C433D6; Mon, 26 Sep 2022 10:34:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664188458; bh=h62uxua1+0TpFbufiuCzOyC10k0JkQvNcXqCkOcpJsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xd34K33r6Af4uK5CxIC0C6ULgEY28qtxL+Hk5ENdUcLWZkwQMc99Ss+I4OsQMsqyi 3hQuIhFKBexZ1ghkJTIkNk7tk9D7WAI1yOvJR7vwhrzE58VKdmUhxQ6GOBmhieR2Zw KGPpsSmrHUE2C88LpfDnOcGAEwFN8AUMwJ/a99cM= 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.15 002/148] drm/amdgpu: make sure to init common IP before gmc Date: Mon, 26 Sep 2022 12:10:36 +0200 Message-Id: <20220926100756.158888817@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100756.074519146@linuxfoundation.org> References: <20220926100756.074519146@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alex Deucher [ Upstream commit a8671493d2074950553da3cf07d1be43185ef6c6 ] Move common IP init before GMC init so that HDP gets remapped before GMC init which uses it. This fixes the Unsupported Request error reported through AER during driver load. The error happens as a write happens to the remap offset before real remapping is done. Link: https://bugzilla.kernel.org/show_bug.cgi?id=3D216373 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=C3=B6nig Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/a= md/amdgpu/amdgpu_device.c index f443b4630f9d..7450773821f4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2388,8 +2388,16 @@ static int amdgpu_device_ip_init(struct amdgpu_devic= e *adev) } adev->ip_blocks[i].status.sw =3D true; =20 - /* need to do gmc hw init early so we can allocate gpu mem */ - if (adev->ip_blocks[i].version->type =3D=3D AMD_IP_BLOCK_TYPE_GMC) { + if (adev->ip_blocks[i].version->type =3D=3D AMD_IP_BLOCK_TYPE_COMMON) { + /* need to do common hw init early so everything is set up for gmc */ + r =3D adev->ip_blocks[i].version->funcs->hw_init((void *)adev); + if (r) { + DRM_ERROR("hw_init %d failed %d\n", i, r); + goto init_failed; + } + adev->ip_blocks[i].status.hw =3D true; + } else if (adev->ip_blocks[i].version->type =3D=3D AMD_IP_BLOCK_TYPE_GMC= ) { + /* need to do gmc hw init early so we can allocate gpu mem */ /* Try to reserve bad pages early */ if (amdgpu_sriov_vf(adev)) amdgpu_virt_exchange_data(adev); @@ -3037,8 +3045,8 @@ static int amdgpu_device_ip_reinit_early_sriov(struct= amdgpu_device *adev) int i, r; =20 static enum amd_ip_block_type ip_order[] =3D { - AMD_IP_BLOCK_TYPE_GMC, AMD_IP_BLOCK_TYPE_COMMON, + AMD_IP_BLOCK_TYPE_GMC, AMD_IP_BLOCK_TYPE_PSP, AMD_IP_BLOCK_TYPE_IH, }; --=20 2.35.1