diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-05-10 02:59:42 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-05-19 02:22:04 -0400 |
commit | 92b9618761465d190b68519bcc6a6fbd8847cf2c (patch) | |
tree | df6e34413cc3e18130b06f05b3f540db4ff75dab /drivers | |
parent | 9170a82438230da63ed09cf6fd1f4d2f87baf68c (diff) |
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: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 387ac734e9b9..d8dcb362e8b5 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -3130,7 +3130,7 @@ parse_init_table(struct nvbios *bios, unsigned int offset, | |||
3130 | * is changed back to EXECUTE. | 3130 | * is changed back to EXECUTE. |
3131 | */ | 3131 | */ |
3132 | 3132 | ||
3133 | int count = 0, i, res; | 3133 | int count = 0, i, ret; |
3134 | uint8_t id; | 3134 | uint8_t id; |
3135 | 3135 | ||
3136 | /* | 3136 | /* |
@@ -3145,26 +3145,33 @@ parse_init_table(struct nvbios *bios, unsigned int offset, | |||
3145 | for (i = 0; itbl_entry[i].name && (itbl_entry[i].id != id); i++) | 3145 | for (i = 0; itbl_entry[i].name && (itbl_entry[i].id != id); i++) |
3146 | ; | 3146 | ; |
3147 | 3147 | ||
3148 | if (itbl_entry[i].name) { | 3148 | if (!itbl_entry[i].name) { |
3149 | BIOSLOG(bios, "0x%04X: [ (0x%02X) - %s ]\n", | ||
3150 | offset, itbl_entry[i].id, itbl_entry[i].name); | ||
3151 | |||
3152 | /* execute eventual command handler */ | ||
3153 | res = (*itbl_entry[i].handler)(bios, offset, iexec); | ||
3154 | if (!res) | ||
3155 | break; | ||
3156 | /* | ||
3157 | * Add the offset of the current command including all data | ||
3158 | * of that command. The offset will then be pointing on the | ||
3159 | * next op code. | ||
3160 | */ | ||
3161 | offset += res; | ||
3162 | } else { | ||
3163 | NV_ERROR(bios->dev, | 3149 | NV_ERROR(bios->dev, |
3164 | "0x%04X: Init table command not found: " | 3150 | "0x%04X: Init table command not found: " |
3165 | "0x%02X\n", offset, id); | 3151 | "0x%02X\n", offset, id); |
3166 | return -ENOENT; | 3152 | return -ENOENT; |
3167 | } | 3153 | } |
3154 | |||
3155 | BIOSLOG(bios, "0x%04X: [ (0x%02X) - %s ]\n", offset, | ||
3156 | itbl_entry[i].id, itbl_entry[i].name); | ||
3157 | |||
3158 | /* execute eventual command handler */ | ||
3159 | ret = (*itbl_entry[i].handler)(bios, offset, iexec); | ||
3160 | if (ret < 0) { | ||
3161 | NV_ERROR(bios->dev, "0x%04X: Failed parsing init " | ||
3162 | "table opcode: %s %d\n", offset, | ||
3163 | itbl_entry[i].name, ret); | ||
3164 | } | ||
3165 | |||
3166 | if (ret <= 0) | ||
3167 | break; | ||
3168 | |||
3169 | /* | ||
3170 | * Add the offset of the current command including all data | ||
3171 | * of that command. The offset will then be pointing on the | ||
3172 | * next op code. | ||
3173 | */ | ||
3174 | offset += ret; | ||
3168 | } | 3175 | } |
3169 | 3176 | ||
3170 | if (offset >= bios->length) | 3177 | if (offset >= bios->length) |