Repository navigation
ipc: remove waiti running in IRQ level higher than passive level - #335
Conversation
There was a problem hiding this comment.
you need to idelay(TIMEOUT / TRIES); Make tries a macro.
There was a problem hiding this comment.
ok, I will refine my patch
There was a problem hiding this comment.
ok, I will refine my patch
There was a problem hiding this comment.
ok, I will refine my patch
683c442 to
bd30cba
Compare
|
update my patch, thanks for review |
There was a problem hiding this comment.
int clk should be named delay_ms or delay_us depending on time measurement.
There was a problem hiding this comment.
yes, I will refine my patch
There was a problem hiding this comment.
clk must be divided by tries. otherwise we will wait for multiples of the timeout and not the timeout.
There was a problem hiding this comment.
yes, I will refine my patch
bd30cba to
9f1aeb5
Compare
|
update my patch, thanks for review |
There was a problem hiding this comment.
why not pass the completion_t here instead of a callback, makes it simpler
There was a problem hiding this comment.
because in some cases, there are no completion, just like waiting for a register idle
There was a problem hiding this comment.
please refer to my second commit in this PR
There was a problem hiding this comment.
waiting for a register is called polling, and this is probably better named poll_for_condition_timeout()
There was a problem hiding this comment.
I just want to make a generic solution. Ok, I will refine my patch
9f1aeb5 to
19f5b1d
Compare
|
update my patch, thanks for review |
There was a problem hiding this comment.
Why did you remove the tries ? and while loop ? This will now block for timeout and be horribly inefficient. We need to try an return as soon as condition completes.
5c014b8 to
6f355a7
Compare
|
update my patch, thanks for review |
There was a problem hiding this comment.
yes, it is good for me
There was a problem hiding this comment.
how do we guarantee delta is not 0 ?
There was a problem hiding this comment.
en, a very tricky corner case, I will refine it.
6f355a7 to
1b6e295
Compare
|
update my patch, thanks for review |
There was a problem hiding this comment.
clock_us_to_ticks returns a uint64_t
There was a problem hiding this comment.
make tries and delta unsigned
There was a problem hiding this comment.
We should not delay if completion is initially true. This is better.
while (!wait_is_completed(comp)) {
if (!tries--) {
trace_error();
return error
}
delay();
}
return 0;waiti would cause FW panic if it is called in irq level higher than passive level Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
1b6e295 to
387befd
Compare
|
|
||
| static inline int poll_for_completion_delay(completion_t *comp, uint64_t us) | ||
| { | ||
| uint64_t tick = clock_us_to_ticks(CLK_CPU, us); |
There was a problem hiding this comment.
@RanderWang @lgirdwood I think this function won't work correctly, because on cAVS platforms wait_delay function is based on XTAL (e.g. 19.2 MHZ for APL) and CLK_CPU has entirely different freq.
There was a problem hiding this comment.
@RanderWang can you fix, use the PLATFORM_CLK thet we use fr work/scheduling.
waiti would cause FW panic if it is called in irq level
higher than passive level
Signed-off-by: Rander Wang rander.wang@linux.intel.com