Skip to content

serial: amba-pl011: do not time out prematurely when draining tx fifo…

Created by: linosanfilippo-kunbus

… for rs485

The current timeout for draining the tx fifo is calculated by multiplying the time it takes to transmit one character (with the given baut rate) with the maximal number of characters in the tx queue.

This timeout is too short for two reasons: First when calculating the time to transmit one character integer division is used which may round down the result in case of a remainder of the division.

Fix this by rounding up the division result.

Second the hardware may need additional time (e.g for first putting the characters into the shift registers) before the characters are actually put onto the wire.

Take this into account by simply doubling the maximum number of iterations used to wait for the queue drain.

Signed-off-by: Lino Sanfilippo l.sanfilippo@kunbus.com

Merge request reports

Loading