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=1796386591; b=SLWYNw+hLbOhC/vj9fc4Rf3YwbA90KRCZh80ThMkUzcaQ9qZnaPVzXD9I8s2Y2bIukbO Y1VlfpHm4wjvsn2SJEyajBhKR+PGcPRGoC8D8YWTd5RBtC5SS/1SasQVDeKzXGDByhD93 imWCZtG7S634d7hdOvCok99lu99OOpN5oT8/blgd/ISZkCx+0or6DbTKP9VUJ/1vY2ro1 1EVB7Ds3E1JAo6qlK9/KSXDxSBuYWJpBvoye4r5Jf0Rlk0ZLT05q+oQ6M1mSFyfZES04M IiSCd/EKm8wxh0Ft4ExrHO9GCBjBi06X6pU8T9gGYv4jLMwPtqi65Yo7IDAKvEzwLTA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386591; 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=o4BRzkLJTE0NXxQNfClfQSawvSv+JN8FxtDS6j5zVLQ=; b=dLX9aNEEfBncCPuW+QX/klLytVrzH3XCwXbTIlj8lENvcpu334r12j+XQaPU6ZL407bR Q/Z/RS/vDapUb8mpBfmxi9W1v1fTdXNHp0dMzd/vIiomlUXCSNt+SKc4xOK8wKOH0eERU vNp3txkFzE6yiE56PSybYfx3CZeXlTxcKVsX2/yhICU27vPb/43dxo2RCAXWOh73ugMzK L99vsdzeoiY4u6N0oOXDPelh8/LLvO9RMfHmHenfKWmN8sYonkJDs8da3JzEWlLYMfajl AQhyt6PzzfdY8h5GwpRetFS1+iCEjxnOBzgr0c9tvOUE19XZeoSO/atwLHxeW8hVUEw== 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="SCk/Y6hp"; 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 3C952606A330; Fri, 4 Dec 2026 12:16:31 +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=SCk/Y6hp Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74E771F00934; Fri, 4 Dec 2026 12:16:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386590; bh=o4BRzkLJTE0NXxQNfClfQSawvSv+JN8FxtDS6j5zVLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SCk/Y6hpst7kzdpDlYglhB6/2L86Y47+eoKA6ajkVLAVhajPKyWYc6nas0EFLSr5H +HsY3nBGPVjLsPVw68AYDeEKJ6OLhIg3pOw1QI9k2DXwZV86T3JkytLzsDdNMNNf30 P6fm2kE/63wLoREvZ6TFEiIVxdJhafCsPbMSK4lk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alex Deucher , Joshua Horne Subject: [PATCH 6.6 0988/1167] drm/amd/pm: send smu8 sclk level indices, not the level mask Date: Fri, 4 Dec 2026 19:06:55 +0900 Message-ID: <20261204100727.936198486@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-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: