From: sashiko-bot@kernel.org
To: vishnu.saini@oss.qualcomm.com
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4] drm/bridge: lt9611uxc: support displays with up to 4 EDID blocks
Date: Tue, 22 Sep 2026 04:02:12 +0000 [thread overview]
Message-ID: <20260922040212.8D2011F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260922-lt9611usc_edid34_misc_next-v4-1-47d5315821fe@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] drm/bridge: lt9611uxc: race condition in EDID SRAM polling causes torn reads
- [Medium] drm/bridge: lt9611uxc: strict EDID header check breaks repairable displays
--
commit 6559cd85aa7ae1a652dd056a93747b35998d927d
Author: Ravi Agola <raviagol@qti.qualcomm.com>
drm/bridge: lt9611uxc: support displays with up to 4 EDID blocks
This commit adds support for fetching up to 4 EDID blocks in the LT9611UXC
bridge driver by re-triggering access for blocks beyond the first two. It
introduces a polling mechanism for blocks 0 and 2, checking for a valid EDID
header match to verify read success. It also increases the EDID wait time to
handle slower platform interrupts.
> diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
> index b3bb7f2cebb3b..a74077a65f62b 100644
> --- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
> +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
[ ... ]
> @@ -394,20 +422,48 @@ static int lt9611uxc_get_edid_block(void *data, u8 *buf, unsigned int block, siz
> if (block >= EDID_NUM_BLOCKS)
> return -EINVAL;
>
> - lt9611uxc_lock(lt9611uxc);
> + if (block == 0 || block == 2) {
>
> - regmap_write(lt9611uxc->regmap, 0xb00b, 0x10);
> + lt9611uxc_lock(lt9611uxc);
>
> - regmap_write(lt9611uxc->regmap, 0xb00a, block * EDID_BLOCK_SIZE);
> + edid_ready_flag = (block == 0) ? BIT(0) : BIT(1);
>
> - ret = regmap_noinc_read(lt9611uxc->regmap, 0xb0b0, buf, len);
> - if (ret)
> - dev_err(lt9611uxc->dev, "edid read failed: %d\n", ret);
> + /*
> + * Set the EDID ready flag so that lt9611uxc can fetch correct EDID block
> + */
> + regmap_write(lt9611uxc->regmap, 0xb028, edid_ready_flag);
>
> - lt9611uxc_unlock(lt9611uxc);
> + lt9611uxc_unlock(lt9611uxc);
>
> - return 0;
> -};
> + do {
> + msleep(100);
> + ret = lt9611uxc_read_edid_block(lt9611uxc, block, buf, len);
> + if (ret)
> + break;
> + /*
> + * Compare first 8 bytes of EDID header for block 0 and block 2
> + * to confirm EDID read successfully
> + */
> + header_matched = (memcmp(edid_header, buf, 8) == 0);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Severity: Medium]
Will this strict exact match check inadvertently drop blocks with repairable
header corruptions?
If the display provides a corrupted header that the DRM core is natively
designed to fix via edid_header_fix(), it seems this strict memcmp will never
match and the polling loop will exhaust its retries, returning -ETIMEDOUT.
Does this break initialization for displays with non-compliant but repairable
EDID headers?
> + edid_valid = (block == 0 && header_matched) ||
> + (block == 2 && !header_matched);
> + if (edid_valid)
> + break;
^^^^^
[Severity: High]
Does this condition break the wait loop too early, ignoring that the rest of
the block is still being written by the MCU?
When the DRM core requests block 2, the bridge driver writes to 0xb028 to
trigger the MCU fetch, and then polls the SRAM. The SRAM initially contains
block 0 (which has a valid header). As soon as the MCU overwrites the first
byte of SRAM with block 2 data, the !header_matched condition evaluates to
true.
Could this cause the driver to immediately stop polling and read the rest of
the block, which might still contain stale data from block 0?
> +
> + } while (retry_cnt-- > 0);
> +
> + if (!ret && !edid_valid)
> + ret = -ETIMEDOUT;
> + } else {
> + ret = lt9611uxc_read_edid_block(lt9611uxc, block, buf, len);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Severity: High]
Blocks 1 and 3 are read immediately here without any synchronization. Does
this guarantee reading torn data if the firmware is still fetching them over
I2C?
> +
> + lt9611uxc_lock(lt9611uxc);
> + regmap_write(lt9611uxc->regmap, 0xb028, 0x00);
> + lt9611uxc_unlock(lt9611uxc);
> + }
> +
> + return ret;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260922-lt9611usc_edid34_misc_next-v4-1-47d5315821fe@oss.qualcomm.com?part=1
next prev parent reply other threads:[~2026-09-22 4:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 3:50 [PATCH v4] drm/bridge: lt9611uxc: support displays with up to 4 EDID blocks vishnu.saini
2026-09-22 4:02 ` sashiko-bot [this message]
2026-09-22 8:55 ` Jani Nikula
2026-09-24 19:33 ` Vishnu Saini
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=20260922040212.8D2011F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vishnu.saini@oss.qualcomm.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.