|
39 | 39 |
|
40 | 40 | #define CTX dc_dmub_srv->ctx
|
41 | 41 | #define DC_LOGGER CTX->logger
|
| 42 | +#define GPINT_RETRY_NUM 20 |
42 | 43 |
|
43 | 44 | static void dc_dmub_srv_construct(struct dc_dmub_srv *dc_srv, struct dc *dc,
|
44 | 45 | struct dmub_srv *dmub)
|
@@ -1888,11 +1889,14 @@ void dc_dmub_srv_ips_query_residency_info(struct dc_dmub_srv *dc_dmub_srv, struc
|
1888 | 1889 | if (command_code == DMUB_GPINT__INVALID_COMMAND)
|
1889 | 1890 | return;
|
1890 | 1891 |
|
1891 |
| - // send gpint commands and wait for ack |
1892 |
| - if (!dc_wake_and_execute_gpint(dc_dmub_srv->ctx, DMUB_GPINT__GET_IPS_RESIDENCY_PERCENT, |
1893 |
| - (uint16_t)(output->ips_mode), |
1894 |
| - &output->residency_percent, DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY)) |
1895 |
| - output->residency_percent = 0; |
| 1892 | + for (i = 0; i < GPINT_RETRY_NUM; i++) { |
| 1893 | + // false could mean GPINT timeout, in which case we should retry |
| 1894 | + if (dc_wake_and_execute_gpint(dc_dmub_srv->ctx, DMUB_GPINT__GET_IPS_RESIDENCY_PERCENT, |
| 1895 | + (uint16_t)(output->ips_mode), &output->residency_percent, |
| 1896 | + DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY)) |
| 1897 | + break; |
| 1898 | + udelay(100); |
| 1899 | + } |
1896 | 1900 |
|
1897 | 1901 | if (!dc_wake_and_execute_gpint(dc_dmub_srv->ctx, DMUB_GPINT__GET_IPS_RESIDENCY_ENTRY_COUNTER,
|
1898 | 1902 | (uint16_t)(output->ips_mode),
|
|
0 commit comments