mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Mario Limonciello" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Mario Limonciello <mario.limonciello@amd.com>,
	"Borislav Petkov (AMD)" <bp@alien8.de>,
	Ingo Molnar <mingo@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/core] x86/amd_node: Add a smn_read_register() helper
Date: Wed, 19 Mar 2025 11:03:51 -0000	[thread overview]
Message-ID: <174238223147.14745.1185713088833075540.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20250217231747.1656228-2-superm1@kernel.org>

The following commit has been merged into the x86/core branch of tip:

Commit-ID:     4476e7f81467b2c1b0aea7383e657181a3f9e652
Gitweb:        https://git.kernel.org/tip/4476e7f81467b2c1b0aea7383e657181a3f9e652
Author:        Mario Limonciello <mario.limonciello@amd.com>
AuthorDate:    Mon, 17 Feb 2025 17:17:41 -06:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 19 Mar 2025 11:18:48 +01:00

x86/amd_node: Add a smn_read_register() helper

Some of the ACP drivers will poll registers through SMN using
read_poll_timeout() which requires returning the result of the register read
as the argument.

Add a helper to do just that.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20250217231747.1656228-2-superm1@kernel.org
---
 arch/x86/include/asm/amd_node.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/x86/include/asm/amd_node.h b/arch/x86/include/asm/amd_node.h
index 002c3af..23fe617 100644
--- a/arch/x86/include/asm/amd_node.h
+++ b/arch/x86/include/asm/amd_node.h
@@ -46,4 +46,15 @@ static inline int __must_check amd_smn_hsmp_rdwr(u16 node, u32 address, u32 *val
 }
 #endif /* CONFIG_AMD_NODE */
 
+/* helper for use with read_poll_timeout */
+static inline int smn_read_register(u32 reg)
+{
+	int data, rc;
+
+	rc = amd_smn_read(0, reg, &data);
+	if (rc)
+		return rc;
+
+	return data;
+}
 #endif /*_ASM_X86_AMD_NODE_H_*/

  parent reply	other threads:[~2025-03-19 11:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-17 23:17 [PATCH 0/7] Adjust all AMD audio drivers to use AMD_NODE Mario Limonciello
2025-02-17 23:17 ` [PATCH 1/7] x86/amd_node: Add a helper for use with `read_poll_timeout` Mario Limonciello
2025-02-18 17:29   ` [tip: x86/misc] x86/amd_node: Add a smn_read_register() helper tip-bot2 for Mario Limonciello
2025-03-19 11:03   ` tip-bot2 for Mario Limonciello [this message]
2025-02-17 23:17 ` [PATCH 2/7] ASoC: amd: acp: rembrandt: Use AMD_NODE Mario Limonciello
2025-02-17 23:17 ` [PATCH 3/7] ASoC: amd: acp: acp70: " Mario Limonciello
2025-02-17 23:17 ` [PATCH 4/7] ASoC: amd: acp: acp63: " Mario Limonciello
2025-02-17 23:17 ` [PATCH 5/7] ASoC: SOF: amd: " Mario Limonciello
2025-02-17 23:17 ` [PATCH 6/7] ASoC: amd: acp: Drop local symbols for smn read/write Mario Limonciello
2025-02-17 23:17 ` [PATCH 7/7] ASoC: SOF: amd: Drop host bridge ID from struct Mario Limonciello
2025-02-18 15:11 ` [PATCH 0/7] Adjust all AMD audio drivers to use AMD_NODE Mark Brown
2025-02-18 15:16   ` Mario Limonciello
2025-02-18 15:26     ` Borislav Petkov
2025-02-18 15:33       ` Mario Limonciello
2025-02-18 17:26         ` Borislav Petkov
2025-02-18 17:29           ` Mario Limonciello
2025-02-19 23:08 ` (subset) " Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=174238223147.14745.1185713088833075540.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=mingo@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®