@@ -355,8 +355,10 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
for (i = 0; i < 4; i++) {
if (drm_do_probe_ddc_edid(adapter,
block + (valid_extensions + 1) * EDID_LENGTH,
- j, EDID_LENGTH))
- goto out;
+ j, EDID_LENGTH)) {
+ valid_extensions = 0;
+ goto done_fix_extension_count;
+ }
if (drm_edid_block_valid(block + (valid_extensions + 1) * EDID_LENGTH, j, print_bad_edid)) {
valid_extensions++;
break;
@@ -368,6 +370,7 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
drm_get_connector_name(connector), j);
}
+done_fix_extension_count:
if (valid_extensions != block[EDID_EXTENSION_FLAG_OFFSET]) {
block[EDID_CHECKSUM_OFFSET] += block[EDID_EXTENSION_FLAG_OFFSET] - valid_extensions;
block[EDID_EXTENSION_FLAG_OFFSET] = valid_extensions;
If I2C readout fails for an extension block but we have read a valid base block, don't fail completely but at least return the base block. v2: Make goto target names more telling. Signed-off-by: Egbert Eich <eich@suse.com> --- drivers/gpu/drm/drm_edid.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)