-
Notifications
You must be signed in to change notification settings - Fork 7.6k
espi/it8xxx2: waiting till completion of VW send to host #89703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
drivers/espi/espi_it8xxx2.c
Outdated
VW_CHAN(ESPI_VWIRE_SIGNAL_SLP_LAN, 0x42, BIT(0), BIT(4), 0), | ||
VW_CHAN(ESPI_VWIRE_SIGNAL_HOST_C10, 0x47, BIT(0), BIT(4), 0), | ||
VW_CHAN(ESPI_VWIRE_SIGNAL_DNX_WARN, 0x4a, BIT(1), BIT(5), 0), | ||
VW_CHAN(ESPI_VWIRE_SIGNAL_PME, 0x04, BIT(3), BIT(7), 0xe1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please define register names for these offsets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
drivers/espi/espi_it8xxx2.c
Outdated
while ((vw_reg->VW_INDEX[vw_index] != | ||
sys_read8(config->base_espi_vw + vw_sent)) && | ||
timeout < IT8XXX2_ESPI_VW_SEND_TIMEOUT_MS) { | ||
k_busy_wait(10); | ||
timeout += 10; | ||
} | ||
|
||
if (timeout >= IT8XXX2_ESPI_VW_SEND_TIMEOUT_MS) { | ||
LOG_WRN("VW send to host has timed out vw[0x%x] = 0x%x", | ||
vw_index, vw_reg->VW_INDEX[vw_index]); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while ((vw_reg->VW_INDEX[vw_index] != | |
sys_read8(config->base_espi_vw + vw_sent)) && | |
timeout < IT8XXX2_ESPI_VW_SEND_TIMEOUT_MS) { | |
k_busy_wait(10); | |
timeout += 10; | |
} | |
if (timeout >= IT8XXX2_ESPI_VW_SEND_TIMEOUT_MS) { | |
LOG_WRN("VW send to host has timed out vw[0x%x] = 0x%x", | |
vw_index, vw_reg->VW_INDEX[vw_index]); | |
} | |
if (!WAIT_FOR(vw_reg->VW_INDEX[vw_index] == sys_read8(config->base_espi_vw + vw_sent), | |
IT8XXX2_ESPI_VW_SEND_TIMEOUT_US, k_busy_wait(10))) { | |
LOG_WRN("VW send to host has timed out vw[0x%x] = 0x%x", | |
vw_index, vw_reg->VW_INDEX[vw_index]); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
sys_read8(config->base_espi_vw + vw_sent), | ||
IT8XXX2_ESPI_VW_SEND_TIMEOUT_US, k_busy_wait(10))) { | ||
LOG_WRN("VW send to host has timed out vw[0x%x] = 0x%x", | ||
vw_index, vw_reg->VW_INDEX[vw_index]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please return -ETIMEDOUT upon failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Dino-Li this is still relevant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
heya, this needs a rebase |
Done. |
@albertofloyd @keith-zephyr please revisit. |
On it8xxx2, there are VW transmitted registers indicating that VW signal has been transmitted to host. This patch checks the register to ensure successful transmission of VW state change. fixes: zephyrproject-rtos#89298 Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
|
On it8xxx2, there are VW transmitted registers indicating that VW signal has been transmitted to host.
This patch checks the register to ensure successful transmission of VW state change.