Commit 92b96187 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau: display error message for any failed init table opcode

Some handlers don't report specific errors, but we still *really* want to
know if we failed to parse a complete init table.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 9170a824
...@@ -3130,7 +3130,7 @@ parse_init_table(struct nvbios *bios, unsigned int offset, ...@@ -3130,7 +3130,7 @@ parse_init_table(struct nvbios *bios, unsigned int offset,
* is changed back to EXECUTE. * is changed back to EXECUTE.
*/ */
int count = 0, i, res; int count = 0, i, ret;
uint8_t id; uint8_t id;
/* /*
...@@ -3145,26 +3145,33 @@ parse_init_table(struct nvbios *bios, unsigned int offset, ...@@ -3145,26 +3145,33 @@ parse_init_table(struct nvbios *bios, unsigned int offset,
for (i = 0; itbl_entry[i].name && (itbl_entry[i].id != id); i++) for (i = 0; itbl_entry[i].name && (itbl_entry[i].id != id); i++)
; ;
if (itbl_entry[i].name) { if (!itbl_entry[i].name) {
BIOSLOG(bios, "0x%04X: [ (0x%02X) - %s ]\n", NV_ERROR(bios->dev,
offset, itbl_entry[i].id, itbl_entry[i].name); "0x%04X: Init table command not found: "
"0x%02X\n", offset, id);
return -ENOENT;
}
BIOSLOG(bios, "0x%04X: [ (0x%02X) - %s ]\n", offset,
itbl_entry[i].id, itbl_entry[i].name);
/* execute eventual command handler */ /* execute eventual command handler */
res = (*itbl_entry[i].handler)(bios, offset, iexec); ret = (*itbl_entry[i].handler)(bios, offset, iexec);
if (!res) if (ret < 0) {
NV_ERROR(bios->dev, "0x%04X: Failed parsing init "
"table opcode: %s %d\n", offset,
itbl_entry[i].name, ret);
}
if (ret <= 0)
break; break;
/* /*
* Add the offset of the current command including all data * Add the offset of the current command including all data
* of that command. The offset will then be pointing on the * of that command. The offset will then be pointing on the
* next op code. * next op code.
*/ */
offset += res; offset += ret;
} else {
NV_ERROR(bios->dev,
"0x%04X: Init table command not found: "
"0x%02X\n", offset, id);
return -ENOENT;
}
} }
if (offset >= bios->length) if (offset >= bios->length)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment