Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6830522rwn; Tue, 13 Sep 2022 09:32:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR4SYXnGbMaC8bW9uWGXAK0gcPqk6t9RSW89yly/8xXc87KdzL4/e+diTBa6b1VkutA/F84L X-Received: by 2002:a17:902:f606:b0:172:6522:4bfc with SMTP id n6-20020a170902f60600b0017265224bfcmr32173872plg.133.1663086736179; Tue, 13 Sep 2022 09:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663086736; cv=none; d=google.com; s=arc-20160816; b=Do0F56omSDxUJayIWcTNvPtj4SqGriSHbdVLHi40PqKs6hJbETbEYeYk1lzF6ZzOP9 /LwNWd0ZHe5B5nom+u5LF+yVVyLM4Yzn9q/ElizDrJmB0IWnxxzuahYRGDz3N++UTLub m/b4oT4/mogxYwKguXCpC9exrR10oD5YpuBilf962XmDhQf+9uscqhcVBX/Is0N1lJaL ud9C12xhoijS8egAKt8yhvPH+Sxv1K34hEMlC61Y94M6NOzsCe5OettX1G7Kxderjbou vGypvtDSXVIEQawy5MeDqlvCBSDs5HWW91VUsbqLWjwYYQkPcWq/of7Vou3CFsj/Nync pTqw== 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=c7eYasokuXMK3DmUNZM4ydsanLh4DR0GquGOoPrnXwA=; b=UEr4JFHJULFm1hCQMWPI2VGAQJzAERr5U63KDIJR/HUle+ZLjIsnXF//fFtqOrksSJ 3n9eo/dbYXnDsV0eUU7hXh7yp/T0SNPaTxdJ8/dxROgteDvdUzm2gLhAKNjvxgqbm6k2 DrRO3uHXPsiCtzPrpbzwZJFJK3KqxzpjdRi31J94IHkjxcL1zKZdgEQd8UCd58tmHrOE GtwATWkETMQAED1uN3QqkHKsTieGya2W4QmwHxMfhZqV9zS9xvUBO4ZZw7gG4+XPunrp fKZLS24hrR2kCLWST+iZfYn0PoRpo5VAEfFzlj6VIqto2l9fIecc+k3PjKPleetOrUa9 MeaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MoCm+G4x; 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 rm12-20020a17090b3ecc00b001fa55447988si1960470pjb.40.2022.09.13.09.32.03; Tue, 13 Sep 2022 09:32:16 -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=MoCm+G4x; 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 S233907AbiIMOaT (ORCPT + 99 others); Tue, 13 Sep 2022 10:30:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233821AbiIMO20 (ORCPT ); Tue, 13 Sep 2022 10:28:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12D0D696CB; Tue, 13 Sep 2022 07:17:52 -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 dfw.source.kernel.org (Postfix) with ESMTPS id B918C614B3; Tue, 13 Sep 2022 14:17:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C445CC433D6; Tue, 13 Sep 2022 14:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663078672; bh=eNmdi/BoP7WYZz4B7PTE9g7lLo2eJ9DD+Kgpxwy77wE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MoCm+G4xuQIpXAoFrAYGqACtXdKikgdkAzgcqUJ9bBhEfJ6e9yZG/kNBFpaTb/kYn yCmqwcd1FvT7uNss5EANO7f7T2j8o2ZTSpzgCihqeC705eR41NmLni+yFcAw9MEeDI muoReho9OoSJD8IsL9i9TrqIKz/b4OZv7wy+w/dg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, YiPeng Chai , Hawking Zhang , Alex Deucher , Sasha Levin Subject: [PATCH 5.15 011/121] drm/amdgpu: Move psp_xgmi_terminate call from amdgpu_xgmi_remove_device to psp_hw_fini Date: Tue, 13 Sep 2022 16:03:22 +0200 Message-Id: <20220913140357.817506266@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140357.323297659@linuxfoundation.org> References: <20220913140357.323297659@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.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 57e9932d8a04e..5b41c29f3ed50 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -2729,6 +2729,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_unload(psp); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c index a799e0b1ff736..ce0b9cb61f582 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c @@ -723,7 +723,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) -- 2.35.1