Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3518443pxf; Mon, 15 Mar 2021 11:19:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqTfxOEOd9LR0RXG2BsCJl1Q7YdpRtOJeC2ozQZ8oWmdcrDf8tg1fD8y0Eke7tVKgS7F2X X-Received: by 2002:a17:906:400b:: with SMTP id v11mr25026246ejj.194.1615832392880; Mon, 15 Mar 2021 11:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832392; cv=none; d=google.com; s=arc-20160816; b=zJiY37wX11ByUgDn/k/qD1rJGVrl8O3JnP6bJ4pqUehEigqe9UCxxwNI6MOn9NR09P JyH/E4UkatRFyRmGjI658naIGgOuipQlyK0L3R7oqewWM9QYYWI7NEQVZGJgHrLtwUuC BkoC3A3PlCONe3tyfXA8O1vUw7Pra5NumbeZKhc5u6PpMh3kF5Sl1Z0W6/CsJpHx73Qn kMgwpKf8RgCdtlIGzmUsphqg6LBO/M5I06kTz3JdWUN59rnsiD9RxStWnvMjrRV0FtZk N/Q+FJ3XJjIAwyiTmM1En9xEx8ZA8U5BQ028SJXly6zvlYMh0qMmabwMw7TdtQofORCi QBBw== 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=sGIz0G2EuhSd5Z7wAoMWb9aYLkVXJ/8TKhfu9Pmh6cM=; b=f8MqpszPExmFaUnEr2bD2cSmPg13S4Ebu3/9FbV5l9gISdU6Ro91NXwc21L7sa/mGz oU8zhpfxiizV47zE2i+soSdU9iO5vbRX5UN/J9FYGHqncDjzonvAEQiPn7qFz72qNlcL fpVr2SdCxDqWAOjZU4aojQSTWeslwQg0S72VeemAlOUaCinIqaLAfE2heAMHeUxTyaB2 SVBwwLRSPkX/n2QEkqXdk56RL2JyeQ6AyNcnuuHlVWlFnkd1VkhG6xJh+vRnn3HpWuga 7MZfzuPPEhU8tOgzl4885YpuAk9vRiGzFjwPJigv72sYo6IMIse2WrHyYqCV/0AZShkd 8aKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SQpiQbNM; 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 b5si11371677edq.537.2021.03.15.11.19.30; Mon, 15 Mar 2021 11:19:52 -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=SQpiQbNM; 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 S236986AbhCOORF (ORCPT + 99 others); Mon, 15 Mar 2021 10:17:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:37522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232679AbhCON73 (ORCPT ); Mon, 15 Mar 2021 09:59:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 341EF64F06; Mon, 15 Mar 2021 13:59:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816747; bh=588BgDknMzbDHS7zPOgtnxq0+noLDSWDQe9Z1AjJ8w0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SQpiQbNM/TvefCFvBomnVQQ3MHhkb13xThyenTiiXlBSNQ43PdRRvum5OyvwHu4dX 3s3eh17HTko178vl7L0avd2pTdkqBb/4B7dr0hDHzfzm1mi9rc4mOmezA1wkJOFLUf YPGZvWBKWoMvzGDSBSniKsHepTSxw4b0U7Kk1KSY= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evan Quan , Feifei Xu , Alex Deucher , Georgios Toptsidis Subject: [PATCH 5.11 100/306] drm/amd/pm: correct the watermark settings for Polaris Date: Mon, 15 Mar 2021 14:52:43 +0100 Message-Id: <20210315135511.029768060@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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: Greg Kroah-Hartman From: Evan Quan commit 48123d068fcb584838ce29912660c5e9490bad0e upstream. The "/ 10" should be applied to the right-hand operand instead of the left-hand one. Signed-off-by: Evan Quan Noticed-by: Georgios Toptsidis Reviewed-by: Feifei Xu 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/powerplay/hwmgr/smu7_hwmgr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c @@ -5216,10 +5216,10 @@ static int smu7_set_watermarks_for_clock for (j = 0; j < dep_sclk_table->count; j++) { valid_entry = false; for (k = 0; k < watermarks->num_wm_sets; k++) { - if (dep_sclk_table->entries[i].clk / 10 >= watermarks->wm_clk_ranges[k].wm_min_eng_clk_in_khz && - dep_sclk_table->entries[i].clk / 10 < watermarks->wm_clk_ranges[k].wm_max_eng_clk_in_khz && - dep_mclk_table->entries[i].clk / 10 >= watermarks->wm_clk_ranges[k].wm_min_mem_clk_in_khz && - dep_mclk_table->entries[i].clk / 10 < watermarks->wm_clk_ranges[k].wm_max_mem_clk_in_khz) { + if (dep_sclk_table->entries[i].clk >= watermarks->wm_clk_ranges[k].wm_min_eng_clk_in_khz / 10 && + dep_sclk_table->entries[i].clk < watermarks->wm_clk_ranges[k].wm_max_eng_clk_in_khz / 10 && + dep_mclk_table->entries[i].clk >= watermarks->wm_clk_ranges[k].wm_min_mem_clk_in_khz / 10 && + dep_mclk_table->entries[i].clk < watermarks->wm_clk_ranges[k].wm_max_mem_clk_in_khz / 10) { valid_entry = true; table->DisplayWatermark[i][j] = watermarks->wm_clk_ranges[k].wm_set_id; break;