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=1796380650; b=WMbIXvcRzicvhwr0MLA+mVRnFta19DEoeQj0ZV4kbwWdq9Nsz7o+DWCAXPSWQiWNFws1 sNarHwUkfnIdXLDlKAb+7u7VqwDfjW60qCrdC5hjkBk2IAVq5Y/9bPeJWZ7OVRfr9cE1T TLg4HaOGIqn63klcGHh0+vQyAGMZaWNvbrx8i03yDyt2RtFor8A85ZadqSXlrNd8o1DDJ ZmDYwshjFYZoh/X8hcIiWRX8R+0dnpX+NbaV/sQQECKbM8ivyPpiQ5yc8iozEeuLVGoxB 2n2oCWBmX7jTsPYXL7RE6k9NA8qIIiKxpt5C3b0pXn72LI3V9GH9Y0ZTJzY6PpFEnqw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380650; 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=NKR65troE/sYe4avSCs1+O13KYq79sjG0kkhjKCB5Ec=; b=PcTFsvcyGHyBdvEW2o5lG5B2hi8M30S4505gsBLcqdG/6dI0DOdt9Jqp8QIx1G0+V6M9 /8va3g3qS4vxom4Hhq1456Ec9QEXzuSSKaXmYI+SO65xFDtIcnzZddMlvVmZUZz+Hx4EW 3GQCJueKYKUFygtpzd7WoYe+k7F99ThkO7Iqqz/a/63u8IpmDLAyknhY+VvMGwwZcqDId 5/IzFgJbgzZb8FfGQa0F28x3F0u90TQ48uRQCWJsNTz7emzR4xO+8vc/X5ZOmz1YSC/vL IUP/DjVWrNo1vHMX52VfCThyc0n72xG69YbmhM8WKyLV9E9cRShfn4s4aI2jeLhU/7A== 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=KU1BFmR9; 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 F2EAD606A68C; Fri, 4 Dec 2026 10:37:29 +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=KU1BFmR9 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FD7C1F000C2; Fri, 4 Dec 2026 10:37:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380649; bh=NKR65troE/sYe4avSCs1+O13KYq79sjG0kkhjKCB5Ec=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KU1BFmR9Vre1+K0VIOJV22yrXGy0hczhOkIotol5X+ZgFuNepeSE4MiMZW41nVB7f QH3hfotZ6bbZLLjhapMr42s4BKXyNXoTEBq+fQx/fEdnvCWIleOUhvdfDiFJ/nwPFx MOgS49YpjgV+W50AwrF/j1O2kQE8Pfzq4nYbLl/c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alex Deucher , Joshua Horne Subject: [PATCH 7.3 367/742] drm/amd/pm: send smu8 sclk level indices, not the level mask Date: Fri, 4 Dec 2026 19:03:51 +0900 Message-ID: <20261204100644.836066976@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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 @@ -1483,15 +1483,25 @@ static int smu8_store_cc6_data(struct pp 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: