drivers/smmstore: Retry APM SCI if it fails
For some reason, the APM SCI to install the SMMSTORE comm buffer regularly, but not always, fails with 0x4ed on ADL. In this case, a second attempt seems to always complete successfully. Tested on system76/darp8 and system76/galp6. Change-Id: I843116113b8c24f1aee42f9d9042cdc0471a1b43 Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
committed by
Tim Crawford
parent
254e7dca82
commit
1cb13106c9
@@ -57,18 +57,22 @@ static void init_store(void *unused)
|
|||||||
|
|
||||||
printk(BIOS_INFO, "SMMSTORE: Setting up SMI handler\n");
|
printk(BIOS_INFO, "SMMSTORE: Setting up SMI handler\n");
|
||||||
|
|
||||||
/* Issue SMI using APM to update the com buffer and to lock the SMMSTORE */
|
for (int retries = 0; retries < 3; retries++) {
|
||||||
__asm__ __volatile__ (
|
/* Issue SMI using APM to update the com buffer and to lock the SMMSTORE */
|
||||||
"outb %%al, %%dx"
|
__asm__ __volatile__ (
|
||||||
: "=a" (eax)
|
"outb %%al, %%dx"
|
||||||
: "a" ((SMMSTORE_CMD_INIT << 8) | APM_CNT_SMMSTORE),
|
: "=a" (eax)
|
||||||
"b" (ebx),
|
: "a" ((SMMSTORE_CMD_INIT << 8) | APM_CNT_SMMSTORE),
|
||||||
"d" (APM_CNT)
|
"b" (ebx),
|
||||||
: "memory");
|
"d" (APM_CNT)
|
||||||
|
: "memory");
|
||||||
|
|
||||||
if (eax != SMMSTORE_RET_SUCCESS) {
|
if (eax == SMMSTORE_RET_SUCCESS) {
|
||||||
printk(BIOS_ERR, "SMMSTORE: Failed to install com buffer\n");
|
printk(BIOS_INFO, "SMMSTORE: Installed com buffer\n");
|
||||||
return;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
printk(BIOS_ERR, "SMMSTORE: Failed to install com buffer: 0x%x\n", eax);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user