From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org,
dri-devel@lists.freedesktop.org
Cc: Juergen Gross <jgross@suse.com>, Helge Deller <deller@gmx.de>,
linux-geode@lists.infradead.org
Subject: [PATCH 22/32] fbdev/geode: Stop using 32-bit MSR interfaces
Date: Mon, 29 Jun 2026 08:05:13 +0200 [thread overview]
Message-ID: <20260629060526.3638272-23-jgross@suse.com> (raw)
In-Reply-To: <20260629060526.3638272-1-jgross@suse.com>
The 32-bit MSR interfaces rdmsr() and wrmsr() are planned to be
removed. Use the related 64-bit variants instead.
Signed-off-by: Juergen Gross <jgross@suse.com>
---
drivers/video/fbdev/geode/display_gx.c | 8 +++---
drivers/video/fbdev/geode/lxfb_ops.c | 38 +++++++++++++-------------
drivers/video/fbdev/geode/suspend_gx.c | 20 ++++++++------
3 files changed, 34 insertions(+), 32 deletions(-)
diff --git a/drivers/video/fbdev/geode/display_gx.c b/drivers/video/fbdev/geode/display_gx.c
index 099322cefce0..b93aa21a1d2b 100644
--- a/drivers/video/fbdev/geode/display_gx.c
+++ b/drivers/video/fbdev/geode/display_gx.c
@@ -23,15 +23,15 @@ unsigned int gx_frame_buffer_size(void)
unsigned int val;
if (!cs5535_has_vsa2()) {
- uint32_t hi, lo;
+ struct msr msr;
/* The number of pages is (PMAX - PMIN)+1 */
- rdmsr(MSR_GLIU_P2D_RO0, lo, hi);
+ rdmsrq(MSR_GLIU_P2D_RO0, msr.q);
/* PMAX */
- val = ((hi & 0xff) << 12) | ((lo & 0xfff00000) >> 20);
+ val = ((msr.h & 0xff) << 12) | ((msr.l & 0xfff00000) >> 20);
/* PMIN */
- val -= (lo & 0x000fffff);
+ val -= (msr.l & 0x000fffff);
val += 1;
/* The page size is 4k */
diff --git a/drivers/video/fbdev/geode/lxfb_ops.c b/drivers/video/fbdev/geode/lxfb_ops.c
index 2e33da9849b0..f5f1134cae9a 100644
--- a/drivers/video/fbdev/geode/lxfb_ops.c
+++ b/drivers/video/fbdev/geode/lxfb_ops.c
@@ -124,19 +124,19 @@ static const struct {
static void lx_set_dotpll(u32 pllval)
{
- u32 dotpll_lo, dotpll_hi;
+ struct msr dotpll;
int i;
- rdmsr(MSR_GLCP_DOTPLL, dotpll_lo, dotpll_hi);
+ rdmsrq(MSR_GLCP_DOTPLL, dotpll.q);
- if ((dotpll_lo & MSR_GLCP_DOTPLL_LOCK) && (dotpll_hi == pllval))
+ if ((dotpll.l & MSR_GLCP_DOTPLL_LOCK) && (dotpll.h == pllval))
return;
- dotpll_hi = pllval;
- dotpll_lo &= ~(MSR_GLCP_DOTPLL_BYPASS | MSR_GLCP_DOTPLL_HALFPIX);
- dotpll_lo |= MSR_GLCP_DOTPLL_DOTRESET;
+ dotpll.h = pllval;
+ dotpll.l &= ~(MSR_GLCP_DOTPLL_BYPASS | MSR_GLCP_DOTPLL_HALFPIX);
+ dotpll.l |= MSR_GLCP_DOTPLL_DOTRESET;
- wrmsr(MSR_GLCP_DOTPLL, dotpll_lo, dotpll_hi);
+ wrmsrq(MSR_GLCP_DOTPLL, dotpll.q);
/* Wait 100us for the PLL to lock */
@@ -145,15 +145,15 @@ static void lx_set_dotpll(u32 pllval)
/* Now, loop for the lock bit */
for (i = 0; i < 1000; i++) {
- rdmsr(MSR_GLCP_DOTPLL, dotpll_lo, dotpll_hi);
- if (dotpll_lo & MSR_GLCP_DOTPLL_LOCK)
+ rdmsrq(MSR_GLCP_DOTPLL, dotpll.q);
+ if (dotpll.l & MSR_GLCP_DOTPLL_LOCK)
break;
}
/* Clear the reset bit */
- dotpll_lo &= ~MSR_GLCP_DOTPLL_DOTRESET;
- wrmsr(MSR_GLCP_DOTPLL, dotpll_lo, dotpll_hi);
+ dotpll.l &= ~MSR_GLCP_DOTPLL_DOTRESET;
+ wrmsrq(MSR_GLCP_DOTPLL, dotpll.q);
}
/* Set the clock based on the frequency specified by the current mode */
@@ -268,7 +268,7 @@ static void lx_graphics_enable(struct fb_info *info)
config |= VP_DCFG_CRT_VSYNC_POL;
if (par->output & OUTPUT_PANEL) {
- u32 msrlo, msrhi;
+ struct msr val;
write_fp(par, FP_PT1, 0);
temp = FP_PT2_SCRC;
@@ -282,10 +282,10 @@ static void lx_graphics_enable(struct fb_info *info)
write_fp(par, FP_PT2, temp);
write_fp(par, FP_DFC, FP_DFC_BC);
- msrlo = MSR_LX_MSR_PADSEL_TFT_SEL_LOW;
- msrhi = MSR_LX_MSR_PADSEL_TFT_SEL_HIGH;
+ val.l = MSR_LX_MSR_PADSEL_TFT_SEL_LOW;
+ val.h = MSR_LX_MSR_PADSEL_TFT_SEL_HIGH;
- wrmsr(MSR_LX_MSR_PADSEL, msrlo, msrhi);
+ wrmsrq(MSR_LX_MSR_PADSEL, val.q);
}
if (par->output & OUTPUT_CRT) {
@@ -313,15 +313,15 @@ unsigned int lx_framebuffer_size(void)
unsigned int val;
if (!cs5535_has_vsa2()) {
- uint32_t hi, lo;
+ struct msr msr;
/* The number of pages is (PMAX - PMIN)+1 */
- rdmsr(MSR_GLIU_P2D_RO0, lo, hi);
+ rdmsrq(MSR_GLIU_P2D_RO0, msr.q);
/* PMAX */
- val = ((hi & 0xff) << 12) | ((lo & 0xfff00000) >> 20);
+ val = ((msr.h & 0xff) << 12) | ((msr.l & 0xfff00000) >> 20);
/* PMIN */
- val -= (lo & 0x000fffff);
+ val -= (msr.l & 0x000fffff);
val += 1;
/* The page size is 4k */
diff --git a/drivers/video/fbdev/geode/suspend_gx.c b/drivers/video/fbdev/geode/suspend_gx.c
index 73307f42e343..6c0a526ee8a2 100644
--- a/drivers/video/fbdev/geode/suspend_gx.c
+++ b/drivers/video/fbdev/geode/suspend_gx.c
@@ -40,25 +40,27 @@ static void gx_save_regs(struct gxfb_par *par)
static void gx_set_dotpll(uint32_t dotpll_hi)
{
- uint32_t dotpll_lo;
+ struct msr dotpll;
int i;
- rdmsrq(MSR_GLCP_DOTPLL, dotpll_lo);
- dotpll_lo |= MSR_GLCP_DOTPLL_DOTRESET;
- dotpll_lo &= ~MSR_GLCP_DOTPLL_BYPASS;
- wrmsr(MSR_GLCP_DOTPLL, dotpll_lo, dotpll_hi);
+ rdmsrq(MSR_GLCP_DOTPLL, dotpll.q);
+ dotpll.l |= MSR_GLCP_DOTPLL_DOTRESET;
+ dotpll.l &= ~MSR_GLCP_DOTPLL_BYPASS;
+ dotpll.h = dotpll_hi;
+ wrmsrq(MSR_GLCP_DOTPLL, dotpll.q);
/* wait for the PLL to lock */
for (i = 0; i < 200; i++) {
- rdmsrq(MSR_GLCP_DOTPLL, dotpll_lo);
- if (dotpll_lo & MSR_GLCP_DOTPLL_LOCK)
+ rdmsrq(MSR_GLCP_DOTPLL, dotpll.q);
+ if (dotpll.l & MSR_GLCP_DOTPLL_LOCK)
break;
udelay(1);
}
/* PLL set, unlock */
- dotpll_lo &= ~MSR_GLCP_DOTPLL_DOTRESET;
- wrmsr(MSR_GLCP_DOTPLL, dotpll_lo, dotpll_hi);
+ dotpll.l &= ~MSR_GLCP_DOTPLL_DOTRESET;
+ dotpll.h = dotpll_hi;
+ wrmsrq(MSR_GLCP_DOTPLL, dotpll.q);
}
static void gx_restore_gfx_proc(struct gxfb_par *par)
--
2.54.0
next prev parent reply other threads:[~2026-06-29 6:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 6:04 [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces Juergen Gross
2026-06-29 6:05 ` Juergen Gross [this message]
2026-06-29 6:05 ` [PATCH 31/32] treewide: convert rdmsrq() from a macro to an inline function Juergen Gross
2026-06-29 6:52 ` [PATCH 00/32] x86/msr: Drop 32-bit MSR interfaces Arnd Bergmann
2026-06-29 7:01 ` Jürgen Groß
2026-06-29 8:06 ` Arnd Bergmann
2026-06-29 8:15 ` Jürgen Groß
2026-06-29 8:38 ` Arnd Bergmann
2026-06-30 20:06 ` H. Peter Anvin
2026-06-29 11:19 ` Ingo Molnar
2026-06-30 18:59 ` Sean Christopherson
2026-07-01 8:33 ` Jürgen Groß
2026-07-02 10:07 ` Ingo Molnar
2026-07-02 11:03 ` Juergen Gross
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=20260629060526.3638272-23-jgross@suse.com \
--to=jgross@suse.com \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-geode@lists.infradead.org \
--cc=linux-kernel@vger.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