arch/riscv/src/mpfs/mpfs_ethernet.c: discard err rxframe in int work

Workaround to avoid deadlock situation: The RX shall not try to wait for complete
frame in case there is RX errors detected.

In case mpfs_receive is called, it keeps waiting for complete frame and
also keeps the net_lock locked. In the mean while, the TX may run out of free
descriptors, but can not get net_lock mutex lock to be able to release used
descriptors. If there are no free TX descs it disables RX interrupts because
it may require to send response to the received frame.
So, TX side keeps RX interrupts disabled due to lack of free descriptors and
RX blocks TX to release those descs by stubbornly waiting for complete frame.
This commit is contained in:
Jari Nippula 2023-03-09 08:58:02 +02:00 committed by Xiang Xiao
parent 47627c5fbd
commit ef18d2b599

View File

@ -1046,13 +1046,6 @@ static void mpfs_interrupt_work(void *arg)
uint32_t rx_error = 0;
ninfo("RX: rsr=0x%X\n", rsr);
if ((rsr & RECEIVE_STATUS_FRAME_RECEIVED) != 0)
{
/* Handle the received packet */
mpfs_receive(priv, queue);
}
/* Check for Receive Overrun */
if ((rsr & RECEIVE_STATUS_RECEIVE_OVERRUN) != 0)
@ -1094,6 +1087,12 @@ static void mpfs_interrupt_work(void *arg)
regval |= NETWORK_CONTROL_ENABLE_RECEIVE;
mac_putreg(priv, NETWORK_CONTROL, regval);
}
else if ((rsr & RECEIVE_STATUS_FRAME_RECEIVED) != 0)
{
/* Handle the received packet only in case there are no RX errors */
mpfs_receive(priv, queue);
}
}
net_unlock();