Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp832285rwb; Mon, 26 Sep 2022 06:28:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5LgKG/+jAjkFSKVgICcx1dcG5fDLL12MUecWUjM4JOY/P9AJ2GRcPQ6dplj2DKFG5AWy5x X-Received: by 2002:a05:6402:3552:b0:451:2037:639e with SMTP id f18-20020a056402355200b004512037639emr23046245edd.136.1664198920564; Mon, 26 Sep 2022 06:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664198920; cv=none; d=google.com; s=arc-20160816; b=MlHD5+mrdl3YX6GdJV73jGdeMG6d6ucnqfNOoordPT7pWiSXNZTfG4JToOwTYA36cv TlPPMRbMnircouFqA4WyWe//DYVygGI9qOqz317JZC4OMhrSseweS0Z3aYEiDAin8HP4 mtxuGai+lBk88dW+RBHwLvm5IfMMFLVWN99YAp8rYpFPTHqW0CyyBXFOCVbeg1ILEBhl zo9CKQYpa1EyaIuAaXrLn7zSPEO7I2l4IzqOEzgMSeXtnO79546TXNJzBv03xHugR/2D JxvIapvwrU8yQrgwd6cDZiqdtp27g/FGcNdF0dGvmP24Zgiq4IcSAd4R3Eep74NYAHJE 7pPw== 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=WlDTC+1MyoLa5XenZSDjQ24fzcxs3GljEo3JQXVlQok=; b=1E14NKgqsTA+Rd+6M7380Bj7dX9YAH4qMa7N1szHv/fBgwZDhIytRi5SXAChZpFdE+ T6qqR/55H2llq2j53R6PVpxw0dvxWbyl2Q4FuKFH8M0s7Rwo+kc7ZcCLi5IICksHDJ4Z DJf3SdCuUNig+K4MQ8LWSG9ka/nPsueXISNJZ5i6JWmmT8HNY19s4zJhwRI2gYwwLY9g oF5TVDpzFyBNheBjvsjk/TwECOtOcjtXj1JhvR7PiGudIiPGQaiN4VI8QnrMZqkS35pL zHp54QNrpYRZz8H9XN2egDh9vLUtiHnjAYk+ez9NYKaw+JgLUvf4q7FGb+30Ou7DPaOk zZUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vialv12c; 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 ne35-20020a1709077ba300b007814ff4ce25si16583722ejc.285.2022.09.26.06.28.14; Mon, 26 Sep 2022 06:28:40 -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=vialv12c; 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 S239023AbiIZL5b (ORCPT + 99 others); Mon, 26 Sep 2022 07:57:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239180AbiIZLyq (ORCPT ); Mon, 26 Sep 2022 07:54:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9012E78219; Mon, 26 Sep 2022 03:50:23 -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 79DC160C41; Mon, 26 Sep 2022 10:50:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AF72C433D6; Mon, 26 Sep 2022 10:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664189407; bh=jR+9wdzZXg1ytd9GBg3XFo+5bh/ND8xS//zX2kiAkgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vialv12cO+qJjwDfCwEyqga7S/boVA0IRIlLYFaifSUblu/4IpXSn0ZQGpQdSw9t1 LC9/TDhVNejqPJ2WMVu5RRWwKlOJFDOiSobLiAbCEU39YWB0sEwV4sobyOhLxIkCIO E0Uv0ykDOH70nyg/hKqEqluqnTpU8Kr7SPqtT9ko= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yang Wang , Hawking Zhang , Alex Deucher , Sasha Levin Subject: [PATCH 5.19 178/207] drm/amdgpu: change the alignment size of TMR BO to 1M Date: Mon, 26 Sep 2022 12:12:47 +0200 Message-Id: <20220926100814.598225135@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100806.522017616@linuxfoundation.org> References: <20220926100806.522017616@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.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: Yang Wang [ Upstream commit 36de13fdb04abef3ee03ade5129ab146de63983b ] align TMR BO size TO tmr size is not necessary, modify the size to 1M to avoid re-create BO fail when serious VRAM fragmentation. v2: add new macro PSP_TMR_ALIGNMENT for TMR BO alignment size Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index b19bf0c3f373..79ce654bd3da 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -748,7 +748,7 @@ static int psp_tmr_init(struct psp_context *psp) } pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL; - ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_SIZE(psp->adev), + ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_ALIGNMENT, AMDGPU_GEM_DOMAIN_VRAM, &psp->tmr_bo, &psp->tmr_mc_addr, pptr); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h index e431f4994931..cd366c7f311f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h @@ -36,6 +36,7 @@ #define PSP_CMD_BUFFER_SIZE 0x1000 #define PSP_1_MEG 0x100000 #define PSP_TMR_SIZE(adev) ((adev)->asic_type == CHIP_ALDEBARAN ? 0x800000 : 0x400000) +#define PSP_TMR_ALIGNMENT 0x100000 #define PSP_FW_NAME_LEN 0x24 enum psp_shared_mem_size { -- 2.35.1