From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99781480961 for ; Thu, 3 Sep 2026 15:07:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788448021; cv=none; b=IE3nI7ajfNng3Bge9R7iqpIw42lDWHEFCv6A3ps8tt5XDykB2a4pE7tndjqXPgIQv2VEQ3Fu3C32Z4cNhz5YqJEiGX4fsTFtcHUeUmgPnG/eIzzxtaxkcohHXbfKO6ihT+/s7pnPZoic0z4sMRo3wF9PwPBaFNAO+4s4Kq1F6Yk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788448021; c=relaxed/simple; bh=SxrOHXS7T/zPufR7L534X+DzHzUm9Qtt88qDApsgAeg=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=SOOcjwKtduHsiPuYiMbwMz+uPek2EAEFTUcXVN9whOg4ez7HKCu+cnjRZujNIbay5dzO4uLQhbeJyGy7mIc8YkLfCeMMmizw9igmKXoVKA+Mx7+KdftPaYBoMBhDWGpz2WPvgJSLwDldtjZ6NoW5AFx78K1S10pu5wRDC4/ytsU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=G1Buk+g2; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="G1Buk+g2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F362D1F000E9; Thu, 3 Sep 2026 15:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788448020; bh=eeZeu00oTXYmg6Rno9iShM2nivcktCefZjnaeeLr7NQ=; h=Subject:To:Cc:From:Date; b=G1Buk+g2qpA4qu++LlvrTeD7fE8NMMJhop99bd0j7ujjcqLK7ZOKBC2MKZIaID/WH inpnjmh5eXAzjbSFSNnPTe1QmDXs4xzJLK5x9rGmtpECLz5p+nJBNoWfIzXq9ghfrK 9JDDTnGvKoOOhbMgyRuL90wi0+K5IymzAjdmeABY= Subject: FAILED: patch "[PATCH] platform/x86/amd/pmc: Fix msg_port restoration in" failed to apply to 6.18-stable tree To: mario.limonciello@amd.com,ilpo.jarvinen@linux.intel.com Cc: From: Date: Thu, 03 Sep 2026 16:50:31 +0200 Message-ID: <2026090331-president-referable-7380@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x cbb32ff92f8a62212e0f7384b1de986ced92082b # git commit -s git send-email --to '' --in-reply-to '2026090331-president-referable-7380@gregkh' --subject-prefix 'PATCH 6.18.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From cbb32ff92f8a62212e0f7384b1de986ced92082b Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Tue, 21 Jul 2026 13:17:52 -0500 Subject: [PATCH] platform/x86/amd/pmc: Fix msg_port restoration in amd_stb_debugfs_open_v2() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit amd_stb_debugfs_open_v2() switches dev->msg_port to MSG_PORT_S2D to query S2D telemetry but only restores it to MSG_PORT_PMC on one path. The early return on the dump_custom_stb path (and the error/allocation returns) leave the port stuck on MSG_PORT_S2D, so subsequent SMU communication - including the s2idle prepare/restore handlers - is directed at the wrong mailbox. Consolidate the exit path through a single label so the message port is always restored, mirroring the fix in amd_stb_s2d_init(). Reported-by: sashiko.dev Link: https://sashiko.dev/#/patchset/20260717162023.956346-1-mario.limonciello%40amd.com Fixes: 2851f4f8ed4e ("platform/x86/amd/pmc: Define enum for S2D/PMC msg_port and add helper function") Cc: stable@vger.kernel.org Signed-off-by: Mario Limonciello Link: https://patch.msgid.link/20260721181756.143084-3-mario.limonciello@amd.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen diff --git a/drivers/platform/x86/amd/pmc/mp1_stb.c b/drivers/platform/x86/amd/pmc/mp1_stb.c index 83645c0a8d78..90b8a5cebfa8 100644 --- a/drivers/platform/x86/amd/pmc/mp1_stb.c +++ b/drivers/platform/x86/amd/pmc/mp1_stb.c @@ -157,7 +157,7 @@ static int amd_stb_debugfs_open_v2(struct inode *inode, struct file *filp) struct amd_pmc_dev *dev = filp->f_inode->i_private; u32 fsize, num_samples, val, stb_rdptr_offset = 0; struct amd_stb_v2_data *stb_data_arr; - int ret; + int ret = 0; /* Write dummy postcode while reading the STB buffer */ ret = amd_stb_write(dev, AMD_PMC_STB_DUMMY_PC); @@ -176,22 +176,24 @@ static int amd_stb_debugfs_open_v2(struct inode *inode, struct file *filp) * the enhanced dram size. Note that we land here only for the * platforms that support enhanced dram size reporting. */ - if (dump_custom_stb) - return amd_stb_handle_efr(filp); + if (dump_custom_stb) { + ret = amd_stb_handle_efr(filp); + goto out; + } /* Get the num_samples to calculate the last push location */ ret = amd_pmc_send_cmd(dev, S2D_NUM_SAMPLES, &num_samples, dev->stb_arg.s2d_msg_id, true); - /* Clear msg_port for other SMU operation */ - dev->msg_port = MSG_PORT_PMC; if (ret) { dev_err(dev->dev, "error: S2D_NUM_SAMPLES not supported : %d\n", ret); - return ret; + goto out; } fsize = min(num_samples, S2D_TELEMETRY_BYTES_MAX); stb_data_arr = kmalloc_flex(*stb_data_arr, data, fsize); - if (!stb_data_arr) - return -ENOMEM; + if (!stb_data_arr) { + ret = -ENOMEM; + goto out; + } stb_data_arr->size = fsize; @@ -214,7 +216,10 @@ static int amd_stb_debugfs_open_v2(struct inode *inode, struct file *filp) filp->private_data = stb_data_arr; - return 0; +out: + /* Restore the default message port for subsequent SMU operations */ + dev->msg_port = MSG_PORT_PMC; + return ret; } static ssize_t amd_stb_debugfs_read_v2(struct file *filp, char __user *buf, size_t size,