Hi Russel,
>
> The problem is that the console write method may be called prior to
> autoconfig() being run for the port in question, so tx_loadsz may be
> uninitialised.
Thank you for explanation.
>> > * if it has been initialised
>> > * how much data is already contained in the FIFO
>>
>> Right, we can't know how many byte exist in the FIFO.
>> So this patch is waiting the FIFO becomes empty at first
>> by calling "wait_for_xmitr(up)".
>> (This is the same logic with original.)
>>
>> After TX FIFO become empty, we can decide the available
>> TX FIFO depth by up->tx_loadsize.
>
> Only if you ignore the fact that tx_loadsz may not be initialised.
OK.
Before initialization, does tx_loadsz left 0?
If so, we can easily solve the problem:
tx_loadsz = (up->tx_loadsz ? up->tx_loadsz : 1); <-----
for (i = 0; i < count; ) {
int fifo;
wait_for_xmitr(up);
fifo = tx_loadsz; <------
.
.
.
Best regards,
Hironobu Ishii