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=1796382205; b=xSuu4Tb5WTD6hlN4wnFUplo/TznSEtKSSszamWog9qR8b/uIEnLQ0Ftf1g5zxYX2PFSa x5KymxhTTG+a1ufqp4Mkk+PvjmXJY2HbwkzFEC1cfserXJyCOMPiIn5QfejSppo/xKw1H LqCN7k46FrWcctkmrs8YluPsKorLDoJnAwDftkyBiBfaqR0lxy9HPaybzDTwYa/yN8mbp Jiw2rxWBb6yTCVpX8MW1cM3RDfBs3LEp1uPs8E75a70GnplKWofS5mAI2Qc58YyauljD6 ey4cEICXa3bM2xK5+5Gucpzha47YT1iMRfmW5H+eoMFJhLzz866kn/rw+7MNI5dQZng== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382205; 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=uQHXkwlo75fv9G8IYgrj6WKtWkTK3KvXiXHSIFBROEU=; b=xF15v3DBykMGgItj4gKePuD/9q2jcpopmc+AwUPeFrKREI/0RmGDKvWVjfv6dKbZaTQL qws/UY8Y6oThiy/wSY4SEHmDj/xZbWHIRZgUuq+MA2Mwmtz+FeWwq7epUHWlnpVjXtolb xnKaY8n67JNqoj2NL0jf4JcZMfihvYtmQ/nRCilt+eXXgPB5/vJcIvAlkjwgdO3iHo9Bi V2OTuRu4UG7Dwej1SttKeUm7H4axS73ZpT9tQZY4Yz9kA4SUMBP3/mVVu6UljYnwM6vL9 N2wM8f8N/CUIg7sivfU+rP+MA/xfK4UNaKQR1NuhAADaPAp3jIbnJxie5CRbBrPy5WQ== 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=drjoogHs; 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 3A4B8606A322; Fri, 4 Dec 2026 11:03:25 +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=drjoogHs Received: by smtp.kernel.org (Postfix) with ESMTPSA id 902061F00935; Fri, 4 Dec 2026 11:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382205; bh=uQHXkwlo75fv9G8IYgrj6WKtWkTK3KvXiXHSIFBROEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=drjoogHsJqwYMNqC3D1PRK6+0oozfIfXJWVSJlHiyHaYHG2dRxOZMMqTC5Yyi4Is2 dkpC1WQ0fK/yCzWZL+Ekb78MO1a/8sHt/CRgx8jkGuzb/GbudlmXWAXEJbbSkiQgi0 XPnFUvQ5q0Zqbwpxbn5QFJBtmBF8zsLjtszSuVbQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alex Deucher , Joshua Horne Subject: [PATCH 6.18 353/703] drm/amd/pm: send smu8 sclk level indices, not the level mask Date: Fri, 4 Dec 2026 19:04:12 +0900 Message-ID: <20261204100637.187731481@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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.18-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: