From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796389189; b=W5W1BRwuQLBFMIFjjqaqnyi95p3gIzSHaDowNSMFiEPLceQi5f8IbzgJ5aUejGxh6Iqj hSZoEXt6HGNofw4Z4bDcW6JfPhFNT8nTrGukrBriwrZbZiHl71mS/daTBNjDxKex/ntpy Z769E9ox2cmN0/oLP7JH9kxHhs5wqFRP8b+G951EQuly1ERgjszSIp7mIgfMs4z47+RKR Qo4m6VvhFcdP2zGznOmC1JKSuWtLf/I5qZhF7Agua2EKmm+bJoyrXv53ScqenJZEsR8Hj 3TNNycPNNesAq1cvXuRZHOci0diU/bLdL5Z54C8b4tt8Eh6QXXlmrjlTo+ervKYD0oQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389189; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=rzEWM0uERtbQUzXsHeMgSwo2Vs+kYf/287lD+lVU5o8=; b=FSxY68OzhAHi3XMTHMslryi/y176OJq1JJeeljJ0cNgXXq1RyREHd6QVXFTX9XcFlaWy bCdLjbrDwcYfrjk9kmvZjmhPgtKgsH2vAYdG25dCyXnQZ57eHVvXLdDQHySZRA3Q90zJ3 Zs1yJI/k5BJY3V2Rj3UQJjLVs/SKeuVSEg+kayu132zz71UzpttVFkjIbh9XJdYhh6F6x wJNFOLITxkAh8xtFvfkZ008M6WlODZb6gp1ZpBK54zZEH3c1jRUhmMCS060UMugRy/twe UCVVU5x3YGq6GV/sDgV/tUhJVu0swYnYau6aQkT/jWxRiRu6FXtG58COF7OuLu4awuQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=2dJx9gur; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07840606A330; Fri, 4 Dec 2026 12:59:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=2dJx9gur Received: by smtp.kernel.org (Postfix) with ESMTPSA id 212171F000CE; Fri, 4 Dec 2026 12:59:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389188; bh=rzEWM0uERtbQUzXsHeMgSwo2Vs+kYf/287lD+lVU5o8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=2dJx9gurfslagjJKW1tRpnQ+5nf9ivUdJODGev/Z9MdiedGzYeuimomFWCLN8THg9 eVDJiBfzPf7dtkcgxKgAGgvGH44qk63yWg7qy3MrUbc3Y3kqTq/k1oWfKjq8WtLQ4p fpvAQxUbTi4tVMiQTA1aPNkWkQolZyf2LP7xDvgY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alex Deucher , Joshua Horne Subject: [PATCH 6.1 0898/1059] drm/amd/pm: send smu8 sclk level indices, not the level mask Date: Fri, 4 Dec 2026 19:07:09 +0900 Message-ID: <20261204100707.274193281@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Joshua Horne commit 535f6852652e3239c8688491ccd0ed4b6e09d14f upstream. smu8_force_clock_level() passes the pp_dpm_sclk level mask straight to PPSMC_MSG_SetSclkSoftMin and PPSMC_MSG_SetSclkSoftMax, which take a level index, as the other smu8 callers do through smu8_get_sclk_level(). In manual mode, "echo 0 > pp_dpm_sclk" thus selects level 1, "echo 2" selects level 4, and masks above the highest level index are out of range for the SMU, so e.g. "echo 3", "echo 7" or "echo 0 1 2 3 4 5 6 7" do not select the requested levels. The original single level version sent 1 << level and had the same problem. Send the lowest and highest level in the mask, as smu10 does, and reject levels above those the SMU has enabled, as smu10 and vega20 do. Fixes: d7341ef66870 ("drm/amd/powerplay: add some hwmgr functions for sysfs interface on Carrizo") Reviewed-by: Alex Deucher Signed-off-by: Joshua Horne Signed-off-by: Alex Deucher (cherry picked from commit 8ff6b368360adb24ccf145047b0261dfae77f28a) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c @@ -1546,15 +1546,25 @@ static int smu8_get_dal_power_level(stru static int smu8_force_clock_level(struct pp_hwmgr *hwmgr, enum pp_clock_type type, uint32_t mask) { + struct phm_clock_voltage_dependency_table *table = + hwmgr->dyn_state.vddc_dependency_on_sclk; + uint32_t low, high; + switch (type) { case PP_SCLK: + /* the SMU takes level indices, not a mask of levels */ + low = mask ? (ffs(mask) - 1) : 0; + high = mask ? (fls(mask) - 1) : 0; + if (high >= min(table->count, smu8_get_max_sclk_level(hwmgr))) + return -EINVAL; + smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetSclkSoftMin, - mask, + low, NULL); smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetSclkSoftMax, - mask, + high, NULL); break; default: