Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4482748rwe; Tue, 30 Aug 2022 10:52:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Cw6oaXDVSMKBcFIxSsvCehmsNoSBD8SlwE6ih41TnoaOVD8/q1iYR2KaNws5NS27wriAd X-Received: by 2002:a17:90a:e7c2:b0:1f5:85ab:938c with SMTP id kb2-20020a17090ae7c200b001f585ab938cmr25144391pjb.133.1661881956119; Tue, 30 Aug 2022 10:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661881956; cv=none; d=google.com; s=arc-20160816; b=ndn5BeIVKTHketXqWTkKYU+UIVJmNVokXnt7rM7hAHS6uXrdyOAosAJL8vDbldOP1k lQwWdYsAdQgkU9elZaJVsY9Te5s397G2Qxf43VuyybP8Zd+KcnOqrPQJmI6kmj7IqaJ6 110brm1sGPryF0gBrDFJF4SRukgOFB9wCRnLrgzSBeQ6Z1Gt7tXZuraLUyZdebWl5/m2 hgqxeqFth24TZMQnToZj8HKT5n6lvH64wGTqcOC5HQtp1gC3zSF8xsQNmUvfzYy/WWrE U/O3PW+pkYLTKtyIqnZM/kcyeC68Lmc9akpQyABhMq12lJJ20zqe/UAsSLneLHZcdzEf +Hwg== 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=6xf8zn7dLkc8Qqe0IavycDKuWJZmUVJDRq4zF77SrAY=; b=Y86cz3yGlJVmXY0UtGvUfz1i6O+YIqeFPVsw6i0kGLF/BsSazxbkGqaLjyGTRU8Q63 hzL/DWQqP1+GF/cQtDZMq09L2npORCf1tReeiESerebXGH7Zyk0gvbauMocrOPHH//iS wQ6hOVx5xg1bR5pQpeDKcsH3nQkBNovSOwEj4qAil+y6hPd8Aps6o2RHkuSpvFpQBSrV 4Rem8bWY14ffGNTfU1QEhqZ41p+3doXXfdQicEJ6oc60mrvPIEsVgFYyn7QZqYUss98C UMDKaRafoWFnXyLeUYUPmNhDi5e7rQUaafFOk/IgzyD8Hh4rOUjct6YvJqmBj1PlcLul 1nFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=toF2nozl; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gq2-20020a17090b104200b001fd8ade18aasi8385521pjb.137.2022.08.30.10.52.24; Tue, 30 Aug 2022 10:52:36 -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=@kernel.org header.s=k20201202 header.b=toF2nozl; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230461AbiH3RTs (ORCPT + 99 others); Tue, 30 Aug 2022 13:19:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230133AbiH3RTc (ORCPT ); Tue, 30 Aug 2022 13:19:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1437CDDB7B; Tue, 30 Aug 2022 10:19:03 -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 CC2A1B81D0C; Tue, 30 Aug 2022 17:19:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8761BC433D6; Tue, 30 Aug 2022 17:18:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661879940; bh=Q+vMHRGkAwSDWOXbaXN+wZkgMIIyt/l7oOCUkocI/mw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=toF2nozlKPtOX4wkepgkzH1jQgI0A8paAQvNCiQyvj675XlHQP4sQ5YSgw442b24d Q2FjzwZKbCRHvenNdmg8g5S5FHgtfhye3gVmoNB6GyZLgDDkZXAR0pObcOYvt/ENKg t+/WEHhVIpw/kkOANcXkie/fKLuGZCpMoUE4nO5ZnE72Ve0V7MEVPqBq7ilXNPRw2O cfDuTovdsKyXkcDFVlPlj4K4ryWYM+q1IpX49Ir3sATS8Oc/wL7g5nx9TPP6EMcrbb 6whOos2M9ToAT0LycjW5E6RxIUl13KwBsN8nIrZk1VLxmIyFhShpGV8D7iIoJ56Egv uugJpqPJK5eJw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: YiPeng Chai , Hawking Zhang , Alex Deucher , Sasha Levin , christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@linux.ie, daniel@ffwll.ch, john.clements@amd.com, Likun.Gao@amd.com, candice.li@amd.com, tao.zhou1@amd.com, guchun.chen@amd.com, Bokun.Zhang@amd.com, andrey.grodzovsky@amd.com, bernard@vivo.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.19 09/33] drm/amdgpu: Move psp_xgmi_terminate call from amdgpu_xgmi_remove_device to psp_hw_fini Date: Tue, 30 Aug 2022 13:18:00 -0400 Message-Id: <20220830171825.580603-9-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220830171825.580603-1-sashal@kernel.org> References: <20220830171825.580603-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,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 From: YiPeng Chai [ Upstream commit 9d705d7741ae70764f3d6d87e67fad3b5c30ffd0 ] V1: The amdgpu_xgmi_remove_device function will send unload command to psp through psp ring to terminate xgmi, but psp ring has been destroyed in psp_hw_fini. V2: 1. Change the commit title. 2. Restore amdgpu_xgmi_remove_device to its original calling location. Move psp_xgmi_terminate call from amdgpu_xgmi_remove_device to psp_hw_fini. Signed-off-by: YiPeng Chai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index e9411c28d88ba..2b00f8fe15a89 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -2612,6 +2612,9 @@ static int psp_hw_fini(void *handle) psp_rap_terminate(psp); psp_dtm_terminate(psp); psp_hdcp_terminate(psp); + + if (adev->gmc.xgmi.num_physical_nodes > 1) + psp_xgmi_terminate(psp); } psp_asd_terminate(psp); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c index 1b108d03e7859..f2aebbf3fbe38 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c @@ -742,7 +742,7 @@ int amdgpu_xgmi_remove_device(struct amdgpu_device *adev) amdgpu_put_xgmi_hive(hive); } - return psp_xgmi_terminate(&adev->psp); + return 0; } static int amdgpu_xgmi_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *ras_block) -- 2.35.1