Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31919
Change subject: ec/google/wilco: Fix handling of commands that do not respond ......................................................................
ec/google/wilco: Fix handling of commands that do not respond
If the command does not respond the driver should not wait for it to complete before returning.
Tested with SMI debug enabled to ensure that the final command does not report a failure.
Change-Id: I7c1bfa19a92e8332ac1aa6ff95f94ff4cbdf789d Signed-off-by: Duncan Laurie dlaurie@google.com --- M src/ec/google/wilco/mailbox.c 1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/31919/1
diff --git a/src/ec/google/wilco/mailbox.c b/src/ec/google/wilco/mailbox.c index 1c38a5b..d47290c 100644 --- a/src/ec/google/wilco/mailbox.c +++ b/src/ec/google/wilco/mailbox.c @@ -155,12 +155,6 @@ /* Start the command */ outb(EC_MAILBOX_START_COMMAND, CONFIG_EC_BASE_HOST_COMMAND);
- /* Wait for it to complete */ - if (wilco_ec_response_timed_out()) { - printk(BIOS_ERR, "%s: response timed out\n", __func__); - return -1; - } - /* Some commands will put the EC into a state where it cannot respond */ if (msg->type == WILCO_EC_MSG_NO_RESPONSE) { printk(BIOS_DEBUG, "%s: EC does not respond to this command\n", @@ -168,6 +162,12 @@ return 0; }
+ /* Wait for it to complete */ + if (wilco_ec_response_timed_out()) { + printk(BIOS_ERR, "%s: response timed out\n", __func__); + return -1; + } + /* Check result */ msg->result = inb(CONFIG_EC_BASE_HOST_DATA); if (msg->result != 0) {
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31919 )
Change subject: ec/google/wilco: Fix handling of commands that do not respond ......................................................................
Patch Set 1: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/31919 )
Change subject: ec/google/wilco: Fix handling of commands that do not respond ......................................................................
ec/google/wilco: Fix handling of commands that do not respond
If the command does not respond the driver should not wait for it to complete before returning.
Tested with SMI debug enabled to ensure that the final command does not report a failure.
Change-Id: I7c1bfa19a92e8332ac1aa6ff95f94ff4cbdf789d Signed-off-by: Duncan Laurie dlaurie@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/31919 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Furquan Shaikh furquan@google.com --- M src/ec/google/wilco/mailbox.c 1 file changed, 6 insertions(+), 6 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved
diff --git a/src/ec/google/wilco/mailbox.c b/src/ec/google/wilco/mailbox.c index 1c38a5b..d47290c 100644 --- a/src/ec/google/wilco/mailbox.c +++ b/src/ec/google/wilco/mailbox.c @@ -155,12 +155,6 @@ /* Start the command */ outb(EC_MAILBOX_START_COMMAND, CONFIG_EC_BASE_HOST_COMMAND);
- /* Wait for it to complete */ - if (wilco_ec_response_timed_out()) { - printk(BIOS_ERR, "%s: response timed out\n", __func__); - return -1; - } - /* Some commands will put the EC into a state where it cannot respond */ if (msg->type == WILCO_EC_MSG_NO_RESPONSE) { printk(BIOS_DEBUG, "%s: EC does not respond to this command\n", @@ -168,6 +162,12 @@ return 0; }
+ /* Wait for it to complete */ + if (wilco_ec_response_timed_out()) { + printk(BIOS_ERR, "%s: response timed out\n", __func__); + return -1; + } + /* Check result */ msg->result = inb(CONFIG_EC_BASE_HOST_DATA); if (msg->result != 0) {