This error occurs when you restart the tl-wa901nd device and you do not have an internet connection, the way to solve the error manually is by disconnecting the ethernet cable and waiting for a few seconds and reconnecting it once restarted.
In the rc.local file place:
What version of tl-wa901nd? By any chance V1 (AR7240) or V4 (TP9343) or V5 (TP9343)?
Also what version of OpenWRT 18.6.x, 19.7.x?
I ask because I have a somehow similar problem. In my case the switch is basicaly getting stuck after tx timeout and it's only in the case of the 4 lan ports, the wan port is not affected (but the wan port is separated compared to the 4 ports switch).
wireless is not affected so the problem is entirely with the lan switch and nothing else.
an ifup lan from wireless is fixing it... not a viable solution when this is used as a wireless client so i kinda need the eth switch working...
L.E.: I can constantly trigger the eth0: tx timeout on my 841nd v5 (ar7200) followed by the eth switch getting stuck and no longer sending any usefull trafic on the eth ports (sometimes it recover after some minutes sometimes it just remain stuck, ifup lan temp fix it but it will happen again). First time it's happening the log show the following:
So far the 841nd v5 has 14 hours of uptime without a crash or tx timeout error or eth switch getting stuck, basicaly I'm no longer capable to replicate the problem (simply opening 2 particular websites was triggering it, anyway high traffic is what is triggering it) with pdata->use_flow_control = 1; removed.
The ideea came up after reading: https://bugs.openwrt.org/index.php?do=details&task_id=106