Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2654118pxj; Mon, 31 May 2021 07:29:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGYiDgDzig3lCcf6oXqhiMk/VX29GilLUzMemYaXofrJAN0bWBLCys8W09ZNFx4uRcpIqr X-Received: by 2002:a17:906:2da1:: with SMTP id g1mr22663654eji.47.1622471368116; Mon, 31 May 2021 07:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622471368; cv=none; d=google.com; s=arc-20160816; b=hCCVTKHeAav9tZp03PDMwvBSYPO8MUhcRJH48XQKBFOmC8edToOfmz4/ddRs9y1pJs 41y2nbKhpkzSG0Y1SqjzK4EUgFt2uxwt0up2gxqEqIBP9tYHAmCWaMk23Ug74X1xdhck 9LXL9J5Lu47514gimIO9xiIw9xY8Rsc1cTl9IgkDQ8g14Hv6hsA6t2Y+5TxQ/mqObzRs N4eOYlrGN0yXzq7CZcuQN0lCVHPrd+BfJHeqRmiP5BhZs4Ca68hpqcElLfDlnTTy6ksB r4JhzErmViul8aYMfDiSs2CIMkIJlbqj1pMePUphtJNAzHOmfsVC0gfI+V3PSd/s0MWX 6YiQ== 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=Lkyh9R00SYJJDwSqM3FaAyvBpD99yid0CDgL8RoVarc=; b=Cg3LDyTZjHk4q5tmfevrHr8zu5Hj06CPGPJDI1IjGcna4xzPN4enIr4WDq2aV+B5K+ OCvozXAfRyjEDhbYROe5i8VZU4mYhwpgBgs5gvoTjZbeqdYMXitg79TFdVmg9QG9gONm sLVjtor+c3ipK9I9H1uCYRZcSbq8YGh/fwA2kkb8sJuws9YGYJDpYcDY8WPS0OnrvfDO ZMXHffRS5PVuMxFgHUZGPBo0lyDUCAV04LhpbQCZ+XLsS+xUfl8LvaYXmHdAYIl4hfgE IrqXA3ODDKCOgrVbEflQHmq2K6KaQeWviFQorp+HG3ErFEH+1hoNU75z/nfpz3jMjxwc PNBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Etd1/0qq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c10si13181357edv.407.2021.05.31.07.29.01; Mon, 31 May 2021 07:29:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Etd1/0qq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232601AbhEaO20 (ORCPT + 99 others); Mon, 31 May 2021 10:28:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:55706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232616AbhEaNw3 (ORCPT ); Mon, 31 May 2021 09:52:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 108FA613DD; Mon, 31 May 2021 13:32:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467970; bh=WIx+AEv0ty7LhI3bH1MGrWlfecbNRbfmPT4AVaqFIWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Etd1/0qq7X9PzyWSaRtPUZQEe/9rWdNozr5X513EIx1+uYJn/72vbeMOtvw34KY7b EHD9yTzljtt9kS1ZRlBr4xtlkOKYhdNExZdgcuMPDLnkCFCCNI2SioQQFysuL3R7Ma I+Ik9YKqKOsx6xQ/6Km4icNqanvyIf0M3TPVkd0g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evan Quan , Kenneth Feng , Alex Deucher Subject: [PATCH 5.10 041/252] drm/amd/pm: correct MGpuFanBoost setting Date: Mon, 31 May 2021 15:11:46 +0200 Message-Id: <20210531130659.383607619@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Evan Quan commit 1a0b713c73688c6bafbe6faf8c90390b11b26fc6 upstream. No MGpuFanBoost setting for those ASICs which do not support it. Otherwise, it may breaks their fan control feature. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1580 Signed-off-by: Evan Quan Reviewed-by: Kenneth Feng Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 9 +++++++++ drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 10 ++++++++++ 2 files changed, 19 insertions(+) --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c @@ -2606,6 +2606,8 @@ static ssize_t navi10_get_gpu_metrics(st static int navi10_enable_mgpu_fan_boost(struct smu_context *smu) { + struct smu_table_context *table_context = &smu->smu_table; + PPTable_t *smc_pptable = table_context->driver_pptable; struct amdgpu_device *adev = smu->adev; uint32_t param = 0; @@ -2613,6 +2615,13 @@ static int navi10_enable_mgpu_fan_boost( if (adev->asic_type == CHIP_NAVI12) return 0; + /* + * Skip the MGpuFanBoost setting for those ASICs + * which do not support it + */ + if (!smc_pptable->MGpuFanBoostLimitRpm) + return 0; + /* Workaround for WS SKU */ if (adev->pdev->device == 0x7312 && adev->pdev->revision == 0) --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c @@ -2715,6 +2715,16 @@ static ssize_t sienna_cichlid_get_gpu_me static int sienna_cichlid_enable_mgpu_fan_boost(struct smu_context *smu) { + struct smu_table_context *table_context = &smu->smu_table; + PPTable_t *smc_pptable = table_context->driver_pptable; + + /* + * Skip the MGpuFanBoost setting for those ASICs + * which do not support it + */ + if (!smc_pptable->MGpuFanBoostLimitRpm) + return 0; + return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetMGpuFanBoostLimitRpm, 0,