Skip to content

Commit

Permalink
Ignore broken identification response for monitors
Browse files Browse the repository at this point in the history
Some devices seem to produce invalid (wrong checksum/length/reply code)
responses for the identification command but provide a valid capability
string and otherwise interact normally.

Related to issue torvalds#22
  • Loading branch information
cgrenz committed Aug 16, 2021
1 parent 70e9fa4 commit 50f7044
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ddcci/ddcci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1493,8 +1493,14 @@ static int ddcci_detect_device(struct i2c_client *client, unsigned char addr,

/* Read identification and check for quirks */
ret = ddcci_identify_device(client, addr, buffer, 29);
if (ret < 0)
goto err_free;
if (ret < 0) {
if (!dependent && (ret == -EBADMSG || ret == -EMSGSIZE)) {
dev_warn(&device->dev, "DDC/CI main device sent broken response on identification. Trying to detect solely based on capability information.\n");
} else {
goto err_free;
}
}

if (ret == 29 && buffer[0] == DDCCI_REPLY_ID) {
memcpy(device->vendor, &buffer[7], 8);
memcpy(device->module, &buffer[17], 8);
Expand Down

0 comments on commit 50f7044

Please sign in to comment.