From patchwork Thu Feb 9 05:54:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1739800 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=W+v8MhP0; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PC5gJ4nPFz23kw for ; Thu, 9 Feb 2023 16:55:08 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pPztd-0002r9-CB; Thu, 09 Feb 2023 05:55:01 +0000 Received: from mail-pj1-f51.google.com ([209.85.216.51]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pPzta-0002nt-DB for kernel-team@lists.ubuntu.com; Thu, 09 Feb 2023 05:54:58 +0000 Received: by mail-pj1-f51.google.com with SMTP id o13so1141846pjg.2 for ; Wed, 08 Feb 2023 21:54:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=2scyLDNRZu4IrA98sT50AY/6yOGVC1ufgdyftLbJsWw=; b=W+v8MhP0GrmqcULJdd/30thGbqRwOs3+sAv4FvGjx49Rqcpis54ayT+FoILSpPg0o0 S09EolMlxKIN3WPF8X0XA4Jr3bl+F95BGrYfcqBFJEDaUGIzkyonCNMpRGeQf5u/xBww h1EtfH0GcQlhMeS6HJYC/f8zokuJh91TrFlVapPaNOKymYClBoOr4mCIVJkDsqaVAnHj lLOXT19+RMq2qZAH8gxrgXN92NZ73A/FrjW+oelW4+qwCcHOvlMFL37y1NakZ6mLGs3+ /th30Jj1Ga2o/p8kJflqCq3Zx5OjErug+EYYX1Bynv0X9OvN/m9gnGj9O2ZDEykzTMU0 FiLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=2scyLDNRZu4IrA98sT50AY/6yOGVC1ufgdyftLbJsWw=; b=w1beG9M5fAn9f7M3MjAuyD2Eqpslmr629CdkqLY4juJU4cRaUjRXjTIZ9aJV0sO8dJ Wf1n8a63nxDt0A5U0Yzht53A1sRp9Xg2dSNFE+of4mjI4aRpxv5fHLVoRSGHzVhPYO1p Unw1HHGdlEl58Ld9cquL7F0KE3JWjeUbp7Wg+FmCR6ROOq7pvvLXzF493RdoL5LHmDjh qT7/42d5H+FcwQyN2btxSLsZuLawhFaH6UZMm0WCt5Vz0gThdZt1ICArSMNaAdQhKKqs rSFduXCZqCWWeKkPJbhW3CYBsvLJJn0rsEsasSyQfBRok9XZ7Xf1MV66FEsR7j0i8AYL adzg== X-Gm-Message-State: AO0yUKVSp9cb4bmZX0ZG+tBndZMeSWO4YgxqsdN5TYE0hsTl2MoDQLiN ztZT8WstxxldZRCza0elvzqEGs+CLvYFQA== X-Google-Smtp-Source: AK7set9HnJ5ozO6yg0emhf9MXbePeaXZ0cwAnuvn+FuCKHynxIYi58/rAvMl2DKQUT/CewxFH4bCmQ== X-Received: by 2002:a17:902:ea05:b0:194:828d:62b0 with SMTP id s5-20020a170902ea0500b00194828d62b0mr10768585plg.48.1675922096415; Wed, 08 Feb 2023 21:54:56 -0800 (PST) Received: from localhost (220-135-95-34.hinet-ip.hinet.net. [220.135.95.34]) by smtp.gmail.com with ESMTPSA id a11-20020a1709027e4b00b00189b2b8dbedsm455506pln.228.2023.02.08.21.54.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Feb 2023 21:54:55 -0800 (PST) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH v2 3/4][SRU][OEM-5.17] drm/amdgpu: make sure to init common IP before gmc Date: Thu, 9 Feb 2023 13:54:32 +0800 Message-Id: <20230209055433.229851-4-acelan.kao@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230209055433.229851-1-acelan.kao@canonical.com> References: <20230209055433.229851-1-acelan.kao@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.216.51; envelope-from=acelan@gmail.com; helo=mail-pj1-f51.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Alex Deucher BugLink: https://launchpad.net/bugs/2000110 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=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 (cherry picked from commit a8671493d2074950553da3cf07d1be43185ef6c6) Signed-off-by: Chia-Lin Kao (AceLan) --- 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/amd/amdgpu/amdgpu_device.c index 7956089ed95a3..ce352aad42ff3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2357,8 +2357,16 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev) } adev->ip_blocks[i].status.sw = true; - /* need to do gmc hw init early so we can allocate gpu mem */ - if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) { + if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_COMMON) { + /* need to do common hw init early so everything is set up for gmc */ + r = 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 = true; + } else if (adev->ip_blocks[i].version->type == 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); @@ -3016,8 +3024,8 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev) int i, r; static enum amd_ip_block_type ip_order[] = { - 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, };