From: Peter Schneider <pschneider1968@googlemail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org
Cc: patches@lists.linux.dev, Thomas Zimmermann <tzimmermann@suse.de>,
Jocelyn Falempe <jfalempe@redhat.com>,
Nick Bowler <nbowler@draconx.ca>,
Douglas Anderson <dianders@chromium.org>,
Dave Airlie <airlied@redhat.com>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 6.17 105/849] drm/ast: Clear preserved bits from register output value
Date: Tue, 11 Nov 2025 16:38:40 +0100 [thread overview]
Message-ID: <32141af0-a792-4c2f-a7cf-cc1cf59d6a55@googlemail.com> (raw)
In-Reply-To: <20251111004538.940185021@linuxfoundation.org>
Hi Greg,
Am 11.11.2025 um 01:34 schrieb Greg Kroah-Hartman:
> 6.17-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Thomas Zimmermann <tzimmermann@suse.de>
>
> commit a9fb41b5def8e1e0103d5fd1453787993587281e upstream.
>
> Preserve the I/O register bits in __ast_write8_i_masked() as specified
> by preserve_mask. Accidentally OR-ing the output value into these will
> overwrite the register's previous settings.
>
> Fixes display output on the AST2300, where the screen can go blank at
> boot. The driver's original commit 312fec1405dd ("drm: Initial KMS
> driver for AST (ASpeed Technologies) 2000 series (v2)") already added
> the broken code. Commit 6f719373b943 ("drm/ast: Blank with VGACR17 sync
> enable, always clear VGACRB6 sync off") triggered the bug.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Reported-by: Peter Schneider <pschneider1968@googlemail.com>
> Closes: https://lore.kernel.org/dri-devel/a40caf8e-58ad-4f9c-af7f-54f6f69c29bb@googlemail.com/
> Tested-by: Peter Schneider <pschneider1968@googlemail.com>
> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
> Fixes: 6f719373b943 ("drm/ast: Blank with VGACR17 sync enable, always clear VGACRB6 sync off")
> Fixes: 312fec1405dd ("drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)")
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Nick Bowler <nbowler@draconx.ca>
> Cc: Douglas Anderson <dianders@chromium.org>
> Cc: Dave Airlie <airlied@redhat.com>
> Cc: Jocelyn Falempe <jfalempe@redhat.com>
> Cc: dri-devel@lists.freedesktop.org
> Cc: <stable@vger.kernel.org> # v3.5+
> Link: https://patch.msgid.link/20251024073626.129032-1-tzimmermann@suse.de
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> drivers/gpu/drm/ast/ast_drv.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> --- a/drivers/gpu/drm/ast/ast_drv.h
> +++ b/drivers/gpu/drm/ast/ast_drv.h
> @@ -284,13 +284,13 @@ static inline void __ast_write8_i(void _
> __ast_write8(addr, reg + 1, val);
> }
>
> -static inline void __ast_write8_i_masked(void __iomem *addr, u32 reg, u8 index, u8 read_mask,
> +static inline void __ast_write8_i_masked(void __iomem *addr, u32 reg, u8 index, u8 preserve_mask,
> u8 val)
> {
> - u8 tmp = __ast_read8_i_masked(addr, reg, index, read_mask);
> + u8 tmp = __ast_read8_i_masked(addr, reg, index, preserve_mask);
>
> - tmp |= val;
> - __ast_write8_i(addr, reg, index, tmp);
> + val &= ~preserve_mask;
> + __ast_write8_i(addr, reg, index, tmp | val);
> }
>
> static inline u32 ast_read32(struct ast_device *ast, u32 reg)
>
I think that with this patch (which fixes a bug in the original ast driver affecting AST2300), it is now safe to also
include (in both 6.12.58 AND 6.17.8)
6f719373b943 ("drm/ast: Blank with VGACR17 sync enable, always clear VGACRB6 sync off")
which triggered that bug, and which you dropped from 6.12.55 and 6.17.5, respectively, because of my report
https://lore.kernel.org/dri-devel/a40caf8e-58ad-4f9c-af7f-54f6f69c29bb@googlemail.com/
NB: 6f719373b943 fixed (IIRC) an important issue for AST2500 users. I have tested the combination of both patches in
mainline 6.18-rc2, and they work fine together, and Linus has both of them in his tree since 6.18-rc4.
Also, I tested both of them already on top of 6.12.5 and 6.17.5, and they were fine, too. Please see:
https://lore.kernel.org/lkml/045e6362-01db-47f3-9a4f-8a86b2c15d00@googlemail.com/
Beste Grüße,
Peter Schneider
--
Climb the mountain not to plant your flag, but to embrace the challenge,
enjoy the air and behold the view. Climb it so you can see the world,
not so the world can see you. -- David McCullough Jr.
OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244
Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc
https://keys.mailvelope.com/pks/lookup?op=get&search=pschneider1968@googlemail.com
https://keys.mailvelope.com/pks/lookup?op=get&search=pschneider1968@gmail.com
prev parent reply other threads:[~2025-11-11 15:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20251111004536.460310036@linuxfoundation.org>
2025-11-11 0:34 ` [PATCH 6.17 099/849] drm/sysfb: Do not dereference NULL pointer in plane reset Greg Kroah-Hartman
2025-11-11 0:34 ` [PATCH 6.17 105/849] drm/ast: Clear preserved bits from register output value Greg Kroah-Hartman
2025-11-11 15:38 ` Peter Schneider [this message]
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=32141af0-a792-4c2f-a7cf-cc1cf59d6a55@googlemail.com \
--to=pschneider1968@googlemail.com \
--cc=airlied@redhat.com \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=jfalempe@redhat.com \
--cc=nbowler@draconx.ca \
--cc=patches@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=tzimmermann@suse.de \
/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