* [PATCH] drm/aspeed: Fix vga_pw sysfs output
@ 2021-11-17 1:01 Joel Stanley
2021-11-17 2:28 ` Oskar Senft
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Joel Stanley @ 2021-11-17 1:01 UTC (permalink / raw)
To: Jeremy Kerr, Oskar Senft
Cc: linux-aspeed, David Airlie, dri-devel, Andrew Jeffery,
Ali El-Haj-Mahmoud
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/aspeed: Fix vga_pw sysfs output
2021-11-17 1:01 [PATCH] drm/aspeed: Fix vga_pw sysfs output Joel Stanley
@ 2021-11-17 2:28 ` Oskar Senft
2021-11-19 6:54 ` Jeremy Kerr
2021-11-19 11:00 ` (subset) " Maxime Ripard
2 siblings, 0 replies; 5+ messages in thread
From: Oskar Senft @ 2021-11-17 2:28 UTC (permalink / raw)
To: Joel Stanley
Cc: linux-aspeed, David Airlie, dri-devel, Andrew Jeffery,
Jeremy Kerr, Ali El-Haj-Mahmoud
On Tue, Nov 16, 2021 at 8:02 PM Joel Stanley <joel@jms.id.au> wrote:
>
> 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
>
Tested-by: Oskar Senft <osk@google.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/aspeed: Fix vga_pw sysfs output
2021-11-17 1:01 [PATCH] drm/aspeed: Fix vga_pw sysfs output Joel Stanley
2021-11-17 2:28 ` Oskar Senft
@ 2021-11-19 6:54 ` Jeremy Kerr
2021-11-19 7:07 ` Joel Stanley
2021-11-19 11:00 ` (subset) " Maxime Ripard
2 siblings, 1 reply; 5+ messages in thread
From: Jeremy Kerr @ 2021-11-19 6:54 UTC (permalink / raw)
To: Joel Stanley, Oskar Senft
Cc: linux-aspeed, David Airlie, dri-devel, Andrew Jeffery,
Ali El-Haj-Mahmoud
Hi Joel,
> 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.
As a userspace consumer of this:
Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au>
Thanks!
Jeremy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/aspeed: Fix vga_pw sysfs output
2021-11-19 6:54 ` Jeremy Kerr
@ 2021-11-19 7:07 ` Joel Stanley
0 siblings, 0 replies; 5+ messages in thread
From: Joel Stanley @ 2021-11-19 7:07 UTC (permalink / raw)
To: Daniel Vetter, David Airlie
Cc: linux-aspeed, Andrew Jeffery, open list:DRM DRIVERS, Oskar Senft,
Jeremy Kerr, Ali El-Haj-Mahmoud
Hi David, Daniel,
On Fri, 19 Nov 2021 at 06:54, Jeremy Kerr <jk@codeconstruct.com.au> wrote:
>
> Hi Joel,
>
> > 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.
>
> As a userspace consumer of this:
>
> Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au>
Am I okay to apply this to drm-misc-fixes? I've not applied a patch to
the fixes tree before, so I wanted to check if there is some process
I've missed.
Cheers,
Joel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: (subset) [PATCH] drm/aspeed: Fix vga_pw sysfs output
2021-11-17 1:01 [PATCH] drm/aspeed: Fix vga_pw sysfs output Joel Stanley
2021-11-17 2:28 ` Oskar Senft
2021-11-19 6:54 ` Jeremy Kerr
@ 2021-11-19 11:00 ` Maxime Ripard
2 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2021-11-19 11:00 UTC (permalink / raw)
To: Jeremy Kerr, Joel Stanley, Oskar Senft
Cc: linux-aspeed, David Airlie, dri-devel, Andrew Jeffery,
Maxime Ripard, Ali El-Haj-Mahmoud
On Wed, 17 Nov 2021 09:01:45 +0800, Joel Stanley wrote:
> 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.
>
> [...]
Applied to drm/drm-misc (drm-misc-fixes).
Thanks!
Maxime
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-11-19 11:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 1:01 [PATCH] drm/aspeed: Fix vga_pw sysfs output Joel Stanley
2021-11-17 2:28 ` Oskar Senft
2021-11-19 6:54 ` Jeremy Kerr
2021-11-19 7:07 ` Joel Stanley
2021-11-19 11:00 ` (subset) " Maxime Ripard
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.