drivers: serial: nrfx: Force poll_out when lock attempts are over
When the loop that tries to obtain the lock in poll_out() finishes because of hitting the max number of trials (what normally should never happen), force the lock to be taken instead of just giving up with sending the data. The latter approach that was in use so far could not deal with a situation when some thread was aborted while keeping the lock. Other threads would then have no chance to send anything with poll_out() until it was called from an ISR. Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
parent
6c9d4a5c57
commit
d000ff38dc
2 changed files with 2 additions and 2 deletions
|
@ -280,7 +280,7 @@ static void uart_nrfx_poll_out(struct device *dev, unsigned char c)
|
|||
*/
|
||||
k_msleep(1);
|
||||
if (--safety_cnt == 0) {
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -1030,7 +1030,7 @@ static void uarte_nrfx_poll_out(struct device *dev, unsigned char c)
|
|||
*/
|
||||
k_msleep(1);
|
||||
if (--safety_cnt == 0) {
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue