Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH v2 1/2] drm/radeon: Read the VRAM VBIOS signature with readb()
       [not found] <20260927145505.16883-1-kaloz@kernel.org>
@ 2026-09-27 14:55 ` Imre Kaloz
  0 siblings, 0 replies; only message in thread
From: Imre Kaloz @ 2026-09-27 14:55 UTC (permalink / raw)
  To: Alex Deucher, Christian König
  Cc: David Airlie, Simona Vetter, amd-gfx, dri-devel, linux-kernel,
	stable

igp_read_bios_from_vram() checked bios[0]/bios[1] with a plain
__iomem load, which faults on sparc64 before the copy runs at all.
radeon_read_bios() already reads its two signature bytes with
readb() ahead of its own copy; use the same accessor here, keeping
the check before the allocation.

Fixes: b442962a9e82 ("drm/radeon/kms: add support for "Surround View"")
Cc: stable@vger.kernel.org
Signed-off-by: Imre Kaloz <kaloz@kernel.org>
---
Changes in v2:
- Read the signature with readb() before the allocation instead of
  checking the RAM copy, as radeon_read_bios() does.

 drivers/gpu/drm/radeon/radeon_bios.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c
index 8595f4c6e2e5..1da6bf1c17ff 100644
--- a/drivers/gpu/drm/radeon/radeon_bios.c
+++ b/drivers/gpu/drm/radeon/radeon_bios.c
@@ -49,6 +49,7 @@
 static bool igp_read_bios_from_vram(struct radeon_device *rdev)
 {
 	uint8_t __iomem *bios;
+	uint8_t val1, val2;
 	resource_size_t vram_base;
 	resource_size_t size = 256 * 1024; /* ??? */
 
@@ -63,7 +64,10 @@ static bool igp_read_bios_from_vram(struct radeon_device *rdev)
 		return false;
 	}
 
-	if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) {
+	val1 = readb(&bios[0]);
+	val2 = readb(&bios[1]);
+
+	if (size == 0 || val1 != 0x55 || val2 != 0xaa) {
 		iounmap(bios);
 		return false;
 	}
-- 
2.47.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-27 14:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260927145505.16883-1-kaloz@kernel.org>
2026-09-27 14:55 ` [PATCH v2 1/2] drm/radeon: Read the VRAM VBIOS signature with readb() Imre Kaloz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox