Re: [PATCH] drm/bridge: anx7625: Fix EDID block size at drm_edid_alloc() calling

From: Ayushi Makhija
Date: Mon Nov 03 2025 - 05:37:46 EST


On 8/8/2025 12:16 PM, Xin Ji wrote:
> Since DRM validates the all of EDID blocks, allocates drm_edid data
> structure based on the actually block count returned by the sink
> monitor at drm_edid_alloc() calling.
>
> Fixes: 7c585f9a71aa ("drm/bridge: anx7625: use struct drm_edid more")
>
> Signed-off-by: Xin Ji <xji@xxxxxxxxxxxxxxxx>
> ---
> drivers/gpu/drm/bridge/analogix/anx7625.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index c0ad8f59e483..4b5a74e9785e 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -1801,7 +1801,7 @@ static const struct drm_edid *anx7625_edid_read(struct anx7625_data *ctx)
> return NULL;
> }
>
> - ctx->cached_drm_edid = drm_edid_alloc(edid_buf, FOUR_BLOCK_SIZE);
> + ctx->cached_drm_edid = drm_edid_alloc(edid_buf, edid_num * EDID_LENGTH);
> kfree(edid_buf);
>
> out:

I applied https://lore.kernel.org/all/20250808064613.2623732-1-xji@xxxxxxxxxxxxxxxx/ on linux-next (next-20250929),
tested on QCS9100 RIDE SX platform.

Before this patch, the ANX7625 bridge driver allocated drm_edid with a fixed 512 bytes (FOUR_BLOCK_SIZE),
while the connected monitor provides only 256 bytes of EDID (2 blocks; EDID_LENGTH = 128 bytes per block)
(It could vary depending on the number of edid blocks supported by the monitor). This mismatch caused
drm_edid_valid() to fail and the system to boot into a fail safe mode.

With this patch, the allocation uses edid_num * EDID_LENGTH, matching the actual number of EDID blocks from
the monitor, and the issue is no longer reproducible.

Tested-by: Ayushi Makhija <quic_amakhija@xxxxxxxxxxx>

Thanks,
Ayushi