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=1796383782; b=ewhw+nawETOszpKtydh8G3ji6E0r8eIYUjCrcKDNXCLntk9+NpdCJYDBxrCu+OVkSj// Hb4OKnM6j05v9zlLGT4oqXRcdwKRT3f7X08EmWgZWK0GZ5L+1H2bw+qZNNc9W2xmP22AH b0it8YKA7FjnaQ6MJ5XTOYYDEuA6qRsgltGRZy8vDMHbSNUhuaKY2jxCtE/RGupnBJ/tI CtEqHZSn7kpe6T+tiR4egQ8eofws8DIRGoMl9buqQ1FK0TPqcw8HmgAh/ZjIMr1ObCm13 Vhwb1VTUaxyWVZvVdokMjEYdUFhi+P3HTVWAtDl5OBZQccSr4XbZJbmgT8pTJQN1I4g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383782; 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=kBOpYTCNs8RUCLVmy/ApWwoUD0KCXmKGJ3Lvuw41/PE=; b=ttqO8aOsUZH2Ttv6NWB43tCxyDnypUqoT4We9jCITg/1uvSVetcN3E7bYc1NR2uwf3cJ HPkmBkPRLXBbGKzeWmXR3yT96CZtRWCFLHqrujzUFzcaJIvni3hMcUUruoX5Zs0Eg081j Jz0gEX6wjiMwMeSG8n+7OwIFJy4PWXcZ0b09foO0up0PqjYUNgUma3AnHDuqC2hHUFg0T p695JtlXac7rlCUiuz4hWbcEbcMZZ74q+AcGIh99Zq4VOUOH+l3lzLwPvj/L8gqKWMNEY 5b3ODRdoxx6ibzJtTyCYkreBsPen2gAYsTdtxMmgjP73ShHhpafXVcJWX7rxKvpdoyw== 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=H7qe+EDC; 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 31ADE606A322; Fri, 4 Dec 2026 11:29:42 +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=H7qe+EDC Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D7741F000C2; Fri, 4 Dec 2026 11:29:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383781; bh=kBOpYTCNs8RUCLVmy/ApWwoUD0KCXmKGJ3Lvuw41/PE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=H7qe+EDCzo5I16quNoRMBOaev6HeOm/dyFA6hRI7yJRbzZA07+8N6RnPmFOay2Fa/ w7ki7PlcWjSd/ClVwRgX5Hc9ODfPBBkghwp6jKiVlOL8w3NgpMW0Vtn+SQmXiDRq4p tWLM/226VoTVXYyk33of7+EHJeS+wGMkn+L328QQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alex Deucher , Joshua Horne Subject: [PATCH 6.12 328/555] drm/amd/pm: send smu8 sclk level indices, not the level mask Date: Fri, 4 Dec 2026 19:06:11 +0900 Message-ID: <20261204100622.372107517@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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.12-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: