All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Stanley <joel@jms.id.au>
To: Jeremy Kerr <jk@codeconstruct.com.au>, Oskar Senft <osk@google.com>
Cc: linux-aspeed@lists.ozlabs.org, David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org, Andrew Jeffery <andrew@aj.id.au>,
	Ali El-Haj-Mahmoud <aaelhaj@google.com>
Subject: [PATCH] drm/aspeed: Fix vga_pw sysfs output
Date: Wed, 17 Nov 2021 09:01:45 +0800	[thread overview]
Message-ID: <20211117010145.297253-1-joel@jms.id.au> (raw)

Before the drm driver had support for this file there was a driver that
exposed the contents of the vga password register to userspace. It would
present the entire register instead of interpreting it.

The drm implementation chose to mask of the lower bit, without explaining
why. This breaks the existing userspace, which is looking for 0xa8 in
the lower byte.

Change our implementation to expose the entire register.

Fixes: 696029eb36c0 ("drm/aspeed: Add sysfs for output settings")
Reported-by: Oskar Senft <osk@google.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
index b53fee6f1c17..65f172807a0d 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
@@ -291,7 +291,7 @@ vga_pw_show(struct device *dev, struct device_attribute *attr, char *buf)
 	if (rc)
 		return rc;
 
-	return sprintf(buf, "%u\n", reg & 1);
+	return sprintf(buf, "%u\n", reg);
 }
 static DEVICE_ATTR_RO(vga_pw);
 
-- 
2.33.0


             reply	other threads:[~2021-11-17  1:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17  1:01 Joel Stanley [this message]
2021-11-17  2:28 ` [PATCH] drm/aspeed: Fix vga_pw sysfs output Oskar Senft
2021-11-19  6:54 ` Jeremy Kerr
2021-11-19  7:07   ` Joel Stanley
2021-11-19 11:00 ` (subset) " Maxime Ripard

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=20211117010145.297253-1-joel@jms.id.au \
    --to=joel@jms.id.au \
    --cc=aaelhaj@google.com \
    --cc=airlied@linux.ie \
    --cc=andrew@aj.id.au \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jk@codeconstruct.com.au \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=osk@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.